TL;DR
Linear attention models are fast, memory-frugal alternatives to standard Transformers, but cramming an entire document into a fixed-size memory causes older facts to either blur together or get aggressively overwritten. Integral DeltaNet solves this trade-off by maintaining two complementary memories: a nimble "delta" state for recent updates and a slow-moving "integral" state that preserves a smoothed history of the past. By dynamically blending both timescales at readout, the model remembers distant context much better while keeping training fast and inference memory constant.
What Problem Does This Paper Address?
Transformers have a well-known Achilles' heel: their compute scales quadratically with sequence length, and their key-value (KV) cache grows linearly during generation. Linear attention fixes this by compressing the entire history of key-value pairs into a single, fixed-size recurrent matrix—giving us linear-time compute and constant inference memory.
However, stuffing thousands of tokens into one fixed matrix causes memory collisions: unless all keys are mathematically orthogonal, new memories interfere with old ones. Recent architectures like Mamba-2, DeltaNet, and Gated DeltaNet fight this interference using decay (gradually fading old memories) or the delta rule (targeted erasing of an old value associated with a key before writing a new one).
Here is the catch: fighting interference causes forgetting. If you erase or decay an old association to make room for a new one, and that old fact turns out to be crucial 10,000 tokens later, it is gone forever.
As shown in the toy example above, when keys overlap ($k_1 = k_2 + k_3$), standard linear attention suffers from collisions and gets later queries wrong. Conversely, models with decay or overwriting (Mamba-2, DeltaNet, Gated DeltaNet) clean up the interference to nail the recent queries, but inevitably overwrite and forget the initial $k_1$ association. How do we prevent collisions without throwing away the past?
Methods
The authors introduce Integral DeltaNet, an architecture built on a dual-timescale memory system:
- The Fast Delta State ($S_t$): Uses standard, expressive linear-attention update rules—specifically applied to Kimi Delta Attention (KDA) and Gated DeltaNet-2 (GDN-2)—to aggressively track current associations and clear out immediate interference.
- The Slow Integral State ($X_t$): A newly introduced state that maintains a channel-wise exponential moving average (a weighted history) of past delta states, governed by a learned integration gate $\lambda_t$.
- Adaptive Gated Readout: Crucially, $X_t$ does not alter how $S_t$ updates. Instead, when querying the memory, a learned readout gate $\gamma_t$ dynamically blends answers from both states—pulling sharp, recent associations from $S_t$ and faint, older memory traces from $X_t$.
To ensure this two-state recurrence doesn't bottleneck GPUs, the authors derive a chunkwise parallel formulation. By slicing sequences into chunks, computing intra-chunk interactions via parallel matrix multiplications, and passing the dual states across chunk boundaries, they build custom FlashLinearAttention kernels. They offer two flavors: throughput-first (caches intermediates for speed) and memory-first (recomputes the mixer during backpropagation to slash VRAM usage).
Datasets
No new benchmarks are introduced; models (340M and 1.3B parameters) are trained from scratch on FineWeb-Edu (15B and 100B tokens, respectively, at 4K context length) and tested across a comprehensive suite:
- Language Modeling & Reasoning: WikiText-2, LAMBADA, PIQA, HellaSwag, WinoGrande, ARC-e/c, OpenBookQA, SIQA, and BoolQ.
- Real-World Retrieval: SWDE, SQuAD, FDA, TriviaQA, Natural Questions (NQ), and DROP.
- Synthetic & Long-Context Understanding: RULER Needle-in-a-Haystack (S-NIAH-1/2/3, MK-NIAH-1) and 14 English tasks from LongBench (up to 16K tokens).
- Length Extrapolation: GovReport, QMSum, NarrativeQA, Qasper, CodeParrot, and PG19 (evaluated up to 20K tokens).
Key Insights and Ideas
- Breaking the Single-State Bottleneck: Mathematically, any single-state linear readout is trapped by linear dependencies among keys (if $k_1 = k_2 + k_3$, the readout for $k_1$ must equal the sum of readouts for $k_2$ and $k_3$). By making the readout gate query-dependent across two states from different eras, Integral DeltaNet breaks this symmetry and achieves zero retrieval risk on the illustrative collision problem.
- Connection to Iterate Averaging: Forming the integral state mirrors optimization techniques like Stochastic Weight Averaging (SWA) and Schedule-Free optimizers, which average fast-moving parameter iterates over time. However, instead of using the average to guide future state updates, Integral DeltaNet keeps it purely as a historical archive for readout.
- Out-of-the-Box Length Extrapolation: Even though the models only saw 4K-token sequences during training, maintaining a smoothed historical state allows them to extrapolate cleanly out to 20K tokens without perplexity spikes.
Key Results
Applying Integral DeltaNet to KDA and GDN-2 consistently boosts performance over their respective backbones across scales:
- Reasoning & Real-World Retrieval (1.3B): Integral KDA achieves the highest average reasoning accuracy among recurrent models (56.1% vs. 54.6% for KDA and 54.7% for Transformer++) and lifts average real-world retrieval accuracy from 35.4% to 37.3% (with SWDE jumping from 32.7% to 40.4%). Integral GDN-2 similarly beats GDN-2 on reasoning (54.6% vs. 54.2%) and retrieval (34.5% vs. 32.3%).
- Multi-Key Needle-in-a-Haystack: On the tough MK-NIAH-1 task (4K length), Integral KDA jumps to 35.6% (from KDA's 20.8%), and Integral GDN-2 leaps to 39.8% (from GDN-2's 23.8%).
- LongBench & Extrapolation: Integral KDA and Integral GDN-2 take the top two spots overall on LongBench (15.0 and 14.8 average scores, handily beating Transformer++'s 5.6, which degrades past its 4K training window). On length extrapolation up to 20K tokens, the two Integral variants achieve the lowest perplexity across every dataset and context length tested.
- Hardware Efficiency: During decoding (batch size 8 on a B300 GPU), memory stays constant across 4K to 64K lengths at 2.99 GiB (vs. 2.85 GiB for backbones, while Transformer++ balloons from 7.77 GiB to 83.70 GiB). Decoding latency increases modestly from ~3.2–3.3 ms/token to ~4.6–4.8 ms/token. For training, the memory-first kernel actually uses less activation memory than the baseline kernels (e.g., 49.8 GiB for Integral KDA vs. 81.7 GiB for KDA) at the cost of a moderate throughput slowdown.
Limitations and Future Work
- Inference Overhead & Task Variance: Maintaining a second matrix state adds a small fixed memory footprint (~0.14 GiB at 1.3B) and increases per-token decoding latency by ~40–50%. Additionally, Integral GDN-2 slightly trails standard GDN-2 on a few single-needle synthetic retrieval setups (such as S-NIAH-1/2 at 4K and 8K).
- Passive History: Right now, information flows strictly one way—from the delta state into the integral state, combining only at readout. For future work, the authors suggest feeding the integral state back into the delta-state update rule to actively guide memory writing, much like schedule-free optimizers use averaged weights to compute gradients.
Summary updated