Table of Contents
Fetching ...

How well can off-the-shelf LLMs elucidate molecular structures from mass spectra using chain-of-thought reasoning?

Yufeng Wang, Lu Wei, Lin Liu, Hao Xu, Haibin Ling

TL;DR

This study benchmarks off-the-shelf LLMs on the task of elucidating molecular structures from MS/MS data using a domain-informed chain-of-thought prompting framework, without any model training. Across four large models, the approach yields syntactically valid SMILES and expert-like reasoning traces but fails to achieve chemical fidelity: DBE and formula correctness are near-zero and no exact canonical matches are produced. Mid-sized molecules (200–400 Da) show the best but still modest similarity to ground-truth structures, while larger and smaller molecules exhibit rapid degradation, highlighting the lack of spectral grounding in text-only LLMs. The results underscore a gap between linguistic reasoning and mechanistic chemical interpretation, motivating integration with spectral encoders, chemistry-aware constraints, and multimodal or physics-informed architectures to achieve reliable MS-to-structure predictions. Overall, the work provides a diagnostic benchmark demonstrating that chain-of-thought prompting alone cannot bridge the gap to chemically grounded molecular elucidation from mass spectra.

Abstract

Mass spectrometry (MS) is a powerful analytical technique for identifying small molecules, yet determining complete molecular structures directly from tandem mass spectra (MS/MS) remains a long-standing challenge due to complex fragmentation patterns and the vast diversity of chemical space. Recent progress in large language models (LLMs) has shown promise for reasoning-intensive scientific tasks, but their capability for chemical interpretation is still unclear. In this work, we introduce a Chain-of-Thought (CoT) prompting framework and benchmark that evaluate how LLMs reason about mass spectral data to predict molecular structures. We formalize expert chemists' reasoning steps-such as double bond equivalent (DBE) analysis, neutral loss identification, and fragment assembly-into structured prompts and assess multiple state-of-the-art LLMs (Claude-3.5-Sonnet, GPT-4o-mini, and Llama-3 series) in a zero-shot setting using the MassSpecGym dataset. Our evaluation across metrics of SMILES validity, formula consistency, and structural similarity reveals that while LLMs can produce syntactically valid and partially plausible structures, they fail to achieve chemical accuracy or link reasoning to correct molecular predictions. These findings highlight both the interpretive potential and the current limitations of LLM-based reasoning for molecular elucidation, providing a foundation for future work that combines domain knowledge and reinforcement learning to achieve chemically grounded AI reasoning.

How well can off-the-shelf LLMs elucidate molecular structures from mass spectra using chain-of-thought reasoning?

TL;DR

This study benchmarks off-the-shelf LLMs on the task of elucidating molecular structures from MS/MS data using a domain-informed chain-of-thought prompting framework, without any model training. Across four large models, the approach yields syntactically valid SMILES and expert-like reasoning traces but fails to achieve chemical fidelity: DBE and formula correctness are near-zero and no exact canonical matches are produced. Mid-sized molecules (200–400 Da) show the best but still modest similarity to ground-truth structures, while larger and smaller molecules exhibit rapid degradation, highlighting the lack of spectral grounding in text-only LLMs. The results underscore a gap between linguistic reasoning and mechanistic chemical interpretation, motivating integration with spectral encoders, chemistry-aware constraints, and multimodal or physics-informed architectures to achieve reliable MS-to-structure predictions. Overall, the work provides a diagnostic benchmark demonstrating that chain-of-thought prompting alone cannot bridge the gap to chemically grounded molecular elucidation from mass spectra.

Abstract

Mass spectrometry (MS) is a powerful analytical technique for identifying small molecules, yet determining complete molecular structures directly from tandem mass spectra (MS/MS) remains a long-standing challenge due to complex fragmentation patterns and the vast diversity of chemical space. Recent progress in large language models (LLMs) has shown promise for reasoning-intensive scientific tasks, but their capability for chemical interpretation is still unclear. In this work, we introduce a Chain-of-Thought (CoT) prompting framework and benchmark that evaluate how LLMs reason about mass spectral data to predict molecular structures. We formalize expert chemists' reasoning steps-such as double bond equivalent (DBE) analysis, neutral loss identification, and fragment assembly-into structured prompts and assess multiple state-of-the-art LLMs (Claude-3.5-Sonnet, GPT-4o-mini, and Llama-3 series) in a zero-shot setting using the MassSpecGym dataset. Our evaluation across metrics of SMILES validity, formula consistency, and structural similarity reveals that while LLMs can produce syntactically valid and partially plausible structures, they fail to achieve chemical accuracy or link reasoning to correct molecular predictions. These findings highlight both the interpretive potential and the current limitations of LLM-based reasoning for molecular elucidation, providing a foundation for future work that combines domain knowledge and reinforcement learning to achieve chemically grounded AI reasoning.
Paper Structure (29 sections, 6 equations, 5 figures, 4 tables)

This paper contains 29 sections, 6 equations, 5 figures, 4 tables.

Figures (5)

  • Figure 1: Standard machine-learning pipeline for MS/MS-to-molecule prediction. Given an input MS/MS spectrum (left), existing methods typically combine (i) spectral reference matching (library search), (ii) structure retrieval from candidate databases, and (iii) de novo generation models using architectures such as Transformers, autoencoders, GNNs, or diffusion models, to propose one or more molecular structures (right).
  • Figure 2: Overview of the CoT-guided MS-to-SMILES benchmarking framework. A domain-specific prompt elicits structured CoT reasoning from an LLM, which generates ranked SMILES candidates that are evaluated with format, validity, and structural/chemical metrics.
  • Figure 3: Tanimoto similarity across molecular-weight bins for all four evaluated LLMs. All models achieve their highest similarity in the 200-400 Da range, with performance degrading for very small ($<200$ Da) and larger ($>400$ Da) molecules.
  • Figure 4: MCES across molecular-weight bins for all four evaluated LLMs. MCES scores follow a similar trend as Tanimoto but exhibit an even sharper decline for large molecules ($>400$ Da), indicating severe mismatches in global graph connectivity.
  • Figure 5: Qualitative case studies across molecular-weight regimes. Each row shows the model’s 10 candidate structures and the corresponding ground-truth molecule for a representative small, medium, and large precursor.