Teaching Large Language Models (LLMs) to use external tools—such as web search, database queries, or email—is a critical step toward building autonomous agents. However, obtaining high-quality training data for these tasks is notoriously difficult. This paper introduces InfTool, a fully autonomous framework that generates its own training data through a self-evolving, multi-agent "playground," achieving state-of-the-art results without human labels.
The Challenge of Tool-Use Data
Current approaches to training agentic LLMs face three major hurdles:
- Data Scarcity: High-quality trajectories of human-tool interactions are expensive and slow to annotate.
- Limited Generalization: Static datasets become obsolete as new APIs and tools are released.
- The Quality Ceiling: When a single model generates its own training data, it often inherits its own biases and fails to explore complex, multi-step workflows.
InfTool addresses these by creating a closed-loop system that continuously improves its own data generation process.
The InfTool Framework
InfTool operates as a multi-stage system designed to synthesize and refine tool-use trajectories through interaction and reinforcement learning.
1. MCP-Driven Data Synthesis
The framework utilizes the Model Context Protocol (MCP) to decouple AI models from data sources. The authors ingested over 17,000 raw APIs from RapidAPI, refining them into a clean "MCP Tree" of approximately 3,000 high-fidelity tool definitions. This semantic clustering prevents the model from learning from redundant or low-quality data.
2. Multi-Agent Role-Playing
To create realistic data, InfTool orchestrates three collaborative agents:
- User Simulator: Acts as a human with a specific goal and background.
- Tool Agent: The "assistant" attempting to solve the user's problem using tools.
- Server Simulator: Simulates the tool's response (e.g., a database returning a record).
This role-playing setup forces the model to handle unknown information and dependencies, such as needing a specific user ID before checking a balance, mimicking real-world troubleshooting more effectively than simple prompting.
3. Self-Evolution via GRPO
The model is trained using Group Relative Policy Optimization (GRPO). A key innovation is the gated reward mechanism: the model is only rewarded for its reasoning (Chain-of-Thought) if the final tool call is correct. This ensures the model develops robust internal logic rather than just memorizing outputs.
Key Results and Performance
The impact of InfTool is most evident in the performance gains of open-source models. A base Qwen2.5-32B model saw its accuracy on the Berkeley Function-Calling Leaderboard (BFCL) V3 jump from 19.8% to 70.9% after training with InfTool.
- Competitive Edge: At 32B parameters, InfTool outperformed larger models like DeepSeek-V3 (41.96%) and rivaled top-tier proprietary systems like Claude-Opus (78.9%).
- Multi-Turn Mastery: In complex multi-turn scenarios, InfTool-32B scored 59.0, nearly doubling the performance of the standard Qwen2.5-32B-Instruct baseline (32.0).
- Efficiency: The RL-based self-evolution achieved performance parity with standard fine-tuning (SFT) while requiring only half the total data volume.
Limitations and Future Work
While InfTool provides a blueprint for building autonomous agents, the authors note several limitations. Synthetic users are often more rational than real humans, who can be ambiguous or prone to "cognitive drift." Additionally, performance eventually degrades as multi-turn interactions exceed the base model's context window. Future work aims to expand the scope to multi-modal agents capable of interacting with visual user interfaces.
By closing the loop between data generation and model training, InfTool demonstrates that high-quality, complex tool-use capabilities can be synthesized autonomously, bypassing the traditional bottleneck of human annotation.
Summary updated