跳转至

历史在此重演:利用原生重放释放线性注意力的百万长上下文能力

History Replays Itself: Unleashing Long-Context Capability in Linear Attention

arXiv:2610.15715 [cs.AI, cs.LG]
Authors: Li Nanbo, Firas Laakom, Yilan Zhang, Piotr Piękos, Yimeng Chen, Liangyu Wang, Yifan Xu, Mateusz Ostaszewski, Dandan Guo, Wenyi Wang, Yanning Dai, Yuhui Wang, Jürgen Schmidhuber
Submitted: October 11, 2026
Project Page: nanboli.github.io/notebank-page
Paper: arXiv:2610.15715 | View PDF

文章背景与核心概要

在长上下文语言建模 (Long-Context Language Modeling) 领域,以线性注意力 (Linear Attention) 为代表的循环神经网络架构凭借优越的推理计算效率被寄予厚望;然而受限于固定尺寸的循环隐状态,模型既要在自回归过程中维系每一步的前向计算,又不得不设法容纳无限延伸的历史信息,极易在处理超长文本时遭遇严重的“记忆遗忘”。学术界此前普遍认为,正是这种状态容量的物理天花板锁死了线性注意力的长上下文扩展上限。针对这一核心瓶颈,Li Nanbo 与 Jürgen Schmidhuber 等研究人员提出了创新的 NoteBank 框架,打破了“循环计算必须孤身背负长时记忆全部负担”的传统定势——它构建了一种稀疏情境记忆 (Sparse Episodic Memory) 体系,在未知未来提问的情况下预先归档高价值文本,并直接复用主干网络的原生特征进行写入与寻址,最终借助“原生重放 (Native Replay) ”在前向计算中直接阅读并召回关键事实证据。这项免训练、即插即用的方案在高达 100 万 Token 的严苛评估下,将 Gated DeltaNet 在 RULER 检索基准上的平均准确率从濒临失效的 1.7% 跨越式提升至 70.3%,且在 4K 到 1M 的超大跨度内几乎没有出现检索衰退。尤为难能可贵的是,该方法仅引入了极小的计算开销 (理论分析浮点运算量 FLOPs 增幅 \(\leqslant\)0.025%) ,持久化上下文存储需求更是仅为传统 Transformer 完整多头注意力键值缓存 (KV Cache) 的约 1/2,600,为极低代价实现百万级长上下文能力提供了全新的技术突破口。


内容概要

Summary

线性注意力模型凭借卓越的计算效率,一直被视为长上下文语言建模的理想方案;然而在传统实践中,它们往往陷入左右为难的困局——其固定尺寸的循环隐状态既要支撑当下的实时计算,又要艰难背负不断累积的历史信息。本文正是要直面并挑战这一长期存在的固有观念:循环状态本身的物理存储容量,并不必然等同于模型长上下文能力的天花板。

Linear attention models offer the efficiency required for long-context language modeling, but traditionally struggle because their fixed-size recurrent states must simultaneously handle ongoing computation and retain an ever-growing history. This paper challenges the assumption that the recurrent state's memory capacity dictates a model's long-context limit.

作者团队为此提出了 NoteBank——一种创新的稀疏情境记忆架构。它在未来提问尚不可知的前提下,前瞻性地甄选并归档重要文本;同时直接调用主干网络的原生特征进行写入与索引寻址,并在需要时通过“重放”机制将检索到的证据无缝融入标准前向计算进行读取。这种免训练、即插即用的轻量方案彻底摆脱了对外部嵌入模型、独立训练检索器或专用神经阅读器的依赖。在高达 100 万 Token 的超长上下文评测中,NoteBank 展现出惊人的威力:它将 Gated DeltaNet 在六项 RULER 检索任务上的平均准确率从近乎不可用的 1.7% 奇迹般提升至 70.3%,且在测试全流程中未见明显性能衰退。更令人瞩目的是,该方法仅引入了极小的理论计算开销 (理论分析浮点运算量 FLOPs 增幅 \(\leqslant\)0.025%) ,其上下文存储占用也仅为传统 Transformer 的一小部分。跨越多种主干网络——包括三款 1.3B 循环模型、Mamba-2-8B 以及 Qwen3.5-9B——的广泛实验表明,NoteBank 在 LongBench v1/v2 与 MemoryAgentBench 基准上均带来了持续且稳健的性能跃升。

The authors introduce NoteBank, a sparse episodic memory framework that archives selected text before future queries are known, leverages the backbone's native features for writing and addressing, and retrieves evidence through standard forward computation via replay. This training-free, plug-and-play approach requires no external embedding models, separate retrievers, or dedicated neural readers. At one million tokens, NoteBank dramatically increases Gated DeltaNet's mean accuracy across six RULER retrieval tasks from 1.7% to 70.3% without notable degradation. Furthermore, it adds minimal overhead (\(\leqslant\)0.025% to analytical FLOPs) while utilizing a fraction of the context storage required by traditional Transformers. Experiments span multiple backbones—including 1.3B recurrent models, Mamba-2-8B, and Qwen3.5-9B—demonstrating consistent performance gains on LongBench v1/v2 and MemoryAgentBench.


论文摘要

Abstract

线性注意力展现了长上下文语言建模梦寐以求的高效潜力,但其固定尺寸的循环隐状态却背负着双重重压:既要维系眼下源源不断的实时计算,又要持久封存无限延展的历史信息。这种计算与记忆的深度纠缠,催生并强化了一种学界的主流认知——即隐状态本身的存储容量上限,直接决定了模型长上下文能力的边界。

Linear attention promises the efficiency needed for long-context language modelling, yet its fixed-size recurrent state must simultaneously support ongoing computation and preserve information from an ever-growing history. This coupling has reinforced a prevailing view that the state's memory capacity defines the model's long-context capability.

我们明确对这一假想的天花板提出挑战:循环计算本就不必孤身背负长期存储的全部重担。为此,我们提出了 NoteBank——一种创新的稀疏情境记忆机制。它在未来的提问尚不可知之时,即预先筛选并留存核心文本片段;完全复用主干网络的原生表征完成信息的写入与寻址;并通过“重放”机制将检索到的证据无缝注入原生前向计算中进行阅读。这一 免训练、即插即用 (Training-Free, Plug-and-Play) 的接口无需任何额外的外部嵌入模型、专门训练的检索模块或独立的神经阅读器。

We challenge this presumed ceiling: recurrent computation need not bear the full burden of long-term storage. We introduce NoteBank, a sparse episodic memory that archives selected text before future queries are known, uses the backbone's native features for writing and addressing, and reads retrieved evidence through its native forward computation via replay. This training-free, plug-and-play interface requires no external embedding model, separately trained retriever, or separate neural reader.

在长达 100 万 Token 的超长上下文规模下,NoteBank 将 Gated DeltaNet 在六项 RULER 检索任务上的平均准确率从濒临失效的 1.7% 激增至 70.3%,且从 4K 到 1M Token 跨度内未见任何显著的检索性能退化。这种能力的强势挽回仅带来了微不足道的计算代价 (理论分析浮点运算量 FLOPs 增幅 \(\leqslant\)0.025%) ,在相同的模型宽度、深度与数值精度下,其持久化上下文存储体积仅为标准 Transformer 完整多头注意力键值缓存 (Full MHA KV Cache) 的约 1/2,600。我们的评测体系涵盖了从三款 1.3B 循环主干到 Mamba-2-8B 以及后训练版 Qwen3.5-9B 的丰富模型阵列,在 LongBench v1/v2 与 MemoryAgentBench 基准上均取得了持续一致的性能提升。综合各项成果,本文有力证明:稀疏证据存储与原生重放机制能够在完美保留循环计算极致效率的同时,大幅解锁预训练线性注意力模型的百万级长上下文潜能。

At one million tokens, it raises Gated DeltaNet's mean accuracy across six RULER retrieval tasks from 1.7% to 70.3%, with no observed significant retrieval degradation from 4K to 1M tokens. This recovery adds \(\leqslant\)0.025% to analytical FLOPs, with persistent context storage approximately 1/2,600 that of a Transformer's full MHA KV cache at matched width, depth, and precision. Experiments extend from three 1.3B recurrent backbones to Mamba-2-8B and post-trained Qwen3.5-9B, demonstrating gains on LongBench v1/v2 and MemoryAgentBench. Together, these results show that sparse evidence storage and native replay can substantially expand the long-context capability of pretrained linear attention models while retaining the efficiency of recurrent computation.


元数据与相关资源

Metadata & Resources