智能体
research.google ·
ToolGrad:用文本“梯度”高效生成工具使用数据集
Google Research 在 ACL 2026 提出 ToolGrad,反转传统数据生成流程:先生成 ground-truth 工具调用链,再反向标注对应的用户 query,只需一步 LLM 调用。相比 ToolBench、ToolACE 用 DFS 智能体试错搜索工具路径的做法,该方案声称能以更低成本生成更复杂的长程工具使用数据,训练出的 LLM 在含未见工具的 OOD 数据集上表现优于基线,并接近 SoTA 专有 LLM。方法借鉴 TextGrad,用 LLM 评论者给出的文本反馈(“文本梯度”)迭代优化工具链。
AI推荐理由 Google Research 官方博客介绍 ACL 2026 论文 ToolGrad,提出先由 LLM 生成工具调用链、再反向标注用户 query 的数据生成范式,并借用 TextGrad 的文本梯度做迭代优化。相比 ToolBench/ToolACE 的 DFS 试错搜索,该方法声称成本更低、可生成更长程工具使用数据,且训练出的模型在未见工具的 OOD 数据集上接近 SoTA 专有 LLM。属于有论文支撑的方法创新,对 Agent 工具使用训练数据构建有直接参考价值;但正文为摘要片段,具体实验数字与开源情况未给出,效果仍需以论文为准。
82
正文
ToolGrad: Efficient tool-use dataset generation with textual "gradients"
September 10, 2026
Zhongyi Zhou, Research Scientist, and Ruofei Du, Interactive Perception & Graphics Lead, Google XR
ToolGrad is a data generation framework that reverses the traditional paradigm by first generating tool-use answers before user queries. We show this design enables LLMs to achieve better tool-use performance.
Quick links
Paper
ToolGrad
Share
Copy link
×
AI agents have shown great potential in automating real-world tasks, such as conducting a Google Search, reading local computer files, or executing generated Python scripts. To achieve such agentic workflows, LLMs need to learn how to use tools correctly and efficiently. To teach large language models tool uses, we need datasets of tool-use chains and their corresponding user queries. In our prior work introduced in InstructPipe, we manually annotated our evaluation data, but it is impractical to scale up the human annotation for advanced LLM fine-tuning workstreams. To streamline the data workstream, prior work, e.g., ToolBench and ToolACE, explored using an agent to automatically search a tool-use path with trial and error. This representative annotation approach involves two steps: (1) generate a hypothetical user instruction from a sampled API pool, and (2) use a depth-first search (DFS) agent to find its tool-use solution. This approach is inherently inefficient because its core concept is to distill valuable trajectories from a complex agent exploration for training an LLM.
In “ToolGrad: Efficient Tool-use Dataset Generation with Textual ‘Gradients’”, presented at ACL 2026, we introduce an alternative solution paradigm. ToolGrad first generates a ground-truth tool-use chain and then annotates its corresponding user prompt. Intuitively, an explicit tool-use solution provides more unambiguous information than a prompt, making the annotation, from tool usage to the use query, much easier and requiring only one LLM step. Our result shows that our answer-first approach can generate more complex (long-horizon) tool-use data with lower cost. LLMs trained on our generated data also outperform those trained on baseline methods, and even match SoTA proprietary LLMs on out-of-distribution (OOD) datasets with unseen tools.
While prior art generates tool-use datasets by searching solutions of user queries with low pass rate, ToolGrad generates successful tool-use chains before generating prompts, yielding high pass rate.
Iterative tool-use chain generation with textual “gradients”
Standard machine learning (ML) systems improve by computing numerical loss gradients across mini-batches of training samples, which are then used by an optimization algorithm to update model weights. Recently, TextGrad adapted this paradigm for prompt engineering using an LLM critic to provide rich, descriptive feedback in plain text — feedback called “textual gradients”. These textual gradients then guide the refinements of a given prompt into a new draft that can better resolve the target task.
ToolGrad adapts the concept of textual gradients from prompt optimization to synthetic dataset generation. Rather than optimizing a static text prompt, ToolGrad uses these gradients to iteratively construct complex, valid API workflows from large tool libraries.
Comparing the optimization components of ToolGrad to traditional ML and TextGrad.
The ToolGrad framework
ToolGrad features four core modules that sequentially propose, execute, select, and update.
API Proposer: In each iteration, this module narrows down a sampled set of APIs into a few promising candidates to extend the current workflow.
API Executors: These test the selected APIs in parallel and generate detailed execution reports.
API Selector: This module reviews the execution reports and selects the single best-performing API call — acting as a textual gradient that provides directional feedback for improvement — and appends it to the workflow.
LLM Updater: Finally, this module revises the synthetic user query and AI response to match the new API set.
Repeating this iterative process results in a data sample consisting of a user query, a verified API workflow, and the final AI response.
ToolGrad generates successful tool-use chains before generating prompts, yielding a high pass rate.
Experiments
Data generation efficiency
We first evaluate the cost and quality of the data generation. We use ToolBench as our API database, consisting of 16k+ real-world APIs, to generate our tool-use dataset. We compare the original query-first data generation approach on ToolBench, using depth-first search (DFS), with our answer-first approach, ToolGrad. The results demonstrate that ToolGrad can generate more complex tool-use data with higher pass rate, using lower generation cost.
Generation efficiency comparison between the query-first approach (baseline) and the answer-first approach (ours).
Berkeley function calling leaderboard
We generated small-scale tool-use datasets called ToolGrad-500, using API databases from ToolBench. We then fine-tuned Gemma-3 models (1B, 4B and 12B) using ToolGrad-500, and we called these fine-tuned models ToolGrad-1B, ToolGrad-4B and ToolGrad-12B. We evaluated these models' tool-use performance on Berkeley Function Calling Leaderboard (BFCL), a tool-use benchmark with a different tool set from ToolBench. We compare our fine-tuned models against (1) base models without fine-tuning, (2) SoTA proprietary models (Gemini, GPT and Claude), and (3) SoTA tool-use specialized models (ToolACE, Hammer-2.1-7B).
The following summarizes our findings.
Consistent improvements over baselines: Post-training Gemma-3 models on ToolGrad-500 can clearly enhance its tool-use performance across all tested parameter sizes.
Outperforming proprietary LLMs: The ToolGrad-12B model demonstrates exceptional capability with its score of 83.1, making it highly competitive with the industry's most advanced proprietary models at the time of publication, gemini-2.5-pro (83.2), claude-4.5 Opus (82.8) as well as gpt-5 (74.4).
Self-evolving: The ToolGrad-500 dataset is generated using gemini-2.5-flash-lite. Interestingly, we find Gemma-3-12B fine-tuned on data generated by gemini-2.5-flash-lite can outperform its original “teacher model”.
Outperforming other open-sourced models: ToolGrad-12B establishes a clear lead compared to other open-sourced tool-use specialized models, including ToolACE, which was fine-tuned on a more advanced API database.
BFCL evaluation results on Gemma-3, ToolGrad models, Gemini 2.5 series, GPT-5, Claude-4.5, ToolACE and Hammer-2.1-7B models.
Conclusion and future directions
ToolGrad demonstrates that high-quality tool-use datasets can be generated more efficiently and reliably through an answer-first paradigm. By designing an agentic framework that iteratively chains APIs via textual gradients, ToolGrad addresses the longstanding cost and scalability bottlenecks in producing ground-truth data. Our design achieves almost 100% pass rate in data generation, enables relatively compact models to perform exceptionally well, and shows that student LLMs can even surpass their teachers.
Looking ahead, this research can be expanded to broader, real-world applications by scaling the framework to handle increasingly dynamic and vast API ecosystems. Future work will also explore extending this self-evolving capability to support continuous, on-the-fly learning for personalization over time. As agentic workflows become increasingly embedded in enterprise and everyday tasks, frameworks like ToolGrad lay the essential groundwork for training digital agents that are both highly capable and economically scalable to deploy.
Acknowledgements
This research was primarily conducted by Zhongyi Zhou during his Visiting Researcher tenure at Google. We extend our sincere gratitude to key contributors, Kohei Uehara, Haoyu Zhang, Jingtao Zhou, Lin Gu, Zheng Xu, Tatsuya Harada, for their support, and to Adarsh Kowdle and Shahram Izadi for their strategic guidance and thoughtful reviews.
Labels:
Machine Intelligence
Natural Language Processing
Quick links
Paper
ToolGrad
Share
Copy link
×
Other posts of interest
September 3, 2026
Transfer learning for genomic prediction in underrepresented populations
General Science
·
Machine Intelligence
September 3, 2026
A connectomics milestone: Mapping the complete male fruit fly brain
General Science
·
Health & Bioscience
·
Machine Intelligence
·
Open Source Models & Datasets
September 1, 2026
Mapping global methane emissions from space with deep learning
Climate & Sustainability
·
Earth AI
·
Machine Intelligence
×
❮
❯
A table showing ToolGrad outperforming ToolBench by achieving a 99.8 percent pass rate with fewer optimization steps.
A table comparing the optimization components of Machine Learning, TextGrad, and ToolGrad across four key dimensions.
A diagram showing ToolGrad's sequential API mini-batch method achieving a high annotation pass rate compared to failing prior art.
A flowchart illustrating the ToolGrad workflow, where APIs are proposed, evaluated, and sequentially integrated to update a query and workflow.
A bar chart showing ToolGrad consistently improving the tool-calling benchmark scores of 1B, 4B, and 12B base models.