장기적 목표를 위한 LLM 에이전트의 확장: 컨텍스트 접기를 통한 접근
Scaling Long-Horizon LLM Agent via Context-Folding
October 13, 2025
저자: Weiwei Sun, Miao Lu, Zhan Ling, Kang Liu, Xuesong Yao, Yiming Yang, Jiecao Chen
cs.AI
초록
대규모 언어 모델(LLM) 에이전트는 장기적인 과제에서 컨텍스트 길이에 의해 근본적으로 제약을 받습니다. 우리는 에이전트가 작업 컨텍스트를 능동적으로 관리할 수 있도록 하는 Context-Folding 프레임워크를 소개합니다. 이 프레임워크에서 에이전트는 서브태스크를 처리하기 위해 절차적으로 서브트래젝토리로 분기하고, 완료 후 이를 접어 중간 단계를 축소하면서도 결과에 대한 간결한 요약을 유지할 수 있습니다. 이러한 동작을 학습 가능하게 만들기 위해, 우리는 효과적인 태스크 분해와 컨텍스트 관리를 장려하기 위한 특정 프로세스 보상을 포함한 종단 간 강화 학습 프레임워크인 FoldGRPO를 개발했습니다. 복잡한 장기 과제(Deep Research 및 SWE)에서, 우리의 폴딩 에이전트는 ReAct 기준선과 동등하거나 더 나은 성능을 보이면서도 활성 컨텍스트를 10배 더 작게 사용하며, 요약 기반 컨텍스트 관리에 의존하는 모델들을 크게 능가합니다.
English
Large language model (LLM) agents are fundamentally constrained by context
length on long-horizon tasks. We introduce Context-Folding, a framework that
empowers agents to actively manage their working context. An agent can
procedurally branch into a sub-trajectory to handle a subtask and then fold it
upon completion, collapsing the intermediate steps while retaining a concise
summary of the outcome. To make this behavior learnable, we develop an
end-to-end reinforcement learning framework FoldGRPO with specific process
rewards to encourage effective task decomposition and context management. On
complex long-horizon tasks (Deep Research and SWE), our folding agent matches
or outperforms the ReAct baselines while using an active context 10times
smaller and significantly outperforms models that rely on summarization-based
context management.