Molecules & materials

Mass Spectrum Annotation

Develop AI models that match molecular fragmentation patterns to chemical structures, enabling the identification of unknown small molecules.

Match a fragmentation spectrum to candidate molecules
  1. Fragment the ion

    Tandem mass spectrometry breaks a precursor ion into fragments.

  2. Read the spectrum

    Peaks record signal intensity by mass-to-charge ratio.

  3. Retrieval outputs
    Ranked candidates
    Candidates ordered by their match to the spectrum
    Top candidate
    The highlighted structure ranks first.

Results

Score breakdown

The Task

What is Mass Spectrometry?

Identifying unknown molecules is important in drug discovery, metabolomics, and environmental chemistry. Tandem mass spectrometry (MS/MS) selects an ionized molecule, breaks it into fragments, and measures the mass-to-charge ratios (m/z) of the fragment ions.

In the resulting spectrum, a peak's position indicates the fragment ion's mass-to-charge ratio. Its intensity shows the relative signal from ions at that position. Different structures can produce different patterns of peaks, giving clues about the original molecule.

  1. Precursor ion
    An ionized molecule with a positively charged terminal group.

    The instrument selects a charged molecule.

  2. Fragmentation
    Dashed marks identify example bond locations on the precursor structure.

    Collisions can break bonds and produce smaller ions.

  3. Mass spectrum

    Peak position shows m/z. Height shows relative intensity.

Retrieving Molecular Structures from Spectra

A spectrum S contains P peaks. For peak i, mi is its mass-to-charge ratio and Ii is its relative intensity. The benchmark also provides a set ℳ of up to 256 candidate molecules. Each candidate is supplied as a SMILES string that describes its atoms and bonds.

S={(mi,Ii)}i=1P, ℳ={M1,…,MN},N≤256

The model assigns each candidate a compatibility score sj and sorts the candidates from highest to lowest score:

sj=fθ(S,Mj), π^=argsortj(−sj)

Structurally similar molecules can produce nearly identical spectra. Instrument settings and collision energy can also change the fragmentation pattern of the same molecule.

What the Agent Develops

The agent develops one molecular retrieval system. It can infer molecular features from the measured spectrum, predict a spectrum for each candidate, or combine the two approaches in a shared ranking system.

Fourier-DeepSets[1] is an example of the first approach. GLACIER[2] exemplifies the second. These methods provide references while the agent can choose its own representations, architecture, training objectives, and ranking method.

One trained system must handle all test queries independently. Published pretrained weights and test-answer lookups are excluded.

Data & Prediction Tasks

Training Data

MassSpecGym v1.5[1] pairs experimental MS/MS spectra with known structures. Each spectrum includes measured peak positions and intensities, information about the precursor ion, and any available acquisition metadata, such as instrument type and collision energy.

SplitSpectraUnique 2D structures
Training194,11922,746
Validation19,4293,185
Test17,5562,998
Total231,10428,929

The dataset splits are disjoint by molecular structure, so the true molecules in the test set are absent from training. The benchmark also provides 2,333,485 optional ICEBERG-based simulated spectra[4] after filtering overlaps with held-out structures and removing invalid molecular structures.

Molecular Retrieval Task

Each test query contains one experimental MS/MS spectrum, the available acquisition metadata, and up to 256 mass-compatible candidate molecules. The correct identity is withheld from the model. The output must include every candidate ID exactly once:

(S,ℳ)⟶π^=(j1,j2,…,jN)

Here, j1 is the ID of the highest-ranked candidate.

Evaluation

Molecular Retrieval Accuracy

The evaluator compares each candidate ranking with the known molecule for its experimental spectrum.

MetricWhat it measures
Hit@1Fraction of spectra where the correct molecule ranks first
Hit@5 / Hit@20Fraction with the correct molecule among the top 5 or top 20 candidates
MCES@1Maximum common edge subgraph distance between the top-ranked and correct molecules. A lower value means fewer differences in their bond structure.
Example ranking
  1. 1. Molecule ATop prediction
  2. 2. Molecule BCorrect molecule
  3. 3. Molecule C
  4. …More candidates
Hit@1
0 · Miss
Hit@5
1 · Hit
Hit@20
1 · Hit
MCES@1 compares A with B
A ring with two separate branches.
A · Top prediction
A ring with one longer branch.
B · Correct molecule

The two molecules share a ring but differ in their branches, giving a nonzero structural distance.

Overall Scoring

The primary score is Hit@1 across all 17,556 test spectra. If M^ is the highest-ranked molecule and M* is the true molecule, the score counts exact top-ranked matches:

Score=Hit@1=1Q∑i=1Q1[M^i=Mi*]

Here, Q is the number of test queries. A score of 1 means the correct molecule ranks first for every spectrum. Hit@1 can also be expressed on a 0–100 scale. Hit@5, Hit@20, and MCES@1 are separate diagnostics.

References

  1. [1] Bushuiev, R. et al. MassSpecGym: A benchmark for the discovery and identification of molecules. NeurIPS (2024). Dataset.
  2. [2] Wang, R.-X., Wang, R. & Coley, C. W. GLACIER: Rethinking Mass Spectrum Prediction as an Object Detection Problem. NeurIPS (2026).
  3. [3] Goldman, S., Wohlwend, J., Stražar, M. et al. Annotating metabolite mass spectra with domain-inspired chemical formula transformers. Nature Machine Intelligence (2023).
  4. [4] Goldman, S., Bradshaw, J., Xin, J. & Coley, C. W. Prefix-Tree Decoding for Predicting Mass Spectra from Molecules. NeurIPS (2023).