When to Forget: Risk-Controlled Context Adaptation for Long-Horizon Agents
Not on the map. Why?
Abstract (arXiv)
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.
Key facts. No citing papers in the map yet (data through 26 Nov 2026). Builds on 33 of its 38 references that are in the map. Submitted 16 Oct 2026.
Builds on
33 of 38 references.
References · 33
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 9,589
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,559
- 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,789
- 2023Generative Agents: Interactive Simulacra of Human Behaviorcited by 3,841
- 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,799
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,765
- 2023Voyager: An Open-Ended Embodied Agent with Large Language Modelscited by 2,483
- 2023WebArena: A Realistic Web Environment for Building Autonomous Agentscited by 2,232
- 2024τ-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domainscited by 1,714
- 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,559
- 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,557
- 2023AgentBench: Evaluating LLMs as Agentscited by 1,401
21 more
- 2025A-MEM: Agentic Memory for LLM Agentscited by 1,253
- 2017Selective Classification for Deep Neural Networkscited by 1,025
- 2024Evaluating Very Long-Term Conversational Memory of LLM Agentscited by 977
- 2025Mem0: Building Production-Ready AI Agents with Scalable Long-Term Memorycited by 915
- 2023MemoryBank: Enhancing Large Language Models with Long-Term Memorycited by 630
- 2023LongLLMLingua: Accelerating and Enhancing LLMs in Long Context Scenarios via Prompt Compressioncited by 500
- 2023Learning to Compress Prompts with Gist Tokenscited by 426
- 2024LLMLingua-2: Data Distillation for Efficient and Faithful Task-Agnostic Prompt Compressioncited by 397
- 2022Conformal Risk Controlcited by 369
- 2021Learn then Test: Calibrating Predictive Algorithms to Achieve Risk Controlcited by 345
- 2021Distribution-Free, Risk-Controlling Prediction Setscited by 330
- 2023LLMLingua: Compressing Prompts for Accelerated Inference of Large Language Modelscited by 324
- 2023In-context Autoencoder for Context Compression in a Large Language Modelcited by 227
- 2023Compressing Context to Enhance Inference Efficiency of Large Language Modelscited by 208
- 2025Scaling Long-Horizon LLM Agent via Context-Foldingcited by 180
- 2017Safe Policy Improvement with Baseline Bootstrappingcited by 159
- 2025AgentFold: Long-Horizon Web Agents with Proactive Context Managementcited by 120
- 2026Agentic Memory: Learning Unified Long-Term and Short-Term Memory Management for Large Language Model Agentscited by 91
- 2023Prompt Risk Control: A Rigorous Framework for Responsible Deployment of Large Language Modelscited by 20
- 2026Not All Skills Help: Measuring and Repairing Agent Knowledgecited by 11
- 2026AgentCE-Bench: Agent Configurable Evaluation with Scalable Horizons and Controllable Difficulty under Lightweight Environmentscited by 5
Built on by
Not cited yet.