Trajectory2Task: Training Robust Tool-Calling Agents with Synthesized Yet Verifiable Data for Complex User Intents

Ziyi Wang, Yuxuan Lu, Yimeng Zhang, Pei Chen, Ziwei Dong, Jing Huang, Jiri Gesi, Xianfeng Tang, Chen Luo, Qun Liu, Yisi Sang, Hanqing Lu, Manling Li, Jin Lai, Dakuo Wang

Here is a blog-style summary of the paper.

TL;DR

While LLM tool-calling agents excel in clean, lab-controlled environments, real-world user interactions are messy—filled with ambiguous requests, shifting goals, and impossible demands. To address this, researchers introduced Trajectory2Task, a novel "trajectory-first" synthetic data pipeline that generates verifiable, complex multi-turn tasks to train and evaluate robust agents. Their findings show that training lightweight models on fewer than 3,000 of these complex trajectories dramatically improves their resilience and allows them to generalize to entirely unseen tool domains.

What Problem Does This Paper Address?

Most existing benchmarks evaluate tool-calling agents under idealized conditions: the user has a single, well-specified goal, and the agent simply needs to pick the right API and fill in the slots.

In the real world, customer service agents encounter three distinct challenges:

  1. Ambiguous Intent: Users omit critical details (e.g., "I want to return my keyboard" without specifying which order).
  2. Changing Intent: Users change their minds mid-conversation or stack multiple requests.
  3. Infeasible Intent: Users ask for things that violate system constraints or company policy (e.g., trying to cancel an order that has already shipped).
Real-world tool-calling dialogue with complex user intent

Standard data generation pipelines use a "task-first" approach—they prompt an LLM to write a task description and then ask a solver model to find a trajectory. In complex scenarios, this often leads to unverifiable data because the solver might fail or generate hallucinated tool behaviors.

Methods

The authors flip the traditional data generation paradigm on its head with a trajectory-first pipeline called Trajectory2Task.

Trajectory2Task pipeline overview

The pipeline operates in two main stages:

  1. Trajectory Exploration: An explorer LLM interacts directly with a simulated environment (using an API dependency graph) to generate valid, executable multi-step tool-call sequences. Because these are executed in a live sandbox, the final database state is guaranteed to be reachable and correct.
  2. Task Generation: A summarizer LLM takes these successful interaction traces and reverse-engineers them into user-facing task descriptions. Crucially, the prompt introduces controlled perturbations to simulate ambiguous, changing, or infeasible intents. Finally, a separate LLM acts as a validator to filter out unrealistic tasks.

To train better agents, the authors collect successful multi-turn rollouts (including intermediate reasoning tokens) and perform Trajectory-based Supervised Fine-Tuning (SFT) on smaller models like Qwen3-4B and 8B.

Datasets

The authors introduced Retail-3I (Three Complex User Intents), built on top of the Tau2-Bench retail domain framework.

  • Evaluation Benchmark: Contains 1,099 verified tasks (473 ambiguous, 279 changing, and 347 infeasible).
  • Training Set: To avoid data leakage, they generated a completely separate, larger retail database inventory and synthesized 2,872 successful trajectories across the three complex scenario types for fine-tuning.

Key Insights and Ideas

  • The Power of Trajectory-First Design: By generating the execution trace before the task description, the dataset provides an absolute ground-truth label. Every task is mathematically guaranteed to have a valid, reachable end state.
  • Frontier Models are Vulnerable: Even state-of-the-art models like Claude 3.7 Sonnet experience significant performance degradation when intents shift or become infeasible, frequently trying to execute forbidden actions despite explicit policy instructions.
  • Reasoning Over Memorization: The most exciting finding is cross-domain generalization. Models trained purely on retail data showed substantial performance boosts when evaluated on an airline booking domain. This proves the SFT process teaches the agent how to behave (when to ask clarifying questions, how to handle policy rejections) rather than just forcing it to memorize specific API schemas.

Key Results

The authors benchmarked seven state-of-the-art LLMs on Retail-3I, evaluating them using the strict $Pass^{\hat{k}}$ metric (the probability of passing a task across all $k$ independent trials).

Tool-calling performance under complex scenarios
  • Baseline Drops: Moving from the clean "General" setting to the "Infeasible" setting caused Claude 3.7's $Pass^{\hat{1}}$ score to plummet from 0.794 to 0.571. Smaller models suffered even more; Qwen3-4B dropped to a meager 0.259 on ambiguous tasks.
  • SFT Impact: Fine-tuning lightweight models yielded massive gains. Qwen3-4B-FT rocketed from 0.259 to 0.686 in the Ambiguous setting, effectively matching or beating baseline models that were many times its size.
  • Cross-Domain Success: On the completely unseen Tau2-Bench Airline domain, the fine-tuned Qwen3-8B-FT model improved its $Pass^{\hat{1}}$ score from 0.207 (base) to 0.287, demonstrating true algorithmic generalization.

Limitations and Future Work

While Trajectory2Task marks a solid step forward for agent training, the authors note a few limitations:

  • LLM-Driven Users: The user simulator relies on LLM prompting, meaning it may not fully capture the chaotic distribution of real human behavior, such as extreme adversarial attempts or nuanced social dynamics.
  • Environment Scope: Due to API cost constraints, the pipeline was primarily validated within the simulated Tau2-Bench framework.

Future work will focus on expanding the pipeline to support longer-horizon memory, richer user states, and testing within open-world, live tool ecosystems.

Summary updated

BibTeX
@inproceedings{wang2026trajectory,
  author = {Ziyi Wang and Yuxuan Lu and Yimeng Zhang and Pei Chen and Ziwei Dong and Jing Huang and Jiri Gesi and Xianfeng Tang and Chen Luo and Qun Liu and Yisi Sang and Hanqing Lu and Manling Li and Jin Lai and Dakuo Wang},
  title = {{Trajectory2Task: Training Robust Tool-Calling Agents with Synthesized Yet Verifiable Data for Complex User Intents}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2026},
  doi = {10.18653/v1/2026.acl-long.2037},
}
Figure