π Paper β’ π€ Data & Models β’ π§ Toolkits
We present SciAgentGym, the first benchmark environment for evaluating LLM agents' capability in multi-step scientific tool-use. SciAgentGym provides a comprehensive suite of scientific tools across multiple disciplines, enabling rigorous evaluation of how well LLMs can solve complex scientific problems through sequential tool invocation.
Complex scientific problems often require multiple steps of computation, each involving specialized domain tools. SciAgentGym addresses this challenge by providing:
- 1780+ Scientific Tools across Physics, Chemistry, Materials Science, Life Science, and Astronomy
- Multi-step Reasoning Tasks requiring sequential tool calls to reach final answers
- Standardized Evaluation Pipeline with automated answer extraction and scoring
- Flexible Tool Registration enabling easy extension to new domains
SciAgentGym provides an integrated execution environment comprising four components:
| Component | Description |
|---|---|
| Toolkit | 1,780 domain-specific scientific tools across multiple disciplines |
| Filesystem | Data storage and artifact management for intermediate results |
| Databases | Scientific knowledge retrieval (e.g., PubChem, local molecular DBs) |
| Python Interpreter | Flexible computation environment for tool execution |
Each task runs in an isolated instance with its own registered tools and filesystem, ensuring reproducibility and avoiding cross-task contamination.
- Type Safety: Each tool specifies typed input/output signatures enabling automatic validation
- Reproducibility: All executions are recorded as structured traces with fixed random seeds
- Extensibility: Tools are organized by domain with standardized protocols, enabling researchers to register custom tools for specialized domains
SciAgentGym contains 1,780+ scientific tools from 4 major disciplines:
| Discipline | Topics | Python files |
|---|---|---|
| Physics | Optics, Mechanics, Electromagnetism, Thermodynamics, Acoustics, Plasma Physics, Fluid Dynamics, Atomic Physics, Condensed Matter | 96+ |
| Chemistry | Analytical, Physical, Computational, Organic, Environmental | 28+ |
| Materials Science | Crystallography, Spectroscopy, Structural Analysis, XRD | 24+ |
| Life Science | Structural Biology, Mass Spectrometry | 19+ |
Tool clustering results by discipline
SciAgentGym/
βββ gym/ # Core evaluation environment
β βββ env.py # MinimalSciEnv - execution environment
β βββ tool.py # EnvironmentTool base class
β βββ toolbox.py # Tool registration system
β βββ agent.py # Multi-model LLM client
β βββ test_executor.py # Test execution engine
β βββ test_querys.py # Benchmark entry point
β β
β βββ core/ # Core modules
β β βββ tool_loader.py # Dynamic tool loading
β β βββ data_loader.py # Dataset loading
β β βββ evaluator.py # Scoring algorithms
β β βββ environment_fs.py # Result management
β β
β βββ config/ # Configuration
β βββ utils/ # Utilities
β
βββ toolkits/ # Scientific tool implementations
βββ physics/
βββ chemistry/
βββ materials_science/
βββ life_science/
βββ astronomy/
toolkits/
βββ physics/ # Physics (96+ tools)
β βββ optics/ # Optics
β β βββ optics_tools_gym.py # Tool registration module
β β βββ optical_interference_solver_204.py
β β βββ thin_film_interference.py
β βββ mechanics/ # Mechanics (37 tools)
β βββ electromagnetism/ # Electromagnetism (8 tools)
β βββ thermodynamics/ # Thermodynamics (12 tools)
β βββ acoustics/ # Acoustics (4 tools)
β βββ plasma_physics/ # Plasma Physics
β βββ fluid_dynamics/ # Fluid Dynamics
β βββ atomic_and_molecular_physics/ # Atomic & Molecular Physics
β βββ condensed_matter_physics/ # Condensed Matter Physics
β βββ structural_mechanics/ # Structural Mechanics
β
βββ chemistry/ # Chemistry (28+ tools)
β βββ analytical_chemistry/ # Analytical Chemistry
β βββ physical_chemistry/ # Physical Chemistry
β βββ computational_chemistry/ # Computational Chemistry
β βββ organic_chemistry/ # Organic Chemistry
β βββ environmental_chemistry/ # Environmental Chemistry
β
βββ materials_science/ # Materials Science (24+ tools)
β βββ crystallography/ # Crystallography
β βββ spectroscopy_analysis/ # Spectroscopy Analysis
β βββ structural_analysis/ # Structural Analysis
β βββ x_ray_diffraction_analysis/ # XRD Analysis
β
βββ life_science/ # Life Science (19+ tools)
β βββ structural_biology/ # Structural Biology
β βββ mass_spectrometry/ # Mass Spectrometry
β
βββ astronomy/ # Astronomy (6+ tools)
β
βββ local_db/ # Local Databases
βββ *.db / *.sqlite # SQLite databases
| File Type | Description | Example |
|---|---|---|
*_tools_gym.py |
Tool registration module with @Toolbox.register decorated classes |
optics_tools_gym.py |
*.py |
Core computation function implementations | thin_film_interference.py |
*.json |
Configuration or data files | reaction_library.json |
*.db |
SQLite databases for knowledge retrieval | molecules.db |
@Toolbox.register(name="calculate_thin_film_interference")
class CalculateThinFilmInterferenceTool(EnvironmentTool):
"""Calculate enhanced and weakened wavelengths in thin film interference."""
name = "calculate_thin_film_interference"
description = "Calculate enhanced and weakened wavelengths in thin film interference."
arguments = {
"n1": {"type": "number", "description": "Refractive index of incident medium"},
"n2": {"type": "number", "description": "Refractive index of thin film"},
"d": {"type": "number", "description": "Film thickness in nm"},
}
def use(self, environment, action) -> Observation:
result = compute_interference(...)
return Observation(self.name, json.dumps(result))Installation
We recommend the one-shot script β it creates a conda env named
sciagentgym (Python 3.11), installs every scientific package via
conda-forge for binary compatibility, then runs a soft-fail verification
step:
git clone [email protected]:CMarsRover/SciAgentGYM.git
cd SciAgentGYM
# Option A: one-shot script (recommended)
bash install.sh
# Useful flags:
# REBUILD=1 recreate the env from scratch
# USE_TSINGHUA=1 route conda + pip through Tsinghua mirrors (mainland China)
REBUILD=1 USE_TSINGHUA=1 bash install.sh
# Option B: manual (equivalent to Option A minus the verification step)
conda env create -f environment.yml
conda activate sciagentgymConfigure API Keys
Edit gym/config/config.py:
SUPPORTED_MODELS = {
"gpt-4o": {
"provider": "openai",
"api_base_url": "https://api.openai.com/v1",
"api_key": "your-api-key",
},
# Add more models...
}Datasets
dataset/refine_merged_multi_questions.json (83 cases, multi-modal) and
dataset/refine_merged_single_questions.json (48 cases, text-only) ββ combined
they form the paper's 131 original + 128 refined = 259 tasks / 1134 subquestions.
Each case is a JSON object with the following fields:
| Field | Type | Description |
|---|---|---|
id |
int | Case identifier |
question |
str | Original problem statement (multi-modal cases reference images via metadata.image_path) |
answer |
str | Gold answer for the original question (used by boxed-answer evaluation) |
metadata.subject / topic |
str | Discipline / sub-field, used to auto-infer toolkit directories |
metadata.image_path |
list[str] | Image files attached to the question (multi-modal input) |
metadata.solution_steps |
list | Reference reasoning steps |
metadata.tool_expected |
list[str] | Expected tool function names |
metadata.golden_answer |
list | Structured gold answers keyed by sub-question |
usage_tool_protocol |
list | OpenAI function-calling schemas, injected into the tool-call turn |
refined_versions |
list | Refined variants: refined_question + final_answer (a dict of sub-question β answer) |
Run Evaluation
# See all flags
python gym/test_querys.py --help
# Full multi-modal benchmark (default)
python gym/test_querys.py
# Single-modal split
python gym/test_querys.py --dataset single
# Both splits
python gym/test_querys.py --dataset both
# Pick model & disable tools (LLM baseline)
python gym/test_querys.py --model gpt-4o --no-tools
# Run one specific case id (repeat --case-id to select several)
python gym/test_querys.py --case-id 5 --case-id 12
# Structured (refine) evaluation instead of boxed-answer matching
python gym/test_querys.py --test-type refineSciAgentGym provides a standardized evaluation pipeline:
- Tool Loading: Automatically infer and load required tools from metadata
- Agent Execution: LLM generates tool calls, environment executes them
- Answer Extraction: Extract final answer from
\boxed{}format - Scoring: Compare against gold standard with flexible matching
from gym.core.tool_loader import prepare_env_from_query
from gym.core.evaluator import extract_boxed_answer, is_answer_correct
# Load environment and tools
env, tools, schema, registry = prepare_env_from_query(test_case)
# Run agent interaction...
# Evaluate
answer = extract_boxed_answer(model_response)
correct = is_answer_correct(question, answer, gold_answer, case_id)Adding New Tools
# toolkits/physics/optics/my_tool.py
from gym.toolbox import Toolbox
from gym.entities import Observation
@Toolbox.register
class RefractionCalculator:
name = "refraction_calculator"
description = "Calculate refraction angle using Snell's law"
parameters = {
"type": "object",
"properties": {
"n1": {"type": "number", "description": "Refractive index of medium 1"},
"n2": {"type": "number", "description": "Refractive index of medium 2"},
"theta1": {"type": "number", "description": "Incident angle in degrees"}
},
"required": ["n1", "n2", "theta1"]
}
def use(self, n1: float, n2: float, theta1: float) -> Observation:
import math
theta2 = math.degrees(math.asin(n1 * math.sin(math.radians(theta1)) / n2))
return Observation(source=self.name, observation=f"Refraction angle: {theta2:.2f}Β°")@misc{shen2026sciagentgymbenchmarkingmultistepscientific,
title={SciAgentGym: Benchmarking Multi-Step Scientific Tool-use in LLM Agents},
author={Yujiong Shen and Yajie Yang and Zhiheng Xi and Binze Hu and Huayu Sha and Jiazheng Zhang and Qiyuan Peng and Junlin Shang and Jixuan Huang and Yutao Fan and Jingqi Tong and Shihan Dou and Ming Zhang and Lei Bai and Zhenfei Yin and Tao Gui and Xingjun Ma and Qi Zhang and Xuanjing Huang and Yu-Gang Jiang},
year={2026},
eprint={2602.12984},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2602.12984},
}


