ChatPaper.aiChatPaper

ContextPilot: 細粒度強化学習によるプロアクティブなコンテキスト管理エージェントの学習

ContextPilot: Teaching Agents for Proactive Context Management via Fine-grained RL

August 28, 2026
著者: Zhuoshi Pan, Qizhi Pei, Junru Lu, Honglin Lin, H. Vicky Zhao, Di Yin, Xing Sun
cs.AI

要旨

長期的なエージェントタスクでは、大規模言語モデル(LLM)がマルチターン対話を通じて分散した情報を反復的に検索・統合・保持することが求められるが、すべての対話履歴を保持すると作業コンテキストが継続的に増大してしまう。近年のプロアクティブなコンテキスト管理手法は、モデルが専用ツールを用いて自身の作業コンテキストを編集することを可能にするが、依然として次の3つの主要な制限がある。(1) ツールセットが検索・削除・要約に限定されており、グローバルな計画、長期記憶、適応的圧縮をサポートしない。(2) コンテキスト管理アクションを、最終結果への影響が異なるにもかかわらず一律に扱うため、探索が非効率である。(3) 強化学習中、最終的な軌跡レベルの報酬をすべての中間的なコンテキスト編集アクションに割り当てるため、クレジット割り当てが粗粒度である。これらのギャップを埋めるため、我々は長期的エージェント推論のためのプロアクティブなコンテキスト管理フレームワークであるContextPilotを提案する。本手法は、計画、長期記憶、ソフトコンテキストオフロードツールをツールセットに体系的に追加する。さらに、コンテキスト管理に特化したRL手法を提案する。この手法は、コンテキストとエントロピーの変動を用いて分岐サンプリングのための重要な編集決定を特定し、対応するコンテキスト編集アクションを通過するすべての分岐軌跡からアクションレベルのアドバンテージを推定する。長期コンテキストQAおよび深層検索タスクにおける実験により、ContextPilotがよりコンパクトな作業コンテキストでより強力な性能を達成し、様々なベースモデルとベンチマークにわたって既存のベースラインを一貫して上回ることが示された。コードは https://github.com/Tencent/ContextPilot で公開されている。
English
Long-horizon agentic tasks require large language models (LLMs) to iteratively retrieve, integrate, and maintain dispersed information across multi-turn interactions, but preserving all interaction histories leads to a continuously growing working context. Recent proactive context management methods allow models to edit their own working context with specialized tools, yet they still face three key limitations: (1) a limited toolset restricted to search, deletion, and summarization, with no support for global planning, long-term memory, and adaptive compression; (2) inefficient exploration that treats context management actions uniformly despite their heterogeneous impacts on final outcomes; and (3) coarse-grained credit assignment that assigns the final trajectory-level reward to all intermediate context editing actions during RL. To bridge these gaps, we introduce ContextPilot, a proactive context management framework for long-horizon agentic reasoning. Our approach systematically augments the toolset with planning, long-term memory, and soft context offloading tools. We further propose an RL method tailored for context management, which uses context and entropy variation to identify critical editing decisions for branch sampling and estimates action-level advantages from all branched trajectories that pass through the corresponding context editing action. Experiments on long-context QA and deep search tasks show that ContextPilot achieves stronger performance with a more compact working context, consistently outperforming existing baselines across various base models and benchmarks. Code is available at https://github.com/Tencent/ContextPilot.