给AI加个“残差记忆”,长任务不再失忆
长任务AI有个通病:上下文窗口有限,干着干着就得把前面的历史压缩成一段摘要,但摘要一丢细节,后面决策就跟着跑偏。这篇的思路是给摘要“补课”:让一个专门的记忆网络,根据历史和摘要,生成一小串“软记忆”token,附在摘要后面,相当于给压缩过的信息加了一条“残差连接”——把被摘要丢掉的关键信息补回来。效果是:只用原来5.2%的输入位置,就能逼近完整上下文的水平,而且在浏览器操作、终端命令这类长任务里,AI重复调用工具、报错的次数明显变少。它不是你明天就能装上的功能,但“压缩+残差”这个思路,可能是让AI在长任务里不犯迷糊的关键一步。
📄 原文摘要(英文)
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.