AI guides

ToolSpace synthesizes cross-environment tasks from tool dependencies for long-horizon agents

By 董冠霆、孙志超与杨欣羽1 viewsSource: 机器之心
ToolSpace tool-centric cross-environment task synthesis

Researchers from Renmin, Fudan and other universities introduce ToolSpace, building tool-composition graphs from execution traces to synthesize verifiable tasks. Its 744B model averages 56.6 on the paper's seven benchmarks, matching the listed Claude Opus 5 average.

Must building training environments for agents start with a database? Existing synthesis methods typically center on data: first generate databases and business scenarios, then construct tools and tasks. Along that path, however, tool interfaces and parameter logic may depart from real definitions, combinations may lack execution evidence, and tasks often remain confined to one environment. Real-world work, however, needs to cross these boundaries. To familiarize agents with tool calls across environments, training tasks need to cover the transfer of data, the linking of states, and the orchestration of tools between different environments.

Researchers from Renmin University of China, Fudan University and Shanghai Jiao Tong University propose ToolSpace, a tool-centric framework for synthesizing cross-environment agent environments. It has two core stages. (1) Tool-space exploration: extract tools from execution traces, build a tool-composition graph and organize environments and underlying data by tool relationships, giving combinations traceable execution evidence. (2) Cross-environment verifiable-task synthesis: perform state-aware random walks over the graph, turn successful call chains into natural-language tasks and verification scripts, and select replayable samples by difficulty and cross-environment scope.

Article illustration

Figure 1: ToolSpace overview. Environments are organized from tools and execution dependencies to synthesize cross-environment tasks for training data and Pro benchmarks. (Paper Figure 1)

The video below demonstrates ToolSpace's complete workflow.

Article illustration

The researchers validate it through training and evaluation:

  • Improvements across seven long-horizon tool benchmarks: training with ToolSpace's synthetic data produces consistent gains. ToolSpace-744B-A40B's aggregate performance rises from 44.6 to 56.6, matching Claude Opus 5.
  • More challenging upgraded benchmarks: AutomationBench Pro and τ³-Bench Banking Pro test sustained execution in workflows more complex than their standard versions.

Article illustration

  • Paper title: ToolSpace: Scaling Tool-Centric Environment Synthesis for Long-Horizon Agents
  • Paper: https://arxiv.org/pdf/2611.05036
  • Project page: https://toolspace-agent.github.io/
  • Code: https://github.com/dongguanting/ToolSpace
  • Model collection: https://huggingface.co/collections/dongguanting/toolspace

ToolSpace:

Connecting tools into a universe and synthesizing environments on demand

1. Tool-space exploration

ToolSpace treats tools as the basic units of agent task execution. It first reconstructs connections supported by execution evidence, groups closely related tools into environments and supplies underlying data for operations requiring persistent state. It then explores cross-environment call chains on the tool graph, converting executable chains into tasks. Tool relationships drive the entire process.

Article illustration

Figure 2: ToolSpace's two stages. First build tool space from execution traces and environments on demand, then generate cross-environment tasks through state-aware walks.

Modeling the tool-composition graph. ToolSpace collects more than 200,000 agent–tool interaction traces from real MCP services, open tool-use corpora and real workspace records. Execution authenticity differs across sources, so filtering is stratified. For synthetic-environment traces, it retains only calls whose tool names and parameter structures match the corresponding real tools.

With the trajectories available, the next step is to identify dependencies between tools. The same tool, given a different set of parameters, may produce different results or lead to different subsequent operations, so the nodes in the graph record both the tool and its normalized parameter configuration. The system then uses deterministic rules to extract three types of connections from adjacent calls.

1. Data dependencies track how results pass onward. A step may return a file ID that the next uses to read the file. Downstream inputs must use upstream output values with matching field types.

2. State dependencies track how operations change later conditions. One step may modify a record and the next read or further modify that object. Identifying the connection requires checking continuity of the object and its state.

3. Retry dependencies record recovery after failure. When a call returns an error, the trace switches tools and the next call succeeds, both the recoverable error and subsequent successful call are retained.

Rules identify these connections, and edge weights reflect observed transition frequencies. Low-frequency edges are filtered, and downstream parameters on candidate data edges must be traceable to upstream outputs, reducing incidental matches such as limit=10.

On-demand environment-data synthesis. ToolSpace clusters by tool-connection density and organizes environments with real MCP service configurations. Environments with creation, modification or deletion tools require underlying databases, checked through unit tests and state-change tests. Partial states returned by query tools can initialize environments; stateless tools reuse cached results for matching replay calls. Database synthesis thus focuses on environments that actually maintain and change persistent state.

2. Cross-environment verifiable-task synthesis

State-aware random walks. The tool-composition graph supplies possible directions, but whether execution can continue depends on current state. Starting from a node bound to an initial snapshot, ToolSpace checks whether the next inputs are available from earlier results or current state and whether preconditions hold, then samples a successor tool by edge weight. More frequently observed connections receive higher sampling probability.

Backtracking sampling: after selecting a next step, the system executes the tool and updates state. If the call fails or its result does not match the required data/state relationship, it restores the pre-execution snapshot and selects another path. Chains that remain blocked after repeated backtracking are discarded. Target call length and number of environments crossed control workflow complexity.

Article illustration

Figure 3: A state-aware walk in the interactive project demonstration: six environments, 28 tool calls and two backtracks, passing replay verification.

Reverse synthesis of verifiable tasks. After a chain succeeds, a language model generates a natural-language task from the calls and state changes. The description retains user goals and constraints but omits tool names and call order, leaving the trained agent to plan its own execution path.

The system also generates assertion scripts checking final state, key intermediate states and required return fields. It restores the initial snapshot and replays the chain, keeping a sample only if every check passes. Each sample includes its task, verification script, tool chain and initial snapshot for later execution and checking. After deduplication, the system generates teacher trajectories and filters them using the scripts for training. The paper uses Kimi K3 for both reverse task generation and teacher-trajectory generation.

3. ToolSpace's static data statistics

Environment statistics. ToolSpace builds 77,760 tool-call-pattern nodes from 2,042 distinct standardized tools, organizing them into 804 environments. Data dependencies account for 69%, state dependencies 25% and retry dependencies 6%. The space records intermediate-result flows, state changes and failure recovery. Environments span communication, finance, document design, data storage and search. Of them, 181, or 22.5%, contain state-modifying tools; the rest do not all require complete databases synthesized from scratch. Search, file-reading and email-sending tools can also be reused across environments, supporting cross-environment combinations.

Article illustration

Figure 4: Tool-space domain distribution, tools per environment and dependency types. (Paper Figure 4)

Data statistics. ToolSpace generates 34,376 trajectories. In the subset with at least five tool calls, the average is 18.86 calls per trajectory, with a maximum of 209; trajectories span an average of 2.29 environments and a maximum of 22. At least 66.2% involve two or more environments.

Article illustration

Figure 5: Length, call-count and environment-count distributions for 21,385 trajectories containing at least five tool calls. (Paper Figure 5)

Experiment 1:

From 8B to 744B

Substantial gains on seven long-horizon tool benchmarks

The researchers first evaluate ToolSpace on seven long-horizon tool-use benchmarks: AutomationBench, SkillsBench, JobBench, τ³-Bench Banking, BFCL V4, Harvey LAB and OfficeQA Pro. They cover office automation, function calling, banking interactions and document questions. Data from the same synthesis pipeline train 8B, 35B and 744B models to test whether cross-environment tool-composition data improves long-horizon performance.

Article illustration

Table 1: Complete results on seven benchmarks. Avg. is the seven-benchmark mean; + Agent RL denotes reinforcement learning after supervised fine-tuning. The 744B model receives only supervised fine-tuning. (Paper Table 1)

Average scores improve across model sizes. Supervised fine-tuning raises Qwen3.6-35B-A3B from 23.0 to 41.0 overall, including an AutomationBench increase from 8.2 to 45.8. ToolSpace-744B-A40B, based on GLM-5.2, rises from 44.6 to 56.6 with supervised fine-tuning alone, matching Claude Opus 5's average across these seven benchmarks.

Online reinforcement learning further raises the 35B model's average from 41.0 to 43.2, including τ³-Bench Banking from 34.0 to 42.3. This suggests that, after supervised fine-tuning establishes tool use, exploration within environments adds benefits for multistep operations.

Experiment 2: building and evaluating two Pro benchmarks

Beyond training data, the researchers use ToolSpace to expand evaluations. They connect external tools with data or state dependencies to AutomationBench and τ³-Bench Banking, generating longer chains to build AutomationBench Pro and τ³-Bench Banking Pro. Seven models are compared on standard and Pro versions to test the greater orchestration and cross-environment execution difficulty.

Article illustration

Table 2: Results on two Pro benchmarks. Std. means standard, Pro upgraded, and Δ the upgraded-minus-standard score difference. Sources for standard scores appear in the paper's table notes. (Paper Table 2)

All seven models score lower on both Pro benchmarks, with the largest AutomationBench drop reaching 38.2 points. Execution statistics for three models also show more tool calls on average in both Pro versions. Because Pro expands call length, environmental scope and dependencies together, these results reflect the difficulty of the combined task upgrade.

Experiment 3: environment and data scaling analysis

The researchers separately vary training-data proportions and training-environment coverage to examine scaling. The former tests gains from more synthetic samples, the latter from wider tool and environment coverage, controlling the corresponding scale variable in each experiment.

Article illustration

Figure 6: Data and environment scaling. The top row increases training-data proportion; the bottom row increases training-environment proportion. (Paper Figure 7)

As the coverage of synthetic data and training environments expands, model performance generally continues to improve, but the gain curves differ across tasks. AutomationBench shows a clear improvement even at relatively low environment coverage, whereas the gains on banking-interaction tasks appear more at higher coverage. The authors connect this difference to the range of tools on which the tasks depend: general office work involves broader combinations across services, while banking tasks focus more on operations involving specific business states.

They also compare training with the half of environments most relevant to evaluation against a randomly selected half. On AutomationBench, SkillsBench, BFCL V4 and OfficeQA Pro, the largest difference is 1.7 points, with both settings close to full-environment training. In this comparison, relevance-based selection adds limited benefit, supporting the potential for tool-composition training to transfer across environments.

Summary

ToolSpace shifts the starting point of environment synthesis from data to tools: it extracts tool dependencies from execution trajectories, builds a composition graph, and then organizes environments on demand and synthesizes tasks across environments. By adjusting call length and the range of environments, the system can increase task complexity and provide samples with verifiable evidence of execution through state checks, backtracking after failures, and replay verification. Training, evaluation, and analytical experiments demonstrate the application potential of this approach, providing a scalable and verifiable method of synthesizing environments and tasks for long-horizon agents.

The value of this work lies in bringing the composition relationships among real tools into environment and task synthesis, providing a foundation for transferring trained capabilities to actual workflows. As the tools and their connections continue to expand, the same framework can cover more scenarios of collaboration across services and reduce the work of environment synthesis by constructing the underlying data on demand. Training data and evaluation tasks can also continue to expand within a shared tool space, supporting research into agents' ability to generalize across longer workflows and more environments.

Authors and team

The researchers are mainly from Renmin University of China and Fudan University. Co-first authors are Dong Guanting, Sun Zhichao and Yang Xinyu; corresponding authors are Gui Tao and Dou Zhicheng.

This article comes from Synced. Authors: Dong Guanting, Sun Zhichao and Yang Xinyu.

After reading

Join the AINRK community

Read how to join the community and connect with people working in AI.

Community information (opens in a new tab)