Continuous Context Management
cs.AI
Submitted: 2026-09-28
Updated: 2026-09-28
Project page: https://autocompact.github.io
License: http://creativecommons.org/licenses/by/4.0/
The gist: Long-horizon large language model (LLM) agents commonly retain their complete interaction history until compaction is triggered at a predefined threshold.
Abstract
Long-horizon large language model (LLM) agents commonly retain their complete interaction history until compaction is triggered at a predefined threshold. We study Continuous Context Management (CCM), which performs compaction at every turn to prevent interaction history from accumulating in the active prompt. At each turn, a CCM agent emits an updated memory together with an environment action; its next prompt contains the original task, retained memory, and newest observation rather than the complete transcript. We first evaluate CCM without fine-tuning on TerminalBench-2 using Claude Sonnet 4.6, Claude Opus 4.6, GLM-5, and Kimi K3. CCM substantially reduces cumulative input usage and active-prompt size, although it lowers task success for most models while preserving performance for Kimi K3. We use GRPO with privileged full-history distillation to improve CCM in open-weight models. A frozen copy of the student's initial model scores each sampled student action under the complete history reconstructed from that student's rollout, providing dense action-token supervision without a separate teacher rollout or reference solution. On WebShop, this objective substantially improves CCM over GRPO at both evaluated model scales and surpasses full-history GRPO for Qwen3-4B-Instruct, though not for Qwen3-8B. On Endless Terminals, the augmented method provides a modest improvement over GRPO, with both CCM policies outperforming the untrained full-history baseline. These results demonstrate that CCM is a viable inference paradigm for agents operating with substantially reduced retained context and that its performance can be improved through reinforcement learning with privileged full-history distillation.
Sources
- Context Length Alone Hurts LLM Performance Despite Perfect Retrieval
- Group-in-Group Policy Optimization for LLM Agent Training
- Endless Terminals: Scaling RL Environments for Terminal Agents
- Self-Distillation Zero: Self-Revision Turns Binary Rewards into Dense Supervision
- ACON: Optimizing Context Compression for Long-horizon LLM Agents
- MEMENTO: Teaching LLMs to Manage Their Own Context
- Self-Compacting Language Model Agents
- ACM: Agentic Context Management for Long Horizon Tasks
- Scaling LLM Multi-turn RL with End-to-end Summarization-based Context Management
- Self-Distilled Agentic Reinforcement Learning
- DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models
- Self-Distillation Enables Continual Learning
- ReSum: Unlocking Long-Horizon Search Intelligence via Context Summarization
- Learning beyond Teacher: Generalized On-Policy Distillation with Reward Extrapolation
- WebShop: Towards Scalable Real-World Web Interaction with Grounded Language Agents
- On-Policy Context Distillation for Language Models
- Agentic Context Engineering: Evolving Contexts for Self-Improving Language Models
- Embarrassingly Simple Self-Distillation Improves Code Generation
- Self-Distilled Reasoner: On-Policy Self-Distillation for Large Language Models
Related papers
- MAVEN-T: Reinforced Heterogeneous Distillation for Real-Time Multi-Agent Trajectory Prediction
- Model Discovery Agent: LLM-assisted Bayesian experiment design for data-efficient discovery of mechanistic world models
- Agents' Last Exam
- The Clinician's Veto: Navigating Trust, Liability, and Uncertainty in Autonomous AI Prescribing
- MindHelper: Closed-Loop Embodied Mental-State Reasoning for Precision Intervention
- Incumbent Advantage: Brand Bias and Cognitive Manipulation Dynamics in LLM Recommendation Systems