Breaking the Modality Barrier: Generative Modeling for Accurate Molecule Retrieval from Mass Spectra
Yiwen Zhang, Keyan Ding, Yihang Wu, Xiang Zhuang, Yi Yang, Qiang Zhang, Huajun Chen
TL;DR
MS/MS-to-molecule retrieval suffers from limited spectral library coverage and cross-modal misalignment between spectra and chemical structures. GLMR addresses this by a two-stage approach: a pre-retrieval cross-modal contrastive alignment to select contextual candidate molecules, followed by a context-aware generative retrieval that refines a molecule aligned with the input spectrum and priors, enabling re-ranking by molecular similarity. The framework uses a ChemFormer-based molecular encoder and a spectrum encoder to learn aligned representations via an Info-NCE loss, then fuses spectrum and priors with cross-attention in a ChemFormer decoder to generate refined SMILES. The authors introduce MassRET-20k to test generalization beyond MassSpecGym and show GLMR achieves over 40% top-1 accuracy improvements and strong transfer performance, highlighting the practicality of bridging modality gaps with generative retrieval for library-free compound identification in mass spectrometry.
Abstract
Retrieving molecular structures from tandem mass spectra is a crucial step in rapid compound identification. Existing retrieval methods, such as traditional mass spectral library matching, suffer from limited spectral library coverage, while recent cross-modal representation learning frameworks often encounter modality misalignment, resulting in suboptimal retrieval accuracy and generalization. To address these limitations, we propose GLMR, a Generative Language Model-based Retrieval framework that mitigates the cross-modal misalignment through a two-stage process. In the pre-retrieval stage, a contrastive learning-based model identifies top candidate molecules as contextual priors for the input mass spectrum. In the generative retrieval stage, these candidate molecules are integrated with the input mass spectrum to guide a generative model in producing refined molecular structures, which are then used to re-rank the candidates based on molecular similarity. Experiments on both MassSpecGym and the proposed MassRET-20k dataset demonstrate that GLMR significantly outperforms existing methods, achieving over 40% improvement in top-1 accuracy and exhibiting strong generalizability.
