File size: 9,686 Bytes
3f1aec5 73d8074 4aa9fbb 73d8074 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 | ---
title: README
emoji: ⚡
colorFrom: red
colorTo: purple
sdk: static
pinned: false
---
# MetaboLLM
[](https://arxiv.org/abs/2608.06253)
[](https://github.com/dohyunku9/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.
<p align="center">
<img src="https://huggingface.co/spaces/MetaboLLM/README/resolve/main/assets/Figure1.png" alt="Overview of the MetaboLLM framework" width="950">
</p>
## Highlights
- Integrated knowledge covering **237,243 metabolites**, **2,359 pathways**, **12,323 reactions**, and **5,993 enzymes**
- Released **four MetaboLLM model variants** across Qwen, Gemma, and Llama backbones
- Constructed a metabolomics benchmark containing **17 tasks**, **6,000 training examples**, and **4,200 test examples**
- Evaluated factual knowledge, class identification, biochemical relationships, and description generation
- Compared MetaboLLM against corresponding base models and five publicly available medical language models
- Evaluated transfer on the independently developed MetaBench benchmark
## Resources
| Resource | Description |
|---|---|
| [MetaboLLM-Qwen3-4B](https://huggingface.co/MetaboLLM/MetaboLLM-Qwen3-4B) | Primary MetaboLLM model based on Qwen3-4B |
| [MetaboLLM-Qwen3-8B](https://huggingface.co/MetaboLLM/MetaboLLM-Qwen3-8B) | MetaboLLM model based on Qwen3-8B |
| [MetaboLLM-Gemma-3-4B](https://huggingface.co/MetaboLLM/MetaboLLM-Gemma-3-4B) | MetaboLLM model based on Gemma-3-4B |
| [MetaboLLM-Llama-3.2-3B](https://huggingface.co/MetaboLLM/MetaboLLM-Llama-3.2-3B) | MetaboLLM model based on Llama-3.2-3B |
| [MetaboLLM-Benchmark](https://huggingface.co/datasets/MetaboLLM/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:
- **KEGG** for metabolites, reactions, enzymes, and pathways
- **HMDB** for human metabolites, biological roles, chemical taxonomy, and compound descriptions
- **PubChem** for chemical structures, identifiers, molecular properties, and compound descriptions
- **SMPDB** for curated pathways and physiological descriptions
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:
- molecular identity and formula knowledge
- metabolite and reaction class recognition
- metabolite–pathway relationships
- metabolite–reaction relationships
- reaction–enzyme relationships
- metabolite, pathway, and enzyme description generation
- structure-rich and structure-poor metabolite description generation
## 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.
- **MetaboLLM-Qwen3-8B** achieved the highest Knowledge MCQA accuracy at **56.42%**
- **MetaboLLM-Qwen3-4B** achieved the highest pathway-description scores, including **85.19 BERTScore-F1**, **25.83 ROUGE-L-F1**, and **17.61 BLEU-2**
These results demonstrate transfer beyond the internally constructed MetaboLLM benchmark.
## Quick Start
Install the required packages:
```bash
pip install -U transformers peft accelerate torch
```
Example using MetaboLLM-Qwen3-4B:
```python
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
```python
from datasets import load_dataset
dataset = load_dataset(
"MetaboLLM/MetaboLLM-Benchmark",
"Knowledge_recall",
)
print(dataset["test"][0])
```
Available configurations:
- `Knowledge_recall`
- `Class_identification`
- `Relation_identification`
- `Description_generation`
## Intended Uses
MetaboLLM is intended for research involving:
- metabolomics-specific question answering
- biochemical knowledge recall
- metabolite and reaction class identification
- metabolite–pathway and reaction–enzyme relationship identification
- metabolite, pathway, and enzyme description generation
- evaluation of metabolomics-specialized language models
## Limitations
- MetaboLLM may generate incorrect or unsupported biochemical statements.
- Performance outside metabolomics and biochemical knowledge tasks has not been comprehensively evaluated.
- Outputs should be independently verified and should not be used for clinical decision-making.
## Licenses
Each MetaboLLM repository is distributed according to its model card and license notice.
- Use of each adapter remains subject to the license and terms of its corresponding base model.
- Benchmark components created by the MetaboLLM authors are distributed under the terms described in the benchmark repository.
- Third-party and source-derived biochemical content remains subject to the licenses and terms of the original providers.
Please review the license files in the relevant model and dataset repositories before use.
## Resource Maintainers
- Dohyun Ku
- Min Gu Kwak
|