TRACE: Capability-Targeted Agentic Training Turning Recurrent Agent failures into Capability-targeted training Environments

Hangoo Kang*, Tarun Suresh*, Jon Saad-Falcon, Azalia Mirhoseini

Stanford University  ·  *Equal contribution  ·  July 2026

TL;DR
  • Agents usually fail in a target environment for a small number of recurring reasons: missing capabilities. TRACE finds them automatically by contrasting successful and failed trajectories.
  • For each missing capability, TRACE synthesizes a verifiable training environment that isolates it, trains one LoRA adapter per capability with RL, and composes the adapters with token-level MoE routing.
  • On Qwen3-30B-A3B, TRACE improves τ²-Bench by +15.3 points (32.9 → 48.2) and SWE-bench Verified by +15 points Pass@1 (26.0 → 41.0) — beating the strongest external baselines by more than 8 points while using less than one-fourth the rollouts.
  • On Qwen3.6-27B, TRACE reaches 73.2% Pass@1 on SWE-bench Verified — a 27B open-weight model outperforming GPT-5.2-Codex (72.8%) on the public leaderboard.

Why do agents keep failing the same way?

Agentic LLMs fail in target environments because they often lack reusable capabilities the environment demands — retrieving the right customer record before acting, verifying preconditions before a state-changing tool call, or localizing the right function in a large repository. The two mainstream fixes both spend compute poorly:

Our observation is that failures are not random. When we analyze rollouts from a base agent, the same small set of deficits accounts for most failed trajectories. That makes failures actionable: instead of training on the whole environment, we can turn each recurring deficit into its own dense, verifiable training signal.

TRACE in one figure

The four-step TRACE pipeline: capability analysis, targeted environment creation, capability adapter training, and MoE composition with token-level routing.
The TRACE pipeline. (1) An LLM analyst contrasts the base agent's successful and failed trajectories to diagnose missing capabilities. (2) A generation agent creates one seeded, verifiable synthetic environment per capability. (3) A separate LoRA adapter is trained on each environment with RL. (4) A mixture-of-experts model routes each token to the right capability adapter.

Step 1 — Find the missing capabilities by contrast, not by guessing

We collect rollouts of the base agent in the target environment and split them into successful (𝒟⁺) and failed (𝒟⁻) sets. An analysis agent reads tool calls, observations, and final responses to induce a canonical capability dictionary, then labels every trajectory–capability pair as NA, PRESENT, or LACKING. A capability c is retained only if its absence is concentrated in failures and it explains enough of them:

Δ̂(c) = ÊR⁻(c) − ÊR⁺(c) ≥ 0.20
Ĉov(c) = #{failed trajectories lacking c} ⁄ #{failed trajectories} ≥ 0.10

where ÊR±(c) is the rate at which c is lacking among failed / successful trajectories. On τ²-Bench this yields four deficits: structured data reasoning, multi-step task completion, precondition verification, and tool-calling precision.

Bar chart: over 10 independent analysis runs, structured data reasoning, multi-step completion, and precondition verification are selected 10/10 times; tool precision 8/10. Bar chart: structured data reasoning covers 41% of failed tasks, multi-step 25%, tool precision 20%, precondition 16%.
Failures are concentrated and the diagnosis is stable. Across 10 independent analysis runs, the same four deficits are selected almost every time (left), and each covers a large share of failed rollouts (right). A few trainable deficits explain most failures — which is exactly what makes targeted training worthwhile.

Step 2 — Synthesize a verifiable environment per capability

For each retained capability, an LLM generation agent creates a seeded, procedurally-generated synthetic environment that isolates that capability while preserving the target environment's tool schemas and interaction format. Because each task instance is generated from a seed, rewards are automatically verifiable from tool arguments, state changes, final answers, or patches — no human labels, and no LLM judge in the reward loop. The result is a much denser learning signal than the original environment, where success depends on many capabilities at once.

Step 3 — Train one LoRA adapter per capability with GRPO

Capability GRPO: rollouts are grouped by shared seed, rewards are normalized within each group, and only the capability's LoRA adapter is updated while the base model stays frozen.
Capability GRPO. Rollout groups share the same seed (hence the same scenario), so within-group reward differences reflect the policy — not task difficulty. Rewards are normalized within each group, and only the capability's LoRA adapter Δc is updated; the base model stays frozen.

Each capability gets its own frozen-base LoRA adapter (≈5% of backbone parameters) trained with GRPO on its synthetic environment. Keeping adapters separate matters: it avoids collapsing several capabilities into one entangled update, and it gives us interpretable experts we can compose — or inspect — later.

Step 4 — Compose the adapters with token-level MoE routing

MoE composition: base model and capability adapters are frozen; lightweight token-level gates are trained to route each token to the best adapter, with top-1 routing at inference.
MoE composition. With the backbone and all capability adapters frozen, we train only lightweight token-level gates (≈492K parameters total) with a cross-entropy + load-balancing objective. At inference, each token is routed top-1 to a single capability adapter.

A real task interleaves capabilities — a customer-service agent reads structured data, then verifies a precondition, then issues a precise tool call, all in one trajectory. Token-level routing lets the model switch experts mid-trajectory. Top-1 routing works best on τ²-Bench: 48.2% vs. 47.0% for top-2 and 45.1% for top-4.

Main results

We evaluate on τ²-Bench (50 airline + 114 retail customer-service workflows, pass rate) and SWE-bench Verified (500 real GitHub issues, Pass@1), with Qwen3-30B-A3B-Instruct-2507 and Qwen3.6-27B backbones. Baselines include GRPO directly on the target environment, AWM, ADP, GEPA prompt optimization, and SWE-RL. For SWE-bench, TRACE's capability environments are trained on a disjoint SWE-smith split.

Qwen3-30B-A3B results: TRACE reaches 48.2% on τ²-Bench vs. 39.6% for the best baseline (GEPA) and 32.9% base; 41.0% Pass@1 on SWE-bench Verified vs. 32.6% for SWE-RL and 26.0% base.
Qwen3-30B-A3B. TRACE improves the base model by +15.3 points on τ²-Bench and +15.0 points Pass@1 on SWE-bench Verified, beating the strongest external baseline by +8.6 and +8.4 points respectively.
Qwen3.6-27B results: TRACE reaches 59.1% on τ²-Bench (base 50.0) and 73.2% Pass@1 on SWE-bench Verified (base 68.0).
Qwen3.6-27B. The same pipeline transfers to a stronger backbone: 59.1% on τ²-Bench and 73.2% Pass@1 on SWE-bench Verified — surpassing GPT-5.2-Codex (72.8%) on the SWE-bench leaderboard with a 27B open-weight model.

The Qwen3.6-27B result is worth dwelling on. TRACE lifts a 27B open-weight backbone from 68.0% to 73.2% Pass@1 on SWE-bench Verified — which places it above GPT-5.2-Codex (72.8%), GLM 5, and Claude 4.5 Sonnet on the public leaderboard. No frontier-scale pretraining, no proprietary scaffold: the gap is closed purely by diagnosing what the model can't do and training exactly those capabilities.

BackboneMethodτ²-Bench OverallSWE-bench Verified Pass@1
Qwen3-30B-A3BBase32.926.0
GEPA39.631.0
Strongest ext. baseline39.632.6
TRACE (Ours)48.241.0
Qwen3.6-27BBase50.068.0
GEPA53.069.6
Strongest ext. baseline53.770.4
TRACE (Ours)59.173.2

Capabilities scale; prompts plateau

Line chart: TRACE improves monotonically as trained capabilities are added (40.3 → 44.5 → 48.2 for 1, 2, 4 capabilities), while GEPA plateaus near 39.6 even with 16 capability descriptions. Line chart of pass rate vs. rollouts: at 1280 rollouts TRACE (40.3) already exceeds the final scores of GRPO (37.8) and GEPA (39.6) at 5120 rollouts, and continues to 48.2.
Left: each added trained capability improves τ²-Bench monotonically (40.3 → 44.5 → 48.2), while adding more capability descriptions to an optimized prompt plateaus around 39.6. Knowing what to do is not the same as being able to do it. Right: at 1,280 rollouts TRACE already exceeds what target-environment GRPO and GEPA reach with 5,120 — less than one-fourth the rollouts for a higher final score.

Two things stand out. First, training beats telling: GEPA can describe the missing capabilities in the prompt, and it helps (+6.7 points), but a single trained capability adapter already exceeds general-purpose AWM and ADP, and four trained capabilities beat the best prompt by +8.6 points. Second, targeted environments are sample-efficient: because each synthetic environment rewards exactly one capability, every rollout carries signal about the deficit it was built for, instead of diluting credit across the whole task.

Why composition matters

Consolidation methodτ²-Bench Overall
SFT on synthetic data37.8
Single-capability GRPO40.3
Multi-capability GRPO (one adapter for all)40.9
TRACE MoE (Ours)48.2

Given the same synthetic environments, how you consolidate the learning matters as much as the data itself. Distilling everything into one adapter — whether by SFT or by multi-capability GRPO — collapses distinct skills into a single entangled update and leaves more than 7 points on the table. Separate experts plus a learned token-level router preserves each capability and deploys the right one at the right step.

Takeaways

T1 — Failure contrast is actionable. Comparing success and failure trajectories identifies trainable deficits, not generic error categories. The diagnosis is stable across analysis runs, and a handful of deficits covers most failures.

T2 — Targeted synthetic environments are efficient. A verifiable environment built around one capability provides far denser supervision than the sparse end-task reward — TRACE outperforms target-environment GRPO and GEPA with less than a quarter of their rollouts.

T3 — Compositional adaptation matters. One LoRA expert per capability avoids collapsing multiple skills into one update, and token-level MoE routing selects the right expert at each step — worth +7.3 points over the best single-adapter alternative.

More broadly, TRACE is a recipe for environment-specific agent self-improvement: deploy an agent, watch where it recurrently fails, and convert those failures into exactly the training signal that fixes them — no human curation of skills, environments, or rewards in the loop.

Citation

@article{kang2026trace,
  title   = {TRACE: Capability-Targeted Agentic Training},
  author  = {Kang, Hangoo and Suresh, Tarun and Saad-Falcon, Jon and Mirhoseini, Azalia},
  journal = {arXiv preprint arXiv:2604.05336},
  year    = {2026}
}