SciAgent: Tool-augmented Language Models for Scientific Reasoning

Yubo Ma, Zhibin Gou, Junheng Hao, Ruochen Xu, Shuohang Wang, Liangming Pan, Yujiu Yang, Yixin Cao, Aixin Sun

Introduction

Scientific reasoning represents a "boss level" challenge for artificial intelligence, requiring a sophisticated blend of high-level mathematical logic and deep, domain-specific knowledge. Current approaches often rely on extensive fine-tuning on specialized data, a process that is both computationally expensive and difficult to scale across diverse disciplines like physics, chemistry, or finance. Even state-of-the-art models like GPT-4 struggle with complex scientific benchmarks, often achieving low accuracy.

The researchers behind SCIAGENT propose a paradigm shift: instead of attempting to embed all human scientific knowledge into a model's weights, we should develop "proficient tool-users." By teaching Large Language Models (LLMs) to utilize specialized Python functions, SCIAGENT mimics how human scientists use software like Matlab or WolframAlpha to solve complex problems.

The SCIAGENT Framework

The SCIAGENT framework operates through a structured four-step execution pipeline designed to bridge the gap between natural language reasoning and technical computation:

  1. Planning: The agent first generates a high-level, step-by-step natural language plan to decompose the scientific problem.
  2. Retrieval: Using the plan and the original question as queries, the agent retrieves relevant Python functions from a domain-specific toolset.
  3. Action: The agent constructs a solution that interleaves natural language reasoning with Python code, invoking the retrieved functions to perform specific calculations or logic.
  4. Execution: A Python executor runs the generated code to produce the final answer.
The SCIAGENT execution pipeline: from planning and cross-retrieval to function-augmented solution generation.

A critical innovation in this framework is the cross-retrieval training strategy. To prevent models from over-relying on "ad-hoc" tools—functions built for one specific question—the training process forces the agent to solve problems using generalized tools retrieved from different contexts. This encourages the model to truly understand function documentation and apply tools flexibly across various scenarios.

Data Construction and Benchmarking

To support this new paradigm, the authors introduced two significant resources: MATHFUNC and SCITOOLBENCH.

MATHFUNC is a massive training corpus containing 31,375 samples and nearly 6,000 tools. It was developed by prompting GPT-4 to generate modular, reusable Python functions for problems within the MATH dataset.

SCITOOLBENCH serves as a rigorous evaluation benchmark spanning five domains: Mathematics, Physics, Chemistry, EECS, and Finance. It consists of 4,250 questions—a combination of human-curated and synthesized data—supported by a toolset of 2,285 functions. These tools are specifically designed to be composable and generalized, testing the agent's ability to coordinate multiple specialized functions.

The multi-stage process for constructing the MATHFUNC training corpus and SCITOOLBENCH evaluation benchmark.

Key Insights and Results

The evaluation of SCIAGENT revealed several critical insights into the nature of tool-augmented reasoning:

  • Pluggable Knowledge: Domain knowledge can be treated as a "pluggable" component. Once a model is fine-tuned on tool-use (via MATHFUNC), it can be adapted to entirely new scientific fields simply by providing a new library of functions, requiring no additional training.
  • The "Reference" Effect: The presence of function documentation in the model's context acts as a "knowledge reference." Even if a function isn't explicitly called, its documentation helps guide the model's internal reasoning and code generation.
  • Mathematical Foundations: Models pre-trained on mathematical corpora, such as DeepSeek-Math, demonstrated superior tool-use capabilities. Mathematical logic appears to be the fundamental "glue" that enables effective tool coordination.

In terms of performance, SCIAGENT-DEEPMATH-7B achieved 40.0% accuracy on SCITOOLBENCH, significantly outperforming ChatGPT's 31.0%. Similarly, SCIAGENT-LLAMA3-8B reached 34.7% accuracy, marking an 8.7% absolute improvement over the base Llama-3-8B model. The framework also showed remarkable robustness; performance remained stable even when models were presented with irrelevant or sub-par toolsets.

Conclusion and Future Work

While SCIAGENT represents a significant step forward, a performance gap remains when compared to frontier models like GPT-4 with tools, which achieves nearly 60% accuracy. Future research will focus on closing this gap, exploring agent performance in "open-world" scenarios with unfiltered toolsets, and investigating the "in-domain" performance plateau observed in highly specialized models. By refining the "tool-user" paradigm, SCIAGENT paves the way for more scalable and adaptable AI assistants in the scientific domain.

Summary updated

BibTeX
@inproceedings{ma2024sciagent,
  author = {Yubo Ma and Zhibin Gou and Junheng Hao and Ruochen Xu and Shuohang Wang and Liangming Pan and Yujiu Yang and Yixin Cao and Aixin Sun},
  title = {{SciAgent: Tool-augmented Language Models for Scientific Reasoning}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-main.880},
}
Figure