MS-Bart : Unified Modeling of Mass Spectra and Molecules for Structure Elucidation
Yang Han, Pengyu Wang, Kai Yu, Xin Chen, Lu Chen · 2025
Read MS-Bart : Unified Modeling of Mass Spectra and Molecules for Structure Elucidation by Yang Han, Pengyu Wang, Kai Yu, Xin Chen, Lu Chen (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2510-20615.txt.
Introduction
Yang Han and four co-authors build MS-BART, a joint model of mass spectra and molecule forms for the task of naming a molecule from its spectrum. Few tagged spectra exist, and raw spectra are bent and mixed, which blocks the big pre-train route that helps in past fields. Their frame maps spectra and forms to one token set for cross-mode learning.
Pre-train runs on sound fingerprint-molecule sets with joint clean and swap tasks. Fine-tune then moves the model to real spectra by way of print calls from a spectra call model. A chemical check loop steers builds from fake forms to the true form. Wide tests show the joint plan works well, the team reports.
Catalog record
| CREATOR | Yang Han, Pengyu Wang, Kai Yu, Xin Chen, Lu Chen |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 46 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2510-20615
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
MS-Bart : Unified Modeling of Mass Spectra and Molecules for Structure Elucidation Yang Han, Pengyu Wang, Kai Yu, Xin Chen, Lu Chen 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. We provide the data and code at https://github.com/OpenDFM/MS-BART . 1 Introduction Mass spectrometry is an analytical technique that measures the mass-to-charge ratio of ions, enabling the identification, quantification, and structural characterization of molecules. The identification of small molecules from mass spectrometry data represents a fundamental task in analytical chemistry, with broad applications across multiple domains, including drug discovery aebersold2003mass ; meissner2022emerging ; skinnider2021deep , environmental biochemistry pico2020pyrolysis , and materials science huang2021mass . Recent advances in machine learning have enabled structure elucidation from mass spectra. Existing approaches can be broadly categorized into (1) retrieval-based methods and (2) de novo generative methods. Retrieval-based methods rely on matching query spectra against large annotated spectra databases. However, annotated experimental spectra are scarce and costly to obtain bittremieux2022critical . In addition, these methods are inherently limited to known molecules and cannot identify novel structures absent from reference databases. De novo generation methods learn to generate molecular structures directly from mass spectra, offering the potential to discover new compounds. However, these generative models skinnider2021deep ; wang2025madgen ; elser2023mass2smiles ; litsa2023end are also bottlenecked by the limited availability of high-quality experimental spectra. 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. In other domains such as natural language processing (NLP) and computer vision (CV), a common strategy to overcome data scarcity is to pretrain models on large-scale unlabeled data and then finetune them on task-specific datasets devlin2019bert ; lewis2020bart ; brown2020language ; he2022masked ; han2024alignsum . A similar paradigm can also be observed in nuclear magnetic resonance (NMR) structure elucidation yao2023conditional , where the model is first pretrained on 3.6 million unlabeled molecules and then fine-tuned directly on simulated and experimental NMR data. However, adapting this paradigm to mass spectrometry remains challenging due to the intrinsic complexity and heterogeneity of mass spectra. As illustrated in Fig. 1 , spectra for the same molecule can vary substantially under different collision energies, adduct types, or instrument settings, and may even fluctuate slightly under identical experimental conditions. To address this variability, we propose using molecular fingerprints as an intermediate representation of mass spectra. Fingerprints are binary vectors that encode the presence of chemical substructures. Unlike raw spectra, they are invariant to experimental conditions and can be reliably computed from molecular structures using cheminformatics toolkits such as RDKit. This eliminates the need to simulate mass spectra under diverse experimental settings murphy2023efficiently ; goldman2023prefix , enabling scalable pretraining dataset construction. Building on this insight, we propose MS-Bart , a unified framework for molecular structure elucidation from mass spectrometry data, following the pretraining–finetuning–alignment paradigm widely used in NLP. We first construct a large-scale pretraining dataset consisting of fingerprint–molecule pairs, where molecular fingerprints are computed for 4 million unlabeled molecules using RDKit. Based on this dataset, we design multi-task pretraining objectives to facilitate cross-modal learning between molecular fingerprints and molecular structures. For finetuning, we incorporate experimental mass spectrometry data by using MIST goldman2023annotating to predict fingerprints from spectra, conditioned on associated metadata and molecular formulas. As these predicted fingerprints are subject to dataset-specific noise and systematic biases, we finetune the pretrained model using the predicted fingerprints as input, thereby improving its adaptability to real-world experimental conditions. Finally, the generated structures are prone to molecular hallucinations fang2024domain , where outputs are chemically valid but deviate from the true molecules. To address this, we introduce an alignment step that incorporates chemical feedback by assigning higher probabilities to structures more similar to the ground truth. In summary, our main contributions are as follows: • To the best of our knowledge, we are the first to leverage language model for mass spectra structure elucidation by introducing a unified vocabulary and multi-task pretraining on a large corpus of fingerprint–molecule pairs. • We finetune the model on experimental data and incorporate chemical feedback to align the generative distribution with real-world structural preferences. • We validate our approach on two public benchmarks, achieving SOTA performance across 5/12 key metrics on MassSpecGym bushuiev2024massspecgym and NPLIB1 duhrkop2021systematic and is faster by one order of magnitude than competing diffusion-based methods. 2 Related Work Mass Spectra Modeling. Mass spectra are variable-length, discrete, two-dimensional data, which makes them inherently challenging to model. A basic approach involves padding the two-dimensional matrix to a fixed length and projecting it into an embedding space via a linear layer wang2025madgen . A more common strategy is spectral binning, which partitions spectra into fixed-width intervals (e.g., 0.1 Da) to yield fixed-size input vectors seddiki2020cumulative . For example, ChemEmbed faizan2025chemembed limits molecular weights to 700 Da, encodes spectra into a 7000-dimensional vector using a bin size of 0.01, and applies a convolutional neural network (CNN) to predict 300-dimensional Mol2vec embeddings. Similarly, Spec2Mol litsa2023end and MS2DeepScore huber2021ms2deepscore convert spectra into bit vectors and train 1D CNNs or Siamese networks bromley1993signature to learn meaningful spectral embeddings. While binning is simple, it suffers from sparsity and sensitivity to noise, limiting its ability to capture chemically meaningful patterns. To overcome this, some methods leverage molecular fingerprints as intermediate representations that encode chemical substructures more robustly. CSI:FingerID duhrkop2015searching predicts molecular fingerprints from tandem mass spectra using fragmentation trees and machine learning, achieving strong performance in metabolite identification. MSNovelist stravs2022msnovelist builds on this by integrating predicted fingerprints into an encoder-decoder model for de novo structure generation. Inspired by these approaches, MS-Bart adopts molecular fingerprints as a spectrum representation, enabling scalable pretraining while preserving chemical semantics. Structure Elucidation from Mass Spectra. Two major paradigms dominate structure elucidation from mass spectra: library matching and de novo generation. Library matching formulates the task as an information retrieval problem stein2012mass , comparing query spectra against databases of experimental or simulated spectra.