Google researchers have proposed generating agent-training data backwards: establish a working sequence of API calls first, then write the user request that the sequence answers. ToolGrad replaces the common query-first method, which can waste substantial effort searching for a solution to a synthetic prompt.

The framework repeatedly proposes possible APIs, executes candidates in parallel, selects the best successful call and updates the synthetic query and answer. Plain-language feedback from each round acts as a “textual gradient,” guiding the next extension of the workflow. The final example contains a user request, a verified tool chain and its response.

Using a database of more than 16,000 APIs from ToolBench, the team reports that ToolGrad produced longer, more complex workflows at lower cost and with an almost 100 percent pass rate. It then created a 500-example dataset to fine-tune Gemma 3 models. On the Berkeley Function Calling Leaderboard, the 12-billion-parameter version scored 83.1 on an unseen tool set, close to Gemini 2.5 Pro’s reported 83.2 and above several comparison models.

Those numbers measure a controlled benchmark, not reliability in open-ended production systems. Even so, answer-first generation could reduce the expensive trial-and-error stage when teams need verified examples for teaching models to use tools.