메모리로서의 행동: 장기적 에이전트 작업을 위한 자율적 컨텍스트 큐레이션
Memory as Action: Autonomous Context Curation for Long-Horizon Agentic Tasks
October 14, 2025
저자: Yuxiang Zhang, Jiangming Shu, Ye Ma, Xueyuan Lin, Shangxi Wu, Jitao Sang
cs.AI
초록
대규모 언어 모델은 제한된 메모리로 인해 장기적인 에이전트 작업에서 방해 요소나 관련 없는 문맥에 쉽게 압도되는 문제에 직면합니다. 기존의 작업 메모리 방법은 일반적으로 에이전트의 핵심 정책과 분리된 외부적이고 경험적인 메커니즘에 의존합니다. 본 연구에서는 작업 메모리 관리를 학습 가능한 내재적 능력으로 재구성합니다. 우리는 '메모리-액션(Memory-as-Action)'이라는 새로운 프레임워크를 제안하며, 여기서 에이전트는 통합 정책의 일부로 명시적인 편집 작업을 실행하여 작업 메모리를 능동적으로 관리합니다. 이러한 방식은 강화 학습을 통해 훈련된 에이전트가 주어진 자원 제약 하에서 장기적인 작업 목표와 메모리 관리 간의 균형을 유지할 수 있게 합니다. 그러나 이러한 메모리 편집 작업은 LLM 상호작용에서 지속적으로 증가하는 접두사(prefix)라는 표준 가정을 깨뜨리며, 이로 인해 우리가 '궤적 단절(trajectory fractures)'이라 부르는 현상이 발생합니다. 이러한 비접두사 변경은 표준 정책 경사 방법이 요구하는 인과적 연속성을 방해하여 해당 방법들을 적용 불가능하게 만듭니다. 이를 해결하기 위해 우리는 새로운 알고리즘인 '동적 문맥 정책 최적화(Dynamic Context Policy Optimization)'를 제안합니다. 이 알고리즘은 메모리 액션 지점에서 궤적을 분할하고 결과적인 액션 세그먼트에 궤적 수준의 이점을 적용함으로써 안정적인 종단 간(end-to-end) 강화 학습을 가능하게 합니다. 우리의 결과는 작업 추론과 메모리 관리를 종단 간 방식으로 공동 최적화하는 것이 전반적인 계산 소비를 줄일 뿐만 아니라 모델의 내재적 능력에 맞춘 적응형 문맥 관리 전략에 의해 작업 성능을 향상시킨다는 것을 보여줍니다.
English
Large Language Models face challenges in long-horizon agentic tasks as their
constrained memory is easily overwhelmed by distracting or irrelevant context.
Existing working memory methods typically rely on external, heuristic
mechanisms that are decoupled from the agent's core policy. In this work, we
reframe working memory management as a learnable, intrinsic capability. We
propose a novel framework, Memory-as-Action, where an agent actively manages
its working memory by executing explicit editing operations as part of a
unified policy. This formulation allows an agent, trained via reinforcement
learning, to balance memory curation against long-term task objectives under
given resource constraints. However, such memory editing actions break the
standard assumption of a continuously growing prefix in LLM interactions,
leading to what we call trajectory fractures. These non-prefix changes disrupt
the causal continuity required by standard policy gradient methods, making
those methods inapplicable. To address this, we propose a new algorithm,
Dynamic Context Policy Optimization, which enables stable end-to-end
reinforcement learning by segmenting trajectories at memory action points and
applying trajectory-level advantages to the resulting action segments. Our
results demonstrate that jointly optimizing for task reasoning and memory
management in an end-to-end fashion not only reduces overall computational
consumption but also improves task performance, driven by adaptive context
curation strategies tailored to the model's intrinsic capabilities.