When to Memorize and When to Stop: Gated Recurrent Memory for Long-Context Reasoning
Open accessAbstract
While reasoning over long context is crucial for various real-world applications, it remains challenging for large language models (LLMs) as they suffer from performance degradation as the context length grows. Recent work MemAgent has tried to tackle this by processing context chunk-by-chunk in an RNN-like loop and updating a textual memory for final answering. However, this naive recurrent memory update faces two crucial drawbacks: (i) memory can quickly explode because it can update indiscriminately, even on evidence-free chunks; and (ii) the loop lacks an exit mechanism, leading to unnecessary computation after even sufficient evidence is collected. To address these issues, we propose GRU-Mem, which incorporates two text-controlled gates for more stable and efficient long-context reasoning. Specifically, in GRU-Mem, the memory only updates when the update gate is open and the recurrent loop will exit immediately once the exit gate is open. To endow the model with such capabilities, we introduce two reward signals $r^{\text{update}}$ and $r^{\text{exit}}$ within end-to-end RL, rewarding the correct updating and exiting behaviors respectively. Experiments on various long-context reasoning tasks demonstrate the effectiveness and efficiency of GRU-Mem, which generally outperforms the vanilla MemAgent with up to 400\% times inference speed acceleration.
Integrity signals
Registry
Cites
Statistics
Claims the paper makes
Claims other papers make about this one
Each is checked against this paper’s own text: does it say what the citing paper says it does?
The agent remains prone to accumulating noisy or irrelevant information in memory, leading to memory explosion and performance decay as interactions unfold.
“Consequently, the agent remains prone to accumulating noisy or irrelevant information in memory, leading to memory explosion and performance decay as the interactions unfold (Sheng et al., 2026).”
From Meta-Cognitive Memory Policy Optimization for Long-Horizon LLM Agents (2026) · cites this paper as Sheng et al., 2026
Recursive summarization inherently accumulates semantic noise introduced by LLMs, which can induce cascading hallucinations and ultimately degrade long-horizon collapse.
“recursive summarization inherently accumulates semantic noise introduced by LLMs, which can induce cascading hallucinations and ultimately degrade long-horizon collapse (Zhang et al., 2025b; Ji et al., 2023; Sheng et al., 2026).”
From Meta-Cognitive Memory Policy Optimization for Long-Horizon LLM Agents (2026) · cites this paper as Sheng et al., 2026
Cites
RULER: What's the Real Context Size of Your Long-Context Language Models?
Hsieh, C.-P., Sun, S., Kriman, S., Acharya, S., Rekesh, D., Jia, F., Zhang, Y., & Ginsburg, B. (2024) · arXiv · Cited by 13 · cited 3× · see citing works
“In this paper, we primarily focus on the widely adopted long-context question answering (QA) tasks [12, 36].”
Self-citationAbsolute Zero: Reinforced Self-play Reasoning with Zero Data
Zhao, A., Wu, Y., Yue, Y., Wu, T., Xu, Q., Yue, Y., Lin, M., Wang, S., Wu, Q., Zheng, Z., et al. (2025) · arXiv · Cited by 13 · see citing works
Flagged first, then by citations
Cited by
Sorted by citations
Meta-Cognitive Memory Policy Optimization for Long-Horizon LLM Agents
Liu, Z., Hao, Z., Chen, Y., Wang, H., Hou, J., Ding, R., Yang, Y., Ji, W., Xia, W., & Liu, F. (2026) · arXiv · Cited by 7 · see citing works
“Despite this advantage, recursive summarization inherently accumulates semantic noise introduced by LLMs, which can induce cascading hallucinations and ultimately degrade long-horizon collapse (Zhang et al., 2025b; Ji et al., 2023; Sheng et al., 2026).”
- Authors
- Sheng, L., Zhang, Y., Ma, W., Shi, Y., Huang, T., Wang, X., Zhang, A., Shen, K., & Chua, T.-S.
- Affiliations
- National University of Singapore (SG)
- ByteDance (China) (CN)
- University of Science and Technology of China (CN)
- Venue
- arXiv
- Publisher
- arXiv
- Published
- 2026
- ISSN
- 2331-8422 (ISSN-L)
- arXiv
- 2602.10560
- OpenAlex
- W7128676761
- Cited by
- 0
- References
- 2
- Type
- posted content
- Language
- en
- Open access
- green
- arxiv.org
- Locations
- arXiv (Cornell University) (submittedVersion)
- arXiv (Cornell University)
- Topics
- Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
- Physical Sciences › Computer Science › Computer Vision and Pattern Recognition › Multimodal Machine Learning Applications
- Physical Sciences › Computer Science › Artificial Intelligence › Natural Language Processing Techniques
- Keywords
- long-context reasoning, large language models, exit mechanism, reward signals, reinforcement learning, inference efficiency
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review