TL;DR
MidTool introduces a dedicated "mid-training" stage to bridge the gap between general pre-training and specialized post-training for agentic tool use. By synthesizing a 20.3B-token corpus from web data, code, and real-world APIs, the researchers demonstrate that teaching models the fundamentals of tool affordances and workflows earlier in their development significantly boosts performance on complex, multi-turn agentic tasks.
What Problem Does This Paper Address?
While Large Language Models (LLMs) are increasingly used as "agents" that interact with the world via tools, most of their tool-use training happens during the final post-training phase (Supervised Fine-Tuning and Reinforcement Learning). The authors argue this places an undue burden on post-training. A model must simultaneously learn atomic skills—like grounding arguments in a schema, planning multi-step workflows, and recovering from missing information—from a relatively narrow set of curated traces.
Furthermore, the knowledge required for successful tool use is "distributed" across developer documentation, manuals, and code repositories—data that rarely appears as clean agent demonstrations. The authors ask: can we shape general tool-use ability earlier through a dedicated mid-training stage?
Methods
The authors developed the MidTool pipeline, a three-stage process to construct a large-scale mid-training corpus:
- Data Collection: They gathered data from four complementary sources: Web (FineWeb), PDFs (FinePDFs), Code (GitHub), and structured Tool artifacts (REST APIs and Model Context Protocol skills).
- Preprocessing: Source-specific filtering and deduplication to ensure high-quality, technical, and developer-oriented content.
- Agentic Trajectory Synthesizing: This is the core innovation. The refined corpus is converted into executable supervision via two branches:
- Context-grounded Trajectory Augmentation: This branch takes unstructured documents (like an API manual) and uses a teacher model to annotate them with "affordance profiles." A rule-based planner then converts these into Q&A pairs and trajectories to teach the model how to ground tool calls in messy, real-world text.
- Native Agentic Trajectory Synthesis: This branch uses structured tool definitions (APIs/MCP) to build executable, multi-turn trajectories. It focuses on teaching the model to plan, clarify missing info, and handle sequential execution.
Datasets
The resulting training mixture, MidTool-Mix, contains 20.3 billion tokens across 11.22 million samples. As shown in the data mixture statistics, the tokens are balanced across web (42%), code (26%), and PDF (23%) sources, with native agentic trajectories making up the final 9%.
For evaluation, the authors used three complementary benchmarks:
- BFCLv3: Measures function-calling quality in single and multi-turn settings.
- $\tau^2$-Bench: Stresses interactive task completion in realistic verticals like airline and retail.
- MCP-Universe: Evaluates execution over real-world Model Context Protocol servers, testing out-of-distribution generalization.
Key Insights and Ideas
- Mid-training as a "Substrate": Mid-training doesn't replace post-training; it prepares the model for it. Models mid-trained on MidTool-Mix showed faster convergence during SFT and reached higher rewards more quickly during RL.
- Grounding vs. Execution: The two synthesis branches are complementary. The context-grounded branch is better for "transfer" (learning to use new tools from docs), while the native trajectory branch is better for precise function calling and execution.
- The Capability Boundary: General tool-use mid-training provides a strong prior for most tasks but has limits. It contributed marginally to "deep-search" style tasks, suggesting that highly exploratory behaviors still require specialized, dedicated trajectory data.
- Zero-Shot Visual Transfer: In a pilot study, the authors found that mid-training on text-only tool use actually improved performance on visual tool-use tasks, suggesting a fundamental "agentic advantage" that transfers across modalities.
Key Results
MidTool-Mix consistently improved downstream performance for both 4B and 8B Qwen3 models across all benchmarks.
- BFCLv3: At the 4B scale, the average multi-turn score rose by more than 10 points compared to the SFT-only baseline.
- $\tau^2$-Bench: The 4B model nearly doubled its Pass@1 score, and the 8B model showed clear gains in overall interactive capacity.
- MCP-Universe: Mid-training led to significant improvements in score and pass rate, particularly after RL, proving the model learned a general prior that transfers to unseen tool ecosystems.
Limitations and Future Work
- Teacher Dependence: The synthesis pipeline currently relies on strong "teacher" models (like GPT-5 or large Qwen variants) to generate the augmented data.
- Deep Search Gap: As noted, the current mixture doesn't fully solve long-horizon, exploratory "deep search" tasks, which likely need more specialized mid-training data.
- Co-designing Stages: The authors held the post-training recipe fixed to isolate the effects of mid-training. Future work could explore how to optimize the two stages together—for example, seeing if stronger mid-training allows for smaller, more efficient post-training datasets.
Summary updated