ToolRL: Reward is All Tool Learning Needs

Cheng Qian, Emre Can Acikgoz, Qi He, Hongru Wang, Xiusi Chen, Dilek Hakkani-Tür, Gokhan Tur, Heng Ji

TL;DR

ToolRL demonstrates that Reinforcement Learning (RL) can significantly outperform Supervised Fine-Tuning (SFT) for teaching Large Language Models (LLMs) how to use external tools. By utilizing a principled, fine-grained reward system that evaluates tool selection, parameter names, and values independently, the authors achieve a 15% performance gain over SFT models and unlock emergent agentic behaviors like proactive clarification and self-correction.

Introduction: The Challenge of Tool-Integrated Reasoning

While LLMs are increasingly capable, they still struggle with outdated knowledge and calculation errors. Tool-Integrated Reasoning (TIR)—where models interact with search engines, calculators, or code interpreters—is the standard solution.

However, most models are trained for TIR using Supervised Fine-Tuning (SFT), which often leads to "pattern matching" rather than true strategic reasoning. SFT models frequently overfit to specific training examples and fail to generalize when faced with unfamiliar tools or complex, multi-step tasks. While RL has revolutionized mathematical reasoning (e.g., DeepSeek-R1), applying it to tool use is difficult because "correctness" is multi-faceted. A model might pick the right tool but provide the wrong parameters, or vice versa. Standard binary rewards (correct/incorrect) are too coarse to guide the model through these nuances.

Methodology: A Principled Reward Framework

The authors propose a framework for training LLMs using RL—specifically Group Relative Policy Optimization (GRPO)—focused on a customized "rollout" and reward structure.

The TIR Rollout

The model is instructed to use specific XML-style tags: <think> for internal reasoning, <tool_call> for invoking APIs, and <response> for the final answer. This structure allows the training environment to intercept tool calls, execute them, and feed the results back into the model's context.

Illustration of the TIR rollout and the dual-component reward system.

Decomposed Reward Design

The core of ToolRL is its decomposed reward function, $R_{final} = R_{format} + R_{correct}$:

  1. Format Reward ($R_{format}$): A binary signal ensuring the model follows the required XML tag structure.
  2. Correctness Reward ($R_{correct}$): Instead of a single score, this is broken down into:
  3. Tool Name Matching: Did it pick the right tool?
  4. Parameter Name Matching: Did it use the correct schema?
  5. Parameter Content Matching: Are the specific values (e.g., dates, locations) correct?

This fine-grained approach provides a "dense" learning signal, allowing the model to learn from partial successes.

Experimental Setup

The authors constructed a balanced training set of 4,000 examples from three diverse sources:

  • ToolACE: Focuses on multi-step interactions and deciding when to use a tool vs. responding directly.
  • Hammer (Masked): Uses randomized tool/parameter names to force the model to rely on descriptions rather than memorization.
  • xLAM: A compositional dataset for reasoning about tool dependencies.

Evaluation was conducted on the Berkeley Function Call Leaderboard (BFCL), API-Bank, and Bamboogle (a multi-hop QA benchmark used to test generalization to free-form tool use).

Key Findings and Insights

  • Superior Performance: ToolRL achieved a 17% improvement over base models and a 15% gain over SFT-only models across benchmarks.
  • Granularity is Essential: Coarse rewards (rewarding only perfect matches) lead to slow learning and poor performance. Decomposing the reward into names, schemas, and values provides the necessary feedback for the model to navigate complex API calls.
  • "Longer" is not "Better": In mathematical reasoning, longer "thinking" traces often correlate with better results. ToolRL found the opposite for tool use: forcing longer reasoning traces can lead to "overthinking," where the model hallucinates complexity or fails to reject irrelevant tools.
  • Dynamic Scaling: The most effective training strategy involves a "Dynamic" reward scale that smoothly shifts focus from format adherence (early training) to semantic correctness (late training). Abrupt shifts in reward focus were found to degrade performance.
  • Cold Start Advantage: Interestingly, training a raw instruct model from scratch with RL ("Cold Start") often resulted in better generalization than starting from a model already fine-tuned with SFT.
Comparison of reward trends showing how different granularities affect the learning curve.
  • Emergent Agentic Behavior: The models developed "metacognitive" skills. For example, if a user's request is ambiguous, the model learns to ask for clarification rather than making a blind (and likely incorrect) tool call.

Limitations and Future Work

  • Algorithm Scope: The study focused on policy-gradient methods (GRPO and PPO). The authors note that preference-based RL methods like DPO might be less compatible with their structured, trajectory-level rewards.
  • Model Scaling: The experiments were limited to models up to 7B parameters. Whether these insights scale linearly to 70B+ models remains an open question.
  • Future Directions: The authors suggest extending the framework to multi-modal tool use (e.g., models using vision tools) and embodied agents interacting with physical environments.

Summary updated

BibTeX
@inproceedings{qian2025toolrl,
  author = {Cheng Qian and Emre Can Acikgoz and Qi He and Hongru WANG and Xiusi Chen and Dilek Hakkani-Tür and Gokhan Tur and Heng Ji},
  title = {{ToolRL: Reward is All Tool Learning Needs}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=eOLdGbXT6t},
}
Figure