GEMS: Molecular Structure Identification via Geodesic Navigation of the Isomer Manifold
Abstract
Identifying small-molecule structures from tandem mass spectra (MS2) is a central bottleneck in untargeted metabolomics. Existing approaches either retrieve candidates from spectral libraries, limiting discovery to known compounds, or generate ranked final samples without maintaining validated molecular-hypothesis trajectories. We introduce \textbf{GEMS} (Geodesic Elucidation of Molecular Structures), a seeded isomer-navigation method that searches a chemically validated isomer manifold with valence-preserving 2-switch operations. Rather than mapping a spectrum directly to a structure, GEMS maintains a current molecular hypothesis, compares its forward-predicted spectrum to the observation, and uses the resulting correspondence to select a local edit or HALT action. Each retained rollout state is a valid isomer, yielding inspectable trajectories from high-quality retrieved seeds. We train the policy with PubChem-grounded shortest-path supervision certified under the stated atom-alignment and validity model. At inference time, multi-start search records every visited valid molecule and ranks unique candidates by forward spectral cosine and policy halt probability. With target-excluded starts, GEMS reaches the target in at least one trajectory for 72.19\% of held-out NIST unique spectra and obtains 63.39\% top-10 accuracy; without additional training, it reaches the target for 32.02\% of CASMI spectra. GEMS achieves substantially higher NIST top-1 accuracy than recent generative baselines while using roughly two to three orders of magnitude fewer iterative model calls per query.