FraGNNet: A Deep Probabilistic Model for Tandem Mass Spectrum Prediction
Authors: Adamo Young
Fei Wang
David Wishart
BO WANG
Russell Greiner
Hannes Rost
Venue: Accepted by TMLR ()

Abstract: Compound identification from tandem mass spectrometry (MS/MS) data is a critical step in the analysis of complex mixtures. Typical solutions for the MS/MS spectrum to compound (MS2C) problem involve comparing the unknown spectrum against a library of known spectrum-molecule pairs, an approach that is limited by incomplete library coverage. Compound to MS/MS spectrum (C2MS) models can improve retrieval rates by augmenting real libraries with predicted MS/MS spectra. Unfortunately, many existing C2MS models suffer from problems with mass accuracy, generalization, or interpretability. We develop a new probabilistic method for C2MS prediction, FraGNNet, that can efficiently and accurately simulate MS/MS spectra with high mass accuracy. Our approach formulates the C2MS problem as learning a distribution over molecule fragments. FraGNNet achieves state-of-the-art performance in terms of prediction error and surpasses existing C2MS models as a tool for retrieval-based MS2C.

Published in Transactions on Machine Learning Research (08/2025)
FraGNNet: A Deep Probabilistic Model for Tandem Mass Spectrum Prediction
Adamo Young
ayoung@esstoorotto.de
Deportment of Computer Science, University of Toronto
Vector Institute for Artificial Intelligence
Terrence Donnelly Centre for Cellular and Biomolecular Research, University of Toronto
Fei Wang
fus @ogalbberraccr
Deportment of Computing Science, University of Alberta Alberta Machine Intelligence Institute
David Wishart
dwishhrtt@uuleerta.cc
Department Computing Science, University of Alberta Department of Biological Sciences, University of Alberta Department of Laboratory Medicine and Pathology, University of Alberta Faculty of Phormacy and Pharnaceutioal Sciences, University of Alberta
Bo Wang
Deportment of Computer Science, University of Toronto Vector Institute, for Artificial Intelligence Department of Laboratory Medicine and Pathobiology, University of Toronto Peter Munk Cardiac Centre, University Health Network
Russell Greiner
rgreinerQuuaberla..c
Department of Computing Science, University of Alberta Alberta Machine Intelligence Institute.
Hannes Rost
konnes..ost@uuoronttooo
Department of Molecular Genetics, University of Toronto
Terrence Donnelly Centre for Cellular and Biomolecular Research, University of Toroulo
Reviewed OpenReview: htt tp op enrevi .ne
et /f ?6 d= ge Hm bm
Abstract
Compound identification from tandem mass spectrometry (MS/MS) data is a critical step in the analysis of complex mixtures. Typical solutions for the MS/MS spectrum to com- pound (MS2C) problem involve comparing the unknown spectrum against a library known pocctrum-molcculd pairs, an approach that is limited by incomplete library coverage. Com- pound to MS/MS spectrum (C2MS) models improve retrieval rates by augmenting real libraries with predicted MS/MS spectra. Unfortunately, many existing C2MS models suffer from problems with mass accuracy, generalization, or interpretability. We develop new probabilistic method for C2MS prediction, FraGNNet, that can efficiently and accurately simulate NS/MS spectra with high mass accuracy. Our approach formulates the C2MS prob- lem as learning distribution over molecule fragments. FraGNNet achieves seate-of-the-ars performance in terms of prediction error and surpasses existing C2MS models as tool for retrieval-based MS2C.

---

Published in Transactions on Machine Learning Research (08/2025)
1 Introduction
Small molecule identification is a challenging problem with broad scientific implications. Determining the chemical composition of a liquid sample (such as human blood or plant extract) is critical step both in the discovery of novel compounds and in the recognition of known compounds new contexts. Tandem mass spectrometry (MS/MS) a widely employed tool for molecule identification, with applications ranging from drug discovery to environmental science and metabolomics (Dueñas et al.) 2022: Gowda Djukovic 2014 Peters 2011 Lebedev 2013). Analyzing the set of MS/MS spectra measured from a liquid sample can reveal important information about its constitution: each spectrum acts as chemical signature that help identify molecule in the sample.
The MS/MS spectrum to compound (MS2C) problem is the task of inferring the structure of a molecule from its mass spectrum. Existing MS2C workflows often rely on comparing the spectrum of an unknown molecule against a library of reference MS/MS spectra with known identities. However, spectral libraries are far from comprehensive. The largest. public MS/MS library, NIST23 (Stein 2023), consists of 51,501 compounds and 2.4 million spectra. In contrast, the most commonly used chemical database, PubChem (Kim) et al. 2019 contains 119 million compounds at the time of writing. The huge gap in spectrum coverage means retrieval-based MS2C might not work even for molecules that have previously been observed.
Many computational approaches attack the MS2C problem head-on by attempting to predict information about the molecule from the MS/MS spectrum. Some models infer high-level chemical properties from the spectrum Dührkop et al.) 2015 Voronov et al. (022) and use these features to recommend likely candidate
structures from existing chemical databases (Dührkop et al.] 2015 Dührkop et al. 2019 Goldman al.
2023b c Bushuiev et al., 2025) or guide generative models towards potential matches (Stravs et al. 2022
Other methods (Butler et al. 2023 Shrivastava et al. 2021 Wang et al. 2025b Bohde et al. 2025 directly
generate structures from the spectrum.
Compound to mass spectrum (C2MS) prediction can be viewed as an indirect approach for solving the MS2C problem. Instead of attempting to infer structural features from the MS/MS spectrum, C2MS models work by boosting the effectiveness of existing retrieval-based MS2C workflows. Accurate C2MS models can predict MS/MS spectra for millions of molecules that are missing from spectral librarics, improving coverage by orders of magnitude. This kind of library augmentation has been mainstay in retrieval-based MS2C workflows for over decade (Wolf et al. 2010 Allen et al. 2015 Wishart et al. 2018 and has led to the successful identification of many novel compounds (Skinnider et al. 2021 Wang et al.
2023 Qiang et al. 2024).
Despite numerous advances, challenges with C2MS remain (Schymanski et al.
2017
Bushuiev et al. 2024
Many cxisting approaches cannot prodict MS/MS spectra with high mass accuracy: this loss of information can be harmful in MS2C applications (Kind et al.) 2018). Model interpretability is important for manual validation of MS/MS predictions, yet many models operate as black boxes. Finally, generalization to new compounds is difficult given the limited availability of training data.
In this work, we make the following contributions:
We introduce FraGNNet, a novel method for MS/MS spectrum prediction that integrates combinatorial bond-breaking methods with principled probabilistic modelling.
We argue that this approach meets key requirements in the areas of prediction error, mass accuracy and interpretability.
Through comparisons with strong baseline models, we demonstrate that FraGNNet achieves statc-of-the-art performance on MS/MS spectrum prodiction and compound retrieval tasks.
2 Background
At a high level, MS/MS spectrometry provides information about molocule's structure by mcasuring how it breaks down. The experimental process is outlined in Figure [ First, molecules in the sample are ionizod: this stage they are referred to as precursor ions, because they have not yet undergone fragmentation. Tn liquid
2

---

Published in Transactions on Machine Learning Research (08/2025)
100 Da, 120 Da, 75 Da
100 Da
25 Da, 50 Da, 75 Da, 100 Da
lonization
Precursor Selection
Fragmentation
Intensity
MS/MS Spectrum
Liquid Sample
Mass
25 Da
Da
Da
100 Da
Figure 1: Overview of MS/MS spectrometry: molecules in the sample are ionized to form precursors, filtered by precursor mass (100 Da), and sent for fragmentation. The fragmentation process stochastically produces fragments with mass values of 25, 50, 75 Da. The distribution of procursor and fragment mass values forms the spectrum.
samples, cach molccule may become associated with chargod adduct during ionization. For example, if the adduct hydrogen ion H*, an [M+H]* precursor ion will form. Following ionization, the mass charge ratio (m/z) of each precursor ion is subsequently measured using values have been measured, ions of selected m/2 are isolated and subjected to fragmentation for further analysis. The fragmentation process is typically facilitated by energetic collisions with nentral gas particles, and is influenced by experimental parameters such as collision energy. In general, higher collision energy results in more extensive fragmentation.
analyzer. Once the precursor m/z
A fragment is defined as a molecule composed of a subsel of the atoms precursor molecule. The fragmentation process involves chemical reactions that cause the stochastic breakage and formation of bonds in the molccule. After fragmentation, the resulting fragment ions are sent to measurement, producing distribution over m/z values that is called the MS/MS spectrum. It is possible for different fragments to have nearly identical m/2, complicating analysis of the spectrum. Throughout this work, we focus our analysis on [M+H]** spectra: as z is always +1, the spectrum can be directly interpreted as a distribution over masses. However, our methods can be extended to other types of adducts, such as [M-H] and [M+Na]+
analyzer for m/z
Mathematically, an MS/MS spectrum Y can be represented each mass my has an associated probability P(my). We refer to each individual pair (my, P(m,)) as a peak, where the mass m, (measured Daltons or Da) is called the peak location and the probability P(m,) ) is called the peak intensity. The precision of the peak locations is commonly referred to the mass accuracy. The C2MS problem tuples {(x,, K where X; is molecule and Y; is its associated MS/MS spectrum. The goal of C2MS model to predict Y, from X, The set of masses in particular spectrum Y; is denoted as M,-
finite set of pairs {(mj, P(mi))}, where
be formulated
standard supervised learning task. The dataset is composed of N
Every molecule can be represented as an undirected molecular graph G = (V, E). Each node a E V represents an atom the molecule with an associated element label w, E Q (where f (C, H, N, O, O.P,S....) is a finite set of common elements) and each edge b E represents a covalent bond between atoms. molecular formula is a representation of the molecule that captures only the quantity of each type of atom present in
3

---

Published in Transactions on Machine Learning Research (08/2025)
the graph. For example, the molecule methylaminomethhnol (Figure 5 which means that its molecular graph contains two carbon atoms, seven hydrogens, one nitrogen, and one oxygen.
has molecular formula of C2H,NO,
Peak annotation is the process of linking peaks in an MS/MS spectrum to chemical information. Practitioners often use these annotations to interpret the spectrum: in the context of MS2C, these annotations can help users compare possible candidate molecules by facilitating the incorporation of domain knowledge (Steckel & Schlosser 2019 Johnson & Carlson 2015). When a peak is associated with subformula of the precursor molecular formula, this is called formala annotation; similarly, when peak is associated with fragment of the precursor molecule this is called a fragment annotation.
3 Related Work
The increasing availability of small molecule MS/MS data has lead to a proliferation of machine learning models for C2MS prediction. Existing methods can be broadly grouped into two categorics, binned and struclured, based on how they represent the spectrum.
Binned methods approximate the spectrum by discretizing the mass range into fixed number of equally sized bins, each with an associated intensity. This simplifies the spectrum prediction problem to a vector regression task, which can be readily solved without extensive domain-specific model customization. Binned approaches generally vary based on the strategy they employ for encoding the input molecule: multi-layer perceptrons
(Wei et al. 2019), 2D and 3D graph neural networks (Zhu et al. 2020 Li et al.] 2022 Hong et al., 2023 Park et al.) 2024). and graph transformers (Young al., 2023) have all been used successfully. However, selecting appropriate bin size can be challenging: bins that too large result in loss of information, while bins that are too small can be overly sensitive to measurement error and yield high-dimensional output vectors.
Structured approaches sidestep the binning problem by modelling the spectrum as a distribution over chemical formulac. This reprosentation allows for arbitrarily high mass accuracy, since the formula masses can be used to determine peaks locations with precision. Some methods predict the formula distribution directly, using either autoregressive formula generation (Goldman et al., 2023a] or a large fixed formula vocabulary (Murphy et al. 2023). Others rely on recursive fragmentation [Wang et al. 2021 Zhu & Jonas 2023 Nowatzky et al, 2025 or autoregrossive generation (Goldman et al., 2024 Wang et al. 2025a) to first model distribution over fragments, then map this to a distribution over formulae. Structured C2MS models tend to be more interpretable, since each peak is always associated with a formula (and possibly one or more fragments). However, they can also be slower than binned approaches due to the increased complexity of the spectrum representation.
CFM-ID (Allen et al. 2015 Wang et al., 2021) and ICEBERG (Goldman et al. 2024) are structured C2MS models that explicitly model fragmentation. Like FraGNNet, both approaches algorithmically generate fragments of the input molecule and predict distribution over those fragments. Their principal distinction, however, lies in the specific strategy for fragment generation. CFM-ID employs deterministic bond-breaking algorithm and incorporates chemistry domain knowledge to compute a set of plausible fragments. This approach benefits from consistent fragment generation and strong chemical priors; however, it does not scale well to larger molecules and datasets. In contrast, ICEBERG uses a deep learning model to autoregressively generate fragments. This approach has proven to be overall more accurate and scalable than CFM-ID [Goldman al., 2024), but it relies on a learned fragment generation process that can result in errors. FraGNNet takes pragmatic approach: like CFM-ID, it employs deterministic algorithm to generate comprehensive set of fragments; however, by relaxing chemical constraints it can achieve greater efficiency and scale to larger compounds like ICEBERG.
4 Methods
4.1
Overview
The goal of our method is to predict the MS/MS spectrum for an input molecular structure. The model works in two stages: first, recursive bond-breaking algorithm (Section 4.2 generates set of plausible
4

---

Published in Transactions on Machine Learning Research (08/2025)
Go
H
R
x
Molecule % mnL
pd
F
G
Fragment GNN 9f
Gix
Chapur
Gyt-
Predicted Spectrum
6/10,
Intenstty 2k6m))
Made N-11
Inieatty
C2
Figure 2: Overview of the FraGNNet C2MS model. The input molecule (G, red box) is processed into approximate Fragmentation DAG (G yellow box) and independently embedded by the Molecule GNN (g0 orange box). Information from the DAG is combined with the molecule embedding and processed by the Fragment GNN (g5 blue box). Output MLPs (brown boxcs) are applied to each fragment node n in the DAG to predict a per-node distribution over formulae (purple boxes), which can be mapped to a distribution over masses (green boxes) and summed across nodes to create the MS/MS spectrum.
molecule fragments. Then, probabilistie model (Section parameterized by a graph neural network (Section 4.4) predicts distribution over these fragments. The fragment distribution induces distribution over molecular formulae, which is converted to MS/MS spectrum using formula masses (Section 4.3p This approach allows for extremely high mass accuracy and probabilistic formula and fragment annotations.
4.2 Recursive Fragmentation
Recall our definition of the molecular graph G (V, E') from Section where nodes represents atoms and edges E E represent bonds. Let S(G) be the set of connected subgraphs of the graph G.
Definition 4.1. The graph F(G) = (G)( called a fragmentation DAG with respect the graph G if the following properties hold:
Each node n E FGG) corresponds to a connected subgraph G, E S(G)
Each edge e F2) from node u E (G) to node E (G) exists if and only if G, S(G) is a connected subgraph of G, S(G) that can be constructed by removing single edge from G2 and selecting one of the resulting connected subgraphs.
Note that the root node r of F(G) always corresponds to the original graph G, and the leaves of F(G) correspond to individual atoms V.
Our method assumes that most fragments that contribute to MS/MS spectrum can be modelled products of sequence of bond breakages. Such fragments appear as nodes E FiG)), and their fragmentation history path from the root to n. We can derive set of molecular formulae (fn. n E Fi (G)),
can be represented where each fn represents the molecular formula of G,,- This set can be used to calculate the set of possible peak locations in the spectrum, M(G) (m, n. E (G) where m,, = mass(fn) is the monoisoloppic mass of molecular formula. fn.
The fragmentation DAG F(G) can be useful tool for spectrum prediction Wang al. 2021 Goldman et al. 2023a 2024). providing information about peak locations and relationships between fragments in the
5

---

Published in Transactions on Machine Learning Research (08/2025)
spectrum. However, computing F(G) from G through exhaustive edge removal is expensive. Inspired by
previous approaches from the literature (Wolf et al. 2010 Ruttkies et al. 2016 Allen et al. 2015 Ridder et al. 2014 Goldman et al.) 2024), we approximate F(G) using a few simplifying assumptions.
Definition 4.2. The graph H(G) (H1(G), H2(G)) is called a heavy atom skeleton of G if H(G) is the largest connected subgraph of G such that wa + H (hydrogen) for all a E Hi(G).
Since H2((G) is often smaller than E (in the NIST20 MS/MS dataset, = 43% smaller on average), calculating F(H(G)) is considerably faster than calculating F(G). We employ a recursive edge removal (i.e. bond- breaking) algorithm that only considers nodes that are at most hops away from the root r, producing a connected subgraph (H(()) of F(H(G)) (see Algorithm for an outline of our implementation).
For simplicity of notation, we refer to (H(()) Gya, with vertex set Vf and edge set Eyn. By definition, each node n E Vu is associated with a fragment subgraph G, E S(H(G)) that does not contain any hydrogen aloms. Since real fragments often include hydrogens, we employ heuristics to bound the number of hydrogens associated with each G., This approach enables us to account for hydrogens while avoiding the computational cost of explicitly modcling their positions the graph.
Let hn be the number of hydrogen atoms in original molecular graph G that are connected to an atom in the fragment subgraph Gn. We define the set {h, -..... hn + j] the range of hydrogen counts for the subgraph Gn, where j is an (integer) tolerance parameter. This induces a set of possible molecular formulae [ JR] and associated masses (m.,)...,, my where Sh is Sn with the addition of h, + hydrogens, and m. is its corresponding monoisotopic mass. For example, if fa = C2O,, hn = 3, and i = 2, then m = mass(C2O,HHz) = 45.03404 Da.
Definition 4.3. The set
M d. = U (m......., m
nVV
is the set of masses derived from the approximate heavy-atom fragmentation DAG Gza with hydrogen tolerance j.
Empirically, we find that calculating (G, d.j) (Definition 4.3) with d e [3.4] and j = 4 can effectively capture most of the total peak intensity in real MS/MS data (see Table 4
4.3 Probabilistic Formulation
Our model can be interpreted as a hicrarchical latent variable model, whose latent distributions depend on a molecular graph G and its approximate fragmentation DAG G
To begin, we define the following latent probability distributions: Definition 4.4. Let (n) be a discrete finite probability distribution over the DAG nodes N Vyra parameterized by a neural network go-
Definition 4.5. Let (flf))) be discrete finite conditional probability distribution between DAG nodes N and associated formulae F = UnEN ( J2), parameterized by a neural network go.
Both distributions depend implicitly on the molecular graph G, but for clarity of notation we have omitted this. Note that for each node n, Po(flm (n) has support over 2j + formulae !
The joint distribution (r f) = (o(n) Po(f(n) can be loosely interpreted as identifying which substructures are generated during fragmentation, with (n(n) modelling the heavy atom structures of the probable fragments and (f() modelling the number of hydrogens associated with each of those fragments.
By marginalizing Po f) over the nodes n, it is possible to calculate distribution over molecular formulae (J).) Since each formula has an associated mass, the discrete distribution Po(J") can be easily converted to a continuous distribution (m(m) over masses. Following Allen et al. (0155). we formulate (m(m) as a mixture of truncated univariate Gaussians as outlined in Equation
There additional filtering for chemical validity which may remove some formulae, but for clarity this has been omitted.
6

---

Published in Transactions on Machine Learning Research (08/2025)
Po(m) Σ Po(f) P(mlf)
(1)
The conditional P(m]f) is a narrow truncated Gaussian centered on the formula mass, juf) mass(f). with variance of) proportional to ʃ and truncation occurring at =1 standard deviation from the mean. This Gaussian model approximates the error distribution of the mass analyzer (Allen et al. 2015 At inference time it convenient to approximate P(m) as a discrete distribution with f(m (mass f)), where d is the Dirac delta function.
Using Bayes Theorem, we calculate another latent distribution Po(n) f) that identifies how much each fragment is contributing to predicted peak centered at formula f. We use Po(n)f) to predict fragment annotations for each output peak (see Figure 3 and Section 5.4).
In Appendix A.3 we describe analogs of (o(n), Po(f(m), and Po(nlf) that account for fragment subgraph
isomrrphism.
4.4 Neural Network Parameterization
The distributions Po(n) and Po(f(n) I) paramcterized by two-stage graph neural network (GNN, Battaglia et al. 2018 as defined by Equation 2
ga
9o
FRAG
(g (G), Gzs)
(2)
The first stage "h called the Molecule GNN, operates the input molecular graph G. The second stage FRAG called the Fragment GNN, combines information from the fragmentation DAG and the molecule 90 embeddings to predict the distributions (nnn) and Po (ff
4.4.1 Molecule GNN
The Molecule GNN otth takes the input molecular graph and outputs embeddings for the atoms in the graph. The atom embeddings Ti(0)) and bond embeddings T0 are initialized with specific features from G (see Appendix A.4.
GNN models work by iteratively updating node states through the aggregation of neighbourhood information. NDL uses the GINE architecture (uu et al. 2019 Fey & Lenssen 2019), which incorporates both node and edge information in its updates. The GINE update rule is given by Equation 3, where / is the GNN layer index, / (l,..., L,), and qo is a standard multi-layer perceptron (MLP):
R(+1)
qo 70 + Σ
ReLU(A
T + A(O0)
(3)
uEN(a)
The final atom embeddings (L,) are subsequently passed to the Fragment GNN go FRA for further processing.
4.4.2 Fragment GNN
The Fragment GNN 90 is another GINE network that propagates information along the approximate fragmentation DAG. Each DAG node V is featurized using information about its associated subgraph
G,, preciscly described in Equations 4 and 5 The vector ( is a concatenation of three terms: he is the average atom embedding for atoms in G hg is an embedding of the subgraph formula fxi and hd is an embedding of the depth in the DAG at which node is located.

---

Published in Transactions on Machine Learning Research (08/2025)
CaH.
Predicted
0.30
P(A) 0.255
P(aAA)
0.989
0.001
0.001
CaHo
0.30
P(6) 0.156
Intensity Pa(m)
0.05
P((AA)
1.000
A C.H.N
0.00
P(A) 0.150
0.05
P()
1.000
0.10
S CaHl
P(A) - 0.127
0.15
P(1 =
0.123
0.123
0.123
S CaIIaO,
0.25
P(G) = 0.080
100
150
200
260
300
Mass
P(1f))
1.000
Figure Example Spectrum Prediction with Peak Annotations: A real spectrum (blue) for molecule from the test set, Adiphenine, is compared with its corresponding FraGNNet-D4 prediction (red). The five most intense peak predictions are annotated with formulae and up to three probable fragment structures. The fragment annotation for peak 5 clearly corresponds to the precursor ion (L.e. the entire graph). The model is uncertain about the fragment annotation for peak 4, giving equal probability (0.123) to three related structures and significant probability (0.631) to other less likely structures.
T((0) = Ri
||
(4)
h 1
(((L))
(5)
Vn
aEV,
The edge embeddings (1) are also initialized with subgraph information: they capture differences between adjacent DAG nodes. Refer Appendix A.5 for full details.
The DAG nodes are processed by the Fragment GNN in manner that is similar to Equation After L2 layers of processing, a small output MLP is applied to each node embedding (1 producing a 2j dimensional vector representing the unnormalized logits for (n, f() for each (-j...., The other
latent distributions in Section 4.3 are calculated from the joint through normalization, marginalization, and application of Bayes Theorem.
After performing model ablations (see Appendix A.8 we discovered that edge information could be omitted without degradation performance, allowing for faster training and inference. As a result, the experiments in Section 5 used a variant of gø FRÁG that excludes the neighbourhood aggregation term from the GINE update, effectively acting as a nodo-wise MLP.
4.5
Loss Function
We fit the parameters of the model with maximum likelihood estimation, using stochastic gradient descent. The loss function is based on the negative log- licelioo of the data, defined in Equation 6
(m)
Σ Σ
P((m) log (m
(6)
i
meM.
8

---

Published in Transactions on Machine Learning Research (08/2025)
For each spectrum (indexed by t), subset of the peak masses M S M, are defined to be Outside of the Support (OS) if they are far enough from away the predicted set of masses M (G,, d, such that their predicted probability is (Equation
P(M
E
P(m)
mE P
The rest of the masses MI5 M; MPs are deemed to be Inside of the Support (IS).
Modelling the OS probability can provide useful information about the reliability of the predicted spectrum (Appendix A.7 FraGNNet is trained to predict Po(M, estimation of P(M,%)) Adjusting the loss function (0) to incorporate the OS cross-entropy term yields Equation
(()) Σ
P(M log )
+ Σ
-P(m) log Po(m)
MEM!S
In cases where (S > O, perfectly optimizing (0) yields predictions that have (incorrectly) redis- tributed P(MO8) to other peaks. This undesirable behaviour can be avoided by minimizing L()) instead.
4.6 Latent Entropy Regularization
Entropy useful tool for interpreting the model's latent distributions. (N(N) quantifies the diversity of fragments that contribute to the spectrum; (FI)))) describes variability in molecular formulac (hydrogen counts) for each fragment; H. (NN)) describes variability in fragment annotations for each predicted formula. For each latent variable Z E F,, F/n,Niff Nif), we define normalized entropy H(2) = H Z)/ log(1 Normalization corrects for differences in support size, facilitating direct comparison of latent entropies across molecules of different sizes. Since entropy differentiable, normalized latent entropy and prediction error can be jointly optimized using gradient-based methods. Incorporating normalized entropy into the objective function, demonstrated in Equation effectively imposes entropy regularization on the latent distributions.
Lee (0) = L(0) + HoN) + apHo(()) + Ho Hol
The tunable hyperparameters az E {aN, ari control the influence of the entropy regularizers. Since (0) is minimized, setting az < 0 will maximize the corresponding normalized entropy Hlg (Z), and vice versa. Entropy regularization can be useful when assessing consistency of fragment annotations, demonstrated in Section 5.4
5
Experiments
5.1
Spectrum Prediction (C2MS)
We evaluated C2MS performance on a held-out portion of the NIST20 MS/MS dataset (Appendix A.9 comparing FraGNNet with other binned and structured prediction models from the literature. ICEBERG [ollmaa et al. 2024 is structured C2MS approach that uses neural networks to generate molecule fragments and map them to predicted spectrum. GrAFF-MS (Murphy et al. 2023 is structured approach that predicts a distribution over static library of common chemical formulac. MassFormer (Young et al. 2023) and NEIMS (Wei et al. 2019) are both binned approaches: the former uses a pretrained graph transformer model (Ying et al. 2021 to encode the molecule, while the latter relies on domain-specific chemical fingerprint representations (Rogers & Hahn! 22100). Precursor-Only is a trivial bascline that only predicts peak centered on the mass of the precursor formula. For more details on the baseline models, refer to Appendix A.14

---

Published in Transactions on Machine Learning Research (08/2025)
Table I: Spectrum Prediction Performance on the NIST20 MS/MS Dataset. CBN is binned cosine similarity (0.01 Da bins), ChUN is the Hungarian cosine similarity (10 ppm tolerance). As NEIMS, MassFormer, and ICEBERG have binned outputs, they cannot be scored with CHUN. Means and standard deviations are reported for random sceds, with best scores in bold.
InChIKey
Scaffold
Model
CBIN f
CHUN 1
CBiN A
CHUN ft
FraGNNet-DA
0.736 0.002
0.709 + 0.002
0.678 + 0.005
0.654 + 0.006
FraGNNet-D3
0.721 + 0.002
0.693 0.002
0.659 + 0.001
0.633 + 0.001
GrAFF-MS
0.596 = 0.005
0.602 + 0.004
0.520 = 0.005
0.518 = 0.004
ICEBERG
0.707 = 0.001
0.636 = 0.002
MassFormer
0.639 = 0.002
0.562 = 0.003
NEIMS
0.635 0.001
0.546 = 0.003
Precursor-Only
0.319 0.000
0.285 0.000
0.313 + 0.000
0.280 + 0.000
Table Compound Retrieval Performance on the NTST20 MS/MS Dataset. Top-k (for (1,3,5)) top-k accuracy, expressed as a percentage. Means and standard deviations are reported for 5 random seeds, with best scores in bold.
InChiKey
Scaffold
Model
Top-1 f
Top-3 f
Top-5 f
Top-1 1 ft
Top-3 ft
Top-5 f
FraGNNet-D4
36.0 0.4
66.3 + 0.5
78.4 + 0.5 30.3 + 0.6
59.8 + 0.3
73.2 + 0.4
ICEBERG
36.0 0.8
+8.9
75.4 0.3
27.9
55.0 0.7
68.3 + 0.8
MassFormer
24.2 0.5
51.7
65.7 0.6
20.4
45.2
60.1 = 0.8
NEIMS
26.0 + 0.7
5
65.1 + 0.9
19.9 + 0.8
42.0 0.9
54.6 + 0.8
The results are summarized in Table [ FraGNNet-D4, a version of our model that uses a 4 approximation of the fragmentation DAG, clearly outperformed other models in terms cosine similarity. Increasing fragmentation depth from d 3 (FraGNNet-D33) had positive impact on performance, as expected.
5.2 Compound Retrieval (MS2C)
Each model was also evaluated in a retrieval-based MS2C task. Our setup is similar to previous works (Goldman et al. 2024 Murphy et al. 2023;: for each molecule X, and associated MS/MS spectrum Y, in the test set ( 4,000 pairs, Appendix A.9h a candidate set C, is constructed from X; and 49 other molecules sampled from PubChem (Kim et al. 2019). Each C2 E C. - (X, is selected to have high chemical similarity with X; measured by Tanimoto similarity between chemical fingerprints (Rogers Hahn 2010p. The C2MS models are tasked with predicting a set of spectra Y, for molecules C; E C, The spectra Y; are ranked by their similarity with the real spectrum Y,, inducing a ranking on the molecules C,. The models are scored based on their ability to correctly rank X; in the Top-k.
For each model, a variety ranking methods were evaluated, and the one that produced the best ranking was recorded Table 2 FraGNNet-D4 matched or outperformed all baseline models for all values of on both splits, with larger gains on the more challenging Scaffold split. For additional retrieval results, refer Appendix A.11
5.3 Formula Annotations
Peak annotations (Section 2 are an important tool in the intorpretation of MS/MS spectra. The FraGNNet model can produce both formula and fragment peak annotations (Figure is an example). In this section we assess the quality of FraGNNet's formula annotations, and in Section 5.4 evaluate its fragment annotations.
10

---

Published in Transactions on Machine Learning Research (08/2025)
Table 3: Formula Annotations (Scaffold Split). AR is Annotation Recall, AWR is Annotation Weighted Recall, AP is Annotation Precision, AWP is Annotation Weighted Precision, AF is Annotation Fi score, AWF1 is Annotation Weighted Fi score. Means and standard deviations (where applicable) are reported for random soeds, with best scores in bold.
Model
AR f
AWR f
AP f
AWP A
AF1 ft
AWF1 ft
FraGNNet-D4
0.81
0.90
0.98
1.00 + 0.00
0.89
0.95 0.00
GrAFF-MS
0.95
0.98
0.61
0.81 0.01
0.74
0.88 0.01
ICEBERG
0.66 + 0.00
0.81 + 0.00
0.99 + 0.00
0.79 + 0.00
The NIST20 dataset provides expert-curated formula annotations for most spectra; for more details on these annotations, refer to Appendix A.15 We pose the formula annotation task as a classification problem. Given a real spectrum P(m), each real peak m E M has a (possibly empty) set of associated expert formula annotations A(m)= = { that are assumed be correct. Similarly, in the predicted spectrum Po(m') each predicted peak m' M has (nonempty) set of associated formula. annotations A(m') = (f
Using relative mass lolerance of 10 ppm, match peaks in the predicted spectrum m'' with peaks in the real spectrum m and identify overlap in their associated formula annotation sets A(m') and A(m). This allows us to calculate recall of annotated peaks in the real spectrum (Equation 31) and precision of annotated peaks in the predicted spectrum (Equation 33 as well as their aatensity-weighted counterparts (Equations 32
and 34 and associated Fi scores (Fquations
35 and 36
The results are summarized in Table FraGNNet provided the best balance of recall and precision, as indicated by superior F1 scores. GrAFF-MS achieved slightly higher recall and much lower precision; ICEBERG offered slightly higher precision but lower recall. GrAFF-MS relied on static formula library, which yielded a distribution over roughly 10,000 formulae for each imput compound. By comparison, FraGNNet's formula distribution was lypically much smaller, with a median support size of 679 formulae (Table 4 Note that GrAFF-MS directly used NIST formula annotations to define its formula library (refer to Appendix Arrenndi/AA11... 14.2 for full details); in contrast, the other models did not rely on expert annotations for training or inference.
5.4 Ensembling and Fragment Annotations
Fragment annolations provide greater model interpretability than formula annotations. FraGNNel's latent distribution Po (n)l)) naturally provides a map from formulae f to DAG nodes and their associated fragments Gn. f) can be interpreted as a fragment annotation distribution, indicating the likelihood of fragment G. contributing to a peak centered around mass(J) (see Figure 3 for an example). However, the ground truth distribution P(nlf) is generally unknown and difficult to measure experimentally. In principle, is possible for multiple fragments (with the same molecular formula) contribute to the same peak, meaning that the true P(nlf) is not necessarily degenerate.
Unlike the experiments in the previous section, there are no expert-curated fragment annotations that can be used for comparison. Rather than measuring the accuracy of the model annotations, we focus instead on measuring their consistency. In particular, we attempt to construct models with different fragment distributions that nonetheless achieve comparable spectrum prediction performance. Disagreement in fragment. annotations between models that perform equally well would indicate that model explanations are variable and therefore potentially unreliable.
We construct four FraGNNet-D4 ensembles, each with different annotation distribution, by tuning the latent entropy regularization parameters (Section 4.6). The Baseline Entropy configuration represents a standard ensemble of K models without entropy regularization (axN) 0). The High Entropy and Low Entropy configurations consists of K models with entropy regularization (awis < 0 and aNj > O, respectively). The Mixed Entropy configuration consists of K/3 models cach of the Bascline, Low, and High Entropy configurations. All ensembles use K = 15 models with the same hyperparameters and different random seeds for initialization and training.
11

---

Published in Transactions on Machine Learning Research (08/2025)
Let {0t gb ~ p(0)) denote the set of parameters for an ensemble of K models. We perform ensembling in the latent space (see Appendix A.16 for details). Let pk (mlʃ) and 1it* (N]J) denote the latent distribution and latent normalized entropy (respectively) of a ensemble of K models. For each configuration, Figure Ma compares the behaviour of the individual models to the overall ensemble, in both the output space and the latent space. Ensembling provides a modest increase in cosine similarity (4.2 - 4.3%) and a somewhat larger increase in normalized entropy (7.6 - 11.4%). The observed entropy increases are consistent. with theory; for a short proof see Appendix A.16
K
Focusing now on the ensemble metrics, we see that all four model configurations achieved similar MS/MS spectrum prediction performance (CHUN R 0.67) despite differing markedly in normalized entropy: the Low Entropy configuration only had = 71% of the normalized entropy of the High Entropy configuration (0.37 vs 0.52, respectively). This confirms that FraGNNet models with different fragment annotation distributions can achieve similar C2MS performance.
Viewed in isolation, these results might suggest that FraGNNet's fragment annotations are inconsistent and raise questions about. their reliability. However, we also investigated the top-1 fragment agreement (t.e., pK (nl mode consistency) between ensemble configurations. This behaviour was measured using pairwise fragment annotation agreement (PFA, Equation 42) and consensus fragment annotation agreement (CFA, Equation 43). In the NIST20 MS/MS test set, PFA 2 82% (Figure 4bb and CFA & 76% across all model configurations. These results demonstrate that the modes of the annotation distributions (n were relatively consistent and robust to variations in latent entropy. In Appendix |A.17 we performed a similar analysis focusing on ff the version of the annotation distribution that accounts for fragment isomorphism (Appendix A.3 In this case the top-1 agreement was even higher (PFA 91%, CFA R 89%).
In summary, we have shown that it is possible to achieve comparable performance with ensembles that differ significantly in their normalized latent entropies H. (f) However, despite these entropy differences, the models tend to agree on which fragment annotation G, is most appropriate for a given formula ʃ and its associated peak at mass(f). Although we cannot establish the true fragment annotations without specialized measurements (van Tetering et al.) 2024), our experiments indicate that, at a minimum, FraGNNet's explanations remain robust to perturbations in latent entropy.
6 Discussion
In this work we introduce FraGNNet, a deep probabilistic model for spectrum prediction. Our work shows that pairing combinatorial fragmentation with graph neural networks can achieve slate-of-the-arl C2MS performance. FraGNNet is unique in its interpretable probabilistic representation of fragmentation. Features such as OS prediction and tunable entropy regularization further differentiate it from existing models. Strong results in compound retrieval and peak annotation demonstrate potential utility in MS2C applications.
Several paths for improving our method are available. First, the fragmentation algorithm currently depends on recursive edge-removal operations, which could be parallelized to accelerate runtime. Second, the algorithm fails to account for some fragments, as evidenced by unexplained OS peaks in the spectra. These peaks may arise from complex chemistry, such as cyclizations, that dramatically expand the fragment search space and are therefore challenging to model. One potential remedy is to develop a sequential reaction sampler that can generate fragments beyond simple bond-breaking, Alternatively, combining FraGNNet with a more flexible C2MS model, such as formula predictor like GrAFF-MS, could be an effective method of capturing OS peaks without explicitly modelling their fragments. Finally, to broaden FraGNNet's practical applicability, it is important to evaluate performance unmerged spectra and under broader range of experimental conditions, including different instrument platforms and precursor adducts.
7 Author Contributions
The project conception was a joint effort of all authors. Experimental design was undertaken by A.Y., F.W., and H.R., with implementation by A.Y. and F.W. All authors participated in revising the manuscript.
12

---

Published in Transactions on Machine Learning Research (08/2025)
Individual
Ensemble
Cosine Similarity
Baseline
100%
86%
84%
87%
0.7
+4.2%
+4.3%
+4.2%
+-4.2%
0.6
Low
86%
100%
82%
88%
0.5
Baseline
Low
High
Mix
0.6
High
84%
82%
100%
85%
Normalized Entropy
Individual
Ensemble
+7.6%
0.5
11.4%
Mix
87%
88%
85%
100%
+8.3%
0.4
+9.9%
Baseline
Low
High
Mix
Baseline
Low
High
Mix
(a) ChUN and (NI))
(b) PFA
Figure 4: a. For each ensemble configuration (Baseline, Low, High, Mix), the cosine similarity CHUN and normalized ent enty of the annotation distribution Hlg are reported. For both metrics, the average score of the individual models (Individual) is compared with the score of the ensemble (Ensemble). Each ensemble consists of K 15 models. Standard deviations for the K individual models are plotted as error bars. (b) Pairwise fragment annotation agreement (PFA) for all ensemble combinations are plotted in matrix. The consensus agreement (CFA) is ~ 76%.
8 Acknowledgements
We thank Tytus Mak for clarification on the techniques used at NIST for formula annotations.
Resources used in preparing this research were provided, in part, by the Province of Ontario, the Government. of Canada, through the Canadian Institute for Advanced Research (CIFAR) and companies sponsoring the Vector Institute. This research was also enabled in part by support provided by Compute Ontario and the Digital Research Alliance of Canada (alliancecan.ca). A.Y. is supported by Natural Sciences and Engineering Research Council of Canada (NSERC) Postgraduate Scholarship (Doctoral Program) and a Vector Institute research grant. F.W. is supported by Alberta Machine Intelligence Institute (Amii) research grant. H.R. is supported by NSERC, the Canadian Institutes for Health Research (CTHR), the Canadian Foundation for Innovation, the Canada Research Coordinating Committee (CRCC), the John R. Evans Leaders Fund and the Canada Research Chair Program. B.W. supported by NSERC (grants: RGPIN-2020-0611 and at the University Health Network and the CIFAR AI Chair Program. D.S. W. is supported by Genome Canada, Genome British Columbia, and Genome Alberta (project 284MBO); NSERC Brockhouse Canada Prize (NSERC BCPIR-590317) and the Canada Research Chairs (CRC TIERI 100628). R.G. is supported by NSERC Amii and CIEAR AI Chair Program.
the Peter Munk Cardiac Centre Al Fund
13

---

Published in Transactions on Machine Learning Research (08/2025)
References
Felicity Allen, Russell Greiner, and David Wishart. Competitive fragmentation modeling of ESI-MS/MS spectra for putative metabolite identification. Metabolomics, 11(1):98 110, February 2015. ISSN 1573-3890. doi:
URL https::/doi..rgg//
014-0676-4
Peter W. Battaglia, Jessica B. Hamrick, Victor Bapst, Alvaro Manchez-Gonzalee Vinicius Zambaldi, Matcusz Malinowski, Andrea Tacchetti, David Raposo, Adam Santoro, Ryan Faulkner, Caglar Gulcehre, Francis Song, Andrew Ballard, Justin Gilmer, George Dahl, Ashish Vaswani, Kelsey Allen, Charles Nash, Victoria Langston, Chris Dyer, Nicolas Heess, Daan Wierstra, Pushmeet Kohli, Matt Botvinick, Oriol Vinyals, Yujia Li, and Razvan Pascanu. Relational inductive biases, deep learning, and graph networks. arXiv:1806. 01261 (es, statf, October 2018. URL. http://arret org/ abs/ 1806 01261
Stefan Behnel, Robert Bradshaw, Craig Citro, Lisandro Dalcin, Dag Sverre Seljebotin, and Kurt Smith. Cython: The best of both worlds. Computing in Science & Engineering, 13(2):31 39, 2011.
Guy W. Bemis and Mark A. Murcko. The Properties of Known Drugs. 1. Molecular Frameworks. Journal of Medicinal Chemistry, 39(1)) 2893, January 1996. ISSN 0022-2623, doi: 10.1021/jm9602928. URL 10. 1011mm0002222222222
https://doi.ors oww..o.gg11o..o
Lukas Biewald. Experiment tracking with weights and biases, 2020. URL Software available from wandb.com.
com/
Montgomery Bohde, Mrunali Manjrekar, Runzhong Wang, Shuiwang Ji, and Comnor W. Coley. DifMMS: Diffusion Generation of Molecules Conditioned on Mass Spectra, February 2025. URL http://arxiv.. or
g/abs/2502.000 09571. arXiv:2502.09571 [cs].
Roman Bushuiev, Anton Bushuiev, Niek F. de Jonge, Adamo Young, Fleming Kretschmer, Raman Samusevich, Janne Heirman, Fei Wang, Luke Zhang, Kai Dührkop, Marcus Ludwig, Nils A. Haupt, Apurva Kalia, Corinna Brungs, Robin Schmid, Russell Greiner, BO WANG, David Wishart, Liping Liu, Juho Rousu, Wout Bittremieux, Hannes Rost, Tytus D. Mak, Soha Hassoun, Florian Huber, Justin J.J. van der Hooft, Michael A. Stravs, Sebastian Böcker, Josel Sivic, and Tomas Pluskal. Massspecgym: A benchmark for the discovery and identification of molecules. In The Thirty-eight Conference Neural Information Processing AAoAAAAAS
Systems Datasets and Benchmarks Track, 2024. URL /ttps:://ppeneevicg
Roman Bushuicv, Anton Bushuiev, Raman Samuscvich, Corinna Brungs, Josef Sivic, and Tomáš Pluskal. Emergence of molecular structures from repository-scale self-supervised learning tandem mass spectra, January 2025. /ttp:///tp/////eaaa..//////////r http://///ecectteeeeo//a/a/eeaaa 815ccc5
Thomas Butler, Abraham Frandsen, Rose Lightheart, Brian Bargh, James Taylor, T. J. Bollerman, Thomas Kerby, Kiana West, Gemnady Voronov, Kevin Moon, Tobias Kind, Picter Dorrestein, August Allen, Viswa Colluru, and David Healey. MS2mol: A transformer model for illuminating dark chemical space from mass spectra, 2023. URL https:// http://hwwxwvior/eeeeeeeeeeeeeee 2b082fc
Maria Emilia Dueñas, Rachel E Peltier-Heap, Melanie Leveridge, Roland S Annan, Frank H Büttnnr, and Matthias Trost. Advances in high-throughput mass spectrometry in drug discovery. EMBO Molecular Medicine, 15(1):e14855 48500, December 2022. ISSN 1757-4676. doi: 10. 10.15252/emmm.. www.umm.222144400 URL https://wwwz ncbi nlm. nih www..nih..ov. http:///c/aattcce/////////22////
Kai Dührkop, Huibin Shen, Marvin Meusel, Juho Rousu, and Sebastian Böcker. Searching molecular structure databases with tandem mass spectra using csi:fingerid. Proceedings of the National Academy of Sciences, 112(41):12580 12585, 2015. ISSN 0027-8424. doi: 10.1073 http://naa.11097880/ URL https
/ //www. wwww.pna..ooo www.aa...o.caeeoo..p..ap...peeeo /ttp://////ooeeet///////////
Joseph I. Durant, Burton A. Leland, Douglas R. Henry, and James G. Nourse. Reoptimization of MDL keys for use in drug discovery. Journal of Chemical Information and Computer Sciences, 42(6))1273-1225) 2002.
ISSN 0095-2338. doi: 00.1021/ci010132
14

---

Published in Transactions on Machine Learning Research (08/2025)
Kai Dührkop, Markus Fleischauer, Marcus Ludwig, Alexander A. Aksenov, Alexey V. Mclnik, Marvin Meusel, Pieter C. Dorrestein, Juho Rousu, and Sebastian Böcker. SIRIUS 4: a rapid tool for turning tandem mass spectra into metabolite structure information. Nature Methods, 16(4):299 302, April 2019. ISSN 1548-7105. doi: 10.1088//441592-019--900
URL http::/wwa www.:/nnturreccomm hat.a//ec...orrrriee/////111999 019-0991192-00004------
William Falcon and The PyTorch Lightning team. PyTorch Lightning, March 2019. URL https://github
.com/Lighttingg Aigggiignnnn//iggiiignggg
Matthias Fey and Jan Eric Lenssen. Fast graph representation learning with pytorch geometric. CoRR, abs/1103.022288, 2019. URL http://arxiv.. wttp:/b////..//2//5//3/// http:://aaaxl.oorr////////31/.1
02428
Samuel Goldman, John Bradshaw, Jiayi Xin, and Comnor Coley. Prefix- Tree Decoding for Predicting Mass Spectra from Molecules. In A. Oh, T. Neumann, A. Globerson, K. Sacnko, M. Hardt, and S. Levine (ods.), Advances in Newral Information Processing Systems, volume 36, pp. 48548 48572. Curran Associates, Inc., 2023a. URL https:://proceeddnga www.reiiininnnnnnnnneeeee / htt.a//i.iii..i...oe.oeoooaaaaaa
pdf
Samuel Goldman, Jeremy Wohlwend, Martin Stražar, Guy Haroush, Ramnik J. Xavier, and Connor W. Colcy. Annotating metabolite mass spectra with domain-inspired chemical formula transformers. Nature Machine Intelligence, 5(9):965 979, 2023b. ISSN 2522-5839. doi: 10.1038/ 10.1038/s42256-022 /0/////26000200000-566
URL
https://www. http:://wwwn..tuu.eeee haabbrrr.coa/rrtaceeee//ee6666-2 Group.
Number: 9 Publisher: Nature Publishing
Samuel Goldman, Jiayi Xin, Joules Provenzano, and Connor W. Coley, MIST-CF: Chemical Formula Inference from Tandem Mass Spectra. Journal of Chemical Information and Modeling, September 2023c. ISSN 1549-9596, doi: 10.1021/acs, http://cs.cc...cll0.... 3c000000..... URL https: htttps://doi.or/10... /000//cccs.... cci...30mmm... 3c01082 Publisher: American Chemical Society.
Samuel Goldman, Janet Li, and Connor W. Coley. Generating Molecular Fragmentation Graphs with Autoregressive Neural Networks. Analytical Chemistry, 9618):3419 3428, February 2024. ISSN 0003-2700.
doi: 10.1021/acs..ooo www.chhe..304655 URL http:///bo..rr///000//////// chhe 3c04654 Publisher:
American Chemical Society.
G.A. Nagana Gowda and Danijel Djukovic. Overview of Mass Spectrometry- Metabolomics: Opportu- nities and Challenges. Methods in molecular biology (Clifton, N.J.), 1198:3-12, 12, 2014. ISSN 1064-3745. doi: 17100779778--4999
1. URL https://ww:: http://wwwwwncci...m nlm. mih http://maaartiiclee/////43//////
Aric Hagberg, Picter Swart, and Daniel S Chult. Exploring network structure, dynamics, and function using networkx. Technical report, Los Alamos National Lab.(LAATT.) Los Alamos, NM (United States), 2008.
Stephen R. Heller, Alan McNaught, Igor Pletnev, Stephen Stein, and Dmitrii Tehekhovskoi. InChi, the TUPAC International Chemical Identifier. Journal of Cheminformatiics, 7(1 (1):23, May 2015. ISSN 1758-2946. doi:
URL https://doi.ore 110.011180//11321-1-00000--
Yuhui Hong, Sujun Li, Christopher J Welch, Shane Tichy, Yuzhen Ye, and Haixu Tang. 3DMoLMS: prediction of tandem mass spectra from 3D molecular conformations. Bioinformatics, 39())bbtd3344, May 2023. ISSN 1367-4811. doi: htts///ooonoommatss/bbaaeeee bttd354. URL
a354
.print:
Florian Huber, Stefan Verhoeven, Christiaan Meijer, Hanno Spreeuw, Efraín Manuel Villanueva Castilla, Cunliang Geng, Justin j van der Hooft, Simon Rogers, Adam Belloum, Faruk Diblen, and Jurriaan H. Spaaks. matchms processing and similarity evaluation of mass spectrometry data. Journal of Open Source Software, 5(52):2411, August 2020. ISSN 2475-9066. doi: 10.21105/joss.02111 02411.. URL https
//joss.theoj. . ww.. wttpg//appsss..... http:///....11/oosssooooo 02411
Andrew R. Johnson and Erin E. Carlson. Collision-induced dissociation mass spectrometry: powerful tool for natural product structure elucidation. Analytical Chemistry, 87(21):10668-1000 11686666-11188,, November 2015.
ISSN 0003-2700, 1520-6882. doi: 10.1021 10.1021/acs.analdo aacs.anacchem555015555.
15

---

Published in Transactions on Machine Learning Research (08/2025)
Sunghwan Kim, Jie Chen, Tiejun Cheng, Asta Gindulyte, Jia He, Siqian He, Qingliang Li, Benjamin A Shoemaker, Paul A Thiessen, Bo Yu, Leonid Zaslavsky, Jian Zhang, and Fvan E Bolton. PubChem 2019 update: improved access to chemical data. Nucleic Acids Research, 47(Database issue):DD102 D1109, January 2019. ISSN 0305-1048. doi: 10.1093/nar har//kky0333 URL https://wwww http://wwww.c.i....//m////...... nlm nih www.iiih.....p.oo gov/pmc/a
Tticless/MC63240055/
Tobias Kind, Hiroshi Tsugawa, Tomas Cajka, Yan Ma, Zijuan Lai, Sajjan S. Mchta, Gert Wohlgemuth, Dinesh Kumar Barupal, Megan R. Showalter, Masanori Arita, and Oliver Fichn. Identification of small molecules using accurate mass MS/MS search. Mass spectrometry reviews, 37(4):513 532, July 2018. ISSN 0277-7037. doi: 10.1002/mas, 21535. URL httpp::/wwat ncbi nlm www..ii......... htt..////pmc/aattttclee////oooo/
Kezhi Kong, Guohao Li, Mucong Ding, Zuxuan Wu, Chen Zhu, Bernard Ghanem, Gavin Taylor, and Tom Goldstein. Robust optimization as data augmentation for large-scale graphs. In Proceedings of the IEEE/CVF Conference. on Computer Vision and Pattern Recogration,, pp. 69, 2022.
H. W. Kuhn. The Hungarian method for the assignment problem. Naval Reseorch Logistics Quarterly, 2(1-2):83 97, March 1955. ISSN 0028-1441, 1931-9193. doi: 2.1002//av.3500022 URL https
//onlinelibrary www.rrrrr..lll......al.eeeeeeeee com wtt.ccoocooccccccccccccc wwt.:/..11000//..........
Greg Landrum. Rdkit: Open-source cheminformatics, 2022. URL http:://ww.rdksst .rg
Albert T. Lebedev. Environmental Mass Spectrometry, Annual Review of Analytical Chemistry, 6(1):163 189, 2013. doi: 10. 10.1146 http///ueevvannceee-00000-----00 m n-062012-092604
URL https://abi.org//// 11w///1nrr///aeaaaca....
Xinmeng Li, Hao Zhu, Li-ping Liu, and Soha Hassoun. Ensemble Spectral Prediction (ESP) Model for Metabolite Annotation. arXiv:2208. 13783 [es, g-bioj, March 2022. URL http:://axxiv.rr//bbba 3783. arXiv: 2203.13788
Yuanyue Li, Tobias Kind, Jacob Folz, Arpana Vaniya, Sajjan Singh Mchta, and Oliver Fichn. Spectral entropy outperforms MS/MS dot product similarity for small-molecule compound identification. Nature Methods, 18(12):1524-15) 1531, December 2021. ISSN 1548-7105. doi:
J. Lin. Divergence measures based on the shannon entropy. IEEE Transactions on Information Theory, 37 (1):145 151, 1991. doi: 10.1109/18.61115
Michael Murphy, Stefanie Jegelka, Ernest Fraenkel, Tobias Kind, David Healey, and Thomas Butler. Efficiently predicting high resolution mass spectra with graph neural networks. In Andreas Krause, Emma Brunskill, Kyunghyun Cho, Barbara Engelhardt, Sivan Sabato, and Jonathan Scarlett (eds.), Proceedings of the 40th International Conference on Machine Learning, volume 202 of Proceedings of Muchine Learning Research, pp. 25549 25562. PMLR, July 2023. URL https://proceedingg mlr
html
Maho Nakata and Tomomi Shimazaki. PubChemQC Project: A Large-Scale First-Principles Electronic Structure Database for DaiveDriven Chemistry. Journal of Chemical Information and Modeling, 57((): 1300 1308 June 2017. ISSN 1549-9596. doi: 10.1021/acs, httpl//ass.ciim.b//// jeim.7b00082, URL https:://oii. org/oog///// 1021/ acs acs.jcim... 7b00083
Yannek Nowatzky, Francesco Friedrich Russo, Jan Lisec, Alexander Kister, Knut Reinert, Thilo Muth, and Philipp Benner. FIORA: Local neighborhoodd-assed prediction of compound mass spectra from single fragmentation events. Nature Communications, 26(1). March 2025. ISSN 2041-1723, doi: 00.1038//41447-0255-/77
URL https: http:///wwn.atur.eeeee nature..treeeee http://awaarr.oaaaaaaaeeeeeeeeee Publisher: Nature Publishing Group.
Jiwon Park, Jeonghee Jo, and Sungroh Yoon. Mass spectra prodiction with structural motif-basod graph neural networks. Scientific Reports, 14(1):1400, Jamuary 2024. ISSN 2045-2322. doi: 0088//41598-02--111
URL http://w..attu...ttm nature. wtt.://wwww..c.o.t.r.e.eaaeaeeaa
Publisher: Nature Publishing Group.
16

---

Published in Transactions on Machine Learning Research (08/2025)
Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Köpf, Edward Yang, Zach DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. PyTorch: An Imperative Style, High- Porfommofoo Deep Learning Library. arXiv:1912.01 703 fcs, stalj, December 2019. URL http:://axiv /tt/////aii..rrr/b/////////0...0
Frank T. Peters. Recent advances of liquid chromalograpphy (lander) mass spectrometry in clinical and forensic toxicology. Clinical Biochemistry, 44(1):54 65, January 2011. ISSN 1009-91200 doi: 10. 10.1016/j.clin
Brtchem.2010.06 http:///sss.caccaccccccc.....ota
486
Python Core Team. Pylhon: A dynamic, open source programeming language. Python Software Foundation,
2021. URL https: //wps://www... http://wwww.ttho....mm.o org/
Hantao Qiang, Fei Wang, Wenyun Lu, Xi Xing, Hahn Kim, Sandrine A.M. Merette, Lucas B. Ayres, Eponine Oler, Jenna F. AbuSalim, Asael Roichman, Michael Neinast, Ricardo A. Cordova, Won Dong Lee, Fhhud Herbst, Vishu Gupta, Samuel Neff, Mickel Giebbrrt,,,,,,,tt, Adamo Young, Vasuk Gautam, Siyang Tian, Bo Wang, Hannes Röst, Russell Greiner, Li Chen, Chad W. Johnston, Leonard J. Foster, Aaron M. Shapiro, David S. Wishart, Joshua D. Rabinowitz, and Michael A. Skinnider. Language model-guided anticipation and discovery of unknown metabolites. bioRmiu, 2024. doi: 10.1101 10.1101/2024.111 222//2........22444..2 URL bttps://www.biorr www.ooriiv.oo///ooooo.oo wwt//oogg///eeoeooooo/ooeeooeeet http:///eeeeeeaa////////////////
623458
Lars Ridder, Justin J. J. van der Hooft, and Stefan Verhoeven. Automatic Compound Annotation from Mass Spectrometry Data Using MAGMa. Mass Spectrometry, 3(Special Issue_2) 2)..00)))SSO00000 -00033, 2014. doi:
10.5702 0555000mmmssseccommetr..... S0033.
David Rogers and Mathew Hahn. Eetended-Connecttnn Fingerprints. Journal of Chemical Information and Modeling, 50(5):742-7744 May 2010. ISSN 1549-9596. doi: 10.1021/ci10000 URL https:
//doi.org/10 10. 1021/
Christoph Ruttkies, Emma L. Schymanski, Sebastian Wolf, Juliane Hollender, and Steffen Neumann. MetFrag relaunched: incorporating strategies beyond in silico fragmentation. Journal of Cheminformaties, 8(1):3, January 2016. ISSN 1758-2946. doi: 10.1166/13332-006-01133 URL. htt.hhtts:///oo/ http:////oooooog00..11////////// 1186/s133 21-016-0115-9
Emma L. Schymanski, Christoph Ruttkies, Martin Krauss, Céline Brouard, Tobias Kind, Kai Dührkop, Felicity Allen, Arpana Vaniya, Drics Verdegem, Sebastian Böcker, Juho Rousu, Huibin Shen, Hiroshi Tsugawa, Tanvir Sajed, Oliver Fiehn, Bart Ghesquière, and Steffen Neumann. Critical Assessment of Small Molecule Identification 2016: automated methods. Journal of Cheminformatiics, :1)22 March 2017. ISSN 1758-2946. doi: 0001188/113321--0100000111 URL httt:p///aaa..or//00001111//1110
Nino Shervashidze, Pascal Schweitzer, Erik Jan van Leeuwen, Kurt Mchlhorn, and Karsten M. Borgwardt. Weisfeiler-Lehman Graph Kernels. Journal of Machine Learning Research, 12((7):2530-2550 2011. URL
http://jmmr.ont http:////pppppppp/e///a/eraraaaa htmml
Aditya Divyakant Shrivastava, Neil Swainston, Soumitra Samanta, Ivayla Roberts, Marina Wright Muelas, and Douglas B. Kell. MassGenie: A Transformer- Based Deep Learning Method for Identifying Small Molecules from Their Mass Spectra. Biomolecules, 11 172)1 November 2021. ISSN 2218-273X. doi: URL htttp:://wwwt ncbi nlm. .ih. htt../////mmmarricee//////9999
Michael A. Skinnider, Fei Wang. Daniel Pasin, Russell Greiner, Lconard J. Foster, Petur W. Dalsgaard, and David S. Wishart. A deep generative model enables automated structure elucidation of novel psychoactive substances. Nature Machine Intelligence, 3(11):973 984, November 2021. ISSN 2522-5839. URL
doi: 103100////0 10.1108//42220 Re2110/332226-02---11- /2422566002--0040000 Number: 11 Publisher: Nature Publishing Group.
Arnold Steckel and Gitta Schlosser. An organic chemist's guide to electrospray mass spectrometric structure elucidation. Molecules, 24(3):611, February 2019. ISSN 1420-3049. doi: (0.33000mooeecuee22400000
17

---

Published in Transactions on Machine Learning Research (08/2025)
Stephen Stein. Mass Spectral Reference Libraries: An Ever-Expanie coe--Exanninng Resource for Chemical Identification. Analylical Chemistry, 84(17):7274-78 7282, September 2012. ISSN 0003-2700. doi: 10. (0.1021/200 (0000//33020000 205z. URL
Stephen Stein. NIST NIST/EPA/NO Mass spectral library with scarch program data version: NIST v23, 2023.
Stephen E. Stein and Donald R. Scott. Optimization and testing of mass spectral library search algorithms for compound identification. Journal of the American Society for Mass Spectrometry, 5(9):859 866, September 1994. ISSN 1044-0305. doi: 10.1006/10444000559))8700000
URL https://pubs.cee acs http://ppo...cc..orr/ooo/////... dtg//o//00.110
/1044-080672294429870068
Michael A. Stravs, Kai Dührkop, Sebastian Böcker, and Nicola Zamboni. MSNovelist: de novo structure generation from mass spectra. Nature Methods, 19(7):865-870, July 2022. ISSN 1548-7105. doi: 10.103
$/s41592-022-014 014---3.. URL https:://wwt http://www.a.uu..eeee/e nature. com http://www...rrrreee////////---0 01486-3 Number:
Publisher: Nature Publishing Group.
Matthew Tancik, Pratul P. Srinivasan, Ben Mildenhall, Sara Fridovich-Keil, Nithin Raghavan, Utkarsh Singhal, Ravi Ramamoorthi, Jonathan T. Barron, and Ren Ng. Fourier features let networks learn high frequency functions in low dimensional domains. CoRR, abs/2006.10739, 2020. URL https:
7/arxiv. beaxiv..rg//bie otwg/bss////aeeeeeee 10739 10739
Lara van Tetering, Sylvia Spies, Quirine D. K. Wildeman, Kas J. Houthuijs, Rianne E. van Outersterp, Jonathan Martens, Ron A. Wevers, David S. Wishart, Giel Berden, and Jos Oomens. A spectroscopic test. suggests that fragment ion structure annotations in MS/MS libraries are frequently incorrect. Communi- cations Chemistry, 7(1):-111, February 2024. ISSN 2399-3669. doi: 10.1038 10.1038//42004-00444 0244200--------11122- URL https://www //wp:///www.. www.:eature..em centbure.co/aaaaa http://///...eeee////00000000100 Group.
Number: Publisher: Nature Publishing
Gennady Voronov, Abe Frandsen, Brian Bargh, David Healey, Rose Lightheart, Tobias Kind, Pieter Dorrestein, Viswa Colluru, and Thomas Butler. Ms2prop: A machine lcarning model that directly predicts chemical properties from mass spectrometry data for novel compounds. bioRaiv, 2022. doi: 10. 10.1101/2022, /2022. 10.09.51.. 1482. URL http::://ww.bboriiii wtwpx/xwwwwwoox....o/o/o/o.. www.looiiv.org/onteeeeeeee httpp///wg...oooo///////////////
Fei Wang, Jaanus Liggand, Siyang Tian, David Arndt, Russell Greiner, and David S. Wishart. CFM-ID 4.0: More Accurate ESI-MS/MS Spectral Prediction and Compound Identification. Analytical Chemistry, August 2021. ISSN 0003-2700. doi: 10.1021 /a1000/ccs.aaa www.aannccch....1110.. URL https: :/dtss://do... wwreddi..ogg///oo httpg//..1022///0/ analchem. 1c01465
Fei Wang, Daniel Pasin, Michael A. Skinnider, Jaanus Liigand, Jan-Niklas Kleis, David Brown, Eponine Oler, Tanvir Sajed, Vasuk Gautam, Stephen Harrison, Russell Greiner, Leonard J. Foster, Petur Weihe Dalsgaard, and David S. Wishart. Deep Learning- Enabled MS/MS Spectrum Prediction Facilitates Automated Identification Of Novel Psychoactive Substances. Analytical Chemistry, 95(50) 18334, December 2023. ISSN 0003-2700. doi: 10.1021 /aa....analceee.r30000 em em.3c02413 Publisher: American Chemical Society.
URL htttp::://oi.org/////tt 1021/acs analch
Runzhong Wang, Rui-Xi Wang, Mrunali Manjrekar, and Connor W. Coley. Neural graph matching improves retrieval augmented generation in molecular machine learning, 2025a. URL https://arxii......t./ http://arrii.orrra///// 02. 17874
Yinkai Wang, Xiaohui Chen, Liping Liu, and Soha Hassoun. Madgen: Mass-spec attends to de novo molccular generation, 2025b. URL https: htttps://arx:: /ttp///axvvv..////////eeeeaaaa org/abs////rrooooo attaaaa/../////// 25501.09950
Jennifer N. Wei, David Belanger, Ryan P. Adams, and D. Sculley. Rapid prediction of electron ionization mass spectrometry using neural networks. ACS Central Science, 5(4):700-708, April 2019. ISSN 2374-7943, 2374-7951. doi: 10.1021 10.1021/acscentsci. sic.scentsci..0000s... URL http:://aaaa...cccooo/o//////oo/ 00085
acs http://doo....11.1///aa/.a.a.acc
18

---

Published in Transactions on Machine Learning Research (08/2025)
David S. Wishart, Yannick Djoumbou Feunang, Ana Marcu, An Chi Guo, Kevin Liang, Rosa Vázquez-Fresno, Tanvir Sajed, Daniel Johnson, Carin Li, Naama Karu, Zinat Sayeeda, Flvis Lo, Nazanin Assempour, Mark Berjanskii, Sandeep Singhal, David Arndt, Yonjie Liang, Hasan Badran, Jason Grant, Arnau Verra-Cayuele Yifeng Liu, Rupa Mandal, Vanessa Neveu, Allison Pon, Craig Knox, Michael Wilson, Clandine Manach, and Augustin Scalbert. HMDB 4.0: the human metabolome database for 2018. Nucleic Acids Research, (D1):D608-DDD) D617, January 2018. ISSN 1362-4962. doi:
Sebastian Wolf, Stephan Schmidt, Matthias Müller-Hannemann Hannemann, and Steffen Neumann. In silico fragmentation for computer assisted identification of metabolite mass spectra. BMC Bioinformmttics, 11(1):148, March 2010. ISSN 1471-2105. doi: 10.1186/1477 10/1:/14111110000 2105- 11-148. URL https://doi.co. http//di..or////// httpp:///aaooooo//0../////////// 1111/11711111- 210--11-4188
Zhenqin Wu, Bharath Ramsundar, Evan N. Feinberg, Joseph Gomes, Caleb Geniesse, Aneesh S. Pappu, Karl Leswing, and Vijay Pande. MoleculeNet: a benchmark for molecular machine learning. Chemical
Science, 9(2):513-58) 530, Jamuary 2018. ISSN 2041-6539. doi: 10. (0.1039/C7SC02644A C7SCC26644. URL https:
//pubs rsc. hrtpa///oeeerrttrraaaaaaaaaaa/er Publisher: The Royal Society of Chemistry.
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In International Conference on Learning Representations, 2019. URL https::/oppereeieet wawparreieee.nt/ffounnnn.
ryGa61A5Km
Xiaoyu Yang, Pedatsur Neta, and Stephen E. Stein. Quality Control for Building Libraries from Electrospray lonization Tandem Mass Spectra. Analytical Chemistry, 86(13):6333-6400 6400, July 2014. ISSN 0003-2700, 1520-6882. doi: 10. 10.1021/ac000111m URL httph::t//pppp htttp::/ppuss.cs... acs wttp:o////....///////////..
Chengxuan Ying, Tianle Cai, Shengjie Luo, Shuxin Zheng, Guolin Ke, Di Hc, Yanming Shen, and Tic-Yan Liu. Do transformers really perform bad for graph representation? Neural Information Processing Systems (NeurIPS), 2021.
Adamo Young, Bo Wang, and Hannes Röst. MassFormer: Tandem Mass Spectrum Prediction for Small Molocules using Graph Transformers, May 2023. URL http://aaxx..orrr/b///11...8 arXiv:2111.04824 [cs, q-bio].
Hao Zhu, Liping Liu, and Soha Hassoun. Using Graph Neural Networks for Mass Spectrometry Prediction.
arXiv:2010.0440 04661 [cs), October 2020. URL
Richard Licheng Zhu and Eric Jonas. Rapid Approximate Subset-Based Spectra Prediction for Electron
Tonization- Mass Spectrometry. Analytical Chemistry, (565) 2663, February 2023. TSSN 0003-2700. doi: 10. (0021//cs.aa analchem 2c02093. URL
1021/// anal 2c02093 2c02200003..
Publisher:
American Chemical Society.
19

---

Published in Transactions on Machine Learning Research (08/2025)
A Appendix
A.1 Recursive Fragmentation Algorithm
Algorithm RecFrag
Input: graph G = (V, E), max depth d, current depth d'
Initialize DAG nodes Vp = O, DAG edges Ep = 0
if d' S then
== I = E)
for (u, v) E E do
E" = = (c)
VV
1" = DD(V"E"*
(V", ,E") = (E,
N ID(V", .E)
S SU E"), (V","*)
Vr V/ [1", 1
Ep = EF U (1,,
end for
for G = E*) E S do
(Vp, Fip)) = RecFrag d, + 1)
VF VV
Ep EF UEp
end for end if
Return (VF, EF)
The approximate fragmentation DAG GFz is constructed by calling Algorithm on the heavy-atom skeleton of the molecule H()), with initial depth parameter d' = 1. BFSCC is a breadth-first search algorithm that returns the set of nodes and edges in a graph that can be reached from a given input node. We apply BFSCC identify connected components (fragment subgraphs) of H(G) after each edge removal. ID function that maps every subgraph of H()) a unique integer id (our implementation just uses an enumeration).
We apply post-processing step that merges fragments n2, E Vp with the same atom sets V V These fragments arise when bond are removed from non-linear structures in the molecule, such as rings. The merging works as follows: the nodes {nshi in the DAG whose associated fragment subgraphs (G"*), all have the same alom set /d are removed from Gyz and replaced with a new DAG node m that retains all edges of the removed nodes. The associated fragment subgraph G = (V"M ET) is defined as the vertex- induced subgraph of n (Equations 10 and 11:
V V
(10)
ET (
(11)
After post-processing, it is possible to assign each node n in the DAG a unique ID based only on its atom set Vr. Note that the DAG node merging can introduce self-edges in Gya, implying that G is not always a true DAG in practice.
Figure visualization of the full fragmentation DAG Fe for an example molecule. Since this molecule is small and linear, the resulting DAG consists of only 10 nodes and 19 edges.
20

---

Published in Transactions on Machine Learning Research (08/2025)
Figure 5: DAG Visualization: the approximate fragmentation DAG G5z (d 3) for a small molccule, mellyyaamioomethanoo. The node is represented by the heavy-atom skeleton of the molecule H(G), and each other node is represented by connected subgraph of H(G). Carbon atoms represented by C, nitrogen atoms by N, oxygen atoms by O.
Table 4: Fragmentation DAG Statistics over the NIST20 MS/MS Dataset. PP is peak precision, PWP is peak weighted precision, PR is peak recall, PWR is peak weighted recall.
D3
(d j.j
4)
D4 (d= 4,j 4)
STATISTICS
MIN
25%
50%
75%
MAX
MIN
25%
50%
75%
MAX
# FORMULAE f
323
527
838
7239
4
388
679
1160
13146
# NODES n
10
167
280
474
5022
10
333
677
1392
32902
# NODES ñ
104
173
308
4518
9
183
379
865
31688
# EDGES e
20
662
1156
2138
44952
20
2288
4790
10020
249138
PR
0.00
0.51
0.64
0.77
1.00
0.00
0.63
0.75
0.85
1.00
PWR
0.75
0.88
0.96
0.00
0.86
0.94
0.98
1.00
PP
0.00
0.05
0.08
0.13
0.53
0.00
0.04
0.08
0.13
0.52
PWP
0.00
0.04
0.07
0.12
0.60
0.00
0.03
0.07
0.13
0.67
A.2 Fragmentation DAG Statistics
Table 4 describes various distributions related to the size of the approximate DAG Gyæ and its associated mass set MGG j) under two different parameterizations. d= 3, = 4 is the configuration for FraGNNet-D3, and d = 4,j = the configuration for FraGNNeL-D4.
Let M be the set of masses in the spectrum (peak locations), and let M' M d, denote the set of masses given by the approximate DAG for molecule G. Peak Recall (PR, Equation 12 is defined as the fraction of peaks in the spectrum that can be explained by DAG mass while Peak Weighted Recall (PWR, Equation incorporates peak intensities; Peak Precision (PP, Equation and Peak Weighted Precision
(PWP, Equation 15 are defined similarly. I is the indicator function.
PR
|M Σ 1Bmm E eM; |m' ml (maxmm, 200)]
(12)
PWR
Σ
P(m) [m E M Im' m|s cmax(m, 200)
(13)
MEM
21

---

Published in Transactions on Machine Learning Research (08/2025)
PP
1
Σ m'EM'
1 M Im' m maxxmm, 200)]
(14)
MM
PWP E
P(m')
1mm M |mm - mls mmax(m,200)
(15)
m'EM'
In our experiments of 0.002 Da.
10 ppm mass tolerance for peak matching (e 10 10-5), truncated to minimum
A.3 Fragment Subgraph Isomorphism
In MS/MS spectrometry, it is possible for fragments with identical molecular structure to originate from different parts of the molccular graph, having been created through distinct sequences of fragmentation steps. In our model, this phenomenon is represented by pairs of DAG nodes R1,72 E Vy= whose corresponding subgraphs Gn = Gn2 are isomorphic (í.e., there exists a node bijection between G,,, and Gnz that is both label-preserving and siiseepreeerring.....
With the exception of PJ) (which does not involve fragments), each of the latent distributions from Section 4.3 can be adapted to account for fragment graph isomorphism. To describe this process precisely, rely on Definition A.I and Corollary A.2
Definition A.1. Let G be a finite set of labelled graphs {Gi) Each G, is member of one of K isomorphism classes
where K < I. Assume an arbilrary total ordering <x for each isomorphie class Gy. Let I()) C E be the set of graphs such that VG2 e I(g) IG, g: G. Gv A G. <s Gk. Corollary A.2. YG,, Gj I(9) G. + G2 G. G...
For each DAG node ñ such that Ga e I(IG, n V we define (n) the total probability of all subgraphs isomorphic to Ga using Equation T6
Po(n) =
Σ
(n(n)
(16)
nEV SeV
The conditional distributions (z)) and Pa(āff) are defined in a similar manner using Equations 17 and 18 respectively:
Po
Po(S)a) = Σ
(17)
Po(n)
nEV = Ga
Po(Aff)
Σ
Po(nlf)
(18)
These distributions provide additional interpretability, demonstrated in Appendix A.17 Intuitively, they remove excess entropy caused by uncertainty over the location in the molecule from which each fragment originated.
In practice, we calculate the set I([G, : V=+)) by applying an approximate Weisfeiler-Lehmaal hashing
algorithm (Shervashidze et al. 2011 Hagberg et al. 2008) to each subgraph G, n E Vya and identify isomorphism class membership with hash collisions.
A.4 Molecule Features
Our method for atom and bond fcaturization follows the approach taken by (Goldman et al. 2024). The features are summarized Table All discrete features are encoded using a standard onc-hot representation. The only continuous feature (Atom Mass) is scaled by factor of 0.01.
22

---

Published in Transactions on Machine Learning Research (08/2025)
Table Input Features for the Molecule GNN
FEATURE
VALUES
ATOM TYPE (ELEMENT)
Cr,
ATOM DEGREE
(O...., 10)
ATOM ORBITAL HYBRIDIZATION
{SP,SP2 SP3, SP3D,
ATOM FORMAL CHARGE
{-2 (O..... 4}
ATOM RADICAL STATE
ATOM RING MEMBERSHIP
(TRUE, FALSE]
ATOM AROMATIC
(TRUE, FALSE]
ATOM MASS
R
ATOM CUIRALITY
{UNSPECIPIED, TETRAHEDRAL CW, TETRAHEDRAL CCW)
BOND DEGREE
{SINGLE, DOUBLE, TRIPLE, AROMATIC)
A.5
Fragment Features
A.5.1
Fourier Embeddings
We use Fourier embeddings (Goldman et al. 2023a Tancik et al. 2020) to represent certain ordinal features such as molecular formulae and collision energy. Given an integer feature E IR, the corresponding Fourier embedding ((z) can be calculated using Equation 19
2x²
2Tz
6(2) sin
sin
(19)
TT
Compared to standard one-hot encoding scheme, this approach makes easier for the model to handle imputs at inference that have not been seen in training. The periods are increasing powers of (we use T = 10 for our experiments).
A.5.2 DAG Node Features
The DAG node embeddings (Equation 4 are initialized with formula. information R4 and fragmentation depth information ig. The formula embedding for DAG node n concatenation of Fourier embeddings corresponding to heavy atom counts in Gn, described in Equation 20
Mf
Φ
Σ Ilw w| V
(20)
WED
The depth embedding ig is a multi-hot representation of the fragment node's depth in the DAG. The depth set is defined as the set of path lengths between the root node and the fragment node n, and is always subset of {o..... d} where d is the fragmentation depth.
A.5.3 DAG Edge Features
The emboddings ( are initialized for each directed edge e E Eys using Equation 21 Assuming e travels from node n node t, let V. V, V2 be the set of atoms in Gn that are G.. As described in Equation 22 ig is simply the average of the atom embeddings in V..
23

---

Published in Transactions on Machine Learning Research (08/2025)
1.0 h || Tig
(21)
h 1 Σ k
(22)
IVee
AEV.
The bg term an embedding of the difference of node formulas fn - fe using Fourier embeddings, similar i These features explicitly capture neutral loss information that would otherwise need to be inferred from the DAG.
As previously noted (Section 4.4.2 for most experiments we used a version of the model that omitted DAG edges; in those cases the edge features were not included.
A.5.4 Collision Energy Embedding
Let Ze be the set of collision energies that were merged to create spectrum Y, for molccule X; in the dataset (Appendix A.10 The collision energy embedding is a representation of Zí Each collision energy z E Z; is a positive integer ranging from 0 200 (they are normalized relative to the mass of the precursor, see Young iet al. 2023 for more details). The collision energy embedding hz is simply an average Fourier embeddings for each collision energy, described by Equation 23
h2
s(:) ZEZ
(23)
The collision energy embedding h2 concatenated with the output Fragment GNN embedding ((4a) for each DAG node n E Grd before being passed to the output ML.P.
A.6 Spectrum Similarity Metrics
The binned approach (Wei et al.] 2019 Young et al. 2023 Zhu et al. 2020) involves preprocessing the spectrum by discretizing the mass range into B equally sized bins and summing the intensities for all peaks falling in the same bin. This produces a B-dimensional vector of non-negative values that is amenable to standard cosine similarity calculation. In our experiments, binned cosine similarity CBIN is calculated with bin size 0.01 Da, resulting
Mass spectra are typically compared using form of cosine similarity (Stein & Scott 1994
150, 000 (we assume a maximum mass of 1500 Da).
An alternate approach to calculating cosine similarity involves comparing intensities of peaks that are close in mass Huber et al. 2020 Murphy et al. 2023). This method can be formalized the linear sum assignment problem below, where indexes spectrum Y, indexes spectrum y and pt. Pú are shorthand for P(m:), P(m)) respectively:
CY
= max wyy (0,1) 1
Σ
Wis
|Pll
||p1
p3
Σ wy $1 Σ Wij $
(24)
s.t.
mi myl TT
We set the tolerance parameter :; = 10-5 max(m,, 200) to reflect a Uhresholded 10 ppm mass error. This maximization problem can be solved efficiently using the Hungarian algorithm (Khhn 1955). Note that the tolerance parameter only depends on the masses spectrum Y, introducing an asymmetry in the measure. When comparing a true spectrum with predicted spectrum (as is typically the case), we use the convention of setting Y to be the true spectrum and y to be the predicted spectrum.
24

---

Published in Transactions on Machine Learning Research (08/2025)
Another important similarity metric is Sansen-Shanoon similarity J. Jensen-Shannon similarity is usually
defined in terms of the Jensen-Shannon divergence Je [Lin 1991 using Equations 25 and 26
J(Y - log [Y JY HYY (((Y) + H()))
(25)
(26)
H()) is Shannon entropy, log is the natural logarithm, and Y a mixture distribution Pk 0.5ps + 0.5p%
Note that JI can be related to unweighted spectral entropy similarity Li et al. 2021), a common metric in the mass spectrometry literature, through Equation
S(Y, 8) J(Y, 2)
(27)
log 2
Proof. Entropy similarity is defined using Equation 28
8( =1 2H HI(Y) (P)
(28)
log 4
Equation 27 follows through simple substitution and rearrangement:
S(Y =1 (Y) HY) H(Y)
log
log 4
2(log' 2 J(Y, P))
2 2 2
8(Y,8) log 2
A.7 Out-of-Sunn Out-of-Support Prediction
For a given spectrum, the set of OS peak masses M is defined using 10 ppm mass cutoff (see Section 4.3 &rv the total variation distance between the true OS distribution and the predicted OS distribution, given by Equation 29
Table 6: Out-of-Support (OS) Prediction performance the NIST20 Datasct. Mcans and standard deviations are reported for 5 random seeds. Best scores (where applicable) are in bold.
Split
Model
P(MOS)
(s
STv(L)
InChiKey
FraGNNet-D3
0.171 0.000
0.191 0.007
0.080 + 0.002
InChlKey
FraGNNet-D4
0.098 0.000
0.115 - 0.003
0.057 + 0.001
Scaffold Scaffold
PraGNNet-D3
0.193 = 0.000
0.213 + 0.008
0.094 + 0.002
FraGNNet-D4
0.110 = 0.000
0.127 = 0.002
0.067 + 0.001
25

---

Published in Transactions on Machine Learning Research (08/2025)
θTV = IP(M00) Pa(M)0))
(29)
δTV measures how well the model can correctly predict the total OS probability. Table summarizes the OS prediction performance of the FraGNNet models. Increasing fragmentation depth from d = to d = 4 resulted in both reduction of OS peaks (lower P(MOS)) and an improved ability to approximate P(MOS) with (MM)). This is useful since knowing P(MOS) at inference time can help identify situations where the fragmentation algorithm performs poorly (in terms of PR and PWR, Section A.2 In such cases, it is impossible for the model to make an accurate MS/MS prediction.
A.8 Model Ablations
We performed two kinds of ablations on FraGNNet: (-CE) corresponds to the removal of merged collision energy information (Appendix [A.54)), (+Edges) corresponds to the addition of bidirectional edges (and associated edge embeddings) and mossage passing in the Fragment GNN. The removal of collision energy information had negative impact on performance, as expected. However, the addition of DAG edge information did not have a strong effect. This seems to suggest either that the hierarchical relationships between fragments (i..,, nodes in the DAG) might be easy for the model to infer without DAG edges, or that this information not helpful for making spectrum predictions.
ICEBERG (+OptFrag) is modified version of ICEBERG that uses additional information from the ground- truth MS/MS spectrum to optimally select set of fragments for each prediction. We emphasize that this ablation is intended solely for benchmarking purposes, since in most real-world applications the goal is to make predictions for molecules without first observing their MS/MS spectra. Providing ICEBERG with this additional information resulted improved performance that nearly matched that FraGNNet-DD (Table 8 confirming that autoregrossive fragment generation souree of error for ICEBERG.
A.9 Datasets and Splits
We trained and evaluated all models the NIST 2020 MS/MS dataset (ttein 2012 Yang et al. 2014
large commercial library of MS data. To ensure homogeneity, the original dataset was filtered to include only [M+H]+ adducts. Following (Goldman et al. 2023a 2024), spectra for the same compound acquired at different collision energies were combined (a process commonly referred to as collision energy merging, see Appendix A0. The resulting dataset contained 21,113 unique molccules, each with an associated merged MS/MS spectrum. Models were trained using 60% of the data, with 20% for validation and 20% used as a heldout test set. Two strategics for data splitting were employed: simple random split by molecule ID using the InChIKey hashing algorithm (Heller et al. 2015 and more challenging split that clustered molecules based on their Murcko Scaffold (a coarse representation of 2D molecular structure, [emis & Murcko 1996). Scaffold splits are commonly used to evaluate generalization of deep learning models in cheminformaties applications (Wu et al. 2018
Table FraGNNet Model Ablations. (-CE) removal of collision energy covariates, (+Edges) is the addition of DAG edges and associated features. Performance reported on the InChiKey test set (mean and standard deviation of 5 random seeds). Best scores are in bold.
MODEL
CaIN t
CHUN f
FRAGNNET-D3
0.721 t 0.002
0.693 t 0.002
FRAGNNET- D3 (-CE)
0.711 + 0.001
0.683 0.001
FRAGNNET-DE D3 (+EDGES)
0.716 + 0.001
0.687 + 0.001
FRAGNNET-DA
0.736 + 0.002
0.709 0.002
FRAGNNET-D4 (-CE)
0.721 + 0.001
0.694 + 0.001
26

---

Published in Transactions on Machine Learning Research (08/2025)
Table 8: ICEBERG Model Ablations. (+OptFrag) replaces learned fragment generation with an optimal approach that uses information from the ground-truth MS/MS spectrum. Performance reported on both InChIKey and Scaffold test sets (mean and standard deviation of random seeds). Best scores are bold.
INCHTKEY
SCAFFOLD CBIN f 0.678 + 0.005
MODEL
CBIN f 0.736 + 0.002
FRAGNNET-DA D4
ICEBERG
0.707 + 0.001
0.636 = 0.002
ICEBERG (+OPTFRAG)
0.732 + 0.000
0.668 + 0.002
A.10 Data Preprocessing
We exported spectra from the NIST20 MS/MS spectral library (following this github repository) We applied a number of filters based on the spectral metadata and molecular propertics.
The metadata criteria are described below:
Orbitrap instrument with higher-energy collisional dissociation (HCD)
[M+H]* adduct type
Precursor m/z S 1500
Normalized collision energy
The molecule criteria are described below:
Element composition: H, J.C.O.N.P,SSF.CCI CI, Br, Se, Si
60 heavy (non-H) atoms
Neutral charge
No radical electrons
Single molecule
After filtering, there were 262,319 spectra representing 21,113 molecules.
Individual MS/MS spectra for the same molecule and precursor adduct were merged across collision energies by averaging the mass distributions. More formally, let (y(())/_ be the set of spectra corresponding to molecule X (each measured with different collision energy 2.). The merged spectrum Y is defined using Equation 30
P(m (0)
}}
(())
( m
(30)
A.11 Compound Retrieval Continued
We investigated the effect different ranking methods on retrieval performance (Section 5.2 A ranking method defined as a combination of spectrum similarity motric, peak intensity transformation, and a peak matching strategy. For similarity metrics, the choices are cosine similarity or Jensen-Shanme similarity J. For peak intensity transformations, the choices square-root identity function (no transformation).
27

---

Published in Transactions on Machine Learning Research (08/2025)
Table 9: Compound Retrieval Results Extended (InChlKey Split). Top-k (for & E 21,2,3,5, 10}) is top-k
accuracy, expressed a percentage; MRR is mean reciprocal rank. Means and standard deviations are reported for random seeds; results reported in Table 2 are in bold.
Model
Method
Top-1 1
Top-2 ft
Top-3 ft
Top-5 ft
Top- 10
MRR
FraGNNet-Dd
CBIN
25.3 + 0.5
41.2 0.5
52.6 + 0.9
67.0 + 0.6
83.7 + 0.4
0.436 0.003
FraGNNet- D4
CBIN + /
35.0 = 0.6
53.9 0.7
0.2
78.0
90.3
0.534 + 0.004
FraGNNet-DA
CHUN
25.4 = 0.4
4.2
5.71
0.5
8.
0.438 + 0.002
FraGNNet-D4
CHUN + V
35.7 + 0.4
5.6
6.49
0.6
9..4
0.539 + 0.003
FraGNNet-D4
JBIN
34.4 0.4
5.72
0.38
0..
8.4
0.529 0.000
FraGNNet--D
JBIN + V
36.1 = 0.4
54.3#04
0.4
0.2
0.8
0.54 + 0.002
FraGNNet-D4
-L
36.0 + 0.4
0.6
66.3 0.5
78.4
90.4
0.541 0.004
ICEBERG
CEIN
27.0 0.4
4..210.4
0.6
0.5
81.7
0.446 0.003
ICEBERG
CBIN + V
34.8 0.4
1.
63.2
7.
8.
0.523 + 0.004
ICEBERG
JBIN
34.4
0.8
0..
0.5
8.3
0.517 + 0.003
ICEBERG
UBIN |
36.0 0.8
53.4
0.3
87.2 0.3
0.532 0.005
ICEBERG
-L
34.8 = 0.4
5..2
6..2
7..7
8.
0.523 0.004
MassFormer
CBIN
16.5 0.7
0.3
0.5
0.5
0.5
0.332 + 0.003
MassFormer
CDIN +
23.7 + 0.4
3..3+
5..4
0.1
8.2
0.417 0.002
MassFormer
JBIN
22.9 - 0.3
3.3
4..4
6.2
7..
0.408 0.002
MassFormer
JAIN + V -L
24.2 0.5
0.3
0.2
6.6
0.3
0.426 + 0.002
MassFormer
23.7 + 0.4
3.4
5..4
0.1
80.5
0.417 + 0.002
NEIMS
CEIN
18.3 + 0.5
3.2
+.5
0.8
6
0.341 + 0.004
NEIMS
CBIN + V
25.1 = 0.6
4.8
0.8
1.0
7.6
0.421 + 0.006
NEIMS
JRIN
24.7 - 0.5
0.8
4..4
1.0
7.62
0.415 + 0.006
NETMS
JIIN +
26.0 0.7
4.11
0.8
6.9
8..1
0.436 0.007
NEIMS
25.1 + 0.6
4.8
50.1
0.8
1.0
0.6
0.421 0.006
For peak matching, the choices are 0.01 Da binning (BIN) or Hungarian matching with 10ppm tolerance (HUN). Refer to Appendix A.6 for more details on similarity metrics and peak matching strategics. Since FraGNNet was the only model in this experiment that does not output binned m/2 values, none of the other baseline models were evaluated with Hungarian peak matching.
In addition to the ranking methods described above, the negative of the loss function (denoted as -L) is also reported. Note that loss functions are model-dependent and may not be symmetric: in this retrieval evaluation, we use the convention that the query spectrum is ground truth and the reference spectrum is the prediction. This relevant for FraGNNet-D4, which uses an asymmetric cross-entropy loss function (Equation S The other models use binned cosine distance loss with square root intensity transform, so the performance of the -L ranking method is identical to the CBIN / ranking method.
In Tables 9 and 10 each model's retrieval performance is reported for all ranking methods. The configurations
reported in Table 2 in the main text are highlighted in bold.
A.12
Implementation Details
The FraGNNet model and baselines were implemented in Python (yython Core Team 2021 using Pytorch Paszke et al. 2019 version 2.1 with CUDA 11.8) and Pytorch Lightning (Falcon & The Py Lightning
team 2019). Weights and Biases (Bewwld 2020) was used to track experiments and run hyperparameter sweeps. The recursive fragmentation algorithm was implemented in Cython (Behnel et. al. 2011). The
graph neural network modules were implemented using Pytorch Geometric (Fey Lenssen 2019). The data
preprocessing and molecule featurization used RDKit [Lndrum 2022
The code is available at github.comm/faCCNN////raagg
28

---

Published in Transactions on Machine Learning Research (08/2025)
Table 10: Compound Retrieval Results Extended (Scaffold Split). Top-k (for 2,, 10)) is top-k
accuracy, expressed a percentage; MRR is mean reciprocal rank. Means and standard deviations are reported for random seeds; results reported in Table 2 are indicated in bold.
Model
Method
Top-1
Top-2 ft
Top-3 ft
Top-5 ft
Top- 10
MRR
FraGNNet-Dd
CBIN
21.0 + 0.7
35.8
46.8 + 0.4
61.4
79.7 + 0.5
0.391 0.006
FraGNNet- D4
CBIN + /
29.6 = 0.6
47.9
0.4
73.0 0.3
0.3
0.485 + 0.004
FraGNNet-DA
CHUN
21.1 = 0.7
0.9
0.5
0.7
8.4
0.395 + 0.006
FraGNNet-D4
CHUN + V
30.3 + 0.6
4.72
59.8 + 0.3
0..2
0.3
0.489 + 0.004
FraGNNet-D4
JBIN
28.9 0.9
4.88
0.3
0.3
8.2
0.477 0.006
FraGNNet-DD
JBIN + V
29.7 0.8
1.0
0.4
73.0
8.99
0.484 0.005
FraGNNet-D4
-L
29.8 1.0
4.0
0.6
7.7
87.7
0.484 0.008
ICEBERG
CEIN
20.4 0.5
33.8
4..2
0.8
7.84
0.376 + 0.004
ICEBERG
CBIN + /
27.0 0.6
0.3
54.1
0.5
0.6
0.449 + 0.003
ICEBERG
JBIN
26.4
0.4
52.9
0.5
0.6
0.442 0.004
ICEBERC
UBIN |
27.9 1 0.9
43.8
5.70
0.8
8.
0.456 0.007
ICEBERG
-L
27.0 = 0.6
4.3
0..1
0.5
0.6
0.449 + 0.003
MassFormer
CBIN
12.9 = 0.3
23.2
31.81111
1.3
65.7
0.286 + 0.006
MassFormer
CDIN +
19.1 + 0.5
33.1
4.4
58.2+
76.9 1.0
0.369 0.005
MassFormer
JBIN
18.6 0.3
3.6
4.06
0.8
7.80
0.361 0.005
MassFormer
JAIN + V -L
20.4 0.4
0.56
0.8
6.8
1.19
0.383 + 0.005
MassFormer
19.1 + 0.5
33.1
43.9
5.7
76.9 1.0
0.369 + 0.005
NEIMS
CEIN
12.7 + 0.4
0.3
3.5
41.6+
59.8
0.273 0.003
NEIMS
CBIN +
18.4 0.9 0.9
0.6
0.5
5.4
0.3
0.347 + 0.007
NEIMS
JRIN
17.7 = 1.0
2.7
0..
7.2 0.6
0.339 + 0.007
NETMS
JIIN +
0.8 0.8
3.87
4.9
54.6 0.8
7.6
0.363 + 0.007
NEIMS
18.4 + 0.9
0.6
4.5
52.8
70.8
0.347 0.007
A.13
Parameter Counts
Table 11: Parameter counts, reported in millions.
MODEL
# PARAMETERS
FRAGNNET-DA
1.6
FRAGNNET-D3
1.2
ICEBERG
17.6
MASSFORMER
165.3
NEIMS
125.4
GRAFF-MS
57.8
The parameter counts for all models are summarized in Table
A.14 Baseline Models
All baseline models were re- re-implemented our framework, to facilitate fair comparison across methods. Some of the models were originally designed to support additional covariates such as precursor adduct and instrument type. Since our experiments were restricted MS/MS data of single precursor adduct ([++]}+ and instrument type (Orbitrap), excluded these features in our implementations.
29

---

Published in Transactions on Machine Learning Research (08/2025)
A.14.1 ICEBERG
by Estimating Breakage Events and Reconstructing their Graphs, Goldman et al. 2024) is a state-of-the C2MS model. ICEBERG is composed of two sub-modules (ncural networks) that are trained independently of cach other. The first modulc (the fragment generator, also called (OBBERG-Generale) auloregressively predicts a simplified fragmentation DAG, and the second module (the intensity predictor, also called ICEBERGG-Sore) outputs a distribution over those fragments. The fragment generator is trained to approximate a fragmentation tree that constructed using a variant of the MAGMa algorithm (Ridder et al., 2014). MAGMa applies a combinatorial atom removal strategy to generate fragmentation DAG from an input molecular graph G: the resulting MAGMa DAG has a similar set of fragment nodes to Gra, but may contain different edges (refer to Ridder et al. 2014 Goldman et al. 2024 for full details). The MAGMa DAG is then simplified using a number of pruming strategies. Fragments with masses that are not represented by any peak in the spectrum are removed. Fragments that map to same peak are deduplicated: chemical heuristics are used to determine which fragment should be kept. Unlike our approach, no distinction is made between isomorphie fragments that originate from different parts of the molecule. Redundant paths between fragments are removed to convert the DAG into proper tree, which is required for autoregressive generation.
ICEBERG (Inferring
The aggressive DAG pruning removes information that could be important for correctly predicting the spectrum. However, this pruning also facilitates more expressive representations of the fragments that remain: since the total number of fragments is lower, the computational and memory cost per fragment can be much higher. This tradcoff underlines the key conceptual difference between FraGNNet and ICEBERG. The former uses more complete fragmentation DAG but must employ simpler representation for each individual fragment. The latter can afford more complex fragment representation but only considers sampled subset. of the DAG.
In ICEBERG the output spectrum is binned, with each fragment contributing to the intensity of a particular bin (refer to Goldman et al. 2024 Section 2.5 for full details). Unlike FraGNNet, ICEBERG does not explicitly model a latent fragment distribution (n) or formula distribution Po(f). There is no straightforward method to calculate these latent distributions in a way that consistent with the output spectrum.
ICEBERG (+OptFrag) is variant of ICEBERG that introduced for the purposes of benchmarking (Section A.S) ICEBERG (+OptFrag) replaces the learned fragment generator with the exact output of the MAGMa algorithm. This modification removes sampling error in the fragment generation process, creating an artificially easier learning problem that should result in better performance. However, it assumes access to the ground truth MS/MP MS spectrum for the input molecule. ICEBERG (+OptFrag) is helpful in benchmarking because it. can be used to infer how much overall MS/MS prediction error caused by incorrect fragment. generation, but it is not practically useful as a C2MS model.
Our ICEBERG implementation was based the code from Goldman al. 2024 although in our experiments the model was trained using binned cosine similarity with 0.01 Da bins (previously, it was trained using 0.1 Da bins). We applied a square root transformation to each binned target intensity during training. We also fixed a bug that caused spurious peaks to appear in the smallest m/z bin as a result of improper batching.
A.14.2 GrAFF-MS
GrAFF-MS (Graph neural network for Approximation via Fixed Formulas of Mass Spectra, Murphy et al. 2023) structured C2MS model. Unlike ICEBERG and FraGNNet, GrAFF-MS does not rely on fragment information, instead predicting a distribution over formulae Po(J) directly. It uses a static library of common product and neutral loss formulae derived from the formula. annotations of a labelled spectrum dataset. At inference time, the model predicts distribution over the formula library, and the formula masses are used to map this distribution to spectrum.
In our experiments we used the NIST20 expert-curated formula annotations to construct the formula library (see Appendix A. for details). Each formula annotation f in the datasct can be interpreted as a product formula f+ = f; the associated neutral loss formula can be calculated as f- -= f, where p is the precursor formula for that spectrum. For each formula annotation in the dataset, we recorded its associated peak
30

---

Published in Transactions on Machine Learning Research (08/2025)
intensity. In the case of multiple formula annotations for the same peak, we divided the peak intensity equally across all annotations. We then selected the top 10,000 product and neutral loss formulae in terms of total intensity across spectra in the dataset. Given a molecule with precursor formula p, the support of the formula distribution Po( is defined as the union of the set of product formulac {f, te and the set of complements of the neutral loss formulae {p- f
We trained the model with a mark-narginal cross-entropy loss (Murphy et al., 2023) using thresholded 10 ppm mass tolerance (to be consistent with our CHUN metric). The original GrAFF-MS implementation was designed to work with a single collision energy; implementation uses the average collision energy to predict the merged spectrum. Like the original model, our implementation supports isotopic traces for each predicted peak, modelled as an additional covariate (i.e., binary variable indicating presence/ presence/absenee absence of isotopes). This sort isotope information is present in the NIST20 MS/MS dataset, although it is not used for FraGNNet or the other baseline models.
A.14.3 NEIMS
NEIMS (Neural Electron lonization Mass Spectrometry, Wei et al. 2019 was the first deep learning C2MS model, originally designed for low mass accuracy (1.0 Da bins) electron-ionization mass spectrometry (EI-MS) prediction. NEIMS represents the input molecule using a domain--pecifie featurization method called a molecular fingerprint, which capture useful properties of the molecule such as the presence absence of various substructures. More recent works (Zhu et al. 2020 Young et al. 2023 Goldman et al. 2023a have adapted NEIMS to ESI-MS/MD MS prediction at higher mass accuracy (0.1 Da bins). We based our implementation on the version from Young et al. 2023 which uses three different kinds of molecular fingerprint represenlations: the Extended Connectivity (Morgan) fingerprint (Rogers & Hahn 2010), the RDKit fingerprint (Landrum, 2022), and the Molecular Access Systems (MACCS) fingerprint (Durant et al. 2002). We adapted the model to use the same collision energy featurization strategy as FraGNNet (Equation 23 Finally, to avoid an excess of parameters,
replaced the final fully-connected layer's weight matrix with low-rank approximation. This layer maps from the latent dimension dn 1024 to the output dimension d, 150000, corresponding to the mass range [0, 1500] with 0.01 Da bins. The low-rank approximation was implemented as product of two learnable weight. matrices: a d₁ x d, matrix and a d, x do matrix, where d,- = 256.
We trained the model with binned cosine similarity, and applied a square root transformation to the binned target intensitics.
A.14.4 MassFormer
MassFormer (Young et al. 2023 is a binned C2MS method that was originally designed for low mass accuracy (1.0 Da bins) MS MS prodiction. It uses a graph transformer architecture (Ying et al. 2021) that is pre-trained on large chemical dataset. (Nakata & Shimazaki] 2017) and then fine-tuned on spectrum prediction. We preserved most aspects of the model's original implementation but adapted the collision energy fcaturization and low rank output matrix approximation (d, 128) from the NEIMS bascline. Unlike the original FassFormer paper, we did not employ FLAG (Kong et al. 2022). a strategy for adversarial data augmentation in graphs, since none of the other models used data augmentation. We trained the model with binned cosine similarity, and applied a square root transformation to the binned target intensities.
A.14.5 Precursor-Only
A trivial baseline that simply puts 100% of the intensity on the precursor peak. More formally, given the input molccule's precursor formula p, the model predicts a spectrum with single peak (pass(p), 1)]. This bascline is useful because the precursor peak typically accounts for a large fraction of the overall intensity in the spectrum.
31

---

Published in Transactions on Machine Learning Research (08/2025)
A.15 Formula Annotation Evaluation
The NIST20 expert formula annotations were determined using combination of algorithmic and manual approaches. Following (Murphy et al. 2023), we excluded glycan and peptide spectra from formula annotation analysis and focused on small molecules.
Based on our correspondence with scientists at NIST, the procedure for establishing small molecule formula annotations can be described as follows. For each precursor compound, an exhaustive dccomposition of the precursor molecular formula was used to enumerate all possible subformulae. These subformulae were then matched peaks in the spectrum by comparing exact subformula masses with measured peak masses. Finally, expert opinion used to remove unlikely annotations.
While the details of the matching process are not published, our analysis indicates that the vast majority (< 95%) of formula annotation masses were within 10 ppm of their associated real peak masses. A small fraction of annotation formula masses (< 1%) are within 10 ppm of at least one other peak in the spectrum. For consistency with the peak matching metrics used elsewhere in the paper (í.e., the Hungarian cosine similarity metric CHUN, Appendix A.G), we excluded annotations with formula masses more than 10 ppm away from their associated peak mass.
The annotation metrics used in Section 5.3 are defined in the following equations; 10-5 is the mass tolerance parameter.
AR = Emen I Im M' : (Im- mll S E max 200)) A ([A(m) A A(m')l 0)
(31)
E [ [|Amm]] > 0]
AWR Emer P(m)ll [3m' E M' (Im mm1 S max(m, 200)) A (IA(m) A(m') > 00]
(32)
Emers ((m)[[[A(m)) > 0)
AP Emerr 1m3m E M (Im ml| S E maxx 200)) A (IA(m) A A(m')) > 00
(33)
EmeEr [[m)(m²') > 0]
AWP Emverr Pm E M (mm- - mm max(m, 200)) A (IA(m) A AA(mm) > 0)
(34)
Emvers Po(m')ll ([ A(m)) 0
2
AF1
(35)
AR" +AP
2
AWF1
(36)
AWR + AWP-T
Note that with FraGNNet and GrAFF-MS, the formula annotations for a given input molecule are determin- istically computed: in the former case they are derived from the fragmentation DAG Fdl while the latter they are given by static formula library. In both cases, the model's learned parameters only affect predicted peak intensities, not formula annotations. In contrast, ICEBERG uses a learned model to predict both formula annotations and peak intensities. This explains why seed variance for FraGNNet and GrAFF-MS is only reported in Table 3 for metries that involve predicted intensities (AWP, AWF1).
In the case of the ICEBERG model, the metrics AWP or AWFI are not well defined due to their dependence on predicted peak intensities. Unlike the other models, ICEBERG peak intensities Po(m') are only calculated after a 0.01 Da mass binning. This makes it impossible to evaluate Po Pa(m') i) and Po (2) for predicted peaks m'r 1 and m'2 that end up in the same mass bin. For ICEBERG, the other metrics in Table are calculated using the unbinned formula masses, Le., mi mas)(f") for each predicted formula. f³.
32

---

Published in Transactions on Machine Learning Research (08/2025)
A.16 Ensembling
Let {0t : B ~ P(O)) denote the set of parameters for an ensemble of FraGNNNet-D4 models, sampled IID from a distribution over parameters P(0). We perform ensembling in the latent space, using Equations 37 and 38 to calculate the ensemble latent distributions P (nlf) and PK (f) (respectively):
(nlf)
1 (nlff) = P(nlf) = Bo) [Po(n]))]
Σ
(37)
K
PK (f) = K k
1
(f) P(f) Ee- [Po(f)
(38)
The spectrum predictions are defined to be the average of the individual model predictions (Equation
39
1 E (m) Re P(m) = Ee-P(0) [m)()]
pk (m) K
(39)
By defining the ensemble this way, we are implicitly assuming that PK (ml (n, f). Empirically we found that this was the case, ensembling the joint distribution produced similar results.
Let H. (NI.)) denote the entropy of PK (nl.f) Note that H. (Nlf) is a Monte Carlo approximation of (f = Bn-P(n))) [- P(n]f)].
We want show that ensembling increases latent. conditional entropy. This is formalized in Equation 40
E [Ho(N)]) s H((NJ)
(40)
Proof. Proving Equation 40 simply requires noting that entropy is strictly concave with respect to the probability density function. To make this clear, we introduce the notation h(P(x)) = H(X) where h is the entropy function applied to the distribution P(x).
HI(NS) M(P(n[))
h(Ea- P(D) [P((n))))
EAmP(10 [M(Po(n)))
El- (NI)))
By the same reasoning we can get bounds for the isomorphic distributions (Fquation
BBw [b([)) S H(NJ))
(41)
Since normalized entropy simply a scaled version of entropy, the inequalities in Equations 40 and hold if each entropy is replaced with its normalized counterpart.
41 also
A.17 Isomorphic Fragment Annotation
For given pair of ensembles e, and Pe pairwise fragment annotation agreement (PFA) measures the average amount of mode agreement betwen their fragment annotation distributions PK (nls) and PK (nlf)-
33

---

Published in Transactions on Machine Learning Research (08/2025)
Individual
Ensemble
Cosine Similarity
Baseline
100%
95%
0.7
+4.2%
+4.3%
+4.2%
+-4.2%
0.6
Low
95%
100%
96%
0.5
Baseline
Low
High
Mix
0.5
High
93%
91%
100%
93%
Normalized Entropy
Individual
Ensemble
9.7%
0.4
14.
Mix
96%
96%
93%
100%
+10.9%
0.3
+12.3%
Baseline
Low
High
Mix
Baseline
Low
High
Mix
(a) ChUN and (NI))
(b) PFA
Figure 6: a. For each ensemble configuration (Baseline, Low, High, Mix), the cosine similarity CHUN and normalized ent entr of the annotation distribution (NI)) are reported. For both metrics, the average score of the individual models (Individual) is compared with the score of the ensemble (Ensemble). Each ensemble consists of K 15 models. Standard deviations for the K individual models are plotted as error bars. (b) Pairwise fragment annotation agreement (PFA) for all ensemble combinations are plotted in matrix. The consensus agreement (CFA) is ~ 89%.
More formally, let F; be the set of formula annotations in a predicted MS/MP MS spectrum i. PFA is defined using Eqquatin 42
PFA 1 Σ Eeer arg max, Po (nl = arg max, P (nl
(42)
FF
Consensus fragment annotation agreement (CFA, Equation across all ensembles.
43 is similar to PFA but measures agreement
CFA Σ ΣsEr, [Nas (arg max Pk (all) = arg max Pk (+l
(43)
F1
Figure 0 presents the same experiments as those covered by Figure but focuses the isomorphic annotation distribution (f instcad of Po(nlf). The general trends are the same: ensembling increases both cosine similarity and normalized entropy, PFA is 2 91%, and CFA ss 89%. Note that for each ensemble configuration, (f < Ho(N)f); this makes sense, as one would expect ff to more concentrated than (n( since the former does not distinguish between isomeric fragments.
Note that cases where only a single fragment is possible (ie., formulae ʃ F, such that PK (nlf) is degenerate distribution) are excluded from analysis.
A.18 Hyperparameter Optimization
For each model, we ran a random hyperparameter sweep with a budget of 100 samples on the InChIKey split, and selected the configuration with the best validation performance as measured by binned cosine similarity CBIN. The specific parameters that were optimized varied depending the type of model.
34

---

Published in Transactions on Machine Learning Research (08/2025)
A.19 Inference Speed
We performed inference speed comparison for FraGNNet and the baseline models using random 1000- spectrum sample from the NIST20 Test split (Table 12). All timing experiments were conducted on single node with modest compute (24-core Intel i9 13900K, NVIDIA RTX A6000 GPU, 64 GB RAM). As expected, the models that do not rely on fragmentation (NEIMS, MassFormer, GrAFF-MS) were significantly faster than those that do (FraGNNet and ICEBERG). Fragment generation was performed on the CPU for both FraGNNet and ICEBERG (using 24 cores). Although GPU-based fragment generation is technically possible for ICEBERG, it is inefficient due to CPU-bound operations. For spectrum prediction, used the GPU and tried batch sizes in 41,4, 16, 32, 64, 128), reporting only the fastest.
The inference times for the baseline models may be different from previously reported benchmarks. Our code uses sparse spectrum batching for both training and inference: this approach improves memory efficiency for models like FraGNNet that predict a highly variable number of peaks, since no peak padding is required. However, sparse batching can slow down inference, particularly for models like GrAFF-MS that always output large fixed number of peaks. The authors of GrAFF-MS reported an average runtime of 3 ms per spectrum the NIST20 dataset when using single GPU (Murphy et al. 2023): this is roughly 30x faster than the time reported in our experiment. The authors of ICEBERG reported runtime of approximately 0.86 per spectrum on a single CPU core (Goldman et al. 2024): this is in line with our reported time of 1.62 although our experiment performs intensity prediction (ICEBERG-Score) on the GPU.
Table 12: Inference Speed. FRAGMENT is the time taken to generate fragments (where applicable); SPECTRUM is the time taken to predict the spectrum (excluding the FRAGMENT time); COMBINED accounts for both. TOTAL refers to the time taken to predict 1000 random spectra from the NIST20 Test split, while SINGLE refers to the average time for one spectrum (per-core for FRAGMENT times, since fragment generation occurs on a 24-core CPU). All times are in seconds.
FRAGMENT
SPECTRUM SINGLE
COMBINED TOTAL
MODEL
TOTAL
SINGLE
TOTAL
SINGLE
PRAGNNET-D4
63.902
1.534
4.223
0.004
68.125
1.538
FRAGNNET-D3
14.289
0.343
2.195
0.002
16.484
0.345
ICEBERG
66.723
1.601
21.662
0.022
88.385
1.623
MASSFORMER
0.000
0.000
2.991
0.003
2.991
0.003
NEIMS
0.000
0.000
1.884
0.002
1.884
0.002
GRAFF-MS
0.000
0.000
57.047
0.057
57.047
0.057
35


Reviews:
[{"review_id": "BJuv8ui1ST", "reviewer": "Reviewer_abgR", "summary": "", "questions": "", "limitations": "", "rating": null, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "## Strengths\n\n* **Novel Integration of Combinatorial Fragmentation**: The key technical insight—replacing the learned fragment generator with combinatorial enumeration—is both elegant and impactful. It shows that a non-learned, deterministic strategy can be competitive or even superior in the molecule-to-spectrum (M2MS) generation task.\n* **Thorough Empirical Evaluation**: The paper presents a comprehensive set of experiments to validate the design choices, including comparisons across multiple metrics and baselines.\n* **Clarity and Presentation**: The paper is well-structured and clearly written, making it accessible to readers from both the cheminformatics and machine learning communities.\n\n## Weaknesses\n\n* **Baseline Reproducibility and Configuration Concerns**: A key concern lies in the reported performance of peer methods. As shown in recent literature (e.g., [arXiv:2502.17874v1](https://arxiv.org/pdf/2502.17874v1), Table 4 in the appendix), models such as **MassFormer** and **ICEBERG** have achieved higher top-1 retrieval accuracies than those reported in this paper. For example:\n\n  * Top-1 accuracy for MassFormer: 0.252\n  * Top-1 accuracy for ICEBERG: 0.251\n\n    This paper reports lower values for both. While methodological differences (e.g., bin width of 0.01 in cosine similarity) may partially explain these discrepancies, retrieval accuracy is often used as a benchmark metric. The authors should clarify the setup and, if feasible, re-run baselines using configurations aligned with the literature for a fair comparison. It is worth noting that I do not mean to compare FraGNNet with any recent/concurrent methods, but want the ICEBERG and MassFormer baselines to be clarified.\n* **Computational Efficiency**: The combinatorial fragmentation strategy, while effective, could introduce computational overhead. The paper does not report inference time or runtime comparisons against baseline models. This is important to assess the practical feasibility of FraGNNet.", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "Yes", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "paper_topic_and_main_contributions": "", "excitement": null, "reproducibility": null, "ethical_concerns": "", "main_review": "", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "summary_of_contributions": "This paper introduces FraGNNet, a molecule-to-mass spectrum forward simulator that combines combinatorial fragmentation with graph neural networks (GNNs). Building upon the ICEBERG framework, FraGNNet replaces the learned fragmentation model with a deterministic combinatorial enumeration strategy, similar to those used in earlier non-learning-based methods such as MetFrag. The authors further update the neural network architecture to accommodate this new design. Experimental results demonstrate that this approach leads to improved performance in both spectrum generation and molecular structure retrieval tasks.", "claims_and_evidence_yn": "Yes", "claims_explanation": "", "audience_yn": "Yes", "audience_explanation": "", "requested_changes": "1. **Clarify Baseline Discrepancies** (Critical):\n   Please elaborate on the differences in evaluation setup (especially for MassFormer and ICEBERG) compared to those reported in [arXiv:2502.17874v1](https://arxiv.org/pdf/2502.17874v1). If feasible, consider re-running the baselines under a standardized setting to ensure fair performance comparisons.\n\n2. **Report Inference Time** (Important):\n   Provide quantitative inference-time metrics for FraGNNet and compare them with peer methods. This would help assess the trade-off between performance gain and computational cost.", "broader_impact_concerns": "No broader impact concerns from the reviewer.", "additional_comments": "", "extra_scores": {}, "extra_text": {}}, {"review_id": "kLutNsVFOw", "reviewer": "Reviewer_7cb5", "summary": "", "questions": "", "limitations": "", "rating": null, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "Strengths:\n+ The paper is clear and well written, and gives an in-depth overview of preliminary work.\n+ The problem formulation is exhaustive and uses clear to follow math.\n+ The experiements and comparions are well-designed and broad. \n+ Latent entropy regularization and ensemble methods were used in an elegant way to asses sources for model error and to reduce them\n\nWeakness:\n- The paper mentions scaling issues of other models but does not provide benchmarks or comparisons", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "Yes", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "paper_topic_and_main_contributions": "", "excitement": null, "reproducibility": null, "ethical_concerns": "", "main_review": "", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "summary_of_contributions": "The paper introduces FraGNNet, a model for compound to tandem mass spectrum prediction with a novel and efficient approach for fragment generation, and a probabilistic formulation for fragment intensity prediction. In addition, entropy estimation and ensembles are used regularize and interpret the model. FraGNNet achieves state-of-the-art accuracy in intensity prediction and a downstream compound retrieval task.", "claims_and_evidence_yn": "Yes", "claims_explanation": "", "audience_yn": "Yes", "audience_explanation": "", "requested_changes": "- The claim for faster inference would benefit from a empirical experiment, measuring spectrum prediction speed comparing FraGNNet-D4, Iceberg and GrAFF-MS. Preferably, the experiment would differentiate the fragment generation, and intensity prediction when possible. The model parameter counts in the appendix suggest that FraGNNet-D4 should perform well.\n- A heuristic is used to simplify the fragmentation graph. Would it be possible to evaluate the impact of this heuristic on model performance, similar to the evaluation of ICEBERG (+OptFrag)?", "broader_impact_concerns": "N/A", "additional_comments": "", "extra_scores": {}, "extra_text": {}}, {"review_id": "y5awqNTOPA", "reviewer": "Reviewer_NwZY", "summary": "", "questions": "", "limitations": "", "rating": null, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "I found this manuscript to well-written with demonstrated expertise in both the mass spectrometry and modeling domains. I believe the primary strength of this manuscript is that the authors were able to combine these expertise to truly devise a modeling approach informed by a domain knowledge. Unlike some field, the data available to train such models is limited; thus, the described fragmentation graph approach and details such as not forcing the model to learn how to calculate m/z values, make the approach data and parameter-efficient.\nA particular detail that I found clever was the approach the handling of \"Out-of-Support\" m/z predictions and their treatment in the loss function.\n\nAlthough I think the presented approach is sound, my main critique is that the performance improvement over SOTA is sometimes modest, particularly for the retrieval task. This is likely the most important task presented in the experiment results, as it most closely reflects the primary way that such a model would be used by practitioners. Furthermore, the metrics presented for the retrieval task are limited to top-k accuracy. Here, top-k accuracy seems like a odd choice as apposed to top-k recall or precision. That being said, the retrieval task is difficult and even modest improvement can push the field forward.", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "Yes", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "paper_topic_and_main_contributions": "", "excitement": null, "reproducibility": null, "ethical_concerns": "", "main_review": "", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "summary_of_contributions": "\"FraGNNet: A Deep Probabilistic Model for Tandem Mass Spectrum Prediction\" presents a method solve compound to MS/MS task using a graph neural networks-based probabilistic model. In the manuscript, the authors present two contributions to the field: (1) an efficient method to generate fragmentations graphs for a compounds, and (2) a method to predict the intensity of those fragments as a probabilistic model.The fragmentation graph approach, although not entirely novel, takes a clever approach to inject expert knowledge into this challenging task. Furthermore, the formulation of the spectrum prediction task as a probabilistic one clearly reflects what is known about the data collection process and demonstrates good performance.", "claims_and_evidence_yn": "Yes", "claims_explanation": "", "audience_yn": "Yes", "audience_explanation": "", "requested_changes": "1. Present a more comprehensive collection of metrics for the retrieval task.\n\n2. Although the *MassSpecGym* paper (https://arxiv.org/abs/2410.23326) is cited, this manuscript does not present benchmark results for it. I recommend including benchmark results for retrieval in this benchmark dataset for others to compare against in the future.", "broader_impact_concerns": "I thoroughly enjoyed reading this manuscript and think it will be impactful for the field.", "additional_comments": "", "extra_scores": {}, "extra_text": {}}]

Author rebuttal:

Decision: Accept (poster)