ToolGrad: Efficient Tool-use Dataset Generation with Textual “Gradients”
Generate the successful tool-use workflow first, then synthesize the user query around it.
Key takeaway
ToolGrad uses proposer, executor, selector, and updater modules to build verified API workflows; its ToolGrad-500 dataset reaches a 99.8% generation pass rate and trains compact Gemma-3 models that perform strongly on tool-use benchmarks.
Updated on Oct 2, 2026
01
Abstract
ToolGrad reverses the conventional tool-use data-generation direction: it first constructs a verified API workflow, then synthesizes a coherent user query and response around that executable artifact. This reduces wasted search and produces richer tool-use trajectories.
02
Introduction
Tool-use datasets are expensive because conventional generation starts with a query and must discover a valid API execution path. ToolGrad instead conditions query generation on a concrete successful workflow.
03
Problem
Query-first generation can fail while searching for executable API chains, waste tool calls, and favor short trajectories. The challenge is to generate diverse, valid, and coherent multi-step tool-use examples efficiently.
04
Background
ToolGrad connects synthetic data generation, API planning, executable workflow verification, and textual feedback. Its “textual gradient” terminology describes discrete selection from execution evidence rather than a numerical gradient.
05
Methodology
Each iteration proposes candidate APIs, executes them in parallel, selects the most valuable API and chain extension, and updates the workflow. Once the workflow is established, an LLM regenerates the query and response so the complete sample remains coherent.
ToolGrad answer-first generation
Official Google Research figure contrasting query-first tool search with ToolGrad API mini-batch construction.
Google Research ToolGrad official project article
ToolGrad workflow
Official figure showing proposer, executor, selector, and updater stages.
Google Research ToolGrad official project article
Generation efficiency comparison
Original result table comparing DFS and ToolGrad generation efficiency.
Google Research ToolGrad official project article
Formula notes
Mathematical details
ToolGrad dataset representation
A training sample contains a user query q, an API workflow W, and a response r.
- W
- -API workflow composed of chains
- q
- -user query
- r
- -response conditioned on the workflow
API proposal
The proposer filters a random API mini-batch into at most m candidates for extending the current workflow.
- m
- -maximum number of API proposals
- bs
- -API mini-batch size
- W_t
- -current workflow
API selection
The selector chooses the API with the highest hypothetical value based on execution reports and the current workflow; in practice an LLM acts as the proxy for V.
- V
- -hypothetical value function
- j
- -selected API index
- rep_i
- -execution report for candidate i
06
Architecture
The generation loop contains API Proposer, parallel API Executors, API Selector, and Workflow Updater. The final artifact is a user query, verified API workflow, and response.
07
Dataset
The work generates tool-use data from a large API library and evaluates models fine-tuned on ToolGrad-500 against ToolBench and BFCL.
08
Training
ToolGrad is a data-generation method rather than a new foundation-model training algorithm. Generated ToolGrad data is subsequently used to fine-tune tool-using models.
09
Experiments
The authors compare ToolGrad against DFS-based ToolBench generation and evaluate ToolGrad-500 fine-tuned models on ToolBench and BFCL. Generation is assessed with pass rate, ground-truth tool uses, LLM cost, and tool cost.
10
Baselines
DFS-based ToolBench generation is the primary data-generation baseline, while ToolBench and BFCL provide evaluation baselines for tool-use quality.
11
Results
The reported findings indicate that reverse workflow construction can generate valid multi-step tool-use data more efficiently while retaining useful diversity and producing improvements on downstream tool-use evaluations.
12
Ablation
API proposal, parallel execution, API selection, and workflow updating are the principal components. Their roles can be separated by measuring generation success, cost, trajectory length, and downstream tool-use quality.
13
Limitations
Generated quality depends on the API library and execution environment. Synthetic workflows can inherit tool-coverage biases, and downstream gains depend on how representative generated tasks are of real tool use.
14
Conclusion
ToolGrad demonstrates a reverse-annotation strategy: build the executable tool workflow first, then generate the natural-language interaction around verified behavior.
15
References
ToolGrad primary paper; Findings of ACL 2026; ToolBench and BFCL; Google Research ToolGrad materials and associated dataset/model releases.
Source trail
Primary papers, implementation pages, and external source records used to ground this explainer.
ToolBench
Query-first tool-use dataset generation and DFS-based solution search used as the principal baseline.
TextGrad
Textual-gradient optimization provides the conceptual analogy used by ToolGrad.
ReAct: Synergizing Reasoning and Acting in Language Models
Agent reasoning-and-acting framework discussed in the paper and related tool-use literature.
01arXiv v302ACL Anthology Findings of ACL 202603Google Research ToolGrad04Official GitHub repositoryContinue reading
Related research
GitSwarm
GitSwarm turns inference-time work into a persistent, branchable body of reusable contributions that later agents can build on.
AI AgentsLongHarness
LongHarness helps agents reason over 100M-token document collections by keeping evidence and conclusions as explicit, revisable states that guide one another.
AI AgentsGenerative Agents
An agent architecture combining memory, retrieval, reflection, and planning to simulate believable long-horizon behavior.