arXiv(opens in a new tab)cs.LGSep 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2609.07816

Kalman Delta Networks: Uncertainty-aware Associative Memory

Ngoc Bui, Tinglin Huang, Rex Ying

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

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 Möbius maps, enabling associative scans with logarithmic parallel depth and O(dk)O(d_k) and O(1)O(1) auxiliary state per head, respectively. 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.

1. Introduction

Self-attention is the central content-based retrieval mechanism of modern sequence models, allowing every query to retrieve the values associated with all preceding keys [Vaswani et al., 2017]. This flexibility comes from retaining the token history itself. Consequently, the autoregressive key-value cache grows with context length, and computing all query-key interactions remains quadratic in the sequence length. Linear attention offers a different scaling regime. It compresses the prefix into a fixed-size recurrent state that can be updated online and evaluated in parallel by a scan [Katharopoulos et al., 2020]. This efficiency turns attention into an online memory-management problem. Each token must edit a compressed summary of the past before the model knows which associations future queries will need. An update that is too timid preserves stale information; one that is too aggressive destroys useful memory.

Delta-rule mixers make these edits more selective. DeltaNet first reads what the memory predicts for the current key and writes only the residual [Schlag et al., 2021; Yang et al., 2024b], an update commonly interpreted as one online gradient step on the instantaneous squared prediction loss of a fast-weight memory. Gated DeltaNet [Yang et al., 2024a] and KDA [Kimi Team, 2025] retain this residual write while adding Mamba-style state-space transitions [Gu and Dao, 2023; Dao and Gu, 2024] that decay stored content at scalar or channel-wise rates. Their transition and write are therefore typically understood through different lenses: state-space dynamics and online optimization, respectively. More importantly, their write gain is predicted from the current token representation rather than derived from explicit confidence in the stored association. Consequently, these models have no explicit mechanism for deciding whether a large residual should revise a tentative association or be discounted because the association has been repeatedly confirmed.

In this paper, we provide a unified view of the recurrent updates in delta-rule mixers through a linear-Gaussian state-space formulation, under which uncertainty emerges as their missing state variable. Specifically, we model the recurrent memory as an estimate of a latent, non-stationary key-value map. Each token supplies a noisy observation of that map at one key, while the learned transition describes how the map persists or drifts between observations. Under linear-Gaussian assumptions, the Kalman filter [Kalman, 1960] is the optimal recursive estimator that propagates both the memory estimate and its covariance, balancing memory uncertainty against observation noise to determine the correction gain. The resulting update retains the residual delta-write form while assigning greater weight to new evidence when the memory is uncertain and protecting associations supported by repeated observations. This formulation leads to Kalman Associative Memory, which generalizes delta-rule mixers through explicit covariance tracking. DeltaNet, Gated DeltaNet, and KDA thus emerge as covariance-free approximations that retain different memory transitions while omitting this uncertainty recursion.

The exact Kalman update, however, is not a practical linear-attention layer. It carries a dense dk×dkd_k \times d_k covariance per head, and its gain depends on a state-dependent Riccati recurrence that is poorly suited to efficient parallel scans. To make uncertainty-aware filtering practical, we introduce Kalman Delta Networks (KDNs), a family of scan-compatible approximations to Kalman Associative Memory. We develop two special cases. Diagonal KDN imposes diagonal structure on the transition, process noise, and predictive covariance. Because each exact update still yields a dense posterior covariance, we derive an online mean-field variational update that projects the posterior back onto the diagonal family by minimizing reverse KL. Conditional on the retained diagonal predictive prior, this projection preserves the exact one-step posterior mean. To mitigate excessive overwrite under this approximation, we introduce an information-scaling factor that calibrates the retained uncertainty. Diagonal KDN maintains one uncertainty value per key channel and requires O(dk)O(d_k) auxiliary state per head, whereas Isotropic KDN uses an isotropic covariance approximation, tying these values to a single uncertainty scalar per head and requiring only O(1)O(1) auxiliary state.

Empirically, under parameter-matched recurrent-only pretraining on FineWeb-Edu [Penedo et al., 2024], both KDN variants achieve lower WikiText and LAMBADA perplexity and higher mean six-task zero-shot accuracy than every evaluated state-of-the-art linear-time recurrent mixer—including Mamba-3 [Lahoti et al., 2026], KDA [Kimi Team, 2025], and GDN-2 [Hatamizadeh et al., 2026]—at both 750M/50B and 1.3B/100B. Diagonal KDN also achieves the highest observed 14-cell RULER aggregate [Hsieh et al., 2024] at both scales. Our contributions are:

  • A principled state-space view of delta-based models. We cast the delta rule as an innovation update in a linear-Gaussian state-space model, connecting delta-based recurrent mixers to the Mamba lineage [Gu and Dao, 2023]. DeltaNet, Gated DeltaNet, and KDA use identity, scalar, and diagonal transitions, respectively; unlike Mamba's control-driven additive input write, they correct a predicted key-value map with a key-conditioned residual, while using a token-predicted rather than covariance-derived gain.

  • A hardware-efficient algorithm for uncertainty-aware associative memory. We derive Diagonal KDN through online variational inference and introduce Isotropic and Diagonal variants with O(1)O(1) and O(dk)O(d_k) uncertainty state per head, respectively. Their uncertainty updates admit an associative gain scan followed by the usual affine memory scan.

  • Overwrite analysis and empirical evidence. We identify how the diagonal uncertainty approximation can underprotect stored key directions, introduce information scaling to control future overwrite, and show improvements over the evaluated state-of-the-art delta-rule models and Mamba-3 variants in both reported perplexities and mean six-task zero-shot accuracy.

References (61)