Gated Delta Networks: Improving Mamba2 with Delta Rule

Songlin Yang, Jan Kautz, Ali Hatamizadeh · OpenReview

Abstract

Linear Transformers have gained attention as efficient alternatives to standard Transformers, but their performance in retrieval and long-context tasks has been limited. To address these limitations, recent work has explored two distinct mechanisms: gating for adaptive memory control and the delta update rule for precise memory modifications. We observe that these mechanisms are complementary: gating enables rapid memory erasure while the delta rule facilitates targeted updates. Building on this insight, we introduce the gated delta rule and develop a parallel training algorithm optimized for modern hardware. Our proposed architecture, Gated DeltaNet, consistently surpasses existing models like Mamba2 and DeltaNet across multiple benchmarks, including language modeling, common-sense reasoning, in-context retrieval, length extrapolation, and long-context understanding. We further enhance performance by developing hybrid architectures that combine Gated DeltaNet layers with sliding window attention or Mamba2 layers, achieving both improved training efficiency and superior task performance.

Introduction

Standard Transformers are the gold standard for Large Language Models (LLMs), but their self-attention mechanism scales quadratically ($O(L^2)$) with sequence length, creating significant computational bottlenecks for long documents. Linear Transformers and RNN-like models such as Mamba2 offer $O(L)$ scaling by using a fixed-size hidden state. However, these models often struggle with "associative recall"—the ability to retrieve specific facts from a large context.

This paper identifies a fundamental trade-off in existing linear models. Mamba2 uses gating to decay the entire memory state uniformly, which is effective for noise filtering but lacks precision for targeted updates. Conversely, DeltaNet uses the "delta rule" to overwrite specific key-value pairs, which is excellent for memorization but lacks a mechanism to rapidly clear irrelevant information. When sequence length exceeds model dimensionality, "memory collisions" occur, garbling information. Gated Delta Networks (Gated DeltaNet) resolve this by viewing gating as an "eraser" for global clearing and the delta rule as a "pencil" for targeted writing.

Methods

The core contribution is the Gated Delta Rule, a unified update equation for the hidden state ($S_t$):

$$S_t = S_{t-1} (\alpha_t(I - \beta_t k_t k_t^\top)) + \beta_t v_t k_t^\top$$

Here, $\alpha_t$ (Gating) is a data-dependent scalar controlling global forgetting, while $\beta_t$ (Delta Rule) controls the "writing strength" to selectively overwrite information associated with key $k_t$.

Architecture of Gated DeltaNet and hybrid variants H1 and H2.

To ensure practical utility, the authors developed a hardware-efficient chunkwise parallel training algorithm using the "WY representation" from numerical linear algebra. This transforms sequential RNN updates into fast matrix multiplications. Additionally, hybrid architectures (GatedDeltaNet-H1 and H2) interleave Gated DeltaNet layers with Sliding Window Attention (SWA) and Mamba2 layers to capture both long-range dependencies and local patterns.

Evaluation and Results

Models were trained on 100B tokens from the FineWeb-Edu dataset and evaluated across synthetic retrieval (S-NIAH), real-world long context (LongBench), and common-sense reasoning benchmarks.

Performance comparison on S-NIAH retrieval tasks across different sequence lengths.

Key findings include:

  • Superior Retrieval: On the challenging S-NIAH-3 task, Gated DeltaNet achieved 27.6% accuracy at 4K length, significantly outperforming Mamba2 (4.6%).
  • Benchmark Dominance: On LongBench, Gated DeltaNet averaged 16.6, surpassing Mamba2 (13.5) and DeltaNet (13.6).
  • Efficiency: The chunkwise algorithm maintains training throughput nearly identical to DeltaNet and only slightly slower than Mamba2.
  • Hybrid Gains: GatedDeltaNet-H2 achieved the highest average scores, validating the strategy of mixing recurrence with local attention.

Conclusion

Gated DeltaNet successfully bridges the gap between efficient linear RNNs and high-performing Transformers. By combining adaptive memory erasure with precise updates, it effectively mitigates memory collisions in long-context tasks. Future work includes scaling these models beyond the 1.3B parameter range and exploring the impact of instruction tuning on real-world performance.

Summary updated

Abstract

Linear Transformers have gained attention as efficient alternatives to standard Transformers, but their performance in retrieval and long-context tasks has been limited. To address these limitations, recent work has explored two distinct mechanisms: gating for adaptive memory control and the delta update rule for precise memory modifications. We observe that these mechanisms are complementary: gating enables rapid memory erasure while the delta rule facilitates targeted updates. Building on this insight, we introduce the gated delta rule and develop a parallel training algorithm optimized for modern hardware. Our proposed architecture, Gated DeltaNet, consistently surpasses existing models like Mamba2 and DeltaNet across multiple benchmarks, including language modeling, common-sense reasoning, in-context retrieval, length extrapolation, and long-context understanding. We further enhance performance by developing hybrid architectures that combine Gated DeltaNet layers with sliding window attention or Mamba2 layers, achieving both improved training efficiency and superior task performance.
BibTeX
@inproceedings{yang2025gated,
  author = {Songlin Yang and Jan Kautz and Ali Hatamizadeh},
  title = {{Gated Delta Networks: Improving Mamba2 with Delta Rule}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=r8H7xhYPwz},
}
Figure