MidTool: Mid-training Data Synthesis for Agentic Tool Use
Organizations: University of Washington · Snowflake · University of North Carolina at Chapel Hill
Abstract
Mid-training is increasingly recognized as a critical stage for shaping the capabilities of large language models. Recent work has shown that targeted mid-training can strengthen reasoning-intensive abilities such as math and science, and can also improve agentic capabilities in software-engineering settings. In this work, we study the parallel but less explored agentic capability: general tool use. We present MidTool, an open corpus construction pipeline for agentic tool-use mid-training that combines large-scale web, PDF, and code data with synthesized supervision from real-world tool APIs, MCP skills, and document-grounded workflows. MidTool is designed to teach models how to recognize tool affordances, ground arguments from context, compose tool call workflow, and recover from incomplete information. We mid-train Qwen3-4B-Base and Qwen3-8B-Base on MidTool-Mix, and then apply follow-up post-training with both supervised fine-tuning and reinforcement learning. Compared with baselines, MidTool-Mix consistently improves downstream performance under both SFT and RL on BFCL, tau2-Bench, and MCP Universe. These results suggest that general tool use, like other important LLM capabilities, benefits from dedicated mid-training rather than being left entirely to post-training.
Figures & tables
| Model Setting | Single Turn | Multi-Turn | Hallu. | Overall | |||||
| Non-live | Live | Base | MF | MP | LC | Avg. | |||
| Qwen3-4B | 39.58% | 24.35% | 10.50% | 9.00% | 6.00% | 10.00% | 8.88% | 9.05% | 24.27% |
| Qwen3-4B-Base + SFT | 59.94% | 43.75% | 21.50% | 14.00% | 10.00% | 16.50% | 15.50% | 60.46% | 39.73% |
| Qwen3-4B-Base + SFT + RL | 59.65% | 39.90% | 27.00% | 18.00% | 13.00% | 18.00% | 19.00% | 55.19% | 39.51% |
| Qwen3-4B-Base + MidTool-Mix + SFT | 66.38% | 57.74% | 36.00% | 23.00% | 19.50% | 28.00% | 26.63% | 56.95% | 50.25% |
| Qwen3-4B-Base + MidTool-Mix + SFT + RL | 76.44% | 58.48% | 34.50% | 24.50% | 20.50% | 31.00% | 27.63% | 60.10% | 54.18% |
| Model Setting | Airline | Retail | Telecom | Overall | ||||
| Pass@1 | Pass@4 | Pass@1 | Pass@4 | Pass@1 | Pass@4 | Pass@1 | Pass@4 | |
| Qwen3-4B | 21.00% | 32.00% | 16.23% | 35.09% | 3.51% | 5.26% | 11.87% | 22.30% |
| Qwen3-4B-Base + SFT | 17.50% | 34.00% | 9.43% | 24.56% | 3.73% | 10.53% | 8.54% | 20.50% |
| Qwen3-4B-Base + SFT + RL | 31.00% | 52.00% | 18.20% | 39.47% | 0.00% | 0.00% | 13.04% | 25.54% |
| Qwen3-4B-Base + MidTool-Mix + SFT | 17.00% | 38.00% | 20.83% | 47.37% | 1.54% | 4.39% | 12.23% | 28.06% |
| Qwen3-4B-Base + MidTool-Mix + SFT + RL | 20.00% | 40.00% | 33.55% | 57.89% | 6.36% | 18.42% | 19.96% | 38.49% |
| Model Setting | Browser Auto. | Financial | Location | Multi-server | Web Search | Overall | ||||||
| Score | Pass | Score | Pass | Score | Pass | Score | Pass | Score | Pass | Score | Pass | |
| Qwen3-4B | 19.42 | 5.88% | 9.17 | 7.50% | 43.51 | 2.86% | 16.17 | 0.00% | 0.00 | 0.00% | 16.05 | 3.35% |
| Qwen3-4B-Base + SFT | 15.44 | 2.94% | 5.00 | 5.00% | 38.98 | 0.00% | 13.67 | 0.00% | 0.00 | 0.00% | 13.20 | 1.68% |
| Qwen3-4B-Base + SFT + RL | 17.65 | 5.88% | 6.67 | 5.00% | 39.69 | 0.00% | 17.00 | 0.00% | 0.00 | 0.00% | 14.50 | 2.23% |
| Qwen3-4B-Base + MidTool-Mix + SFT | 21.81 | 8.82% | 14.27 | 12.50% | 46.81 | 2.86% | 19.50 | 0.00% | 0.00 | 0.00% | 18.66 | 5.03% |
| Qwen3-4B-Base + MidTool-Mix + SFT + RL | 19.73 | 8.82% | 38.33 | 37.50% | 49.50 | 0.00% | 16.17 | 0.00% | 0.00 | 0.00% | 23.80 | 10.06% |
| Mid-training Data | BFCLv3 | -Bench | MCP-Universe | |||||
| Non-live | Live | Multi-turn | Overall | Pass@1 | Pass@4 | Score | Pass | |
| No Mid-training | 59.94% +0.0 | 43.75% +0.0 | 15.50% +0.0 | 39.73% +0.0 | 8.54% +0.0 | 20.50% +0.0 | 13.20 +0.0 | 1.68% +0.0 |
| Dolmino-20BT | 61.44% +1.5 | 51.74% +8.0 | 16.13% +0.6 | 43.10% +3.4 | 7.37% -1.2 | 21.22% +0.7 | 5.41 -7.8 | 0.00% -1.68 |
| MidTool | ||||||||
| Processed data w/o traj. | 60.40% +0.5 | 52.60% +8.9 | 13.90% -1.6 | 42.30% +2.6 | 7.30% -1.2 | 21.90% +1.4 | 12.20 -1.0 | 3.03% +1.4 |
| + native agentic traj. | 68.21% +8.3 | 55.81% +12.1 | 18.75% +3.3 | 47.59% +7.9 | 4.23% -4.3 | 12.95% -7.6 | 6.80 -6.4 | 1.12% -0.6 |
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
| Slice | source-only | QA | QA traj. |
| web (6.86M) | 36.4% | 52.2% | 11.3% |
| pdf (1.34M) | 30.8% | 13.4% | 55.7% |
| code (2.60M) | 68.9% | 4.2% | 26.8% |
| Metric | Stat | web | code | native | |
| Turns | mean | 2.8 | 3.0 | 3.1 | 4.0 |
| median | 3 | 3 | 3 | 4 | |
| max | 15 | 17 | 8 | 69 | |
| Steps | mean | 5.3 | 7.1 | 6.0 | 3.8 |
| median | 5 | 6 | 5 | 4 | |
| max | 54 | 77 | 58 | 21 |
| Category | Calls | Share | Examples |
| Code execution / Shell / DevOps | 862K | 10.9% | run_command , kubectl_get |
| List / Get (generic) | 811K | 10.2% | list_tools , get_* |
| File / Filesystem | 380K | 4.8% | read_file , list_dir |
| Set / Update / Modify | 354K | 4.5% | set_* , configure |
| Add / Create | 348K | 4.4% | create_* , register_* |
| Search / Lookup | 335K | 4.2% | search , lookup |
| Hyperparameter | Value |
| Epochs | 1 |
| Max Sequence length | 8192 |
| Optimizer | AdamW |
| Learning rate | |
| Betas | |
| Weight decay | 0.01 |
| Hyperparameter | Value |
| Max Sequence length | 32768 |
| Optimizer | AdamW |
| Learning rate | |
| Betas | |
| Weight decay | 0.01 |
| LR schedule | cosine, warmup ratio 0.001 |
| Hyperparameter | Value |
| RL algorithm | GRPO |
| Total training steps | 64 |
| Learning rate | 4B: ; 8B: |
| Data Batch size | 32 |
| PPO Mini-batch size | 32 |
| Rollouts per prompt | 16 |
| Model | Tool Succ. | Overall | STEM | Med | Fin | Sprt | Gen |
| Llama4-Maverick ∗ | - | 0.1545 | 0.1875 | 0.1581 | 0.1182 | 0.1562 | 0.1524 |
| Gemma3-4B-pt + SFT | 0.5863 | 0.0567 | 0.0655 | 0.0600 | 0.0573 | 0.0564 | 0.0448 |
| Gemma3-4B-pt + MidTool-Mix + SFT | 0.7231 | 0.0661 | 0.0733 | 0.0765 | 0.0640 | 0.0563 | 0.0606 |
LLM Tool Use
Large language model tool use studies how models select, call, and coordinate external tools to extend their reasoning and take actions.
See all 295 papers