Skip to main content
QUICK REVIEW

[Paper Review] DiffMS: Diffusion Generation of Molecules Conditioned on Mass Spectra

Montgomery Bohde, Mrunali Manjrekar|ArXiv.org|Feb 13, 2025
Analytical Chemistry and Chromatography7 citations
TL;DR

DiffMS is a formula-constrained, diffusion-based molecule generator conditioned on mass spectra, using a transformer spectrum encoder and a discrete graph diffusion decoder pretrained on fingerprint–molecule data to achieve state-of-the-art de novo generation performance.

ABSTRACT

Mass spectrometry plays a fundamental role in elucidating the structures of unknown molecules and subsequent scientific discoveries. One formulation of the structure elucidation task is the conditional de novo generation of molecular structure given a mass spectrum. Toward a more accurate and efficient scientific discovery pipeline for small molecules, we present DiffMS, a formula-restricted encoder-decoder generative network that achieves state-of-the-art performance on this task. The encoder utilizes a transformer architecture and models mass spectra domain knowledge such as peak formulae and neutral losses, and the decoder is a discrete graph diffusion model restricted by the heavy-atom composition of a known chemical formula. To develop a robust decoder that bridges latent embeddings and molecular structures, we pretrain the diffusion decoder with fingerprint-structure pairs, which are available in virtually infinite quantities, compared to structure-spectrum pairs that number in the tens of thousands. Extensive experiments on established benchmarks show that DiffMS outperforms existing models on de novo molecule generation. We provide several ablations to demonstrate the effectiveness of our diffusion and pretraining approaches and show consistent performance scaling with increasing pretraining dataset size. DiffMS code is publicly available at https://github.com/coleygroup/DiffMS.

Motivation & Objective

  • Motivate structure elucidation from LC-MS/MS by generating candidate molecules conditioned on spectra.
  • Incorporate chemical formula constraints to drastically reduce the search space for plausible structures.
  • Develop a pretraining-finetuning framework to leverage vast fingerprint–structure data for better end-to-end performance.
  • Show that end-to-end DiffMS with formula constraints outperforms baselines on standard benchmarks.

Proposed method

  • Encoder: transformer-based spectrum encoder that assigns chemical formulae to peaks and models neutral losses; outputs a spectrum-conditioned embedding.
  • Decoder: discrete graph diffusion (DiGress-style) that generates heavy-atom graphs under chemical formula constraints; denoises a randomly initialized adjacency matrix.
  • Pretraining: decoder trained on 2.8M fingerprint–molecule pairs to learn structure mappings; encoder pretrained to predict fingerprints from spectra.
  • End-to-end finetuning: integrate encoder and diffusion decoder and fine-tune on molecule–spectrum pairs.
  • Training objective: cross-entropy loss on adjacency matrix denoising; sampling via marginalization of diffusion steps.
  • Evaluation: top-k accuracy, MCES, and Tanimoto similarity on NPLIB1 and MassSpecGym benchmarks.

Experimental results

Research questions

  • RQ1Can a diffusion-based, formula-constrained generator produce plausible de novo molecules from mass spectra?
  • RQ2How much does pretraining on fingerprint–structure data improve end-to-end performance?
  • RQ3Does incorporating spectrum-derived formula constraints improve structural accuracy and similarity compared to baseline methods?

Key findings

  • DiffMS achieves state-of-the-art performance on de novo structure elucidation benchmarks, outperforming baselines across metrics.
  • On NPLIB1, DiffMS achieves top-1 accuracy 8.34% and top-10 accuracy 15.44%, with MCES 11.95 and Tanimoto 0.35–0.47 depending on top-k.
  • On MassSpecGym, DiffMS achieves top-1 accuracy 2.30% and top-10 accuracy 4.25%, with MCES 18.45 and Tanimoto 0.28–0.39 depending on top-k.
  • Encoder pretraining and larger decoder pretraining datasets both yield substantial, scalable gains, with decoder pretraining showing clear performance scaling.
  • DiffMS consistently produces close matches even when exact recovery fails, validating practical utility for guidance to domain experts.

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.