Table of Contents
Fetching ...

MS-BART: Unified Modeling of Mass Spectra and Molecules for Structure Elucidation

Yang Han, Pengyu Wang, Kai Yu, Xin Chen, Lu Chen

TL;DR

Mass spectrometry structure elucidation suffers from limited annotated spectra and heterogeneous signals. MS-Bart introduces a unified vocabulary bridging mass-spectrum fingerprints and molecular SELFIES, trained via multi-task pretraining on fingerprint–molecule pairs and adapted to experimental spectra through finetuning with MIST-predicted fingerprints and chemical-feedback alignment. The approach achieves state-of-the-art performance on MassSpecGym and NPLIB1 across multiple metrics while being significantly faster than diffusion-based methods, with ablations validating the benefits of unified pretraining and alignment. This work demonstrates a scalable, cross-modal framework for robust molecular identification from MS data, mitigating hallucinations and enabling practical application to real-world spectral variability.

Abstract

Mass spectrometry (MS) plays a critical role in molecular identification, significantly advancing scientific discovery. However, structure elucidation from MS data remains challenging due to the scarcity of annotated spectra. While large-scale pretraining has proven effective in addressing data scarcity in other domains, applying this paradigm to mass spectrometry is hindered by the complexity and heterogeneity of raw spectral signals. To address this, we propose MS-BART, a unified modeling framework that maps mass spectra and molecular structures into a shared token vocabulary, enabling cross-modal learning through large-scale pretraining on reliably computed fingerprint-molecule datasets. Multi-task pretraining objectives further enhance MS-BART's generalization by jointly optimizing denoising and translation task. The pretrained model is subsequently transferred to experimental spectra through finetuning on fingerprint predictions generated with MIST, a pre-trained spectral inference model, thereby enhancing robustness to real-world spectral variability. While finetuning alleviates the distributional difference, MS-BART still suffers molecular hallucination and requires further alignment. We therefore introduce a chemical feedback mechanism that guides the model toward generating molecules closer to the reference structure. Extensive evaluations demonstrate that MS-BART achieves SOTA performance across 5/12 key metrics on MassSpecGym and NPLIB1 and is faster by one order of magnitude than competing diffusion-based methods, while comprehensive ablation studies systematically validate the model's effectiveness and robustness.

MS-BART: Unified Modeling of Mass Spectra and Molecules for Structure Elucidation

TL;DR

Mass spectrometry structure elucidation suffers from limited annotated spectra and heterogeneous signals. MS-Bart introduces a unified vocabulary bridging mass-spectrum fingerprints and molecular SELFIES, trained via multi-task pretraining on fingerprint–molecule pairs and adapted to experimental spectra through finetuning with MIST-predicted fingerprints and chemical-feedback alignment. The approach achieves state-of-the-art performance on MassSpecGym and NPLIB1 across multiple metrics while being significantly faster than diffusion-based methods, with ablations validating the benefits of unified pretraining and alignment. This work demonstrates a scalable, cross-modal framework for robust molecular identification from MS data, mitigating hallucinations and enabling practical application to real-world spectral variability.

Abstract

Mass spectrometry (MS) plays a critical role in molecular identification, significantly advancing scientific discovery. However, structure elucidation from MS data remains challenging due to the scarcity of annotated spectra. While large-scale pretraining has proven effective in addressing data scarcity in other domains, applying this paradigm to mass spectrometry is hindered by the complexity and heterogeneity of raw spectral signals. To address this, we propose MS-BART, a unified modeling framework that maps mass spectra and molecular structures into a shared token vocabulary, enabling cross-modal learning through large-scale pretraining on reliably computed fingerprint-molecule datasets. Multi-task pretraining objectives further enhance MS-BART's generalization by jointly optimizing denoising and translation task. The pretrained model is subsequently transferred to experimental spectra through finetuning on fingerprint predictions generated with MIST, a pre-trained spectral inference model, thereby enhancing robustness to real-world spectral variability. While finetuning alleviates the distributional difference, MS-BART still suffers molecular hallucination and requires further alignment. We therefore introduce a chemical feedback mechanism that guides the model toward generating molecules closer to the reference structure. Extensive evaluations demonstrate that MS-BART achieves SOTA performance across 5/12 key metrics on MassSpecGym and NPLIB1 and is faster by one order of magnitude than competing diffusion-based methods, while comprehensive ablation studies systematically validate the model's effectiveness and robustness.
Paper Structure (31 sections, 6 equations, 5 figures, 8 tables)

This paper contains 31 sections, 6 equations, 5 figures, 8 tables.

Figures (5)

  • Figure 1: Randomly selected mass spectra of a molecule (SMILES: C#CCNCC1=CC=CC=C1, InChIKey: LDYBFSGEBHSTOQ) from MassSpecGym bushuiev2024massspecgym, acquired under varying collision energies. The $x$-axis shows the mass-to-charge ratio ($m/z$), the $y$-axis indicates collision energy (in eV), and color represents normalized relative intensity.
  • Figure 2: Overview of the MS-Bart framework. Square symbols represent unified tokens, where $\blacksquare$ denotes SELFIES tokens, $\blacksquare$ indicates fingerprint tokens, and $\blacksquare$ represents a special separator token between SELFIES and fingerprint tokens. The $\square$ symbol signifies padding tokens. Masked tokens are represented by striped patterns (). The top row illustrates pretraining tasks utilizing reliably computed fingerprints (Computed by RDKit), designed to enable MS-Bart to capture fundamental patterns in both fingerprint and SELFIES representations. Transfer learning is subsequently applied to experimental spectra through finetuning and alignment to enhance structure elucidation performance.
  • Figure 3: Progressive improvement of MS-Bart for molecular hallucination mitigation on MassSpecGym. Subfigures show: a) Tanimoto similarity, b) Accuracy, and c) MCES scores across three training stages under Top-1 and Top-10 settings. Stage 1: Pretrain, the base model pretrained on 4M simulated unlabeld molecules. Stage 2: Pretrain-FT, fine-tuned on MassSpecGym. Stage 3: Pretrain-FT-Rank, fully optimized MS-Bart with chemical feedback.
  • Figure 4: Predictions of the Pretrain (top row), Pretrain-FT (middle row), and Pretrain-FT-Rank (bottom row) models on a representative MassSpecGym sample, with the ground-truth structure shown in the first column and the Top-4 generated outputs in the subsequent columns. Results demonstrate that MS-Bart can effectively mitigate molecular hallucination and predict more chemically plausible and structurally consistent predictions.
  • Figure 5: Performance of MS-Bart with beam-search multinomial sampling decoding under different beam widths: Top-1 accuracy, Top-10 accuracy, and average inference time per spectrum.