Gated DeltaNet-2: Decoupling Erase and Write in Linear Attention
作者: Ali Hatamizadeh, Yejin Choi, Jan Kautz
分类: cs.AI
发布日期: 2026-05-21
备注: Gated DeltaNet-2 technical report; code at https://github.com/NVlabs/GatedDeltaNet-2
🔗 代码/项目: GITHUB
💡 一句话要点
Gated DeltaNet-2:解耦线性注意力中的擦除与写入操作,提升长程依赖建模能力。
🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture)
关键词: 线性注意力 长序列建模 解耦擦除写入 循环神经网络 门控机制
📋 核心要点
- 现有线性注意力模型在编辑压缩记忆时,擦除和写入操作耦合,限制了模型性能。
- Gated DeltaNet-2通过引入通道式擦除门和写入门,解耦了擦除和写入操作,提升了模型表达能力。
- 实验表明,Gated DeltaNet-2在语言建模、常识推理和长程依赖检索任务上优于现有模型。
📝 摘要(中文)
线性注意力使用固定大小的循环状态替代了softmax注意力的无界缓存,从而将序列混合降低到线性时间,并将解码降低到恒定内存。难点不仅在于忘记什么,还在于如何在不扰乱现有关联的情况下编辑这个压缩的记忆。Delta规则模型在写入新值之前减去当前读取的值,而Kimi Delta Attention (KDA) 通过通道式衰减来锐化遗忘。但主动编辑仍然使用单个标量门来控制两个不同的事情:在键侧擦除多少旧内容,以及在值侧提交多少新内容。我们引入了Gated DeltaNet-2,它通过继承自适应遗忘和通道式衰减来推广Gated DeltaNet和KDA,同时解决了它们的共同局限性,即擦除和写入之间的标量联系。Gated Delta Rule-2使用通道式擦除门b_t和通道式写入门w_t来分离这些角色,当两个门都坍缩为相同的标量时,它简化为KDA,当衰减也坍缩时,它简化为Gated DeltaNet。我们推导出一种快速权重更新视图,一种具有通道式衰减的块状WY算法,通道式衰减被吸收到非对称擦除因子中,以及一种门感知反向传播,可以保持高效的并行训练。在100B FineWeb-Edu tokens上训练的13亿参数的Gated DeltaNet-2在语言建模、常识推理和检索方面取得了Mamba-2、Gated DeltaNet、KDA和Mamba-3变体中最强的总体结果。它的优势在长上下文RULER needle-in-a-haystack基准测试中最为明显,它改进了评估的多键检索设置,并在循环和混合设置中保持强大。
🔬 方法详解
问题定义:现有线性注意力模型,如Gated DeltaNet和KDA,使用单个标量门控机制同时控制信息的擦除和写入,这限制了模型对信息的精细化管理能力。尤其是在长序列建模中,如何有效地更新和维护记忆状态是一个关键挑战。
核心思路:Gated DeltaNet-2的核心思路是将擦除和写入操作解耦,允许模型独立地控制需要遗忘的旧信息量以及需要写入的新信息量。通过引入独立的通道式擦除门和写入门,模型可以更灵活地调整记忆状态,从而更好地捕捉序列中的长程依赖关系。
技术框架:Gated DeltaNet-2基于Delta规则模型,并结合了线性注意力的思想。其整体架构包括以下几个主要模块:输入嵌入层、线性注意力层(包含通道式擦除门和写入门)、循环状态更新机制以及输出层。模型通过循环更新记忆状态,并在每一步使用擦除门和写入门来控制信息的流动。
关键创新:Gated DeltaNet-2最重要的技术创新点在于解耦了擦除和写入操作。与之前的模型使用单个标量门控不同,Gated DeltaNet-2使用独立的通道式门控机制,允许模型更精细地控制信息的更新。此外,论文还提出了一种快速权重更新视图,以及一种门感知反向传播算法,以保证训练效率。
关键设计:Gated DeltaNet-2的关键设计包括:1) 通道式擦除门b_t和写入门w_t,它们允许模型独立地控制每个通道的信息更新;2) 一种块状WY算法,用于加速权重更新;3) 一种门感知反向传播算法,用于优化训练过程。这些设计共同保证了模型在性能和效率上的优势。
📊 实验亮点
Gated DeltaNet-2在1.3B参数规模下,使用100B FineWeb-Edu tokens进行训练,在语言建模、常识推理和检索任务上取得了显著的性能提升。尤其是在长上下文RULER needle-in-a-haystack基准测试中,Gated DeltaNet-2表现出强大的长程依赖建模能力,优于Mamba-2、Gated DeltaNet、KDA和Mamba-3等模型。
🎯 应用场景
Gated DeltaNet-2在长序列建模领域具有广泛的应用前景,例如自然语言处理中的长文本理解、机器翻译、对话生成,以及时间序列分析、视频理解等领域。其解耦擦除和写入操作的设计思想,可以为其他序列建模任务提供借鉴。
📄 摘要(原文)
Linear attention replaces the unbounded cache of softmax attention with a fixed-size recurrent state, reducing sequence mixing to linear time and decoding to constant memory. The hard part is not just what to forget, but how to edit this compressed memory without scrambling existing associations. Delta-rule models subtract the current read before writing a new value, and Kimi Delta Attention (KDA) sharpens forgetting with channel-wise decay. But the active edit still uses a single scalar gate to control two different things: how much old content to erase on the key side and how much new content to commit on the value side. We introduce Gated DeltaNet-2, which generalizes both Gated DeltaNet and KDA by inheriting adaptive forgetting and channel-wise decay while addressing their shared limitation, the scalar tie between erasing and writing. Gated Delta Rule-2 separates these roles with a channel-wise erase gate b_t and a channel-wise write gate w_t, reducing to KDA when both gates collapse to the same scalar and to Gated DeltaNet when the decay also collapses. We derive a fast-weight update view, a chunkwise WY algorithm with channel-wise decay absorbed into asymmetric erase factors, and a gate-aware backward pass that preserves efficient parallel training. At 1.3B parameters trained on 100B FineWeb-Edu tokens, Gated DeltaNet-2 achieves the strongest overall results among Mamba-2, Gated DeltaNet, KDA, and Mamba-3 variants across language modeling, commonsense reasoning, and retrieval. Its advantage is most pronounced on long-context RULER needle-in-a-haystack benchmarks, where it improves the evaluated multi-key retrieval setting and remains strong in both recurrent and hybrid settings. Code is available at https://github.com/NVlabs/GatedDeltaNet-2.