Stanford Researchers Introduce TRACE: A Capability-Targeted Agentic Training System That Turns Recurrent Agent Failures Into Synthetic RL Environment
Stanford researchers present TRACE, a system that diagnoses missing capabilities from agent failures, synthesizes verifiable training environments for each, trains LoRA adapters via GRPO, and composes them with token-level MoE routing. It achieves +15.3 points on τ²-Bench and 73.2% Pass@1 on SWE-bench Verified.
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 Turning Recurrent Agent failures into Capability-targeted training Environments. 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 Works — Interactive Explainer
Interactive Explainer
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.
1 · Contrastive Capability Analysis
Split rollouts into pass / fail, then keep gaps that separate them.
Passed (D⁺)
Failed (D⁻)
Retained if Δ ≥ 0.20 and Cov ≥ 0.10
2 · Targeted Environment Synthesis
One seeded, auto-verifiable environment is generated per capability.
3 · Capability Adapter Training (GRPO)
Rollouts share a seed; rewards are normalized within the group.
0%LoRA Δc (~5.3%)
Base model frozen · only Δc updates
4 · MoE Composition · Token-Level Routing
A learned gate routes each token top-1 to a single capability expert.
Pick a task above to route its tokens.
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 · code. 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.
BackboneMethodτ²-Bench Overall (%)SWE-bench Verified Pass@1 (%)
Qwen3-30B-A3BBase32.926.0
GEPA (prompt optimization)39.631.0
SWE-RL—32.6
Single Capability GRPO (Ours)40.336.6
TRACE (Ours)48.241.0
Qwen3.6-27BBase50.068.0
GEPA (prompt optimization)53.069.6
SWE-RL—70.4
TRACE (Ours)59.173.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.
Copy CodeCopiedUse a different Browser
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.
The post Stanford Researchers Introduce TRACE: A Capability-Targeted Agentic Training System That Turns Recurrent Agent Failures Into Synthetic RL Environment appeared first on MarkTechPost.