JA EN
体系蒸留と圧縮
·★ 会員·論文·14分で読めます

エージェントを蒸留する — 長い軌跡をどう圧縮するか

エージェントの蒸留では、学ぶ単位が「一問一答」から「一局」に変わります。数万トークンの軌跡に対して返ってくる採点は最後の○×ひとつ。この落差をどう埋めるのか — ターン単位のクレジット割当、軌跡の濾過とオンポリシー化、ツール使用の継承を、前提知識ゼロから解きほぐし、長距離エージェントの論文群への地図にします。

対象textタスクagent

ReAct: Synergizing Reasoning and Acting in Language Models

一次資料 — この記事の根拠

論文の発表 2022-10-06この解説の公開 2026-08-293年11か月後

ReAct: Synergizing Reasoning and Acting in Language ModelsShunyu Yao, Jeffrey Zhao, Dian Yu ほか · 2022-10-06 · v3arXiv:2210.03629論文ページ·PDF
A Reduction of Imitation Learning and Structured Prediction to No-Regret Online LearningarXiv:1011.0686論文ページ·PDF
Distilling Step-by-Step! Outperforming Larger Language Models with Less Training Data and Smaller Model SizesarXiv:2305.02301論文ページ·PDF
FireAct: Toward Language Agent Fine-tuningarXiv:2310.05915論文ページ·PDF
AgentTuning: Enabling Generalized Agent Abilities for LLMsarXiv:2310.12823論文ページ·PDF
Toolformer: Language Models Can Teach Themselves to Use ToolsarXiv:2302.04761論文ページ·PDF
On-Policy Distillation of Language Models: Learning from Self-Generated MistakesarXiv:2306.13649論文ページ·PDF
ArCHer: Training Language Model Agents via Hierarchical Multi-Turn RLarXiv:2402.19446論文ページ·PDF
AgentOPSD: Recursive Self-Distillation for Agentic Reinforcement LearningZi-Han Wang, Zhengxi Lu, Zhiyuan Yao ほか · 2026-08-06 · v1arXiv:2608.05987論文ページ·PDF
ABSeeker: Training Long-Horizon Search Agents via Answer-Backtracked Credit AssignmentYijun Lu, Rui Ye, Jiajun Wang ほか · 2026-08-05 · v1arXiv:2608.05102論文ページ·PDF
原文の要旨(Abstract)を読む

While large language models (LLMs) have demonstrated impressive capabilities across tasks in language understanding and interactive decision making, their abilities for reasoning (e.g. chain-of-thought prompting) and acting (e.g. action plan generation) have primarily been studied as separate topics. In this paper, we explore the use of LLMs to generate both reasoning traces and task-specific actions in an interleaved manner, allowing for greater synergy between the two: reasoning traces help the model induce, track, and update action plans as well as handle exceptions, while actions allow it to interface with external sources, such as knowledge bases or environments, to gather additional information. We apply our approach, named ReAct, to a diverse set of language and decision making tasks and demonstrate its effectiveness over state-of-the-art baselines, as well as improved human interpretability and trustworthiness over methods without reasoning or acting components. Concretely, on question answering (HotpotQA) and fact verification (Fever), ReAct overcomes issues of hallucination and error propagation prevalent in chain-of-thought reasoning by interacting with a simple Wikipedia API, and generates human-like task-solving trajectories that are more interpretable than baselines without reasoning traces. On two interactive decision making benchmarks (ALFWorld and WebShop), ReAct outperforms imitation and reinforcement learning methods by an absolute success rate of 34% and 10% respectively, while being prompted with only one or two in-context examples. Project site with code: https://react-lm.github.io

原文の要旨(Abstract)を読む

Reinforcement learning (RL) with verifiable rewards constructs trajectory-level advantage estimates, yet it often fails to credit the few pivotal decisions that determine outcomes in long-horizon, multi-turn agentic tasks. Recent work introduces privileged self-distillation for credit assignment, providing denser supervision, but it remains unclear how such local signals should represent sequential credit. We propose AgentOPSD, a critic-free, recursive method for turn-level credit assignment in agentic reinforcement learning. AgentOPSD aggregates token-level teacher-student log-probability gaps into turn-level evidence and recursively updates a Bayesian belief state in log-odds space. This yields a principled reweighting scheme that converts sparse outcome supervision into turn-level credit signals and identifies pivotal turns through the marginal belief revision between consecutive states. The method is fully compatible with standard policy optimization and requires neither an additional critic nor extra rollouts. We evaluate AgentOPSD on ALFWorld, WebShop, and Search-QA using Qwen2.5 models at two scales (3B and 7B). AgentOPSD outperforms GRPO and strong self-distillation baselines, achieving 89.1% success on ALFWorld with Qwen2.5-7B. Ablation studies attribute the gains to turn-level aggregation and history-dependent recursive belief updates.

原文の要旨(Abstract)を読む

Long-horizon search agents must make multiple sequential actions (steps) to search, retrieve, verify, and integrate evidence to reach a final answer. However, existing methods for training these agents typically treat all steps within a trajectory uniformly during both supervised fine-tuning (SFT) and reinforcement learning (RL), failing to distinguish useful actions from erroneous or redundant ones. In this paper, we propose Answer-Backtracked Credit Assignment (ABC), a fine-grained credit assignment framework for training long-horizon search agents by converting sparse trajectory-level outcomes into dense step-level supervision that rewards useful actions (even in failed trajectories) while suppressing erroneous or redundant actions. Specifically, given a potentially obscure query and its corresponding ground-truth answer, ABC first performs Answer-Backtracked Clue Recovery, which traces back from the answer to recover intermediate clues required to solve the question. It then applies Clue-Anchored Step Scoring to evaluate each search step against these clues, converting sparse binary outcome supervision into dense step-level rewards. Based on these rewards, we develop ABC-SFT, which reweights the loss of each turn, and ABC-GRPO, which uses the step-level scores as rewards in GRPO. Building on this framework, we train ABSeeker based on Qwen3.5-4B with only 8.5k examples. ABSeeker achieves 37.3% on BrowseComp and 39.1% on BrowseComp-ZH. With context management, the scores further improve to 55.3% and 52.9%, respectively, significantly outperforming same-scale (4B) agents and even matching the performance of larger ones (approximately 30B). These results demonstrate the effectiveness of answer-backtracked step-level credit assignment for training long-horizon search agents.


棋譜を渡すだけでは、弟子は強くならない

将棋の名人が指した一局の棋譜があるとします。初手から投了まで、百手がきれいに並んでいる。これを弟子に渡して「この通りに指しなさい」と言えば、弟子は名人になるでしょうか。

なりません。理由は二つあります。ひとつは、棋譜にはなぜその手なのかが書かれていないこと。並んでいるのは結果だけで、読み筋は本人の頭の中にしかありません。もうひとつは、対局には相手がいることです。三手目で相手が棋譜と違う手を指した瞬間、残りの九十七手は使えない紙切れになります。

LLMエージェントの蒸留が難しいのは、まさにこの状況だからです。これまでの蒸留は「一問一答」を単位にしていました。入力があり、教師の出力分布があり、生徒をそこへ寄せる。ところがエージェントは、一問に対して何十手も指してから答えを返します。しかも途中で検索やコード実行を挟み、その結果に応じて次の手が変わる。学ぶ単位が「一問一答」から「一局」に変わるのです。

前提知識は要りません。LLMエージェントを1から解説で扱った「考える→道具を使う→結果を見て考え直す」のループだけ思い浮かべてもらえれば十分です。

軌跡(トラジェクトリ)という単位

エージェントの一局は、専門用語では軌跡(trajectory)と呼ばれます。中身はこうです。

τ=(s0, a1, o1, a2, o2, , aH, oH, r)\tau = \big(s_0,\ a_1,\ o_1,\ a_2,\ o_2,\ \dots,\ a_H,\ o_H,\ r\big)
(1)

記号をひとつずつ。s0s_0 は最初に渡された課題(「このバグを直して」など)、ata_ttt 手目にエージェントが書いたもの、oto_t は環境が返したもの、HH は手数(ホライズン)、rr は最後についた点数です。

注意したいのは、ata_t が1トークンではないことです。ReActのような形式では ata_t は「思考の文章+ツール呼び出し」という数百トークンのかたまりで、oto_t も検索結果やスタックトレースがそのまま返るので数百から数千トークンになります。手数が20あれば、軌跡ひとつで平気で数万トークンに膨らみます。

そして最後の rr は、多くの場合ただの1ビットです。テストが通ったか、通らなかったか。数万トークンを書かせて、返ってくる採点は○か×のひとつ。この落差が、エージェント蒸留のすべての難しさの出どころです。

誤りは足し算ではなく掛け算で効く

各手が独立に確率 pp で正しいとすると、通しで成功する確率はこうなります。

P(成功)=pHP(\text{成功}) = p^{H}
(2)

「一手あたりの正しさを、手数の回数だけ掛け算する」という意味です。足し算ではなく掛け算なので、効き方が直感より激しくなります。一手あたり95%正しくても、20手続けば 0.95200.360.95^{20} \approx 0.36、つまり三回に二回は失敗します。50手なら 0.95500.0770.95^{50} \approx 0.077一手の精度をわずかに上げることが、通しの成功率では桁で効くわけです。

現実はもっと悪くなります。失敗は独立ではなく、一度おかしな道に入るとそこから先の局面がすべて訓練データに無い形になり、モデルはさらに変な手を指すからです。この「ずれが自己増幅する」現象は模倣学習では古くから知られていて、DAggerの論文(Ross et al., 2011)は、教師の軌跡をただ真似るだけでは誤差が地平線の二乗で積み上がりうること、生徒自身が訪れた局面で教師に助言を求め直せばそれを線形に抑えられることを示しました。エージェント蒸留の工夫は、ほぼすべてこの一点への対処です。

「どの手が効いたのか」という問い

では、○×ひとつしかない採点を、20手のどこに配ればいいのでしょうか。これがクレジット割当(credit assignment)、日本語なら「功績の配分」という問題です。蒸留の損失を、ターン単位の重み付き和として書いてみます。

L=t=1HwtKL(πteacher(st)  πstudent(st)),twt=1\mathcal{L} = \sum_{t=1}^{H} w_t \cdot \mathrm{KL}\Big(\pi_{\text{teacher}}(\cdot \mid s_t)\ \Big\|\ \pi_{\text{student}}(\cdot \mid s_t)\Big), \qquad \sum_{t} w_t = 1
(3)

「各ターンで教師と生徒の指し手の分布のズレ(KL)を測り、ターンごとの重み wtw_t で混ぜたものを損失にする」と言っています。π\pi は方策、つまり「その局面でどの手をどれくらいの確率で指すか」。KLは「二つの分布がどれだけ違うか」の物差しで、ここでは「同じ局面で教師と生徒の好みがどれだけ食い違うか」です。新しいのは wtw_t だけ。

その wtw_t は、ターンごとの「効いた度合い」ztz_t を softmax で割合に変える形で書けます。

wt=exp(zt/T)texp(zt/T)w_t = \frac{\exp(z_t / T)}{\sum_{t'} \exp(z_{t'} / T)}

TT は温度です。TT を大きくすると重みは全ターンに均等にばらけ、小さくすると「効いた一手」だけに集中します。極端に大きくすれば wt=1/Hw_t = 1/H の一様配分、つまり全ターンを等しく丸暗記させる普通の教師あり学習に戻ります。

FIG 1棒を「各ターンの効いた度合い」だと思って温度を動かしてみてください。温度が高いと功績は全ターンに薄く均等にばらけ(=丸暗記)、下げていくと一部のターンだけが立ち上がります。どこまで尖らせると学習が壊れるのか、という感覚がこの記事の芯です

をどう決めるかで、エージェント蒸留の流派が分かれます。

この先にあるもの

§

ここから先は会員限定です

解説記事371本・教科書26章・学生モード48単元・論文精読6本が、月額¥490ですべて読み放題になります。新しい解説は毎日3本ずつ増えます。いつでも解約でき、解約後も期間の終わりまで読めます。

会員の方はログインすると続きが表示されます

参考文献

  1. Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du et al.. (2022-10-06) ReAct: Synergizing Reasoning and Acting in Language Models. arXiv:2210.03629論文ページ·PDF
  2. A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning. arXiv:1011.0686論文ページ·PDF
  3. Distilling Step-by-Step! Outperforming Larger Language Models with Less Training Data and Smaller Model Sizes. arXiv:2305.02301論文ページ·PDF
  4. FireAct: Toward Language Agent Fine-tuning. arXiv:2310.05915論文ページ·PDF
  5. AgentTuning: Enabling Generalized Agent Abilities for LLMs. arXiv:2310.12823論文ページ·PDF
  6. Toolformer: Language Models Can Teach Themselves to Use Tools. arXiv:2302.04761論文ページ·PDF
  7. On-Policy Distillation of Language Models: Learning from Self-Generated Mistakes. arXiv:2306.13649論文ページ·PDF
  8. ArCHer: Training Language Model Agents via Hierarchical Multi-Turn RL. arXiv:2402.19446論文ページ·PDF
  9. Zi-Han Wang, Zhengxi Lu, Zhiyuan Yao, Jinyang Wu et al.. (2026-08-06) AgentOPSD: Recursive Self-Distillation for Agentic Reinforcement Learning. arXiv:2608.05987論文ページ·PDF
  10. Yijun Lu, Rui Ye, Jiajun Wang, Yuwen Du et al.. (2026-08-05) ABSeeker: Training Long-Horizon Search Agents via Answer-Backtracked Credit Assignment. arXiv:2608.05102論文ページ·PDF

本記事は上記論文の本文にもとづいて執筆しています。数値・主張は原典を優先してください。

コメント

コメントにはログインが必要です