DAMI:面向门控线性注意力中增强长上下文检索的双轴记忆初始化
研究论文 · 2026/11/03
线性注意力随序列长度线性扩展,但其有限状态记忆可能限制长上下文检索。在门控线性递归中,记忆保持取决于状态衰减,而状态衰减由门控参数A_log和dt_bias以及输入激活共同决定。在受控的Gated DeltaNet (GDN)实验中,这两个参数在训练后仍与其初始值高度相关,凸显了初始化的重要性。因此,我们提出了双轴记忆初始化(DAMI),在训练前联合配置这些参数。DAMI为不同头分配几何时间尺度以覆盖不同的检索距离,并在层间采用低-高-低的输入敏感性配置。通过少量激活样本校准GDN系列实现,以匹配两个行为目标,且不增加可训练参数。在GDN、KDA、GDN2、Mamba-2和RWKV-7上,DAMI将平均RULER风格检索准确率比相应的随机初始化基线提高了5.29至16.71个百分点。在语言建模、常识推理和2K真实世界检索上的性能与这些基线大致相当。代码见https://speedai.com/research/dami。
该论文提出了一种简单有效的初始化方法,显著提升了多种线性注意力模型的长上下文检索能力,且不增加参数,具有较高的实用价值。
Linear attention scales linearly with sequence length, but its finite-state memory can limit long-context retrieval. In gated linear recurrences, memory retention depends on state decay, which is shaped jointly by gate parameters A_log and dt_bias and by input activations. In controlled Gated DeltaNet (GDN) experiments, both parameters remain highly correlated with their initial values after training, highlighting the importance of initialization. Therefore, we introduce Dual-Axis Memory Initialization (DAMI), which jointly configures these parameters before training. DAMI assigns geometric timescales across heads for varied retrieval distances and a low-high-low input-sensitivity profile across layers. A small activation sample calibrates the GDN-family implementation to match both behavioral targets without adding trainable parameters. Across GDN, KDA, GDN2, Mamba-2, and RWKV-7, DAMI improves average RULER-style retrieval accuracy by 5.29 to 16.71 percentage points over the corresponding random-initialization baselines. Performance on language modeling, commonsense reasoning, and 2K real-world retrieval remains broadly comparable to those baselines. Our code is available at https://speedai.com/research/dami.