To tackle long-context reasoning tasks without the quadratic complexity of standard attention mechanisms, approaches based on agent memory have emerged, which typically maintain a dynamically updated memory when linearly processing document chunks. To mitigate the potential loss of latent evidence in this memorize-while-reading paradigm, recent works have integrated retrieval modules that allow agents to recall information previously discarded during memory overwriting. However, retrieval-based recall suffers from both evidence loss during memory formation and interference induced by invalid queries. To overcome these limitations, we propose MemReread. Built upon streaming reading, MemReread circumvents intermediate retrieval. It triggers question decomposition and rereading when the final memory is insufficient, enabling the recovery of indirect facts that were prematurely discarded. This design supports non-linear reasoning while preserving the inherent logical flow of document comprehension. To further enhance practicality, we introduce a reinforcement learning framework that enhances length extrapolation capability while dynamically determining the number of rereading passes based on task complexity, thereby flexibly controlling computational overhead. Extensive experiments demonstrate that MemReread consistently outperforms baseline frameworks on long-context reasoning tasks, while maintaining linear time complexity with respect to context length.
翻译:为在不引入标准注意力机制二次复杂度的前提下解决长上下文推理任务,基于智能体记忆的方法应运而生。此类方法通常在线性处理文档分块时维持动态更新的记忆。为缓解"边记忆边阅读"范式中潜在证据丢失的问题,近期研究引入了检索模块,使智能体能够回忆在记忆覆盖过程中被丢弃的先前信息。然而,基于检索的回忆存在两个缺陷:记忆形成过程中的证据丢失,以及无效查询引发的干扰。为克服这些局限,我们提出MemReread方法。该方法基于流式阅读机制,规避了中间检索环节:当最终记忆不足以支撑推理时,触发问题分解与重读操作,从而恢复过早丢弃的间接事实。这种设计在保持文档理解内在逻辑连贯性的同时,实现了非线性推理。为进一步提升实用性,我们引入强化学习框架,在增强长度外推能力的同时,根据任务复杂度动态确定重读次数,从而灵活控制计算开销。大量实验表明,MemReread在长上下文推理任务中始终优于基线框架,且保持与上下文长度呈线性关系的时间复杂度。