TL;DR
TRACE is an end-to-end system that helps LLM agents self-improve by diagnosing their specific failures and creating custom "mini-games" (synthetic environments) to train those missing skills. By training specialized adapters for each deficit and combining them into a Mixture-of-Experts model, TRACE achieves state-of-the-art performance on agentic benchmarks like SWE-bench and $\tau^2$-Bench with four times the sample efficiency of standard methods.
What Problem Does This Paper Address?
Building reliable LLM agents is hard. When an agent fails a complex task—like booking a multi-leg flight or fixing a bug in a massive codebase—it’s often not because it failed the entire task, but because it lacked a specific "core capability" (e.g., it couldn't parse a nested JSON response or forgot to verify a precondition).
Current solutions usually involve fine-tuning the model on the entire target environment or using massive amounts of generic synthetic data. These approaches are often "blind": they don't target the model's actual weaknesses, leading to low sample efficiency and poor generalization. It’s the equivalent of making a student retake an entire year of school because they failed one specific math concept, rather than just giving them targeted tutoring on that one topic.
Methods
The authors introduce TRACE (Turning Recurrent Agent failures into Capability-targeted training Environments), which follows a four-step pipeline:
- Contrastive Capability Identification: The system compares successful and failed trajectories. An "LLM analyst" identifies specific skills that are present in successes but missing in failures (e.g., "Structured Data Reasoning").
- Targeted Environment Synthesis: For each identified deficit, an LLM generates a synthetic "mini-game" environment. These environments are procedurally generated to isolate and reward the specific missing skill while maintaining the same tool interface as the real task.
- Capability Adapter Training: The model trains a specialized LoRA adapter (a small set of trainable parameters) for each mini-game using GRPO (Group Relative Policy Optimization), a reinforcement learning algorithm that doesn't require a separate "critic" model.
- MoE Composition: Finally, these specialized "expert" adapters are integrated into the base model using a Mixture-of-Experts (MoE) architecture. A lightweight "gate" learns to route different parts of a task to the most relevant expert at the token level.
Datasets
The researchers evaluated TRACE across three diverse benchmarks:
- $\tau^2$-Bench: A customer service benchmark involving complex workflows in Airline and Retail domains.
- SWE-bench Verified: A high-difficulty software engineering benchmark requiring models to resolve real-world GitHub issues.
- ToolSandBox: A stateful tool-use benchmark used to test cross-environment generalization.
- SWE-smith: A dataset used for the initial training phase of the software engineering tasks.
Key Insights and Ideas
- Contrastive Analysis is Key: Simply looking at failures isn't enough. By comparing failures to successes, TRACE filters out "noise" (like ambiguous tasks) and focuses on trainable deficits that actually distinguish top-tier performance.
- Denser Rewards through Isolation: RL is notoriously difficult on long-horizon tasks because the reward is "sparse" (you only know if you won or lost at the very end). By creating "mini-games" that isolate one skill, TRACE provides much "denser" feedback, making the learning process significantly faster.
- Interpretability via Routing: Because each expert in the MoE is trained on a specific, human-readable capability, you can actually see which "skill" the model is invoking at any given moment by looking at the gate's routing decisions.
- Efficiency over Scale: TRACE proves that targeting specific deficits is more effective than throwing more data at the problem. It outperformed baselines while using less than one-fourth the number of environment rollouts.
Key Results
- $\tau^2$-Bench: TRACE improved the base agent's performance by +15.3 points, outperforming the strongest external baseline (GEPA) by +8.6 points.
- SWE-bench Verified: TRACE achieved a 41% Pass@1 with a 30B model. When using the Qwen3.6-27B backbone, it reached 73.2%, outperforming much larger frontier models like GPT-5.2-Codex (72.8%) and Claude 4.5 Sonnet on the public leaderboard.
- Sample Efficiency: TRACE achieved higher final accuracy than standard GRPO or prompt-optimization methods while requiring significantly fewer training examples.
- Generalization: In cross-environment tests, an agent trained on $\tau^2$-Bench skills showed improved performance on the unrelated ToolSandBox, suggesting it learned transferable logic rather than just memorizing the benchmark.
Limitations and Future Work
- Supervisor Dependency: The system relies on a "teacher" LLM to analyze failures and generate environments. If the teacher model isn't significantly more capable than the student, the quality of the training environments might suffer.
- Capability Scaling: The study focused on 2–4 primary capabilities per benchmark. Future work is needed to see how the system handles dozens or hundreds of specialized adapters.
- Computational Overhead: While inference is "sparse" (only one expert is active at a time), storing multiple adapters increases the model's memory footprint.
- Automating the "Dictionary": While the discovery of capabilities is automated, ensuring the "canonical dictionary" of skills remains optimal across vast, diverse domains remains an open challenge.
Summary updated