
An answer-first approach to generating efficient tool-use datasets for AI agents
ToolGrad introduces an answer-first framework for generating synthetic tool-use data, reversing traditional search-based paradigms. By utilizing textual gradients to iteratively build API workflows, models fine-tuned on this data achieve competitive performance against leading proprietary systems.
Published by Jin · 2 min read · 11 SEPT 2026
- Zhongyi Zhou and 7 other authors
- ToolGrad-500

As AI agents become increasingly responsible for executing real-world tasks—such as navigating web searches, reading local files, or running generated scripts—large language models must learn to use tools both correctly and efficiently. Traditional data generation methods often rely on a query-first approach, using search algorithms like depth-first search to find tool paths for randomly sampled instructions. This process is frequently expensive and inefficient.
Presented at ACL 2026, a new framework called ToolGrad reverses this paradigm. It generates a verified tool-use chain first, and only then derives the corresponding user prompt. This design provides unambiguous ground-truth information, streamlining the annotation process into a single step and enabling the creation of long-horizon tool-use data at a significantly lower cost.
Adapting textual gradients for synthetic data

Machine learning models traditionally improve by calculating numerical loss gradients across mini-batches. Building on prior prompt engineering techniques that use descriptive plain-text feedback, ToolGrad applies the concept of textual gradients to dataset generation. Rather than optimizing static prompts, it uses these gradients to construct valid API workflows from extensive tool libraries iteratively.
Source — Original announcement ↗
Worth a read?

Comments · 0