Abstract
Current Large Language Models (LLMs) often undergo supervised fine-tuning (SFT) to acquire tool use capabilities. However, SFT struggles to generalize to unfamiliar or complex tool use scenarios. Recent advancements in reinforcement learning (RL), particularly with R1-like models, have demonstrated promising reasoning and generalization abilities. Yet, reward design for tool use presents unique challenges: multiple tools may be invoked with diverse parameters, and coarse-grained reward signals, such as answer matching, fail to offer the fine-grained feedback required for effective learning. In this work, we present the first comprehensive study on reward design for tool selection and application tasks within the RL paradigm. We systematically explore a wide range of reward strategies, analyzing their types, scales, granularity, and temporal dynamics. Building on these insights, we propose a principled reward design tailored for tool use tasks and apply it to train LLMs using Group Relative Policy Optimization (GRPO). Empirical evaluations across diverse benchmarks demonstrate that our approach yields robust, scalable, and stable training, achieving a 17% improvement over base models and a 15% gain over SFT models. These results highlight the critical role of thoughtful reward design in enhancing the tool use capabilities and generalization performance of LLMs.
Introduction
While LLMs are increasingly deployed as autonomous agents interacting with external tools—such as calculators, search engines, and APIs—training them to do so reliably remains a significant hurdle. The prevailing industry standard, Supervised Fine-Tuning (SFT), relies on training models on "gold standard" trajectories. However, SFT exhibits two major flaws in Tool-Integrated Reasoning (TIR):
- Overthinking: Models often mimic the stylistic elements of deep reasoning (e.g., "Let me think about this...") without executing the underlying logic, leading to "hallucinated" reasoning chains.
- Brittleness: SFT models frequently fail to generalize to unfamiliar tools or complex, multi-step scenarios absent from the training data.
Existing Reinforcement Learning (RL) approaches often rely on "coarse" rewards, such as a binary success signal based on the final answer. Such signals are too sparse to guide the complex process of selecting the correct tool and accurately formatting its parameters.
Methodology: The ToolRL Framework
ToolRL addresses these limitations by utilizing Group Relative Policy Optimization (GRPO)—the algorithm popularized by DeepSeek-R1—to optimize tool-use capabilities through a principled reward design.
Principled Reward Design
The core innovation of ToolRL is the decomposition of the reward signal into two primary components:
- Format Reward ($R_{format}$): A binary score that ensures the model adheres to the required structural syntax, utilizing specific tokens like
<think>,<tool_call>, and<response>in the correct sequence. - Correctness Reward ($R_{correct}$): A fine-grained, multi-level score (ranging from -3 to 3) that evaluates the semantic accuracy of a tool call across three dimensions:
- Tool Name Matching: Did the model select the appropriate tool for the task?
- Parameter Name Matching: Did the model identify the correct argument keys?
- Parameter Content Matching: Are the specific values passed to those arguments accurate?
Dynamic Reward Scaling
To stabilize training, the framework employs Dynamic Reward Scaling. Initially, the model is incentivized to master the output format. As training progresses, the reward weight shifts toward the semantic correctness of the tool calls, allowing the model to refine its logic once the structural foundation is established.
Experimental Setup
The models were trained on a curated dataset of 4,000 examples derived from three sources: ToolACE (general decision-making), Hammer (Masked) (randomized tool names to prevent memorization), and xLAM (compositional planning).
Evaluation was conducted across three rigorous benchmarks:
- Berkeley Function Call Leaderboard (BFCL) V3: Assessing tool-calling accuracy.
- API-Bank: Evaluating multi-turn interactions.
- Bamboogle: A multi-hop QA benchmark testing the model's ability to decide when to invoke a search tool.
Key Insights and Results
Performance and Generalization
ToolRL achieved a 17% improvement over base models and a 15% gain over SFT-only models. On the BFCL benchmark, ToolRL-trained models demonstrated superior performance in "unfamiliar" scenarios, such as using programming languages or APIs not encountered during the training phase.
The SFT Initialization Trap
One of the study's most surprising findings was that "Cold Start" RL—starting from a raw instruct model—often outperformed models that had undergone heavy SFT. Excessive SFT can lead to overfitting, which restricts the model's ability to explore and discover more robust strategies during the RL phase.
Granularity and Reasoning
Unlike mathematical reasoning, where longer "thinking" traces typically correlate with higher accuracy, ToolRL found that forcing longer reasoning in tool use often led to performance degradation and "overthinking." Instead, the density of the reward signal proved to be the critical factor. Breaking rewards down into name, parameter, and value components provided the model with the necessary feedback to identify exactly which part of a complex call was erroneous.
Emergent Metacognition
Models trained via ToolRL began to exhibit emergent "agentic" behaviors. These included proactively asking users for missing information required for a tool call or correctly rejecting irrelevant tools when they did not serve the user's goal.
Conclusion and Future Work
ToolRL demonstrates that the path to effective tool-integrated reasoning lies in the granularity of the reward signal rather than the volume of supervised data. While the current approach relies on ground-truth comparisons—making it less applicable to highly open-ended tasks—it provides a scalable and stable foundation for training agentic LLMs. Future research will focus on scaling these dynamics to 70B+ parameter models and exploring end-to-end rewards for long-horizon agentic trajectories.
Summary updated