Diagnosing and Mitigating Context Rot in Long-horizon Search

Shijie Xia, Yikun Wang, Zhen Huang, Pengfei Liu
6/29/2026
cs.IRcs.AIcs.CL

No official code found. Best implementation: GAIR-NLP/ContextRot (5 stars, last commit 2026-06-30).

Abstract

Extensive context has become the norm as Large Language Models (LLMs) are increasingly deployed in long-horizon tasks. The concern that increasing context length degrades model capabilities, known as context rot, has become a central issue for these applications. In this paper, we focus on deep search scenarios, aiming to investigate the rot phenomenon and its mitigation strategies. By evaluating four flagship open-source models across three benchmarks, we reveal a prevalent but unnoticed rot phenomenon: extensive context causes models to directly give up or prematurely provide uncertain answers, and this issue is exacerbated as the context grows. Through pruning experiments, we demonstrate the relationship between the accumulated context and the rot phenomenon. Furthermore, we investigate mitigating this issue through context management and post-hoc rejection sampling. For context management, we systematically evaluate seven different methods across three categories, based on performance, cost, and impact on context rot, providing clear guidance for strategy selection and usage. For rejection sampling, we develop a rot-aware filtering strategy and demonstrate its effectiveness across three aggregation methods. Finally, we show that these two approaches can be combined for further performance improvements.

View on arXivView PDF

Code Implementations(1)

Diagnosing and Mitigating Context Rot in Long-horizon Search

50Jun 15, 20263 months ago

Cite this paper

@article{xia2026diagnosing,
  title  = {Diagnosing and Mitigating Context Rot in Long-horizon Search},
  author = {Shijie Xia and Yikun Wang and Zhen Huang and Pengfei Liu},
  year   = {2026},
  eprint = {2606.29718},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2606.29718v1}
}

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/2606.29718.svg)](https://codeofpaper.com/paper/2606.29718)

Discussion