Adapting While Learning: Grounding LLMs for Scientific Problems with Tool Usage Adaptation

Bohan Lyu, Yadi Cao, Duncan Watson-Parris, Leon Bergen, Taylor Berg-Kirkpatrick, Rose Yu

TL;DR

Researchers have developed a two-stage fine-tuning method called Adapting While Learning (AWL) that helps Large Language Models (LLMs) internalize scientific knowledge and intelligently decide when to use external tools. By mimicking how human experts gauge problem difficulty, AWL-trained models achieve significantly higher accuracy—even surpassing GPT-4o on specialized datasets—while drastically reducing unnecessary and costly tool calls.

What Problem Does This Paper Address?

LLMs are increasingly used as "AI scientists," but they face a dual challenge in technical domains: hallucination and tool over-reliance.

While giving an LLM access to a physics simulator or a climate model can prevent it from making things up, current models often become "lazy." They call expensive external tools for trivial questions they could have answered internally. Conversely, for truly difficult problems, they might fail to realize they need help, leading to confident but incorrect answers.

The missing link is adaptive decision-making. Human experts don't pull out a calculator for basic arithmetic, but they rely on one for complex calculus. This paper aims to instill that same "meta-cognitive" ability in LLMs: knowing what they know, and knowing when to delegate to a tool.

Methods

The authors propose a novel paradigm called Adapting While Learning (AWL), which consists of two main phases designed to build both internal knowledge and tool-use discretion.

Overview of the Adapting While Learning (AWL) framework, detailing World Knowledge Learning and Tool Usage Adaptation.
  1. World Knowledge Learning (WKL): Instead of just using tools as a crutch, the model first "internalizes" the knowledge. The researchers use tools to generate high-quality, step-by-step solutions for scientific problems. The LLM is then fine-tuned (using Supervised Fine-Tuning and Direct Preference Optimization) on these traces to learn the underlying logic, effectively "distilling" the tool's expertise into the model's weights.
  2. Tool Usage Adaptation (TUA): The model is then taught to categorize problems. If the model can solve a problem accurately without help, it's labeled "easy." If it fails, it's "hard." The model is trained to maintain direct reasoning for easy problems but to automatically trigger tool usage for hard ones.

A critical technical contribution is the Knowledge Consistency loss. The authors found that models often "forget" internal knowledge when switched to a tool-enabled prompt. They solved this by using a combined loss function that optimizes for both direct answering and tool-augmented reasoning simultaneously.

Datasets

The study evaluates the method across six benchmarks, including two standard public sets and four rigorous new environments custom-built for this research.

Question generation pipeline and examples from the four custom scientific datasets: Mujoco, PDE, Climate, and Epidemiology.
  • Public: MATH (high school competition math) and SciBench (college-level science).
  • Custom (New):
    • Mujoco: Physics and robotics problems involving rigid-body dynamics.
  • PDE: Solving 1D and 2D partial differential equations (e.g., heat transfer).
  • Climate Science: Predicting temperature changes based on various emission scenarios.
  • Epidemiology: Simulating disease spread and policy interventions in California.

These custom datasets are particularly challenging because they require interacting with specialized numerical simulators that are rarely found in general web-crawl pre-training data.

Key Insights and Ideas

  • Internalization First, Delegation Second: The most effective way to use tools isn't just to provide an API; it's to teach the model the logic behind the tool first. This grounds the model's internal "world model."
  • Self-Awareness as a Training Signal: By using the model's own accuracy to partition the training data into "easy" and "hard" sets, the researchers created a personalized curriculum that teaches the model its own limitations.
  • Efficiency is a Metric: The paper highlights that "intelligence" in AI should include computational efficiency. AWL reduced tool calls in climate tasks from an average of 7.21 to just 2.70 per question without losing accuracy.
  • Robustness to Noise: Interestingly, AWL-trained models are more robust to "noisy" or "polluted" training data. When the model encounters a confusing, noisy prompt, it learns to treat it as "hard" and defaults to a reliable external tool rather than hallucinating.

Key Results

  • Massive Accuracy Gains: A Llama-3.1-8B model post-trained with AWL saw a 29.11% increase in answer accuracy compared to the base instruct model.
  • Beating the Giants: On the four custom scientific datasets, the 8B AWL model surpassed frontier models like GPT-4o and Claude-3.5 Sonnet. This suggests that targeted "adaptation" can beat raw scale in specialized domains.
  • Smarter Tool Use: Tool usage accuracy (the ability to call a tool only when necessary and use it correctly) improved by 12.72%.
  • Internalization Success: The models showed they could solve many complex PDEs and physics problems internally after training, which they previously could only solve by calling the simulator.

Limitations and Future Work

  • Agent Complexity: The authors noted that "Agent Limitations" remain the biggest source of error. Even with AWL, models struggle with extremely complex, multi-step tool interactions that require long-horizon planning.
  • Binary Difficulty: The current method uses a binary "easy vs. hard" split. Future work could explore a more granular spectrum of difficulty and a wider variety of tools.
  • Domain Specificity: While the method is general, the current implementation requires domain-specific simulators and fine-tuning. Scaling this to a "universal" scientific assistant remains a future goal.
  • Modality: The current work is text/code-based. Expanding AWL to handle multi-modal scientific data (like satellite imagery or molecular structures) is a logical next step.

Summary updated

BibTeX
@inproceedings{lyu2025adapting,
  author = {Bohan Lyu and Yadi Cao and Duncan Watson-Parris and Leon Bergen and Taylor Berg-Kirkpatrick and Rose Yu},
  title = {{Adapting While Learning: Grounding LLMs for Scientific Problems with Tool Usage Adaptation}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=owulFly8oQ},
}
Figure