Gated DeltaNet-2:在线性注意力中解耦擦除与写入

Gated DeltaNet-2: Decoupling Erase and Write in Linear Attention

阿里·哈塔米扎德 Ali Hatamizadeh · NVIDIA · 2026-05-21 · arXiv:2605.22791 ↗ · 被引 8

打开互动全文版(逐段中英对照 + 图/公式 + 论文问答)→

摘要 · Abstract

线性注意力用固定大小的循环状态替代了 softmax 注意力的无限缓存,将序列混合降至线性时间,解码内存恒定。难点不仅在于遗忘什么,更在于如何编辑压缩记忆而不扰乱已有关联。Delta 规则模型在写入新值前减去当前读取,Kimi Delta 注意力(KDA)通过通道级衰减增强遗忘。但活跃编辑仍使用单一标量门控制两件事:键侧擦除多少旧内容,值侧提交多少新内容。我们提出 Gated DeltaNet-2,它继承了自适应遗忘和通道级衰减,同时解决了擦除与写入之间的标量耦合问题。Gated Delta Rule-2 通过通道级擦除门 b_t 和写入门 w_t 分离这两个角色,当两门退化为同一标量时简化为 KDA,当衰减也退化时简化为 Gated DeltaNet。我们推导了快速权重更新视角、将通道级衰减吸收为非对称擦除因子的分块 WY 算法,以及保持高效并行训练的门感知反向传播。在 1.3B 参数、100B FineWeb-Edu token 训练下,Gated DeltaNet-2 在语言建模、常识推理和检索任务中,整体结果优于 Mamba-2、Gated DeltaNet、KDA 和 Mamba-3 变体。其优势在长上下文 RULER 针包基准测试中最为显著,改进了多键检索设置,并在循环和混合设置中均保持强劲性能。代码见 https://github.com/NVlabs/GatedDeltaNet-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.

核心贡献 · Key contributions

局限 · Limitations

论文章节 · Sections(共 39)

阅读逐段中英对照全文 →