Gated DeltaNet-2:解耦擦除与写入的线性注意力
Gated DeltaNet-2: Decoupling Erase and Write in Linear Attention
AI总结:
本文提出Gated DeltaNet-2,通过引入通道级擦除门和写入门,解耦了线性注意力中擦除与写入的控制,从而在语言模型、常识推理和检索任务中取得了最佳性能,特别是在长上下文检索任务中表现突出。
摘要:
线性注意力将softmax注意力的无界缓存替换为固定大小的递归状态,将序列混合时间降低到线性,解码内存降至常数。难点不仅在于决定遗忘什么,还在于如何编辑压缩的记忆而不打乱现有关联。Delta规则模型在写入新值前减去当前读取值,而Kimi Delta注意力(KDA)通过通道级衰减来增强遗忘。但主动编辑仍使用单个标量门控制两件事:在键侧擦除旧内容的程度和在值侧提交新内容的程度。我们引入了Gated DeltaNet-2,通过继承自适应遗忘和通道级衰减,同时解决其共同限制,即擦除与写入之间的标量关联。Gated Delta Rule-2通过通道级擦除门b_t和通道级写入门w_t分离这些角色,当两个门坍缩为同一标量时退化为KDA,当衰减也坍缩时退化为Gated DeltaNet。我们推导出快速权重更新视图,一种分块的WY算法,将通道级衰减吸收进不对称擦除因子中,并提出一种门感知的反向传播,以保持高效的并行训练。在130亿参数在10000亿FineWeb-Edu标记上训练的情况下,Gated DeltaNet-2在语言模型、常识推理和检索任务中取得了最强的整体结果。其优势在长上下文RULER针在 haystack 检索基准中最为明显,其中它改进了评估的多键检索设置,并在递归和混合设置中保持强劲。代码可在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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。