Specialist tools improve large language models on complex mass spectrometry tasks

LLMs Depend on Specialist Tools for Out-of-Distribution Generalization in MS/MS Structural Elucidation

Machine LearningArtificial IntelligenceComputation and Language

Summary

Mass spectrometry helps scientists identify the structure of molecules by analyzing fragments, but guessing structures from scratch is very hard. A recent study tested if advanced language models can solve this problem without outside help. The authors found that while these models do well on familiar molecules, they struggle on new, less studied ones. Using specialized software tools alongside the language model greatly improved its ability to identify unknown molecules.

What this means in practice

  • For mass spectrometry teams: Improve automated identification of unknown molecules from tandem mass spectrometry data by integrating de novo structure generation tools with language models.
  • For chemical software developers: Develop better software agents that combine language models with specialized generators to enhance molecular structure predictions from spectral data.
  • For pharmaceutical data engineers: Enable more accurate automated structure elucidation for novel compounds by deploying language models augmented with domain-specific tools in drug discovery pipelines.$Commercial implications: This paper supports building advanced structural elucidation products targeting pharmaceutical companies needing reliable unknown molecule identification.

Authors

Gabriel Asher, Cailum M. K. Stienstra, Tomo Oga, Devesh Shah Antonio H. de O. Fonseca, Niall O'Connor, Michael Widrich

Abstract

A frontier language model was recently reported to solve 1D NMR structural elucidation without tools. We ask whether this capability transfers to tandem mass spectrometry (MS/MS) in the de novo setting, where the model must propose a structure directly from the spectrum without a candidate list or reference library. To separate reasoning from recall, we build a 100-analyte benchmark from MassSpecGym, split by each analyte's textual footprint into in-distribution (well documented in literature) and out-of-distribution (essentially undocumented) arms. We hold the model, harness, and output format fixed and vary only the LLM's access to domain-specific tools. Without tools, a frontier LLM reaches 52% Top-1 accuracy in-distribution but only 2% out-of-distribution. Only access to de novo structure generators improves out-of-distribution accuracy, raising it to as much as 38% Top-1, and the resulting agent outperforms the standalone de novo models both in and out of distribution. These results suggest that LLMs are not effective at de novo MS/MS structural elucidation on their own, and that further gains depend on the specialist tools available to the agent rather than on the LLM itself.