MetaboLLM

MetaboLLM is a family of metabolomics-specialized large language models designed to integrate biochemical knowledge across heterogeneous resources and support metabolite-, pathway-, reaction-, and enzyme-centered reasoning and description generation.

MetaboLLM was developed through continual pretraining, supervised fine-tuning, and structured retrieval using harmonized biochemical knowledge from KEGG, HMDB, PubChem, and SMPDB.

Overview of the MetaboLLM framework

Highlights

Resources

Resource Description
MetaboLLM-Qwen3-4B Primary MetaboLLM model based on Qwen3-4B
MetaboLLM-Qwen3-8B MetaboLLM model based on Qwen3-8B
MetaboLLM-Gemma-3-4B MetaboLLM model based on Gemma-3-4B
MetaboLLM-Llama-3.2-3B MetaboLLM model based on Llama-3.2-3B
MetaboLLM-Benchmark Training and evaluation benchmark across 17 metabolomics tasks

Model Family

Model Backbone Release Format
MetaboLLM-Qwen3-4B Qwen3-4B PEFT LoRA adapter
MetaboLLM-Qwen3-8B Qwen3-8B PEFT LoRA adapter
MetaboLLM-Gemma-3-4B Gemma-3-4B PEFT LoRA adapter
MetaboLLM-Llama-3.2-3B Llama-3.2-3B PEFT LoRA adapter

MetaboLLM-Qwen3-4B served as the primary model in the associated study. All released repositories contain adapter weights and require the corresponding base model.

Integrated Biochemical Knowledge

MetaboLLM was developed from a unified resource integrating complementary information from:

The harmonized resource contains:

Entity type Count
Metabolites 237,243
Pathways 2,359
Reactions 12,323
Enzymes 5,993

MetaboLLM Benchmark

The benchmark contains 17 tasks organized into four complementary categories.

Category Tasks Train Test
Knowledge recall 5 1,000 1,000
Class identification 4 1,000 1,000
Relation identification 3 1,000 1,000
Description generation 5 3,000 1,200
Total 17 6,000 4,200

The benchmark evaluates:

Benchmark Results

Biochemical Knowledge and Structured Relationships

Mean accuracy across 12 multiple-choice and short-answer tasks.

Category Model Mean Accuracy
Medical LLM MedGemma-1.5-4B 49.0
Medical LLM FineMedLM-O1 57.9
Medical LLM II-Medical-8B-1706 63.0
Medical LLM Qwen2.5-Aloe-Beta-7B 63.9
Medical LLM Meditron3-Qwen2.5-7B 65.7
Base model Llama-3.2-3B 51.5
Base model Gemma-3-4B 52.2
Base model Qwen3-4B 66.5
Base model Qwen3-8B 66.8
MetaboLLM MetaboLLM-Llama-3.2-3B 70.0
MetaboLLM MetaboLLM-Gemma-3-4B 75.3
MetaboLLM MetaboLLM-Qwen3-8B 75.9
MetaboLLM MetaboLLM-Qwen3-4B 79.1

All four MetaboLLM variants outperformed their corresponding unadapted backbones and all evaluated medical language models. MetaboLLM-Qwen3-4B achieved the highest mean accuracy at 79.1%, compared with 65.7% for the strongest evaluated medical model and 66.5% for its corresponding base model.

Biochemical Description Generation

BERTScore-F1 on a 0–100 scale.

Category Model Metabolite Description Pathway Description Enzyme Description Structure-Rich Metabolite Description Structure-Poor Metabolite Description
Medical LLM MedGemma-1.5-4B 81.05 80.97 79.33 84.89 84.73
Medical LLM FineMedLM-O1 83.05 82.87 81.22 84.10 83.96
Medical LLM II-Medical-8B-1706 82.71 82.94 81.60 86.37 85.84
Medical LLM Qwen2.5-Aloe-Beta-7B 83.34 83.39 81.68 85.47 84.52
Medical LLM Meditron3-Qwen2.5-7B 83.69 83.14 81.99 84.47 83.76
Base model Llama-3.2-3B 82.81 82.56 81.40 84.56 84.50
Base model Gemma-3-4B 81.74 81.54 80.37 85.48 85.07
Base model Qwen3-4B 82.39 81.85 80.68 86.48 85.80
Base model Qwen3-8B 82.30 82.28 80.79 86.20 85.61
MetaboLLM MetaboLLM-Llama-3.2-3B 90.93 86.74 83.78 87.13 87.65
MetaboLLM MetaboLLM-Gemma-3-4B 87.39 83.83 80.69 87.03 87.74
MetaboLLM MetaboLLM-Qwen3-8B 90.94 87.26 83.70 87.66 88.02
MetaboLLM MetaboLLM-Qwen3-4B 91.71 88.04 84.12 87.79 88.06

MetaboLLM-Qwen3-4B achieved the highest BERTScore-F1 across all five description-generation tasks.

External Benchmark Transfer

MetaboLLM was also evaluated on MetaBench, an independently developed public metabolomics benchmark.

These results demonstrate transfer beyond the internally constructed MetaboLLM benchmark.

Quick Start

Install the required packages:

pip install -U transformers peft accelerate torch

Example using MetaboLLM-Qwen3-4B:

import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer

base_model_id = "Qwen/Qwen3-4B-Instruct-2507"
adapter_id = "MetaboLLM/MetaboLLM-Qwen3-4B"

tokenizer = AutoTokenizer.from_pretrained(adapter_id)

base_model = AutoModelForCausalLM.from_pretrained(
    base_model_id,
    torch_dtype="auto",
    device_map="auto",
)

model = PeftModel.from_pretrained(
    base_model,
    adapter_id,
)

messages = [
    {
        "role": "user",
        "content": "What is the biochemical role of pyruvate?"
    }
]

inputs = tokenizer.apply_chat_template(
    messages,
    add_generation_prompt=True,
    return_tensors="pt",
).to(model.device)

with torch.no_grad():
    outputs = model.generate(
        inputs,
        max_new_tokens=256,
        do_sample=False,
    )

response = tokenizer.decode(
    outputs[0][inputs.shape[-1]:],
    skip_special_tokens=True,
)

print(response)

Please check the corresponding model card for the exact base-model identifier and model-specific loading instructions.

Loading the Benchmark

from datasets import load_dataset

dataset = load_dataset(
    "MetaboLLM/MetaboLLM-Benchmark",
    "Knowledge_recall",
)

print(dataset["test"][0])

Available configurations:

Intended Uses

MetaboLLM is intended for research involving:

Limitations

Licenses

Each MetaboLLM repository is distributed according to its model card and license notice.

Please review the license files in the relevant model and dataset repositories before use.

Resource Maintainers