Study in a nutshell
ToolGrad produced a usable example in 99.8% of attempts. Generation used 20 tool steps on average, compared with 34.3 for the question-first approach.
Suppose you want to teach an AI to answer “Will I need an umbrella at the stadium tomorrow?” You write the question, then discover that your stadium directory gives street addresses while your weather service needs coordinates. What looked like a simple exercise is missing a step.
ToolGrad starts at the other end. It tries out the tools, builds a sequence that works, and writes a question that the sequence can answer. In a study by Zhongyi Zhou and colleagues, 99.8% of attempts produced a usable training example, compared with 63.8% for a method that started with the question. The examples also contained more tool uses on average.
What is a textual “gradient”?
An AI uses a tool by sending a request to another program through an interface called an API. One program might supply a stadium address, another might convert it into coordinates, and a third might return a forecast. Each result gives the next program something it can use.
ToolGrad proposes a small group of possible next tools, tries them, and gives a language model the reports of what happened. The model picks a useful tool and indicates where it belongs in the workflow. That choice is what the authors call a textual “gradient”. In ordinary machine learning, a gradient gives a mathematical direction for an adjustment. Here, the direction is a decision such as “add the address lookup to this chain.” The workflow grows, and the system updates the question and reply to fit it.

Fewer dead ends, longer worked examples
The comparison method used depth-first search. Starting from a question, it followed one possible sequence of tools and could backtrack to try another. If those attempts failed, the system had spent effort on a question without producing a worked answer.

The difference between making an example and solving one is crucial here. The 99.8% figure describes how often ToolGrad could produce a worked example of its own. A separate test was needed to find out what another AI could learn from those examples.
| Measure | Question first | ToolGrad |
|---|---|---|
| Tool uses in the reference solution | 2.1 | 3.4 |
| Tool-use steps during generation | 34.3 | 20.0 |
| Language-model calls during generation | 64.5 | 63.9 |
The saving came mainly from testing tools: about 42% fewer tool-use steps during generation. The number of language-model calls barely changed. These counts explain where the method saved work. A dollar saving would also depend on which tools and models were used.
What did the smaller models learn?
The team used its roughly 500-example collection, ToolGrad-500, to give three sizes of Google’s Gemma 3 model additional training. Then it tested them on ToolBench-I3, which poses tasks involving tools from different categories. All three improved when asked to produce a solution in one turn. The largest went from a score of 9.8 to 19.6. The middle-sized model reached 17.6, tying the strongest reported result for its counterpart trained on ToolBench.

The unanswered question is what people actually ask
Building an exercise around tools that work gives the learner a usable answer key. It also lets the exercise writer choose the question. A real user might ask for a stadium forecast a year in advance, or leave out which stadium they mean. Those cases call for different skills: recognizing a missing detail, asking a follow-up question or explaining a tool’s limits.
There was some evidence of transfer. On a second benchmark, the Berkeley Function-Calling Leaderboard, all three models improved on single-turn tasks, including requests drawn from real users. Gains were larger on its synthetic portion. The authors also identify a gap in the training examples: they record tool workflows without the reasoning examples needed for some step-by-step agent methods. The strongest conclusion is about how to produce and learn from worked examples. Recognizing when a real question has no workable answer remains a separate challenge.
Conclusion
Starting with a working solution reduced wasted attempts and produced examples that helped all three tested models. The harder question for a deployed assistant is how to respond when a user asks for something its tools cannot deliver.
Frequently asked questions
It measures successful creation of a training example. Separate benchmarks assessed the models trained on those examples.
It is a model’s choice of which tool to add and where it fits, based on reports from tools the system tried.
Read the original research paper
Related study · Why telling an AI how many searches it has left can improve its answers
Explore more Google research papers explained.