TL;DR
MemReread is a novel framework that significantly boosts the long-context reasoning capabilities of Large Language Model (LLM) agents by decoupling reading from reasoning. Instead of relying on noisy intermediate retrieval mechanisms during text processing, MemReread utilizes a streaming memory approach and triggers targeted, question-guided rereading passes only when the final memory is deemed insufficient. Optimized via a specialized reinforcement learning strategy, it consistently outperforms existing memory agents while maintaining linear time complexity and constant space complexity.
What Problem Does This Paper Address?
Standard attention mechanisms in LLMs suffer from quadratic computational complexity ($O(N^2)$), making the processing of ultra-long documents prohibitively expensive. To circumvent this, researchers have developed chunk-level memory agents that process text sequentially in smaller segments ("memorize-while-reading"). However, these agents face two critical bottlenecks:
- Permanent Latent Evidence Loss: Early facts whose relevance only becomes clear after reading later context are often discarded as "noise" during sequential memory updates. Once discarded, they are lost forever.
- Invalid Query Interference: To fix information loss, some frameworks add retrieval modules. However, these modules continuously generate queries without knowing whether the missing information was already overwritten or simply resides further down in unread chunks. This creates a cascade of irrelevant retrievals that pollute the agent's memory buffer.
Methods
The authors propose MemReread, a framework structured into four distinct execution phases:
- Read: The agent processes document chunks sequentially, maintaining a bounded memory buffer without performing any intermediate retrieval.
- Decompose: Upon completing the initial pass, the agent evaluates whether its terminal memory contains sufficient evidence to answer the root question. If gaps are identified, it decomposes the problem to isolate the highest-priority sub-question.
- Integrate: Guided by this new sub-question, the agent executes a targeted rereading pass over the document, derives a sub-answer, and integrates this clean QA pair back into the root memory while discarding intermediate sub-memories. This loop repeats iteratively until the memory is complete.
- Answer: The final response is generated relying exclusively on the fully updated root memory buffer.
To manage the computational overhead of multiple passes, the authors introduce Rereading-Adaptive Group Relative Policy Optimization (ReA-GRPO). This reinforcement learning framework modulates policy advantages based on the number of rereading passes—penalizing excessive passes for easy questions to incentivize brevity, while rewarding additional exploration on highly complex tasks.
Datasets
- Global Reasoning Task: A new diagnostic benchmark synthesized by the authors based on RULER-QA. It decouples evidence from background context to evaluate models from 8K to 1M tokens across two sub-tasks: statistics and variable tracking.
- HotpotQA: Used for in-distribution training and evaluation.
- 2WikiMultiHopQA: Utilized as an out-of-distribution (OOD) evaluation suite to test the model's cross-domain generalization.
- Other Benchmarks: LongBench-E-QA and LongBench-v2 were leveraged to evaluate task adaptability and multi-hop complexity.
Key Insights and Ideas
- Decoupling Reading from Reasoning: Forcing an LLM to reason, generate queries, and retrieve information while actively ingesting long text causes cognitive overload and memory pollution. Separating information acquisition (reading) from gap identification (reasoning) preserves the natural logical flow of document comprehension.
- The Hidden Cost of Retrieval: Counterintuitively, adding chunk-level retrieval modules to streaming agents can degrade performance on complex reasoning tasks due to query-chunk misalignment and noise accumulation.
- Task-Adaptive Compute: Not all long-context tasks require the same amount of processing. Thanks to ReA-GRPO training, MemReread dynamically adjusts its behavior—performing almost zero rereadings for simple linear tasks, but scaling up to multiple passes for intricate multi-hop reasoning.
Key Results
- State-of-the-Art Accuracy: MemReread consistently outperforms pure streaming (MemAgent) and retrieval-augmented (ReMemR1) baselines. Notably, the 4B parameter model achieved up to a 12.1% accuracy improvement over ReMemR1 on OOD multi-hop reasoning datasets.
- Favorable Computational Overhead: The framework maintains a linear time complexity of $O(p_c \cdot n)$ (where $p_c$ is the maximum number of rereading passes and $n$ is context length). Crucially, it maintains a constant space complexity by avoiding the storage of historical chunk memories, capping the active context window under 8K tokens at all times.
- Zero-Shot Scalability: The framework scales seamlessly without training to massive foundation models, including Qwen-Plus (>200B) and Qwen-Max (>1000B), demonstrating strong cross-architecture universality.
Limitations and Future Work
- Task Generalization: The current evaluation focuses almost exclusively on long-context QA and reasoning tasks. Further empirical validation is required to test its efficacy in domains like code understanding, text summarization, and long-form generation.
- Inference Latency: Because MemReread introduces an additional rereading phase, it inherently incurs a 3–4× higher average runtime latency compared to single-pass streaming approaches.
- Dependence on Intrinsic Capabilities: The framework's success is ultimately bounded by the backbone model's inherent reasoning and question-decomposition capabilities; weak base models may generate invalid sub-questions or fail during memory integration.
Summary updated