Table of Contents
Fetching ...

General Intelligence-based Fragmentation (GIF): A framework for peak-labeled spectra simulation

Margaret R. Martin, Soha Hassoun

TL;DR

Metabolomics annotation is hampered by limited spectral libraries and variable fragmentation conditions. We introduce GIF, a two-step framework that uses reasoning-enabled LLMs to simulate spectra: first generate plausible molecular fragments through iterative prompts, then predict fragment intensities via fine-tuning, with offline m/z calculation and human-in-the-loop checks. Evaluated on the MassSpecGym-derived QA-sim dataset, GPT-4o and GPT-4o-mini achieve the best performance (cosine similarity ~0.36 and ~0.35, respectively), with iterative refinement and fine-tuning driving substantial gains. GIF offers an interpretable, collaborative workflow that can augment spectrum annotation and human expertise, though current state-of-the-art methods like FraGNNet still outperform it on raw similarity metrics; the work highlights the potential of reasoning-focused LLMs for domain-specific spectrum simulation and outlines avenues like RLHF and tool integration for further gains.

Abstract

Despite growing reference libraries and advanced computational tools, progress in the field of metabolomics remains constrained by low rates of annotating measured spectra. The recent developments of large language models (LLMs) have led to strong performance across a wide range of generation and reasoning tasks, spurring increased interest in LLMs' application to domain-specific scientific challenges, such as mass spectra annotation. Here, we present a novel framework, General Intelligence-based Fragmentation (GIF), that guides pretrained LLMs through spectra simulation using structured prompting and reasoning. GIF utilizes tagging, structured inputs/outputs, system prompts, instruction-based prompts, and iterative refinement. Indeed, GIF offers a structured alternative to ad hoc prompting, underscoring the need for systematic guidance of LLMs on complex scientific tasks. Using GIF, we evaluate current generalist LLMs' ability to use reasoning towards fragmentation and to perform intensity prediction after fine-tuning. We benchmark performance on a novel QA dataset, the MassSpecGym QA-sim dataset, that we derive from the MassSpecGym dataset. Through these implementations of GIF, we find that GPT-4o and GPT-4o-mini achieve a cosine similarity of 0.36 and 0.35 between the simulated and true spectra, respectively, outperforming other pretrained models including GPT-5, Llama-3.1, and ChemDFM, despite GPT-5's recency and ChemDFM's domain specialization. GIF outperforms several deep learning baselines. Our evaluation of GIF highlights the value of using LLMs not only for spectra simulation but for enabling human-in-the-loop workflows and structured, explainable reasoning in molecular fragmentation.

General Intelligence-based Fragmentation (GIF): A framework for peak-labeled spectra simulation

TL;DR

Metabolomics annotation is hampered by limited spectral libraries and variable fragmentation conditions. We introduce GIF, a two-step framework that uses reasoning-enabled LLMs to simulate spectra: first generate plausible molecular fragments through iterative prompts, then predict fragment intensities via fine-tuning, with offline m/z calculation and human-in-the-loop checks. Evaluated on the MassSpecGym-derived QA-sim dataset, GPT-4o and GPT-4o-mini achieve the best performance (cosine similarity ~0.36 and ~0.35, respectively), with iterative refinement and fine-tuning driving substantial gains. GIF offers an interpretable, collaborative workflow that can augment spectrum annotation and human expertise, though current state-of-the-art methods like FraGNNet still outperform it on raw similarity metrics; the work highlights the potential of reasoning-focused LLMs for domain-specific spectrum simulation and outlines avenues like RLHF and tool integration for further gains.

Abstract

Despite growing reference libraries and advanced computational tools, progress in the field of metabolomics remains constrained by low rates of annotating measured spectra. The recent developments of large language models (LLMs) have led to strong performance across a wide range of generation and reasoning tasks, spurring increased interest in LLMs' application to domain-specific scientific challenges, such as mass spectra annotation. Here, we present a novel framework, General Intelligence-based Fragmentation (GIF), that guides pretrained LLMs through spectra simulation using structured prompting and reasoning. GIF utilizes tagging, structured inputs/outputs, system prompts, instruction-based prompts, and iterative refinement. Indeed, GIF offers a structured alternative to ad hoc prompting, underscoring the need for systematic guidance of LLMs on complex scientific tasks. Using GIF, we evaluate current generalist LLMs' ability to use reasoning towards fragmentation and to perform intensity prediction after fine-tuning. We benchmark performance on a novel QA dataset, the MassSpecGym QA-sim dataset, that we derive from the MassSpecGym dataset. Through these implementations of GIF, we find that GPT-4o and GPT-4o-mini achieve a cosine similarity of 0.36 and 0.35 between the simulated and true spectra, respectively, outperforming other pretrained models including GPT-5, Llama-3.1, and ChemDFM, despite GPT-5's recency and ChemDFM's domain specialization. GIF outperforms several deep learning baselines. Our evaluation of GIF highlights the value of using LLMs not only for spectra simulation but for enabling human-in-the-loop workflows and structured, explainable reasoning in molecular fragmentation.

Paper Structure

This paper contains 14 sections, 2 figures, 3 tables.

Figures (2)

  • Figure 1: GIF overview. Grey boxes represent offline processing steps, yellow boxes represent LLM queries, and pink boxes represent data. (A) GIF has two steps, fragment generation and intensity prediction, with an offline step for calculating the m/z values of the fragments. (B) Fragment-generation step: Given the query molecule and the relevant experiment settings, the LLM suggests SELFIES fragments, which are filtered and used to prompt the LLM anew through iterative refinement. (C) Intensity-prediction step: Given the results of the first step, the LLM is prompted to predict the intensity values. The base LLM in this step is fine-tuned on intensity prediction and the prompting process utilizes a refinement step.
  • Figure 2: An example of GIF guiding LLMs in spectra simulation of two candidate molecules. (A) An abridged textual representation of the application of GIF to molecule 1 (Suxibuzone) through steps 1 and 2. (B) The corresponding visualization of GIF's application to molecule 1. (C) The visualization of GIF's application to molecule 2 (Methyl 4-[3-[cycloheptyl(furan-2-carbonyl)amino]-2,5-dioxopyrrolidin-1-yl]benzoate). (D) An abridged textual representation of the example downstream application that uses the output of GIF when querying molecule 1 and molecule 2. The blue boxes represent GIF steps, either fragment generation or intensity prediction. The yellow boxes are prompts queried to the LLM, where the lighter box is the system prompt and the darker boxes are user prompts. The pink boxes are the LLM responses. We use GPT-4o for all queries in this example.