卡尔曼增量网络:不确定性感知的联想记忆

·

研究论文 · 2026/09/09

线性注意力因其高效的长上下文推理和恒定内存解码而被前沿语言模型广泛采用。然而,其固定大小的循环记忆需要在每个词元处做出在线决策:在知道未来查询需要哪些信息之前,决定写入什么以及以多强的力度覆盖现有关联。Delta规则模型从当前词元嵌入中学习这种强度,但不跟踪记忆估计的置信度,导致每次写入无法适应累积证据。为了显式表示这种不确定性,我们将循环联想记忆重新表述为线性高斯状态空间模型,其中卡尔曼滤波器是最优递归估计器,并引入新模型家族——卡尔曼Delta网络(KDN)。在KDN中,状态转移同时传播记忆状态及其不确定性,使卡尔曼增益能够根据累积证据和观测可靠性对每次残差写入进行加权。在此公式下,Delta风格更新作为特例出现,它用逐词元各向同性替代品代替预测协方差,并省略协方差跟踪。然而,精确跟踪涉及密集的、状态相关的Riccati递归,不适合GPU并行的线性注意力扫描。为解决此问题,我们引入两种扫描兼容的KDN近似:对角KDN通过在线平均场变分推断将每一步后验投影到对角高斯族;各向同性KDN使用各向同性近似,每个头仅用一个不确定性标量。其不确定性递归是Mobius映射,支持对数并行深度的关联扫描。在750M和1.3B参数的受控预训练中,KDN变体在困惑度和平均下游准确率上持续优于最先进的线性注意力模型。

该论文针对线性注意力模型在记忆更新中缺乏不确定性建模的问题,提出基于卡尔曼滤波的KDN框架,理论优雅且实用性强。其近似方法兼顾性能与并行效率,实验验证了有效性,对长上下文建模和高效推理有重要参考价值。

Linear attention is increasingly used in frontier language models for efficient long-context inference and constant-memory decoding. Its fixed-size recurrent memory, however, requires an online decision at each token: what to write and how strongly to overwrite existing associations before knowing which information future queries will require. Delta-rule models learn this strength from the current token embedding but do not track confidence in the memory estimate, preventing each write from adapting to accumulated evidence. To represent this uncertainty explicitly, we reformulate recurrent associative memory as a linear--Gaussian state-space model, for which the Kalman filter is the optimal recursive estimator, and introduce a new family of models, Kalman Delta Networks (KDNs). Within KDNs, the transition propagates both the memory state and its uncertainty, allowing the Kalman gain to weight each residual write by accumulated evidence and observation reliability. Under this formulation, Delta-style updates emerge as a special case that substitutes a token-wise isotropic surrogate for predictive covariance and omits covariance tracking. Exact tracking, however, entails a dense, state-dependent Riccati recursion that is poorly suited to GPU-parallel linear-attention scans. To address this issue, we introduce two scan-compatible KDN approximations. Diagonal KDN projects each one-step posterior onto the diagonal Gaussian family through online mean-field variational inference, whereas Isotropic KDN uses an isotropic approximation with a single uncertainty scalar per head. Their uncertainty recurrences are Mobius maps, enabling associative scans with logarithmic parallel depth. Across controlled pretraining at 750M and 1.3B parameters, KDN variants consistently improve perplexity and mean downstream accuracy over state-of-the-art linear-attention models.

阅读原文

参与讨论