ReContext: Recursive Evidence Replay as LLM Harness for Long-Context Reasoning

Yanjun Zhao, Ruizhong Qiu, Tianxin Wei, Yuanchen Bei, Zhining Liu +4 more
7/2/2026
5 citations
cs.AI

Official code: Yanjun-Zhao/ReContext (13 stars, Python, MIT, last commit 2026-07-01).

Abstract

Understanding and reasoning over long contexts has become a key requirement for deploying large language models (LLMs) in realistic applications. Although recent LLMs support increasingly long context windows, they often fail to use relevant evidence that is already present in the input, revealing a gap between context access and effective context utilization.

Show full abstract

In this work, we propose Recursive Evidence Replay as LLM Harness for Long-Context Reasoning (RECONTEXT), a training-free inference method for improving long-context reasoning. RECONTEXT uses model-internal relevance signals to construct a query-conditioned evidence pool and replays it before final generation while preserving the full original context. This recursive selection process separates evidence organization from answer generation without training, external memory, or context pruning. We also provide a theoretical analysis based on associative memory, which characterizes the context as a memory store, the question as a retrieval cue, attention as cue-trace association, and replay as trace reactivation. Experiments on eight long-context datasets with 128K context length show that RECONTEXT consistently improves evidence utilization across Qwen3-4B, Qwen3-8B, and Llama3-8B, achieving the best average rank on all three backbones. Code is available at https://github.com/Yanjun-Zhao/ReContext.

View on arXivView PDF

Code Implementations(1)

MIT
130Python, ShellJul 1, 20265 months agoMIT

Similar Papers

Cite this paper

@article{zhao2026recontext,
  title  = {ReContext: Recursive Evidence Replay as LLM Harness for Long-Context Reasoning},
  author = {Yanjun Zhao and Ruizhong Qiu and Tianxin Wei and Yuanchen Bei and Zhining Liu and Lingjie Chen and Ismini Lourentzou and Hanghang Tong and Jingrui He},
  year   = {2026},
  eprint = {2607.02509},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2607.02509v1}
}

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

Discussion