When to Forget: Risk-Controlled Context Adaptation for Long-Horizon Agents

Chenle Chen, Yangbo Wei, Zhijie Zheng, Zhenyu Su, Qifan Wang +4 more
10/16/2026
cs.AIcs.LG

No confident code implementation found for this paper.

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{chen2026when,
  title  = {When to Forget: Risk-Controlled Context Adaptation for Long-Horizon Agents},
  author = {Chenle Chen and Yangbo Wei and Zhijie Zheng and Zhenyu Su and Qifan Wang and Junhong Qian and Chao Yao and Chen Wu and Lei He},
  year   = {2026},
  eprint = {2610.22897},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2610.22897v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2610.22897.svg)](https://codeofpaper.com/paper/2610.22897)

Discussion