[Paper Review] MADGEN: Mass-Spec attends to De Novo Molecular generation
MADGEN introduces a two-stage scaffold-based framework for de novo molecular generation guided by MS/MS spectra: scaffold retrieval via contrastive learning and spectra-guided scaffold-conditioned generation using a Markov-bridge model and classifier-free guidance.
The annotation (assigning structural chemical identities) of MS/MS spectra remains a significant challenge due to the enormous molecular diversity in biological samples and the limited scope of reference databases. Currently, the vast majority of spectral measurements remain in the "dark chemical space" without structural annotations. To improve annotation, we propose MADGEN (Mass-spec Attends to De Novo Molecular GENeration), a scaffold-based method for de novo molecular structure generation guided by mass spectrometry data. MADGEN operates in two stages: scaffold retrieval and spectra-conditioned molecular generation starting with the scaffold. In the first stage, given an MS/MS spectrum, we formulate scaffold retrieval as a ranking problem and employ contrastive learning to align mass spectra with candidate molecular scaffolds. In the second stage, starting from the retrieved scaffold, we employ the MS/MS spectrum to guide an attention-based generative model to generate the final molecule. Our approach constrains the molecular generation search space, reducing its complexity and improving generation accuracy. We evaluate MADGEN on three datasets (NIST23, CANOPUS, and MassSpecGym) and evaluate MADGEN's performance with a predictive scaffold retriever and with an oracle retriever. We demonstrate the effectiveness of using attention to integrate spectral information throughout the generation process to achieve strong results with the oracle retriever.
Motivation & Objective
- Address the challenge of annotating MS/MS spectra in the dark chemical space by proposing a scaffold-based de novo generation method.
- Develop a two-stage framework: (i) scaffold retrieval from MS/MS spectra, and (ii) scaffold-conditioned molecule generation guided by spectra.
- Evaluate scaffold retrieval (predictive vs oracle) and de novo generation on multiple datasets (NIST23, CANOPUS, MassSpecGym).
- Demonstrate how attention-based integration of spectra improves generation accuracy and interpretability of the scaffold as a structural anchor.
Proposed method
- Formulate scaffold retrieval as a ranking problem trained with contrastive learning to align spectrum and scaffold embeddings using two encoders (MLP for spectra, GNN for scaffolds).
- Use cosine similarity in a shared latent space to select top-k scaffold candidates for generation.
- Provide an oracle retrieval variant that uses RDKit to extract the correct scaffold from the molecular graph for benchmarking the second stage.
- Perform scaffold-conditioned de novo generation with a Markov-bridge based edge-generation process that progressively connects atoms to a scaffold.
- Incorporate classifier-free guidance to condition generation on the mass spectrum at each step via a CFG-scaled logit combination.
- Encode the mass spectrum as a sequence of peaks, applying self-attention, and inject spectrum information into the graph neural network via cross-attention across nodes and edges.

Experimental results
Research questions
- RQ1Can MS/MS spectra be effectively used to retrieve a plausible molecular scaffold for de novo generation?
- RQ2Does scaffold-based de novo generation improve generation accuracy and interpretability compared to fully end-to-end approaches?
- RQ3How does the oracle scaffold scenario compare to predictive scaffold retrieval in enabling accurate molecule generation?
- RQ4What is the impact of spectrum-guided conditioning and CFG on generation quality and diversity?
- RQ5How does MADGEN perform across diverse datasets (NIST23, CANOPUS, MassSpecGym) in terms of Top-1/Top-10 accuracy and structural similarity?
Key findings
- MADGEN with predictive scaffold retrieval achieves scaffold prediction accuracy between 34.8% and 57.8% across datasets, with higher SPA on NIST23 due to scaffold diversity.
- Predictive scaffold retrieval yields modest top-1 molecule generation accuracy (e.g., 10.3% on NIST23; 1.0% on CANOPUS; 0.8% on MassSpecGym).
- Oracle scaffold retrieval substantially boosts performance, achieving 49.0% Top-1 and 65.5% Top-10 accuracy on NIST23, 8.9% Top-1 and 65.5% Top-? on CANOPUS, and 18.8% Top-1 on MassSpecGym.
- MADGEN with oracle scaffold outperforms the best published MassSpecGym results for random generation, illustrating the value of correct scaffolds in de novo generation.
- Ablation study shows tokenization + self-attention for spectra with cross-attention and CFG (node-level) yields the best conditioning performance among tested configurations.
- Sensitivity analysis indicates that more free atoms (larger scaffolds) increase generation difficulty and reduce accuracy.

Better researchstarts right now
From reading papers to final review, dramatically reduce your research time.
No credit card · Free plan available
This review was created by AI and reviewed by human editors.