← Latest papers
🤖 AI

MidTool: Mid-training Data Synthesis for Agentic Tool Use

This paper introduces MidTool, an open corpus construction pipeline that synthesizes diverse data to enable dedicated mid-training for large language models, demonstrating that this approach significantly enhances general agentic tool-use capabilities compared to relying solely on post-training.

Original authors: Fengqing Jiang, Yite Wang, Boyi Liu, Zhaoyang Wang, Canwen Xu, Zhewei Yao, Radha Poovendran, Yuxiong He

Published 2026-08-21
📖 6 min read🧠 Deep dive

Original authors: Fengqing Jiang, Yite Wang, Boyi Liu, Zhaoyang Wang, Canwen Xu, Zhewei Yao, Radha Poovendran, Yuxiong He

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Large language models are the engines behind a new generation of digital assistants, capable of reading, writing, and reasoning with human-like fluency. For these systems to be truly useful, they must do more than just answer questions; they must be able to act. This means knowing when to reach for a tool, such as a calculator, a search engine, or a software interface, and then using it correctly to solve a problem. In the current landscape of artificial intelligence, researchers have largely treated this ability to use tools as a final step in training. They take a powerful, pre-trained model and then teach it specifically how to call functions or interact with software through a process of fine-tuning. However, this approach places a heavy burden on that final stage, forcing the model to learn complex behaviors like planning a sequence of actions or recovering from missing information all at once, often without a deep foundation of how those tools actually work in the real world.

A team of researchers from the University of Washington and Snowflake has proposed a different path. They suggest that the ability to use tools should be cultivated earlier in the model's life, during a middle stage of training that sits between the initial broad learning and the final specialized instruction. They call this process "mid-training." To test this idea, they built a massive, custom dataset designed specifically to teach models how to interact with tools. They named their project MidTool. By feeding this specialized data to their models before the final training steps, they discovered that the models learned to use tools more effectively, with a better understanding of how to plan actions and handle errors, than models that only received the standard final training.

The researchers began by gathering a diverse collection of materials that contain the raw knowledge of how tools work. They did not just look for examples of tools being used; they collected the manuals, the code, the documentation, and the technical specifications that describe how these tools are supposed to function. This included millions of web pages, thousands of technical documents in PDF format, vast repositories of computer code, and structured definitions of real-world application programming interfaces. They treated these sources as the "textbooks" for their AI students. From this raw material, they created a training mixture containing 20.3 billion tokens, a measure of the amount of text processed. This mixture was carefully balanced, drawing roughly 42 percent from web documents, 26 percent from code, 23 percent from PDFs, and 9 percent from direct, synthesized examples of agents using tools.

To turn this static collection of documents into a dynamic learning experience, the researchers used a two-pronged approach to generate training examples. The first method focused on grounding. They took technical documents and code and asked the model to imagine scenarios where a user would need to use the tools described in those texts. The model had to learn to read a messy manual or a complex code snippet, identify what tools were available, and figure out what information was needed to use them. This taught the model to recognize the "affordances" of a tool—what it is capable of doing—based on context. The second method focused on execution. Here, the researchers used real tool definitions to generate step-by-step stories of an agent solving a problem. These stories included the agent making a plan, calling a tool, receiving a response, and then deciding what to do next. Crucially, these examples also included scenarios where information was missing or the tool failed, teaching the model how to recover and ask for clarification rather than giving up or guessing.

The team tested this approach using two versions of a base language model, one with 4 billion parameters and another with 8 billion. They trained these models on their new MidTool dataset and then applied the standard final training steps used by other researchers. They then put the models to the test on three different benchmarks designed to measure how well an AI can use tools. These tests ranged from simple single-step commands to complex, multi-step tasks that required the model to interact with real software environments. The results showed a clear pattern: the models that received the mid-training consistently outperformed those that did not. The improvement was most noticeable in the hardest tasks, particularly those requiring multiple steps or the ability to handle unfamiliar tools. For instance, on a test measuring the ability to use tools in a multi-turn conversation, the 4-billion-parameter model saw its score jump by more than 10 points compared to a model that only received the final training.

The study also revealed the limits of this approach. While the mid-trained models became significantly better at general tool use, they did not become experts at every type of task. When tested on a specific benchmark involving deep, iterative web search, the models did not show the same level of improvement. This suggests that while a general foundation helps with understanding how to use tools and following instructions, highly specialized behaviors like deep research or complex exploration may require their own dedicated training data. The researchers found that the mid-training provided a strong, stable base that made the subsequent final training more efficient. The models learned to converge faster and reached higher levels of performance, indicating that the mid-training stage helped them build a better internal understanding of how tools fit together.

This work challenges the prevailing assumption that tool use is simply a skill to be added at the very end of a model's development. Instead, it suggests that the capacity to interact with the world through tools is a fundamental capability that benefits from being woven into the model's core knowledge. By exposing the models to the structure of tool documentation and the logic of tool workflows early on, the researchers created a system that is more robust and adaptable. The findings imply that for the next generation of AI agents to be truly effective, their training must include a dedicated phase where they learn not just what tools exist, but how to recognize them, plan with them, and recover when things go wrong. This middle stage of training appears to be the key to unlocking a more natural and reliable form of agency in artificial intelligence.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →