ToolSpace builds agent environments from the tools outward
ToolSpace mines tool-composition graphs from real execution traces and synthesizes only the environment those calls need. The reported gains are large, and the ablation on how tool links are obtained is the most useful result for anyone building agent training data.

Most pipelines for synthetic agent training data start in the same place: pick a theme, generate a database, derive tools that fit it, then write tasks. ToolSpace, a new paper from Renmin University of China, Fudan University and Shanghai Jiao Tong University, reverses that order. It starts from recorded tool calls and builds only as much environment as those calls require.
The benchmark gains are large, but I think the ordering is the real contribution. The ablation behind it is the part I would carry into my own pipeline.
Why the build order matters
When tools are derived from a synthetic database, they take their shape from that database. The paper names three consequences: tool interfaces drift from real ones, links between tools come from random linking or shallow LLM judgment, and tasks stay inside one sandbox. The third is the most structural. Tools from two independently synthesized environments share no typed relation, so nothing says a chain may cross between them.
The results are consistent with that diagnosis. Every 7-8B environment-scaling baseline in the paper scores under 10 on AutomationBench, τ³-Bench Banking, JobBench and Harvey LAB. The authors read this as models learning the form of a function call without learning composition.

How the graph gets built
The raw material is over 200,000 trajectories, drawn from live MCP servers and open corpora such as Toucan-1.5M, ToolBench, and SWE-agent and OpenHands runs. Lower-authenticity sources get stricter filtering. Adjacent calls are then linked by deterministic rules, with no LLM in the loop:
- Data edge: the next call's input uses a value from the previous output, with matching field types. A traceability check stops constants like
limit=10from creating false links. - State edge: the first call mutates an object, and the second reads or mutates that same object.
- Retry edge: a call errors, the trajectory switches tools, and the next call succeeds.
Edges are weighted by observed transition frequency and low-frequency ones are removed. The result has 77,760 nodes from 2,042 canonical tools, because the same tool with a different argument configuration counts as a different node. Data edges make up 69% of the graph, state 25%, retry 6%.
Clustering yields 804 environments, and only 181 of them (22.5%) contain a tool that can change state. Those get a synthesized database. State-query tools seed an initial snapshot from recorded outputs, and stateless tools replay cached returns. This is the instinct I know from physics: simulate the degrees of freedom that evolve, and leave the rest as boundary conditions.
Tasks come from walking the graph. At each step, the walk samples by edge weight among neighbors whose inputs can be filled from earlier returns or current state. If a step fails, the environment rolls back and another neighbor is tried. A language model then decompiles each surviving chain into a task with no tool names or call order, plus assertions on final state, intermediate snapshots and output fields. A sample survives only if the chain replays from the initial state and passes every check. Of the 34,376 synthesized trajectories, the 21,385 with at least five tool calls average 18.86 calls and 2.29 environments.
What the results show
Average score across the seven benchmarks:
| Backbone | Base | ToolSpace SFT | + Agent RL |
|---|---|---|---|
| Qwen3-8B | 7.2 | 19.6 | 20.7 |
| Qwen3.6-35B-A3B | 23.0 | 41.0 | 43.2 |
| GLM-5.2 (744B) | 44.6 | 56.6 | not reported |
The 56.6 ties Claude Opus 5 on average, but the profile differs: 54.7 against 45.6 on AutomationBench, 57.5 against 68.0 on JobBench. Gains are also uneven. The 35B model goes from 8.2 to 45.8 on AutomationBench and from 0.8 to 1.7 on Harvey LAB.
The ablation at 35B is the result I trust most, because it changes one thing at a time. Replacing execution-witnessed edges with LLM-judged ones takes AutomationBench from 45.8 to 37.8, τ³-Bench Banking from 34.0 to 26.7 and BFCL V4 from 74.3 to 66.9. By my arithmetic that averages 6.8 points across the five benchmarks, close to the 7.1 lost by deleting state edges entirely. A link that merely looks right costs about as much as missing a whole class of dependency.
Scaling has not visibly flattened. Going from half the data to all of it still adds 4.6 points on AutomationBench, and going from 1/16 to 1/8 of the environments moves the same benchmark from 9.2 to 33.8.
The same pipeline also produces harder benchmarks: AutomationBench Pro (300 tasks) and τ³-Bench Banking Pro (98 tasks), reviewed by three experts with Fleiss' κ of 0.82. Claude Opus 5.5 falls from 59.2 to 26.3 on AutomationBench Pro, and the largest drop across seven frontier models is 38.2 points.
Where I would read carefully
- Beating the teacher. The authors take the 744B model's lead over its Kimi K3 teacher (56.6 against 49.7) as evidence against simple distillation. But teacher trajectories are filtered by the verifier, and the student starts from a different base model, so that comparison proves less than it appears to. The stronger evidence is the relevance test: training on the top-50% most relevant environments and on a random 50% differ by at most 1.7 points on four benchmarks. τ³-Bench Banking is not part of that claim.
- Pro scores measure difficulty, not validity. Assertions derive from one chain, and some check intermediate snapshots. I would want to know how often a correct alternative route fails them. The expert review covers quality, but I did not see that false-negative rate reported. Table 2 also lists frontier models only, so ToolSpace-trained models are not scored on Pro there.
- Replay under exploration. Cached returns serve matching calls. The main text does not say what an RL rollout receives when it sends arguments that were never recorded. Even a short RL run can generate unseen arguments, and undefined cache-miss behavior could invalidate rewards and the conclusions drawn from training, so I would want that behavior specified.
- Cost. The 55.3% saving (1,218 files against 2,724 across 500 sampled environments) is a file count. The authors say plainly that token, time and compute savings were not measured.
What I would take from it
If you build agent training data, you may not need the full system to use the idea. Log tool calls with their arguments and returns, redact credentials and personal data before storage, restrict who can read the traces, and treat the redacted logs as a training asset. Separate tools that mutate state from those that only read. Let rules, not a model's opinion, decide which calls connect. Require replay from a clean state before any sample enters the set.
The authors link code, models and an interactive walk demo. The demo is the quickest way to build intuition for what a rollback looks like in practice.