# Prefix-Tree Decoding for Predicting Mass Spectra from Molecules

arXiv: https://arxiv.org/abs/2303.06470 · HTML: https://mlsanity.com/paper/2303.06470/

## Key facts

- Cited by 16 papers in the map (data through 14 Oct 2026).
- Builds on 18 of its 65 references that are in the map.
- First posted on arXiv 11 Mar 2023.

## Builds on (most cited first, 18 of 18)

- [Attention Is All You Need](https://mlsanity.com/paper/1706.03762/) (2017)
- [PyTorch: An Imperative Style, High-Performance Deep Learning Library](https://mlsanity.com/paper/1912.01703/) (2019)
- [Optuna: A Next-generation Hyperparameter Optimization Framework](https://mlsanity.com/paper/1907.10902/) (2019)
- [Fourier Features Let Networks Learn High Frequency Functions in Low Dimensional Domains](https://mlsanity.com/paper/2006.10739/) (2020)
- [Deep Sets](https://mlsanity.com/paper/1703.06114/) (2017)
- [Relational inductive biases, deep learning, and graph networks](https://mlsanity.com/paper/1806.01261/) (2018)
- [Geometric Deep Learning: Grids, Groups, Graphs, Geodesics, and Gauges](https://mlsanity.com/paper/2104.13478/) (2021)
- [Object-Centric Learning with Slot Attention](https://mlsanity.com/paper/2006.15055/) (2020)
- [Gated Graph Sequence Neural Networks](https://mlsanity.com/paper/1511.05493/) (2015)
- [Tune: A Research Platform for Distributed Model Selection and Training](https://mlsanity.com/paper/1807.05118/) (2018)
- [Order Matters: Sequence to sequence for sets](https://mlsanity.com/paper/1511.06391/) (2015)
- [Deep Set Prediction Networks](https://mlsanity.com/paper/1906.06565/) (2019)
- [Conditional Set Generation with Transformers](https://mlsanity.com/paper/2006.16841/) (2020)
- [Rapid Prediction of Electron-Ionization Mass Spectrometry using Neural Networks](https://mlsanity.com/paper/1811.08545/) (2018)
- [Efficiently predicting high resolution mass spectra with graph neural networks](https://mlsanity.com/paper/2301.11419/) (2023)
- [Using Graph Neural Networks for Mass Spectrometry Prediction](https://mlsanity.com/paper/2010.04661/) (2020)
- [Competitive Fragmentation Modeling of ESI-MS/MS spectra for putative metabolite identification](https://mlsanity.com/paper/1312.0264/) (2013)
- [Multi-scale Sinusoidal Embeddings Enable Learning on High Resolution Mass Spectrometry Data](https://mlsanity.com/paper/2207.02980/) (2022)

## Built on by (most cited first, 16 of 16)

- [DiffMS: Diffusion Generation of Molecules Conditioned on Mass Spectra](https://mlsanity.com/paper/2502.09571/) (2025)
- [Unraveling Molecular Structure: A Multimodal Spectroscopic Dataset for Chemistry](https://mlsanity.com/paper/2407.17492/) (2024)
- [MS-BART: Unified Modeling of Mass Spectra and Molecules for Structure Elucidation](https://mlsanity.com/paper/2510.20615/) (2025)
- [MolSpectra: Pre-training 3D Molecular Representation with Multi-modal Energy Spectra](https://mlsanity.com/paper/2502.16284/) (2025)
- [Artificial Intelligence in Spectroscopy: Advancing Chemistry from Prediction to Generation and Beyond](https://mlsanity.com/paper/2502.09897/) (2025)
- [DiffSpectra: Molecular Structure Elucidation from Spectra using Diffusion Models](https://mlsanity.com/paper/2507.06853/) (2025)
- [FraGNNet: A Deep Probabilistic Model for Tandem Mass Spectrum Prediction](https://mlsanity.com/paper/2404.02360/) (2024)
- [Test-Time Tuned Language Models Enable End-to-end De Novo Molecular Structure Generation from MS/MS Spectra](https://mlsanity.com/paper/2510.23746/) (2025)
- [MassSpecGym in the Wild: Uncovering and Correcting Evaluation Pitfalls in AI-Driven Molecule Discovery](https://mlsanity.com/paper/2606.19624/) (2026)
- [Neural Graph Matching Improves Retrieval Augmented Generation in Molecular Machine Learning](https://mlsanity.com/paper/2502.17874/) (2025)
- [Spiers Memorial Lecture: How to do impactful research in artificial intelligence for chemistry and materials science](https://mlsanity.com/paper/2409.10304/) (2024)
- [De novo molecular structure elucidation from mass spectra via flow matching](https://mlsanity.com/paper/2602.19912/) (2026)
- [M3-20M: A Large-Scale Multi-Modal Molecule Dataset for AI-driven Drug Design and Discovery](https://mlsanity.com/paper/2412.06847/) (2024)
- [FlexMS: A Unified Public Benchmark for Molecule Tandem Mass Spectrum Prediction](https://mlsanity.com/paper/2602.22822/) (2026)
- [CoRe-Gen: Robust Spectrum-to-Structure Generation under Imperfect Fingerprint Conditions](https://mlsanity.com/paper/2605.12980/) (2026)
- [GLACIER: Rethinking Mass Spectrum Prediction as an Object Detection Problem](https://mlsanity.com/paper/2606.29161/) (2026)

## Abstract (arXiv)

Computational predictions of mass spectra from molecules have enabled the discovery of clinically relevant metabolites. However, such predictive tools are still limited as they occupy one of two extremes, either operating (a) by fragmenting molecules combinatorially with overly rigid constraints on potential rearrangements and poor time complexity or (b) by decoding lossy and nonphysical discretized spectra vectors. In this work, we use a new intermediate strategy for predicting mass spectra from molecules by treating mass spectra as sets of molecular formulae, which are themselves multisets of atoms. After first encoding an input molecular graph, we decode a set of molecular subformulae, each of which specify a predicted peak in the mass spectrum, the intensities of which are predicted by a second model. Our key insight is to overcome the combinatorial possibilities for molecular subformulae by decoding the formula set using a prefix tree structure, atom-type by atom-type, representing a general method for ordered multiset decoding. We show promising empirical results on mass spectra prediction tasks.
