スタンフォード大研究者、再発するエージェントの失敗を合成 RL 環境に変換する能力指向型トレーニングシステム「TRACE」を発表
スタンフォード大学研究チームが公開した「TRACE」は、エージェントの反復失敗を分析して特定の能力欠陥を特定し、合成環境で強化学習を行うことで、効率的な能力獲得を実現する画期的なシステムである。
キーポイント
再発失敗の根本原因と解決策
エージェントの失敗はランダムではなく特定の能力欠陥に起因し、TRACE はこれを分析して直接訓練するアプローチを採用している。従来の RL や SFT が報酬が希薄または非対象的であるのに対し、TRACE は欠陥を特定した高密度な学習信号を提供する。
4 つの自動化パイプライン
対照的能力分析、ターゲット環境合成、能力アダプター訓練、MoE 構成という 4 ステップで構成され、LLM エージェントが自動実行する。各ステップはアルゴリズムに基づき、人間によるラベル付けや LLM 判定を不要としている。
LoRA と GRPO を活用した効率的学習
各能力ごとに LoRA アダプターを生成し、GRPO アルゴリズムを用いてベースモデルを凍結したまま訓練する。これにより、計算リソースを既存のスキルではなく不足しているスキルに集中投入できる。
トークンレベルルーティングによる MoE 統合
最終的に Mixture-of-Experts モデルとして統合され、推論時には各トークンがトップ 1 の能力アダプターへ動的にルーティングされる。これにより、エージェントは軌跡の途中で専門的な能力を切り替えて実行できる。
失敗の自動化と合成データ生成
TRACE はエージェントの反復的な失敗を自動的に解析・分類し、それらを学習用の合成強化学習環境として再構築する仕組みを採用しています。
能力特化型のトレーニング体系
単なるデータ収集ではなく、特定の能力不足(Capability Gaps)に焦点を当てたターゲット型トレーニングシステムとして設計されており、効率的な学習を可能にします。
失敗事例の環境化による学習効率向上
エージェントの反復的な失敗を分析し、それを合成強化学習(Synthetic RL)環境として再構築することで、効率的なトレーニングを実現する。
影響分析・編集コメントを表示
影響分析
この研究は、AI エージェントの学習効率を劇的に向上させる可能性を秘めており、従来の「試行錯誤」型アプローチから「欠陥特化型」アプローチへのパラダイムシフトを示唆しています。特に、計算リソースの浪費を防ぎつつ、特定のスキル不足を迅速に補完できる点は、実世界での複雑なタスク実行におけるエージェントの信頼性を高める重要な一歩となります。
編集コメント
エージェントの失敗を単なるエラーとして処理するのではなく、学習の機会として再定義した点に大きな技術的革新性があります。オープンソース化により、業界全体で効率的なエージェント訓練手法が標準化される可能性が高いです。
エージェント型 LLM は、同じ失敗を繰り返す傾向があります。スタンフォード大学の研究チームは、その原因が「再利用可能な能力の欠落」にあると特定しました。彼らが開発したシステム「TRACE」は、こうした能力のギャップを診断し、不足している部分を直接トレーニングするための仕組みです。
TRACE は「Turning Recurrent Agent failures into Capability-targeted training Environments(反復するエージェントの失敗を、能力指向型のトレーニング環境に変換する)」の略称で、MIT ライセンスの下でオープンソースとして公開されています。
では、TRACE が解決しようとしている課題とは何でしょうか?
その仕組みを理解するには、まず「なぜエージェントが失敗するのか」を考える必要があります。タスクに必要な特定のスキル、例えば適切なレコードの取得や前提条件の確認などが欠けているためです。
現在主流の 2 つのアプローチは、計算リソースを効率的に活用できていません。直接 RL(強化学習)や SFT(教師あり微調整)を行うと、報酬が希薄になりすぎて「どのスキルが不足していたか」を特定できません。また、広範な合成データを作成する手法もターゲットが定まっていないため、予算がすでに備わっているスキルに流れてしまいます。
しかし TRACE は、失敗はランダムではないという点に着目しました。実際には、少数の能力欠陥が失敗した経路の大部分を占めています。つまり、繰り返される欠陥一つひとつを、独立した高密度で検証可能なトレーニング信号として活用できるのです。
TRACE はどのように動作するのでしょうか?
上記の知見に基づき、TRACE は LLM エージェントが Markdown プロンプトに従って実行する、自動化された 4 つのステップからなるパイプラインを採用しています。
ステップ 1:対照的な能力分析
ベースとなるエージェントが対象環境でロールアウト(試行)を実行します。次に、分析用エージェントがその結果を「成功したケース」と「失敗したケース」に分割します。そして、各経路と能力の組み合わせに対して、「NA(該当なし)」「PRESENT(存在する)」「LACKING(不足している)」のいずれかをラベル付けします。
必ず JSON 形式で返してください。translation フィールドのみ。他のフィールドは一切追加しないこと — 余計なフィールドを書こうとして本文がトークン上限で打ち切られる事故を防ぐため:
{"translation": "リライト全文"}
能力は、対照的な差(コントラスト・ギャップ)と十分な網羅性(カバレッジ)を備えている場合にのみ保持されます。具体的には、コントラスト・ギャップがδ = 0.20 を、カバレッジがρ = 0.10 をそれぞれ上回る必要があります。このため、パイプラインは「欠如した能力が失敗に集中するスキル」だけを抽出し続けます。
ステップ 2:ターゲット指向の環境合成
次に、生成エージェントが保持された各能力ごとに 1 つずつ合成環境を構築します。各環境では単一の能力のみを分離しつつも、対象となるツールのスキーマとフォーマットは維持されます。
タスクインスタンスはランダムシードから手続き的に生成されます。生成と検証の両方がアルゴリズムで実行されるため、報酬には人間のラベルや LLM による判定は不要です。
ステップ 3:能力アダプターのトレーニング
続いて、各能力に対して LoRA(Low-Rank Adaptation)アダプターを 1 つずつ用意し、対応する合成環境で学習させます。学習アルゴリズムには GRPO(Group Relative Policy Optimization)を採用します。ベースモデルは学習中も凍結されたままです。
GRPO は共有シードによるロールアウトをグループ化するため、同一グループ内のシナリオはすべて同一になります。報酬はこの各グループ内で正規化され、ポリシーの寄与のみが抽出されます。
ステップ 4:トークンレベルのルーティングによる MoE 構成
最後に、TRACE はこれらのアダプターを組み合わせて Mixture-of-Experts(MoE)モデルを構築します。バックボーンとアダプターは凍結されたまま、トレーニングされるのは軽量なトークンレベルのゲートのみです。
推論時には、各トークンはトップ 1 の能力アダプターへルーティングされます。これにより、モデルは軌跡の途中でも専門家(エキスパート)を切り替えることが可能になります。
TRACE の仕組み — インタラクティブ・エクスペラ
#trace-explainer * { margin:0; padding:0; box-sizing:border-box; }
#trace-explainer {
--bg:#ffffff; --panel:#f7f8fc; --panel2:#eef1f8; --ink:#151a2e; --muted:#5a6379;
--line:#e2e6f0; --indigo:#4f46e5; --cyan:#0891b2; --amber:#d97706; --rose:#db2777;
--green:#16a34a; --red:#dc2626; --shadow:0 6px 22px rgba(30,40,90,.08);
font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
color:var(--ink); background:var(--bg); max-width:960px; margin:0 auto; padding:22px 18px 30px;
line-height:1.5; -webkit-font-smoothing:antialiased;
}
#trace-explainer .te-eyebrow{ font-size:12px; font-weight:700; letter-spacing:.14em; text-transform:uppercase; color:var(--indigo); }
#trace-explainer h1{ font-size:26px; line-height:1.2; margin:6px 0 6px; letter-spacing:-.02em; }
#trace-explainer .te-sub{ color:var(--muted); font-size:14.5px; max-width:640px; }
/* stepper */
#trace-explainer .te-steps { display: flex; gap: 8px; margin: 20px 0 14px; flex-wrap: wrap; }
#trace-explainer .te-step {
flex: 1 1 160px; min-width: 150px; text-align: left; cursor: pointer; border: 1px solid var(--line);
background: var(--panel); border-radius: 12px; padding: 11px 13px; transition: .25s; position: relative; overflow: hidden;
}
#trace-explainer .te-step:hover { border-color: #c7cee0; }
#trace-explainer .te-step.on { background: #fff; border-color: var(--indigo); box-shadow: var(--shadow); }
#trace-explainer .te-step.on::before { content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%;
background: linear-gradient(90deg, var(--indigo), var(--cyan)); }
#trace-explainer .te-step .te-num { font-size: 11px; font-weight: 700; color: var(--muted); }
#trace-explainer .te-step.on .te-num { color: var(--indigo); }
#trace-explainer .te-step .te-t { font-size: 13.5px; font-weight: 650; margin-top: 3px; }
/* stage */
#trace-explainer .te-stage{
border:1px solid var(--line); border-radius:16px; background:linear-gradient(180deg,#fff,#fbfcff);
box-shadow:var(--shadow); padding:18px; min-height:340px; position:relative;
}
#trace-explainer .te-caption{ display:flex; align-items:center; gap:9px; margin-bottom:14px; }
#trace-explainer .te-dot{ width:10px; height:10px; border-radius:50%; background:var(--indigo); box-shadow:0 0 0 4px rgba(79,70,229,.12); }
#trace-explainer .te-caption h3{ font-size:16px; }
#trace-explainer .te-caption p{ font-size:13px; color:var(--muted); }
#trace-explainer .te-view{ display:none; animation:tefade .4s ease; }
#trace-explainer .te-view.show{ display:block; }
@keyframes tefade{ from{opacity:0; transform:translateY(6px);} to{opacity:1; transform:none;} }
/* コントロール */
#trace-explainer .te-ctrl { display:flex; gap:8px; align-items:center; margin-top:16px; flex-wrap:wrap; }
#trace-explainer button.te-btn {
font:inherit; font-size:13px; font-weight:600; cursor:pointer; border:1px solid var(--line);
background:#fff; color:var(--ink); border-radius:9px; padding:8px 14px; transition:.2s;
}
#trace-explainer button.te-btn:hover { border-color:var(--indigo); color:var(--indigo); }
#trace-explainer button.te-btn.primary { background:var(--indigo); color:#fff; border-color:var(--indigo); }
#trace-explainer button.te-btn.primary:hover { background:#4338ca; color:#fff; }
#trace-explainer .te-hint { font-size:12px; color:var(--muted); }
/* step1 trajectories */
#trace-explainer .te-traj-wrap{ display:grid; grid-template-columns:1fr 1.1fr; gap:16px; }
#trace-explainer .te-pool{ border:1px dashed var(--line); border-radius:12px; padding:10px; background:var(--panel); }
#trace-explainer .te-pool h4{ font-size:12px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); margin-bottom:8px; }
#trace-explainer .te-traj{ display:flex; align-items:center; gap:7px; font-size:12px; padding:6px 8px; border-radius:8px;
margin-bottom:6px; background:#fff; border:1px solid var(--line); opacity:0; transform:translateX(-8px); }
#trace-explainer .te-traj.in{ opacity:1; transform:none; transition:.4s; }
#trace-explainer .te-traj .te-tick{ width:16px; height:16px; border-radius:50%; display:grid; place-items:center; color:#fff; font-size:10px; font-weight:800; flex:none; }
#trace-explainer .te-ok{ background:var(--green); }
#trace-explainer .te-no{ background:var(--red); }
#trace-explainer .te-caps h4{ font-size:12px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); margin-bottom:10px; }
#trace-explainer .te-cap{ margin-bottom:12px; }
#trace-explainer .te-cap .te-cn{ display:flex; justify-content:space-between; font-size:12.5px; font-weight:600; margin-bottom:4px; }
#trace-explainer .te-cap .te-cn small{ color:var(--muted); font-weight:500; }
#trace-explainer .te-bar{ height:9px; border-radius:6px; background:var(--panel2); overflow:hidden; }
#trace-explainer .te-bar > i{ display:block; height:100%; width:0; border-radius:6px; transition:width 1.1s cubic-bezier(.2,.7,.2,1); }
#trace-explainer .te-keep{ font-size:11px; font-weight:700; margin-left:6px; padding:1px 6px; border-radius:20px; opacity:0; transition:.4s; }
#trace-explainer .te-keep.y{ background:rgba(22,163,74,.12); color:var(--green); opacity:1; }
/* step2 env cards */
#trace-explainer .te-envgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
#trace-explainer .te-env { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; position: relative;
opacity: 0; transform: scale(0.94); }
#trace-explainer .te-env.in { opacity: 1; transform: none; transition: 0.45s; }
#trace-explainer .te-env .te-etag { font-size: 11px; font-weight: 700; color: #fff; padding: 2px 8px; border-radius: 20px; display: inline-block; }
#trace-explainer .te-env h5 { font-size: 13.5px; margin: 8px 0 3px; }
#trace-explainer .te-env code { font-size: 11px; color: var(--muted); background: var(--panel); padding: 2px 6px; border-radius: 5px; display: inline-block; margin-top: 2px; }
#trace-explainer .te-env .te-seed { font-size: 11px; color: var(--muted); margin-top: 8px; display: flex; gap: 6px; align-items: center; }
#trace-explainer .te-seedpill { font-family: ui-monospace, Menlo, monospace; background: var(--panel2); padding: 1px 6px; border-radius: 5px; }
/* step3 grpo */
#trace-explainer .te-grpo{ display:grid; grid-template-columns:1.2fr 1fr; gap:18px; align-items:center; }
#trace-explainer .te-group{ border:1px solid var(--line); border-radius:12px; padding:12px; background:var(--panel); }
#trace-explainer .te-roll{ display:flex; align-items:center; gap:9px; margin-bottom:8px; font-size:12px; }
#trace-explainer .te-rollbar{ flex:1; height:12px; border-radius:6px; background:#fff; border:1px solid var(--line); overflow:hidden; }
#trace-explainer .te-rollbar > i{ display:block; height:100%; width:0; background:linear-gradient(90deg,var(--cyan),var(--indigo)); transition:width .8s; }
#trace-explainer .te-rew{ width:34px; text-align:right; font-family:ui-monospace,Menlo,monospace; font-size:11.5px; color:var(--muted); }
#trace-explainer .te-adapter{ text-align:center; }
#trace-explainer .te-lora{ width:130px; height:130px; margin:0 auto 8px; border-radius:16px; border:2px solid var(--indigo);
display:grid; place-items:center; position:relative; background:linear-gradient(180deg,#fff,#f2f0ff); overflow:hidden; }
#trace-explainer .te-lora .te-fill{ position:absolute; bottom:0; left:0; width:100%; height:0; background:rgba(79,70,229,.14); transition:height 1s; }
#trace-explainer .te-lora b{ font-size:22px; color:var(--indigo); position:relative; }
#trace-explainer .te-lora span{ font-size:10.5px; color:var(--muted); position:relative; }
#trace-explainer .te-frozen{ font-size:11px; color:var(--muted); }
/* step4 routing */
#trace-explainer .te-route{ display:grid; grid-template-columns:1fr; gap:14px; }
#trace-explainer .te-tokline{ display:flex; flex-wrap:wrap; gap:6px; min-height:34px; padding:8px; border:1px solid var(--line); border-radius:10px; background:var(--panel); }
#trace-explainer .te-tok{ font-size:12px; padding:4px 9px; border-radius:7px; background:#fff; border:1px solid var(--line); transition:.3s; }
#trace-explainer .te-tok.route{ color:#fff; transform:translateY(-2px); box-shadow:var(--shadow); }
#trace-explainer .te-experts{ display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
#trace-explainer .te-exp{ border:1px solid var(--line); border-radius:11px; padding:11px 9px; text-align:center; background:#fff; transition:.25s; }
#trace-explainer .te-exp .te-eicon{ width:30px; height:30px; border-radius:9px; margin:0 auto 6px; display:grid; place-items:center; color:#fff; font-weight:800; font-size:13px; }
#trace-explainer .te-exp .te-en{ font-size:11.5px; font-weight:600; line-height:1.25; }
#trace-explainer .te-exp .te-ec{ font-size:11px; color:var(--muted); margin-top:4px; font-family:ui-monospace,monospace; }
#trace-explainer .te-exp.hot{ transform:translateY(-3px); box-shadow:var(--shadow); }
#trace-explainer .te-tasks{ display:flex; gap:8px; flex-wrap:wrap; }
/* results */
#trace-explainer .te-results { margin-top:22px; border:1px solid var(--line); border-radius:16px; padding:18px; background:var(--panel); }
#trace-explainer .te-results h3 { font-size:15px; margin-bottom:3px; }
#trace-explainer .te-results p.te-rp { font-size:12.5px; color:var(--muted); margin-bottom:14px; }
#trace-explainer .te-rrow { display:flex; align-items:center; gap:10px; margin-bottom:11px; font-size:12.5px; }
#trace-explainer .te-rlabel { width:92px; font-weight:600; flex:none; }
#trace-explainer .te-rtrack { flex:1; height:22px; background:#fff; border:1px solid var(--line); border-radius:6px; overflow:hidden; position:relative; }
#trace-explainer .te-rtrack > i { display:block; height:100%; width:0; border-radius:6px 0 0 6px; transition:width 1.3s cubic-bezier(.2,.7,.2,1); }
#trace-explainer .te-rval { position:absolute; right:8px; top:50%; transform:translateY(-50%); font-size:11.5px; font-weight:700; font-family:ui-monospace,monospace; }
#trace-explainer .te-foot { margin-top:16px; font-size:11.5px; color:var(--muted); text-align:center; }
#trace-explainer .te-foot b { color:var(--indigo); }
#trace-explainer .te-src { color:var(--indigo); text-decoration:none; }
@media(max-width:640px){
#trace-explainer .te-traj-wrap{ grid-template-columns:1fr; }
#trace-explainer .te-grpo{ grid-template-columns:1fr; }
#trace-explainer .te-envgrid{ grid-template-columns:1fr; }
#trace-explainer .te-experts{ grid-template-columns:repeat(2,1fr); }
#trace-explainer h1{ font-size:22px; }
}
インタラクティブ解説
TRACE がエージェントの失敗をどう訓練に転換するか
TRACE は、エージェントが欠いている能力を診断し、その不足分ごとに検証可能な環境を 1 つ構築します。さらに各能力に対応する LoRA エキスパートを訓練し、トークンをこれらのエキスパート間で振り分けます。以下のパイプラインで手順を追って確認してください。
1 · 対照的能力分析
ロールアウト(実行結果)を「成功」と「失敗」に分類し、両者を明確に分けるギャップ(能力の差)を抽出します。
成功 (D⁺)
失敗 (D⁻)
Δ ≥ 0.20 かつ Cov ≥ 0.10 の場合のみ保持
2 · ターゲット型環境合成
各能力ごとに、シード値を固定した自動検証可能な環境が生成されます。
3 · 能力アダプター訓練 (GRPO)
ロールアウトは共通のシード値を使用し、報酬はグループ内で正規化されます。
0%LoRA Δc (~5.3%)
image ベースモデルは凍結 · Δc のみ更新
4 · MoE 構成とトークンレベルのルーティング
学習されたゲートが各トークンを処理し、上位 1 つの能力エキスパートへ振り分けます。
上のタスクを選択して、そのトークンをルーティングしてください。
image 手順を実行
次の手順 →
Result · τ²-Bench 全体のパス率 (Qwen3-30B-A3B)
ターゲットを絞ったトレーニングと MoE(Mixture of Experts)の組み合わせは、プロンプト最適化や単一のアダプターベースラインを上回りました。
出典:arXiv:2604.05336 · コードあり。数値は論文より引用。 • Marktechpost
Stanford の研究者らが、再発するエージェントの失敗を合成 RL 環境に変換する能力指向型アジェント学習システム「TRACE」を発表しました。
このシステムの核心となるのは、構造化データ推論(SDR)、多段階タスク完了(MSC)、事前条件検証(PV)、ツール呼び出し精度(TCP)という 4 つの主要な能力指標です。各指標には固有の色が割り当てられ、性能向上度(delta)と失敗カバレッジ率(cov)が数値化されています。例えば SDR では JSON レコードの解析や相互参照処理が行われ、MSC ではサブタスクを早期に中断せず完遂することが求められます。
TRACE の学習プロセスは 4 つのステップで構成されます。まず能力分析を行い、次に各能力に対応した独自のシード環境を合成します。その後、グループ化されたロールアウトデータを正規化した上で LoRA アダプターを収束するまで訓練し、最後に MoE(Mixture of Experts)によるルーティングを実行します。
このフローでは、データストリームが流入すると各能力の差分ギャップと失敗カバレッジが自動的に更新されます。保持された各能力に対して合成環境が生成され、グループ化されたロールアウトが正規化されることで、LoRA アダプターが最適な状態まで学習を進めます。タスクをクリックすると、トークンがトップ 1 の専門家にどのようにルーティングされるかを確認できます。
// STEP 1 build
var poolPass=document.getElementById('poolPass'), poolFail=document.getElementById('poolFail');
function trajRow(ok,label){
var r=document.createElement('div'); r.className='te-traj';
r.innerHTML=''+(ok?'✓':'✕')+''+label;
return r;
}
var passLabels=['cancel flight','change seat','verify booking'];
var failLabels=['refund order','modify 3 reservations','cancel basic economy','filter retail variant'];
passLabels.forEach(function(l){ poolPass.appendChild(trajRow(true,l)); });
failLabels.forEach(function(l){ poolFail.appendChild(trajRow(false,l)); });
var capList=document.getElementById('capList');
CAPS.forEach(function(c,i){
var el=document.createElement('div'); el.className='te-cap';
el.innerHTML=''+c.name+'KEEP'+
'Δ '+c.delta.toFixed(2)+' · Cov '+Math.round(c.cov*100)+'%
'+
'
';
capList.appendChild(el);
});
// STEP 2 build
var envGrid=document.getElementById('envGrid');
CAPS.forEach(function(c,i){
var e=document.createElement('div'); e.className='te-env'; e.id='env'+i;
e.innerHTML='ENV '+(i+1)+''+
''+c.name+'
reward ↔ '+c.code+''+
'seed → '+(1000+i*137)+' → verifiable task
';
envGrid.appendChild(e);
});
// STEP 3 build
var grpoGroup=document.getElementById('grpoGroup');
var rewards=[0.0,0.3,1.0,0.3,0.0,1.0];
grpoGroup.innerHTML='Group · shared seed 1000
必ず JSON 形式で返してください。translation フィールドのみ。他のフィールドは一切追加しないこと — 余計なフィールドを書こうとして本文がトークン上限で打ち切られる事故を防ぐため:
{"translation": "リライト全文"}
このコードは、エージェントのトレーニング環境を視覚化し、タスクを実行するためのインタラクティブな UI を構築するものです。
まず、報酬(rewards)の各要素に対してループ処理を行い、τ(タイムステップ)ごとのラベルを表示する div 要素を作成します。これらは「te-roll」というクラス名でグループ化され、グリッド内に追加されます。
次に、能力(CAPS)リストに基づいて実験グリッドを構築します。各能力には短い略称と完全な名称が表示され、トークン数として「0 tok」が初期値として設定されます。これらの要素は「te-exp」というクラス名で管理され、個別の ID を付与して DOM に追加されます。
続いて、3 つの具体的なタスク定義を配列に格納します。「Refund order to original card(注文を元のカードへ返金)」、「Cancel 2 flights + change seat(フライト 2 本キャンセル+座席変更)」、「Find economy flight after 11AM(午前 11 時以降のエコノミークラス便を検索)」です。各タスクには、実行すべきアクションとトークンコストがリスト化されています。
最後に、これらのタスクに対応するボタンを動的に生成します。「taskBtns」という要素内に追加され、クリックすると「routeTask」関数が呼び出されて対応するタスクが起動します。
この仕組みにより、ユーザーは視覚的にエージェントの学習プロセスを追跡し、異なる能力やタスクを選択してシミュレーションを実行することが可能になります。
// RESULTS build
var RES=[
{l:'Base',v:32.9,c:'#94a3b8'},
{l:'GEPA',v:39.6,c:'#0891b2'},
{l:'Single cap.',v:40.3,c:'#d97706'},
{l:'Multi-cap GRPO',v:40.9,c:'#db2777'},
{l:'TRACE MoE',v:48.2,c:'#4f46e5'}
];
var resRows=document.getElementById('resRows');
RES.forEach(function(r,i){
var row=document.createElement('div'); row.className='te-rrow';
row.innerHTML='' + r.l + '' + r.v.toFixed(1) + '%
必ず JSON 形式で返してください。translation フィールドのみ。他のフィールドは一切追加しないこと — 余計なフィールドを書こうとして本文がトークン上限で打ち切られる事故を防ぐため:
{"translation": "リライト全文"}
このコードは、結果表示のアニメーション処理を担う JavaScript の一部です。まず、resRows 要素に対して行(row)を追加するループが実行されます。
次に、アニメーションが既に完了しているかを確認するためのフラグ resSeen が初期化され、animResults という関数が定義されています。この関数は、一度呼び出されると二度と再実行されないように、resSeen の状態をチェックして早期リターンする仕組みを持っています。
そして、結果データ(RES)の各要素に対して、インデックス i を用いて遅延処理を行います。setTimeout によって、120 ミリ秒ごとに順次、対応する結果表示要素(res'+i)の幅を、値 r.v に基づいて計算されたパーセンテージ(最大 55 の比率でスケーリング)に設定します。
これにより、結果リストが順番に横に伸びるような滑らかなアニメーション効果が得られます。
// ナビゲーション
var views = root.querySelectorAll('.te-view');
function go(i) {
cur = i;
root.querySelectorAll('.te-step').forEach(function(s, idx) { s.classList.toggle('on', idx === i); });
views.forEach(function(v, idx) { v.classList.toggle('show', idx === i); });
doc
原文を表示
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
#trace-explainer * { margin:0; padding:0; box-sizing:border-box; }
#trace-explainer {
--bg:#ffffff; --panel:#f7f8fc; --panel2:#eef1f8; --ink:#151a2e; --muted:#5a6379;
--line:#e2e6f0; --indigo:#4f46e5; --cyan:#0891b2; --amber:#d97706; --rose:#db2777;
--green:#16a34a; --red:#dc2626; --shadow:0 6px 22px rgba(30,40,90,.08);
font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
color:var(--ink); background:var(--bg); max-width:960px; margin:0 auto; padding:22px 18px 30px;
line-height:1.5; -webkit-font-smoothing:antialiased;
}
#trace-explainer .te-eyebrow{ font-size:12px; font-weight:700; letter-spacing:.14em; text-transform:uppercase; color:var(--indigo); }
#trace-explainer h1{ font-size:26px; line-height:1.2; margin:6px 0 6px; letter-spacing:-.02em; }
#trace-explainer .te-sub{ color:var(--muted); font-size:14.5px; max-width:640px; }
/* stepper */
#trace-explainer .te-steps{ display:flex; gap:8px; margin:20px 0 14px; flex-wrap:wrap; }
#trace-explainer .te-step{
flex:1 1 160px; min-width:150px; text-align:left; cursor:pointer; border:1px solid var(--line);
background:var(--panel); border-radius:12px; padding:11px 13px; transition:.25s; position:relative; overflow:hidden;
}
#trace-explainer .te-step:hover{ border-color:#c7cee0; }
#trace-explainer .te-step.on{ background:#fff; border-color:var(--indigo); box-shadow:var(--shadow); }
#trace-explainer .te-step.on::before{ content:""; position:absolute; left:0; top:0; height:3px; width:100%;
background:linear-gradient(90deg,var(--indigo),var(--cyan)); }
#trace-explainer .te-step .te-num{ font-size:11px; font-weight:700; color:var(--muted); }
#trace-explainer .te-step.on .te-num{ color:var(--indigo); }
#trace-explainer .te-step .te-t{ font-size:13.5px; font-weight:650; margin-top:3px; }
/* stage */
#trace-explainer .te-stage{
border:1px solid var(--line); border-radius:16px; background:linear-gradient(180deg,#fff,#fbfcff);
box-shadow:var(--shadow); padding:18px; min-height:340px; position:relative;
}
#trace-explainer .te-caption{ display:flex; align-items:center; gap:9px; margin-bottom:14px; }
#trace-explainer .te-dot{ width:10px; height:10px; border-radius:50%; background:var(--indigo); box-shadow:0 0 0 4px rgba(79,70,229,.12); }
#trace-explainer .te-caption h3{ font-size:16px; }
#trace-explainer .te-caption p{ font-size:13px; color:var(--muted); }
#trace-explainer .te-view{ display:none; animation:tefade .4s ease; }
#trace-explainer .te-view.show{ display:block; }
@keyframes tefade{ from{opacity:0; transform:translateY(6px);} to{opacity:1; transform:none;} }
/* controls */
#trace-explainer .te-ctrl{ display:flex; gap:8px; align-items:center; margin-top:16px; flex-wrap:wrap; }
#trace-explainer button.te-btn{
font:inherit; font-size:13px; font-weight:600; cursor:pointer; border:1px solid var(--line);
background:#fff; color:var(--ink); border-radius:9px; padding:8px 14px; transition:.2s;
}
#trace-explainer button.te-btn:hover{ border-color:var(--indigo); color:var(--indigo); }
#trace-explainer button.te-btn.primary{ background:var(--indigo); color:#fff; border-color:var(--indigo); }
#trace-explainer button.te-btn.primary:hover{ background:#4338ca; color:#fff; }
#trace-explainer .te-hint{ font-size:12px; color:var(--muted); }
/* step1 trajectories */
#trace-explainer .te-traj-wrap{ display:grid; grid-template-columns:1fr 1.1fr; gap:16px; }
#trace-explainer .te-pool{ border:1px dashed var(--line); border-radius:12px; padding:10px; background:var(--panel); }
#trace-explainer .te-pool h4{ font-size:12px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); margin-bottom:8px; }
#trace-explainer .te-traj{ display:flex; align-items:center; gap:7px; font-size:12px; padding:6px 8px; border-radius:8px;
margin-bottom:6px; background:#fff; border:1px solid var(--line); opacity:0; transform:translateX(-8px); }
#trace-explainer .te-traj.in{ opacity:1; transform:none; transition:.4s; }
#trace-explainer .te-traj .te-tick{ width:16px; height:16px; border-radius:50%; display:grid; place-items:center; color:#fff; font-size:10px; font-weight:800; flex:none; }
#trace-explainer .te-ok{ background:var(--green); }
#trace-explainer .te-no{ background:var(--red); }
#trace-explainer .te-caps h4{ font-size:12px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); margin-bottom:10px; }
#trace-explainer .te-cap{ margin-bottom:12px; }
#trace-explainer .te-cap .te-cn{ display:flex; justify-content:space-between; font-size:12.5px; font-weight:600; margin-bottom:4px; }
#trace-explainer .te-cap .te-cn small{ color:var(--muted); font-weight:500; }
#trace-explainer .te-bar{ height:9px; border-radius:6px; background:var(--panel2); overflow:hidden; }
#trace-explainer .te-bar > i{ display:block; height:100%; width:0; border-radius:6px; transition:width 1.1s cubic-bezier(.2,.7,.2,1); }
#trace-explainer .te-keep{ font-size:11px; font-weight:700; margin-left:6px; padding:1px 6px; border-radius:20px; opacity:0; transition:.4s; }
#trace-explainer .te-keep.y{ background:rgba(22,163,74,.12); color:var(--green); opacity:1; }
/* step2 env cards */
#trace-explainer .te-envgrid{ display:grid; grid-template-columns:repeat(2,1fr); gap:12px; }
#trace-explainer .te-env{ border:1px solid var(--line); border-radius:12px; padding:12px; background:#fff; position:relative;
opacity:0; transform:scale(.94); }
#trace-explainer .te-env.in{ opacity:1; transform:none; transition:.45s; }
#trace-explainer .te-env .te-etag{ font-size:11px; font-weight:700; color:#fff; padding:2px 8px; border-radius:20px; display:inline-block; }
#trace-explainer .te-env h5{ font-size:13.5px; margin:8px 0 3px; }
#trace-explainer .te-env code{ font-size:11px; color:var(--muted); background:var(--panel); padding:2px 6px; border-radius:5px; display:inline-block; margin-top:2px;}
#trace-explainer .te-env .te-seed{ font-size:11px; color:var(--muted); margin-top:8px; display:flex; gap:6px; align-items:center; }
#trace-explainer .te-seedpill{ font-family:ui-monospace,Menlo,monospace; background:var(--panel2); padding:1px 6px; border-radius:5px; }
/* step3 grpo */
#trace-explainer .te-grpo{ display:grid; grid-template-columns:1.2fr 1fr; gap:18px; align-items:center; }
#trace-explainer .te-group{ border:1px solid var(--line); border-radius:12px; padding:12px; background:var(--panel); }
#trace-explainer .te-roll{ display:flex; align-items:center; gap:9px; margin-bottom:8px; font-size:12px; }
#trace-explainer .te-rollbar{ flex:1; height:12px; border-radius:6px; background:#fff; border:1px solid var(--line); overflow:hidden; }
#trace-explainer .te-rollbar > i{ display:block; height:100%; width:0; background:linear-gradient(90deg,var(--cyan),var(--indigo)); transition:width .8s; }
#trace-explainer .te-rew{ width:34px; text-align:right; font-family:ui-monospace,Menlo,monospace; font-size:11.5px; color:var(--muted); }
#trace-explainer .te-adapter{ text-align:center; }
#trace-explainer .te-lora{ width:130px; height:130px; margin:0 auto 8px; border-radius:16px; border:2px solid var(--indigo);
display:grid; place-items:center; position:relative; background:linear-gradient(180deg,#fff,#f2f0ff); overflow:hidden; }
#trace-explainer .te-lora .te-fill{ position:absolute; bottom:0; left:0; width:100%; height:0; background:rgba(79,70,229,.14); transition:height 1s; }
#trace-explainer .te-lora b{ font-size:22px; color:var(--indigo); position:relative; }
#trace-explainer .te-lora span{ font-size:10.5px; color:var(--muted); position:relative; }
#trace-explainer .te-frozen{ font-size:11px; color:var(--muted); }
/* step4 routing */
#trace-explainer .te-route{ display:grid; grid-template-columns:1fr; gap:14px; }
#trace-explainer .te-tokline{ display:flex; flex-wrap:wrap; gap:6px; min-height:34px; padding:8px; border:1px solid var(--line); border-radius:10px; background:var(--panel); }
#trace-explainer .te-tok{ font-size:12px; padding:4px 9px; border-radius:7px; background:#fff; border:1px solid var(--line); transition:.3s; }
#trace-explainer .te-tok.route{ color:#fff; transform:translateY(-2px); box-shadow:var(--shadow); }
#trace-explainer .te-experts{ display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
#trace-explainer .te-exp{ border:1px solid var(--line); border-radius:11px; padding:11px 9px; text-align:center; background:#fff; transition:.25s; }
#trace-explainer .te-exp .te-eicon{ width:30px; height:30px; border-radius:9px; margin:0 auto 6px; display:grid; place-items:center; color:#fff; font-weight:800; font-size:13px; }
#trace-explainer .te-exp .te-en{ font-size:11.5px; font-weight:600; line-height:1.25; }
#trace-explainer .te-exp .te-ec{ font-size:11px; color:var(--muted); margin-top:4px; font-family:ui-monospace,monospace; }
#trace-explainer .te-exp.hot{ transform:translateY(-3px); box-shadow:var(--shadow); }
#trace-explainer .te-tasks{ display:flex; gap:8px; flex-wrap:wrap; }
/* results */
#trace-explainer .te-results{ margin-top:22px; border:1px solid var(--line); border-radius:16px; padding:18px; background:var(--panel); }
#trace-explainer .te-results h3{ font-size:15px; margin-bottom:3px; }
#trace-explainer .te-results p.te-rp{ font-size:12.5px; color:var(--muted); margin-bottom:14px; }
#trace-explainer .te-rrow{ display:flex; align-items:center; gap:10px; margin-bottom:11px; font-size:12.5px; }
#trace-explainer .te-rlabel{ width:92px; font-weight:600; flex:none; }
#trace-explainer .te-rtrack{ flex:1; height:22px; background:#fff; border:1px solid var(--line); border-radius:6px; overflow:hidden; position:relative; }
#trace-explainer .te-rtrack > i{ display:block; height:100%; width:0; border-radius:6px 0 0 6px; transition:width 1.3s cubic-bezier(.2,.7,.2,1); }
#trace-explainer .te-rval{ position:absolute; right:8px; top:50%; transform:translateY(-50%); font-size:11.5px; font-weight:700; font-family:ui-monospace,monospace; }
#trace-explainer .te-foot{ margin-top:16px; font-size:11.5px; color:var(--muted); text-align:center; }
#trace-explainer .te-foot b{ color:var(--indigo); }
#trace-explainer .te-src{ color:var(--indigo); text-decoration:none; }
@media(max-width:640px){
#trace-explainer .te-traj-wrap{ grid-template-columns:1fr; }
#trace-explainer .te-grpo{ grid-template-columns:1fr; }
#trace-explainer .te-envgrid{ grid-template-columns:1fr; }
#trace-explainer .te-experts{ grid-template-columns:repeat(2,1fr); }
#trace-explainer h1{ font-size:22px; }
}
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%)
image 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.
image Play step
Next step →
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
(function(){
var root = document.getElementById('trace-explainer');
var CAPS = [
{name:'Structured data reasoning', short:'SDR', color:'#4f46e5', delta:0.44, cov:0.41, code:'parse / cross-reference JSON records'},
{name:'Multi-step task completion', short:'MSC', color:'#0891b2', delta:0.33, cov:0.25, code:'finish every sub-task, no early stop'},
{name:'Precondition verification', short:'PV', color:'#d97706', delta:0.28, cov:0.16, code:'check policy before state change'},
{name:'Tool calling precision', short:'TCP', color:'#db2777', delta:0.24, cov:0.20, code:'pass the correct arguments'}
];
var STEPS = ['Capability Analysis','Environment Creation','Adapter Training (GRPO)','MoE Routing'];
var HINTS = [
'Trajectories stream in, then each capability’s Δ (contrastive gap) and Cov (failure coverage) fill.',
'A distinct seeded environment is synthesized for each retained capability.',
'Watch grouped rollouts get normalized, then the LoRA adapter train to convergence.',
'Click a task to see its tokens routed top-1 to the matching expert.'
];
var cur = 0;
// Build stepper
var stepsEl = document.getElementById('teSteps');
STEPS.forEach(function(s,i){
var d = document.createElement('div');
d.className='te-step'+(i===0?' on':'');
d.innerHTML='STEP '+(i+1)+'
'+s+'
';
d.onclick=function(){ go(i); };
stepsEl.appendChild(d);
});
// STEP 1 build
var poolPass=document.getElementById('poolPass'), poolFail=document.getElementById('poolFail');
function trajRow(ok,label){
var r=document.createElement('div'); r.className='te-traj';
r.innerHTML=''+(ok?'✓':'✕')+''+label;
return r;
}
var passLabels=['cancel flight','change seat','verify booking'];
var failLabels=['refund order','modify 3 reservations','cancel basic economy','filter retail variant'];
passLabels.forEach(function(l){ poolPass.appendChild(trajRow(true,l)); });
failLabels.forEach(function(l){ poolFail.appendChild(trajRow(false,l)); });
var capList=document.getElementById('capList');
CAPS.forEach(function(c,i){
var el=document.createElement('div'); el.className='te-cap';
el.innerHTML=''+c.name+'KEEP'+
'Δ '+c.delta.toFixed(2)+' · Cov '+Math.round(c.cov*100)+'%
'+
'
';
capList.appendChild(el);
});
// STEP 2 build
var envGrid=document.getElementById('envGrid');
CAPS.forEach(function(c,i){
var e=document.createElement('div'); e.className='te-env'; e.id='env'+i;
e.innerHTML='ENV '+(i+1)+''+
''+c.name+'
reward ↔ '+c.code+''+
'seed → '+(1000+i*137)+' → verifiable task
';
envGrid.appendChild(e);
});
// STEP 3 build
var grpoGroup=document.getElementById('grpoGroup');
var rewards=[0.0,0.3,1.0,0.3,0.0,1.0];
grpoGroup.innerHTML='Group · shared seed 1000
';
rewards.forEach(function(r,i){
var row=document.createElement('div'); row.className='te-roll';
row.innerHTML='τ'+(i+1)+'
–';
grpoGroup.appendChild(row);
});
// STEP 4 build
var expGrid=document.getElementById('expGrid');
CAPS.forEach(function(c,i){
var e=document.createElement('div'); e.className='te-exp'; e.id='exp'+i;
e.innerHTML=''+c.short+'
'+
''+c.name+'
0 tok
';
expGrid.appendChild(e);
});
var TASKS=[
{t:'Refund order to original card', toks:[['Look',0],['up',0],['order',0],['record',0],['then',2],['verify',2],['card',3],['arg',3],['refund',3]]},
{t:'Cancel 2 flights + change seat', toks:[['Check',2],['policy',2],['cancel',1],['first',1],['cancel',1],['second',1],['then',1],['change',3],['seat',3]]},
{t:'Find economy flight after 11AM', toks:[['Parse',0],['nested',0],['price',0],['array',0],['match',0],['economy',0],['cabin',3],['book',3]]}
];
var taskBtns=document.getElementById('taskBtns');
TASKS.forEach(function(tk,i){
var b=document.createElement('button'); b.className='te-btn'; b.textContent=tk.t;
b.onclick=function(){ routeTask(i); };
taskBtns.appendChild(b);
});
// RESULTS build
var RES=[
{l:'Base',v:32.9,c:'#94a3b8'},
{l:'GEPA',v:39.6,c:'#0891b2'},
{l:'Single cap.',v:40.3,c:'#d97706'},
{l:'Multi-cap GRPO',v:40.9,c:'#db2777'},
{l:'TRACE MoE',v:48.2,c:'#4f46e5'}
];
var resRows=document.getElementById('resRows');
RES.forEach(function(r,i){
var row=document.createElement('div'); row.className='te-rrow';
row.innerHTML=''+r.l+''+r.v.toFixed(1)+'%
';
resRows.appendChild(row);
});
var resSeen=false;
function animResults(){
if(resSeen) return; resSeen=true;
RES.forEach(function(r,i){ setTimeout(function(){ document.getElementById('res'+i).style.width=(r.v/55*100)+'%'; }, 120*i); });
}
// Navigation
var views=root.querySelectorAll('.te-view');
function go(i){
cur=i;
root.querySelectorAll('.te-step').forEach(function(s,idx){ s.classList.toggle('on', idx===i); });
views.forEach(function(v,idx){ v.classList.toggle('show', idx===i); });
doc
関連記事
RL エージェントのスキルを活用した自己研究ワークフローの実行方法と NVIDIA NeMo の活用
Anthropic Claude Sonnet 5 と Sonnet 4.6、Opus 4.8 の比較:エージェント型コーディングベンチマーク、API 価格、コストパフォーマンスの検討
プライム・インテレクトが「Verifiers v1」をリリース:エージェント型強化学習のトレーニングと評価のためのコンポーザブルなタスクセット、ハルネス、ランタイムを提供
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み