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)이 다중 턴 상호작용에 걸쳐 분산된 정보를 반복적으로 검색, 통합, 유지해야 한다. 그러나 모든 상호작용 이력을 보존하면 작업 컨텍스트가 지속적으로 증가하게 된다. 최근의 능동적 컨텍스트 관리 방법은 모델이 전용 도구를 사용하여 자신의 작업 컨텍스트를 편집할 수 있게 하지만, 여전히 세 가지 주요 한계가 있다. (1) 검색, 삭제, 요약으로 제한되어 전역 계획, 장기 메모리, 적응형 압축을 지원하지 않는 도구 세트, (2) 최종 결과에 미치는 영향이 서로 다름에도 컨텍스트 관리 행동을 균일하게 처리하는 비효율적인 탐색, (3) 강화 학습 중 최종 궤적 수준의 보상을 모든 중간 컨텍스트 편집 행동에 할당하는 조잡한 신용 할당 문제. 이러한 한계를 극복하기 위해, 우리는 장기 에이전트 추론을 위한 능동적 컨텍스트 관리 프레임워크인 ContextPilot을 제안한다. 우리의 접근 방식은 계획, 장기 메모리, 소프트 컨텍스트 오프로딩 도구를 도구 세트에 체계적으로 추가한다. 또한, 컨텍스트 관리에 특화된 강화 학습 방법을 제안한다. 이 방법은 컨텍스트와 엔트로피 변화를 사용하여 분기 샘플링을 위한 중요한 편집 결정을 식별하고, 해당 컨텍스트 편집 행동을 거치는 모든 분기 궤적으로부터 행동 수준의 어드밴티지를 추정한다. 장기 컨텍스트 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.