Test-Time Tuned Language Models Enable End-to-end De Novo Molecular Structure Generation from MS/MS Spectra
Not on the map. Why?
Abstract (arXiv)
Tandem Mass Spectrometry is a cornerstone technique for identifying unknown small molecules in fields such as metabolomics, natural product discovery and environmental analysis. However, certain aspects, such as the probabilistic fragmentation process and size of the chemical space, make structure elucidation from such spectra highly challenging, particularly when there is a shift between the deployment and training conditions. Current methods rely on database matching of previously observed spectra of known molecules and multi-step pipelines that require intermediate fingerprint prediction or expensive fragment annotations. We introduce a novel end-to-end framework based on a transformer model that directly generates molecular structures from an input tandem mass spectrum and its corresponding molecular formula, thereby eliminating the need for manual annotations and intermediate steps, while leveraging transfer learning from simulated data. To further address the challenge of out-of-distribution spectra, we introduce a test-time tuning strategy that dynamically adapts the pre-trained model to novel experimental data. Our approach achieves a Top-1 accuracy of 3.16% on the MassSpecGym benchmark and 12.88% on the NPLIB1 datasets, considerably outperforming conventional fine-tuning. Baseline approaches are also surpassed by 27% and 67% respectively. Even when the exact reference structure is not recovered, the generated candidates are chemically informative, exhibiting high structural plausibility as reflected by strong Tanimoto similarity to the ground truth. Notably, we observe a relative improvement in average Tanimoto similarity of 83% on NPLIB1 and 64% on MassSpecGym compared to state-of-the-art methods. Our framework combines simplicity with adaptability, generating accurate molecular candidates that offer valuable guidance for expert interpretation of unseen spectra.
Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). Builds on 11 of its 56 references that are in the map. First posted on arXiv 27 Oct 2025.
Builds on
11 of 56 references.
References · 11
- 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,898
- 2024The Faiss librarycited by 370
- 2020A Brief Review of Domain Adaptationcited by 287
- 2023Mathematical Capabilities of ChatGPTcited by 263
- 2018Molecular Transformer - A Model for Uncertainty-Calibrated Chemical Reaction Predictioncited by 225
- 2022Regression Transformer: Concurrent sequence regression and generation for molecular language modelingcited by 49
- 2024Efficiently Learning at Test-Time: Active Fine-Tuning of LLMscited by 42
- 2024Unraveling Molecular Structure: A Multimodal Spectroscopic Dataset for Chemistrycited by 31
- 2025DiffMS: Diffusion Generation of Molecules Conditioned on Mass Spectracited by 28
- 2024Accurate and efficient structure elucidation from routine one-dimensional NMR spectra using multitask machine learningcited by 21
- 2023Prefix-Tree Decoding for Predicting Mass Spectra from Moleculescited by 16
Built on by
Citing papers per year: 2026: 4.
4 papers.
- 2026FRIGID: Scaling Diffusion-Based Molecular Generation from Mass Spectra at Training and Inference Timecited by 3
- 2026MassSpecGym in the Wild: Uncovering and Correcting Evaluation Pitfalls in AI-Driven Molecule Discoverycited by 1
- 2026MS-GPT: Rethinking MS/MS De Novo Structure Elucidation as Spectrum-Induced Posterior Querying of a Molecule-Language Modelcited by 0
- 2026Transferable Mass Spectrum Prediction via Reference-Guided Test-time Specializationcited by 0
- 2026Transferable Mass Spectrum Prediction via Reference-Guided Test-time Specialization28 Sep 2026
- 2026MS-GPT: Rethinking MS/MS De Novo Structure Elucidation as Spectrum-Induced Posterior Querying of a Molecule-Language Model26 Jul 2026
- 2026MassSpecGym in the Wild: Uncovering and Correcting Evaluation Pitfalls in AI-Driven Molecule Discovery17 Jun 2026
- 2026FRIGID: Scaling Diffusion-Based Molecular Generation from Mass Spectra at Training and Inference Time17 Apr 2026