AI Tools Developer Tools

ToolGrad: Google’s Answer-First Way to Make Training Data for AI Agents

Google's ToolGrad builds working tool-call chains first and questions second, making agent training data cheaper.

Abstract network diagram representing the ToolGrad framework release for tool-use data generation
AI-generated editorial illustration.

AI agents are useful because they can use tools: run a web search, read a file, call an API. Language models are not born knowing how to do that well. They learn from examples, and good examples are hard to make. A team at Google has published a method, called ToolGrad, that makes those examples in reverse order. The work was presented at ACL 2026 and described on the Google Research blog on September 10, 2026.

The Problem With Tool-Use Training Data

To teach a model to use tools, researchers need many examples of a user’s request paired with the right sequence of tool calls. Writing them by hand does not scale. The authors had done that for earlier work and say it is impractical for serious fine-tuning.

The usual automatic method, used by projects such as ToolBench and ToolACE, starts with the question. A model invents a plausible user request, and then an agent searches by trial and error for a chain of API calls that answers it. Many of those searches fail. The blog post calls the approach “inherently inefficient” because a lot of exploration produces few usable examples.

The ToolGrad Framework: Answer First

ToolGrad flips the order. It first builds a chain of tool calls that actually works. Only then does it write the user request that the chain answers. The reasoning is simple: a finished, working solution says more about what the question should be than a question says about its solution. Writing the question takes a single model step.

The chain is built step by step. ToolGrad borrows an idea called textual gradients. In normal machine learning, a gradient is a number that tells a model which way to adjust. A textual gradient is written feedback from another model that plays the same role, pointing toward a better version.

Each round has four parts:

  • Proposer. Picks a few promising APIs from a larger sample that could extend the current chain.
  • Executors. Run those candidate calls in parallel and write a report on each result.
  • Selector. Reads the reports and chooses the single best call to add. This choice acts as the textual gradient.
  • Updater. Rewrites the user request and the final answer so they match the longer chain.

Repeating these rounds produces one training example: a request, a verified sequence of API calls and a final response.

What the Results Show

The team used ToolBench’s library of more than 16,000 real-world APIs. Compared with the question-first search method, the researchers say ToolGrad produced longer, more complex tool chains at a lower cost and with a near-perfect success rate. A results table in the post shows a 99.8% pass rate.

With this method they built a small dataset of 500 examples, called ToolGrad-500, using Gemini 2.5 Flash-Lite. They then fine-tuned Google’s open Gemma 3 models at three sizes, 1B, 4B and 12B parameters.

They tested the results on the Berkeley Function Calling Leaderboard, which uses a different set of tools than the training data. The fine-tuned models improved at every size. The 12B model scored 83.1. The blog post compares that with 83.2 for Gemini 2.5 Pro, 82.8 for Claude 4.5 Opus and 74.4 for GPT-5, the leading proprietary models at the time of publication.

The authors also point out a “student beats teacher” effect. The data came from Gemini 2.5 Flash-Lite, yet the Gemma 3 12B model trained on it outperformed Flash-Lite itself.

Trying It Yourself

The code is on GitHub under the Apache-2.0 license. A quick demo needs no GPU. It runs ToolGrad against a Model Context Protocol (MCP) file-system service and needs only a Gemini API key. Reproducing the benchmark scores and fine-tuning the Gemma models requires a GPU; the authors verified it on a single NVIDIA A100 with 40 GB. Generating a full new dataset also needs a ToolBench API key.

Questions for Teams Building Agents

  • Do the tools in the team’s own product resemble the public APIs ToolGrad was tested on?
  • Is a small, specially trained model enough, or does the task still need a large general one?
  • How will generated examples be checked for requests real users would never make?

The comparison with proprietary models is from the time the paper was published, and newer models have appeared since. The more lasting point is the method: making agent training data can be cheaper when the working answer comes first.

Sources