TL;DR
Tool-R0 is a novel self-play reinforcement learning framework that trains general-purpose tool-calling LLM agents from scratch with zero human data. By co-evolving a Generator and a Solver role from the same base model using complementary rewards, it automatically builds an adaptive curriculum that outperforms fully supervised baselines on complex tool-use tasks.
What Problem Does This Paper Address?
Teaching Large Language Models (LLMs) to interact with external environments via tools (like APIs and databases) typically relies on massive, human-annotated datasets or static synthetic data. This approach suffers from two major bottlenecks: it is incredibly labor-intensive to scale, and it caps model performance at the human-expert data distribution.
While self-play reinforcement learning (RL) has unlocked superhuman capabilities in closed games (like Go) and abstract reasoning (like math), extending it to open-ended, real-world tool use has proven difficult. Existing data-free methods are narrowly scoped to single domains like code execution or web search. Tool-R0 addresses this gap by establishing a domain-agnostic framework where an LLM agent can autonomously learn to use diverse tools without any pre-existing human datasets.
Methods
Tool-R0 initializes a single base LLM into two distinct, independently trained roles that co-evolve through a dual-RL cycle:
- The Generator ($\pi_\theta$): Tasked with synthesizing verifiable tool-use problems consisting of a user request, an available tool menu (in JSON format), and the corresponding "gold" tool call. To prevent mode collapse, generation is grounded using lightweight task specifications (domain, context type, tool count, and call count).
- The Solver ($\pi_\phi$): Tasked with executing the correct tool calls based on the Generator's prompts.
The core innovation lies in the Curriculum Reward ($r_{curr}$) designed for the Generator. Instead of just rewarding task validity, it uses a smooth, band-pass difficulty filter ($r_{diff}$) based on the Solver's current success rate ($p_{succ}$).
Tasks that are too easy ($p_{succ} > 0.75$) or completely impossible ($p_{succ} < 1/K$) receive low or zero rewards. The Generator is highly rewarded only when it hits the Solver's "competence frontier" ($0.25 \le p_{succ} \le 0.75$). This forces the Generator to propose progressively harder, multi-step tasks as the Solver improves. After each iteration, the generated tasks are cross-verified, filtered, and fed to the Solver using Group Relative Policy Optimization (GRPO).
Datasets
Because Tool-R0 operates under a zero-data assumption, it uses no human-curated datasets for training.
For evaluation, the framework is tested across five diverse, established tool-calling benchmarks:
- ToolAlpaca: Evaluates multi-step tool composition and generalization across heterogeneous tool categories.
- SealTool: Focuses on single-turn API selection across large-scale APIs.
- NexusRaven: Targets high-fidelity function execution in enterprise and cybersecurity domains.
- API-Bank: Evaluates multi-turn conversational tool use.
- SNIPS: A spoken language understanding dataset adapted to a function-calling format to test natural language variation.
Key Insights and Ideas
- Adaptive Curricula Outperform Human Supervision: Agents trained via autonomous self-play generalize better than those trained on static human datasets. The self-generated data dynamically targets the model's specific, evolving weaknesses rather than relying on fixed human priors.
- Role Separation is Mandatory: Attempting to share parameters between the Generator and Solver causes a massive performance drop (-17.42 percentage points). Because tool-calling involves an open-ended, high-entropy action space, the exploration-driven gradients of the Generator directly conflict with the precision-driven execution gradients of the Solver.
- Smooth Reward Transitions Prevent Collapse: Replacing the smooth Gaussian transitions of the difficulty reward with a harsh rectangular filter destabilizes training. The smooth falloff provides a gradient signal that guides the Generator back to the target difficulty zone if it drifts too far.
Key Results
Evaluated on the Qwen2.5 and Llama-3.2 model families, Tool-R0 demonstrates massive performance leaps:
- Substantial Relative Gains: For the primary Qwen2.5-1.5B-Instruct model, Tool-R0 achieves an average 92.52% relative improvement (+22.99 absolute points) over the base model.
- Surpassing Supervised Baselines: With zero curated data, Tool-R0 achieves an average accuracy of 47.84%, outperforming prominent baselines (like xLAM, Hammer, ToolAce, and ToolRL) trained on 4k to 210k human-annotated examples.
- Narrowing the Scale Gap: Tool-R0 effectively elicits latent capabilities in smaller models. Post-training, the 0.5B model outperforms the 1.5B base model, and the 1.5B model outperforms the 3B base model.
- Effective Mid-Training Foundation: Using Tool-R0 as an intermediate training stage prior to traditional Supervised Fine-Tuning (SFT) yields better results than SFT alone, showing that self-play builds a more robust foundation for learning from human data.
Limitations and Future Work
- Early Saturation in Small Models: Low-capacity models (like the 0.5B variant) tend to saturate and plateau after a few iterations, likely hitting a knowledge boundary or a Nash-like equilibrium where the Generator and Solver become mutually aligned.
- Computational Inefficiency: Estimating task difficulty requires querying the Solver multiple times ($K=8$) per task during Generator training, which significantly increases the computational overhead.
- Future Directions: The authors suggest exploring richer, loss- or gradient-based difficulty feedback rather than relying purely on stochastic solver consistency. They also propose introducing a high-capability "third-party teacher" or oracle to inject missing knowledge when self-play progress stalls.
Summary updated