Stanford Researchers Introduce TRACE: A Capability-Targeted Agentic Training System That Turns Recurrent Agent Failures Into Synthetic RL Environment Stanford researchers introduced TRACE, an open-source system that diagnoses recurring agent failures and trains targeted capabilities using synthetic reinforcement learning environments. TRACE identifies missing skills via contrastive analysis, builds one environment per gap, trains LoRA adapters with GRPO, and composes them via Mixture-of-Experts routing, achieving higher pass rates on τ²-Bench than prompt optimization or single-adapter baselines. Agentic LLMs often fail the same way, again and again. A Stanford research team traced this to missing, reusable capabilities. Their system, TRACE , diagnoses those gaps and trains for them directly. TRACE stands for T urning R ecurrent A gent failures into C apability-targeted training E nvironments. It was released open-source under an MIT license. What problem does TRACE solve? To understand the design, first consider why agents fail. They lack specific skills that tasks demand, like retrieving the right record or verifying a precondition. Two mainstream fixes spend compute poorly. Direct RL or SFT gives sparse rewards that never say which skill was missing. Broad synthetic data is untargeted, so budget flows to skills the model already has. However, TRACE observes that failures are not random. A small set of deficits accounts for most failed trajectories. Therefore, each recurring deficit can become its own dense, verifiable training signal. How does TRACE work? Given that findings, TRACE runs an automated four-step pipeline. Each step is driven by an LLM agent following a markdown prompt. Step 1: Contrastive capability analysis The base agent generates rollouts in the target environment. An analysis agent splits them into successful and failed sets. It then labels every trajectory-capability pair as NA , PRESENT , or LACKING . A capability is retained only when it is contrastive and high-coverage. Specifically, its contrastive gap must clear δ = 0.20 and coverage must clear ρ = 0.10. Consequently, the pipeline keeps skills whose absence concentrates in failures. Step 2: Targeted environment synthesis Next, a generation agent builds one synthetic environment per retained capability. Each environment isolates a single capability while preserving the target’s tool schemas and format. Task instances are procedurally generated from random seeds. Because generation and verification are algorithmic, rewards need no human labels or LLM judge. Step 3: Capability adapter training Then each capability gets one LoRA Low-Rank Adaptation adapter, trained on its synthetic environment. The training algorithm is GRPO Group Relative Policy Optimization . The base model stays frozen throughout. GRPO groups rollouts by shared seed, so scenarios are identical within a group. Rewards are then normalized within each group to isolate the policy’s contribution. Step 4: MoE composition with token-level routing Finally, TRACE composes the adapters into a Mixture-of-Experts MoE model. The backbone and adapters stay frozen, and only lightweight token-level gates are trained. At inference, each token is routed top-1 to a single capability adapter. This lets the model switch experts mid-trajectory. How TRACE Turns Agent Failures Into Targeted Training TRACE diagnoses the capabilities an agent lacks, builds one verifiable environment per gap, trains a LoRA expert for each, then routes tokens across experts. Step through the pipeline below. Passed D⁺ Failed D⁻ Retained if Δ ≥ 0.20 and Cov ≥ 0.10 0% LoRA Δc ~5.3% Result · τ²-Bench overall pass rate Qwen3-30B-A3B Targeted training and MoE composition beat prompt optimization and single-adapter baselines. Built from arXiv:2604.05336 https://arxiv.org/abs/2604.05336 · code https://github.com/ScalingIntelligence/TRACE . Numbers are from the paper. • Marktechpost Which capabilities did it find? In practice, on τ²-Bench, contrastive analysis recovered four deficits. These were structured data reasoning, multi-step task completion, precondition verification, and tool calling precision. Notably, this findings stayed stable across ten independent runs. Structured data reasoning alone covered the largest share of failed tasks. Multi-step task completion followed closely behind. Use cases with examples To ground these capabilities, consider three concrete tasks. Each maps to a distinct failure mode that TRACE targets. - First, take a customer-service airline agent. A user asks to cancel a basic economy flight booked 14 days ago. Precondition verification checks policy eligibility before calling cancel reservation . - Next, consider a compound retail request. A user asks to cancel two reservations and modify a third. Multi-step task completion stops the agent quitting after the first sub-task. - Finally, consider a coding agent on SWE-bench Verified. Correctly locating the relevant function or file is a capability. It is necessary for fixing a bug or updating an API call. How do the results compare? With those capabilities trained, TRACE was tested on two backbones and two benchmarks. τ²-Bench measures customer-service pass rate across 50 airline and 114 retail tasks. SWE-bench Verified measures Pass@1 on 500 real GitHub issues. | Backbone | Method | τ²-Bench Overall % | SWE-bench Verified Pass@1 % | |---|---|---|---| | Qwen3-30B-A3B | Base | 32.9 | 26.0 | | GEPA prompt optimization | 39.6 | 31.0 | | | SWE-RL | — | 32.6 | | | Single Capability GRPO Ours | 40.3 | 36.6 | | TRACE Ours | 48.2 | 41.0 | | | Qwen3.6-27B | Base | 50.0 | 68.0 | | GEPA prompt optimization | 53.0 | 69.6 | | | SWE-RL | — | 70.4 | | TRACE Ours | 59.1 | 73.2 | On Qwen3-30B-A3B, TRACE improved τ²-Bench by +15.3 points and SWE-bench Verified by +15 points Pass@1. It beat the strongest external baselines, GEPA and SWE-RL, by +8.6 and +8.4 points. Moreover, TRACE is sample-efficient. Using under one-fourth the rollouts, it exceeded the final scores of GRPO and GEPA. Its final accuracy ran +10.4 and +8.6 points higher on τ²-Bench. Additionally, a third benchmark, ToolSandBox, showed the same pattern. On Qwen3.6-27B, TRACE reached 73.2% Pass@1 on SWE-bench Verified. That 27B open-weight model surpassed GPT-5.2-Codex 72.8% , GLM 5, and Claude 4.5 Sonnet on the public leaderboard. Implementation For AI professionals, the pipeline is benchmark-agnostic and driven by markdown prompts. After environments are generated, each capability adapter is trained against a running vLLM server. MODEL="Qwen/Qwen3-30B-A3B-Instruct-2507" set your backbone NAME="structured data reasoning" set the capability N GPUS=4 1 — serve the frozen base model, with LoRA hot-swapping enabled export VLLM ALLOW RUNTIME LORA UPDATING=True vllm serve "$MODEL" --port 8000 --tensor-parallel-size 4 \ --enable-lora --max-loras 2 --max-lora-rank 32 \ --enable-auto-tool-choice --tool-call-parser hermes qwen3 xml for Qwen3.6 2 — train one LoRA adapter per capability with GRPO export VLLM BASE URLS=http://localhost:8000 torchrun --nproc per node="$N GPUS" --master-port=29501 -m train \ --game "capability $NAME" --model "$MODEL" Each LoRA adapter adds ~1.6B trainable parameters, or 5.3% of the backbone. The trained MoE gate adds just 491,760 parameters in total. Default thresholds are ρ = 0.10, δ = 0.20, and 8-of-10 cross-run consistency. Key Takeaways Failure contrast is actionable. Comparing successful and failed trajectories surfaces trainable deficits, not generic error labels. Targeted environments are sample-efficient. Each verifiable environment rewards one capability, so every rollout carries dense signal. Composition beats collapse. Separate experts with token-level routing beat the best single-adapter alternative by seven-plus points. Training beats prompting. Trained adapters scale monotonically, while prompt-only optimization plateaus after four capabilities. A 27B model topped the leaderboard. Qwen3.6-27B hit 73.2% Pass@1 on SWE-bench Verified, above GPT-5.2-Codex.