When to Forget: Risk-Controlled Context Adaptation for Long-Horizon Agents
Chenle Chen, Yangbo Wei, Zhijie Zheng, Zhenyu Su, Qifan Wang, Junhong Qian, Chao Yao, Chen Wu, Lei He
Abstract
Long-horizon agents learn from failure, but the value of a failure record can change as execution progresses. We study when retaining, compressing, or removing the same history block improves subsequent execution relative to full-history KEEP. We introduce RECAP, a framework that combines matched context interventions, execution-relational prediction, and independent policy certification. Matched environment states and rollout seeds measure success and continuation prompt-cost differences; prefix-only relations between a failure block and the current execution propose promising edits. Independent task bundles then select a policy subject to harmful-intervention and non-positive-benefit risk constraints under a fixed measurement protocol. A five-seed longitudinal case holds both the failure block and its summary fixed: compression fails at an early state and becomes a cost-saving intervention at a later state. Across five backbones, RECAP produces positive paired-success saving estimates with backbone-specific reliability-efficiency tradeoffs. On Hunyuan-A13B, it edits 43.24% of retained checkpoints while matching KEEP's observed 91.89% continuation success and reducing unconditional mean continuation prompt cost by 4,619.8 tokens (2.13%). The framework provides an execution-level reference for deciding when to forget: retain history by its value to what comes next.
Create a lesson
Metadata
- Categories
- cs.AI, cs.LG
- Comments
- 32 pages, 5 figures, 14 tables
Related papers
MemPrice: Online Memory Allocation via Adaptive Pricing for Long-Horizon Agents
Shared title terminologycs.AIYiming Zong, Shiyuan Piao, Jiashuo Jiang et al.
From Trace to Fix: Residual Task State in Long-Horizon Agents
Shared title terminologycs.AIZile Huang, Ser-nam Lim
CoworkEnv: Synthesizing Training Environments for Long-Horizon Cowork Agents
Shared title terminologycs.AIZhongwei Xie, Yiming Du, Jiaxin Bai et al.
RL-Guided Temporal Localization for Dual-Channel Retrieval in Long-Horizon Agent Memory
Shared title terminologycs.AIDabin Sheng, Zhe Wu, Jinming Zhao et al.
MatHarness: Towards Long-Horizon Open-ended AutoResearch for Computational Materials Science
Shared title terminologycs.AIYanlin Fei, Lei Li, Shaolong Chen et al.
FinEvo: Recursive Self-Improvement for Long-Horizon Financial Modeling
Shared title terminologycs.AIChengjun Pan, Shichun Liu, Zekai Zhou et al.