arXiv:2610.33568cs.CLOct 2026

Manuscript Offprint

arXiv:2610.33568

Trajectory2Gym: Decision-Grounded Compositional Interaction Synthesis for Tool-Use Agents

Yihao Hu, Zhihao Wen, Yitong Lin, Siyuan Lu, Pan Wang, Wei Wu, Jiang-Ming Yang, Tao Lin

Abstract

Successful tool-use trajectories are not necessarily useful supervision. Even successful interactions may underrepresent multi-step dependencies or contain actions that are unjustified by the information visible to the agent at decision time. We identify two coupled requirements for effective trajectory supervision: compositional coverage, so that important observation-action dependencies are represented, and decision grounding, so that each supervised action is supported by the learner-visible interaction history. We introduce Trajectory2Gym, which constructs executable interactions around under-supported compositional structures and derives supervision only from grounded decisions in their realized executions. Structural-support selection allocates the resulting experience, while parent-normalized supervised fine-tuning preserves the semantic interaction as the unit of training weight. This reframes trajectory generation as the deliberate construction of learnable interaction experience, rather than the collection of successful trajectories. Across five Qwen3 scales, Trajectory2Gym improves Tau1, Tau2, and BFCL at every tested scale, increasing the equal-weight three-benchmark mean by 16.9–29.8 percentage points. The gains are strongest in stateful and multi-turn interaction, where later decisions depend on earlier observations and feedback. Our results suggest that scaling tool-use agents depends not only on collecting more successful trajectories, but on constructing interactions whose dependencies are represented and whose decisions are learnable from the agent's visible history.

1 Introduction

Ask a support agent to cancel two orders and update a third. A competent agent looks up the account; when the email lookup fails, it asks for a name and ZIP code and retries; it reads each order to check it is pending, confirms with the user, and only then cancels and swaps items using catalog-returned identifiers. Each call is simple; what must be learned is their composition. We call such workflows compositional interactions: an observation, user update, or state change determines a later decision. Tool-use agents face this composition constantly [Yao et al., 2023, Schick et al., 2023, Patil et al., 2024, Qin et al., 2024a, Qu et al., 2025], interactive benchmarks make it central to task success [Yao et al., 2025, Barres et al., 2026, Patil et al., 2025], and collected or synthesized trajectories are its standard supervision [Qin et al., 2024b, Zeng et al., 2024].

Recent pipelines show that what interactions are collected matters, yet the prevailing strategy still filters trajectories by task completion or per-call execution [Liu et al., 2024c, 2025, Prabhakar et al., 2025, Xu et al., 2025c], and fine-tuning directly on logged trajectories can even fall below the initialization [Wu et al., 2026a]. Success certifies that an episode ended well, not what it teaches or whether each imitated action was justified by what the agent could see. Two challenges follow. Challenge 1 (compositional coverage): trajectories must exercise cross-step dependencies with repeated support, yet in our pool of 34,772 certified candidates, 40.9% contain at most two supervised decisions and only 10.0% contain a certified decision after an authentic error. Challenge 2 (decision grounding): each target must follow from decision-time visible information; successful API execution alone cannot establish this. A collector may use an unseen identifier, and in Figure 1 the API accepts a stale two-item exchange as readily as the lamp-only exchange finally requested by the user.

Our central claim is that what a trajectory teaches is decided not by its outcome, but by the dependencies it realizes and the decisions its visible history can justify. Trajectory2Gym operationalizes this claim in three stages (Figure 2).

∗^{*}Equal contribution. †^{\dagger}Corresponding authors.

Trajectory2Gym

References (1)