REMORY:学习残差记忆以实现上下文压缩
研究论文 · 2026/10/09
长时程智能体通过压缩历史以适应有限上下文窗口,但纯文本摘要可能无法支持后续所有决策。我们提出REMORY,一种神经记忆网络,用有界的软记忆令牌序列补充摘要。给定历史和摘要,该网络学习生成令牌,帮助冻结的LLM逼近其在完整历史下产生的续写。这些令牌以摘要为条件并附加其后,形成沿序列维度的残差连接类似物。在SummHay上,REMORY在洞察覆盖率几乎不变的情况下提升了来源归因,仅使用5.2%的输入位置就接近完整上下文的联合得分。在长时程智能体基准上,Qwen3.8-27B和GLM-5.3-Flash在残差记忆下表现出一致提升。两个模型在BrowseComp和Terminal-Bench 2.1上也显著减少了重复工具输出和工具错误。
该工作为长时程智能体的上下文压缩提供了一种轻量且有效的神经记忆增强方案,在多个基准上验证了其提升效果与效率。
Long-horizon agents compact their history to continue within a finite context window, but a textual summary alone may not support every subsequent decision. We introduce REMORY, a neural memory network that supplements the summary with a bounded sequence of soft memory tokens. Given the history and summary, the network learns to generate tokens that help a frozen LLM approximate the continuation it would produce with the full history. The tokens are conditioned on the summary and appended after it, forming an analogue of a residual connection along the sequence dimension. On SummHay, REMORY improves source attribution at nearly unchanged insight coverage and approaches the full-context joint score using only 5.2% of the input positions. Across long-horizon agent benchmarks, Qwen3.8-27B and GLM-5.3-Flash show consistent gains with residual memory. Both models also exhibit substantially fewer repeated tool outputs and tool errors on BrowseComp and Terminal-Bench 2.1.