ReGLA: Refining Gated Linear Attention

Peng Lu, Ivan Kobyzev, Mehdi Rezagholizadeh, Boxing Chen, Philippe Langlais

Introduction

The Transformer architecture has become the standard for modern AI, yet it faces a significant scalability challenge: the Softmax attention mechanism. As input sequences grow, computational costs and memory requirements increase quadratically ($O(N^2)$), creating a bottleneck for long-context applications.

Linear Attention (LA) was proposed to address this by reducing complexity to $O(N)$, effectively transforming the attention mechanism into a recurrent-style operation. However, LA has historically lagged behind standard Transformers in performance. While Gated Linear Attention (GLA) introduced learnable gates to manage information flow, it remained hampered by numerical instability, improper scaling, and the "saturation trap" where gates become stuck at extreme values. ReGLA (Refining Gated Linear Attention) systematically re-engineers these components to bridge the performance gap while maintaining linear efficiency.

The ReGLA Architecture

ReGLA introduces three primary innovations to stabilize and enhance the gated linear attention framework. First, it replaces standard activations with Normalized Exponential Feature Maps. By using a "safe" exponential mapping, the model ensures that feature values remain bounded and non-negative, preventing the numerical explosions common in earlier LA variants.

Second, the authors address the issue of variance control. In standard Transformers, a $1/\sqrt{d}$ scaling factor is used. However, ReGLA's researchers mathematically derived a new variance reduction factor specifically tailored for exponential feature maps: $\frac{1}{e\sqrt{d(e^2-1)}}$. This ensures that the variance of the hidden states remains stable regardless of the feature dimension.

The ReGLA architecture featuring the refining gate (left) and the safe exponential feature map (right).

Finally, the Refining Gate ($r_t$) is introduced to solve the problem of gate saturation. In traditional GLA, sigmoid gates often saturate at 0 or 1, causing gradients to vanish and halting the learning process. The refining module interpolates between the gate's bounds, ensuring consistent gradient flow even when the primary gate is nearly closed or open.

Overcoming the Saturation Trap

A critical insight of the ReGLA paper is the distribution analysis of gate activations. Standard sigmoid-based gates tend to cluster at the extreme ends of their range. When a gate is fully "closed" (0) or "open" (1), the derivative of the sigmoid function is near zero, leading to vanishing gradients.

Gradient values of the gate function across different refining factors (R). Higher R values maintain gradient flow even as the gate approaches 0 or 1.

As shown in the gradient analysis, the refining factor $R$ allows the model to maintain a healthy gradient value across the entire range of gate activations. This allows the model to learn more diverse and useful activation distributions, preventing the "stuck" states that plague previous gated architectures.

Experimental Results and Efficiency

ReGLA was evaluated across several rigorous benchmarks, demonstrating significant improvements over existing linear models:

  • Language Modeling: On Wikitext-103, ReGLA achieved a perplexity (PPL) of 19.0, significantly better than the previous state-of-the-art linear method, "Fast Decay" (20.8).
  • Reasoning: In zero-shot common sense tasks (including BoolQ, PIQA, and HellaSwag), ReGLA outperformed other linear variants like ReLU and Hedgehog, suggesting that its architectural refinements translate directly to improved reasoning capabilities.
  • Efficiency: ReGLA maintains $O(N)$ time and memory complexity. Benchmarks on Nvidia V100 GPUs showed that while Softmax attention latency and memory usage grew quadratically with sequence length, ReGLA's resource consumption remained nearly flat.
  • Hybrid Potential: Interestingly, a hybrid architecture combining Softmax layers with ReGLA layers actually outperformed a pure Softmax Transformer, suggesting a promising path for future large-scale models.

Conclusion

ReGLA demonstrates that linear attention can be competitive with standard Transformers if the underlying mechanics—feature mapping, scaling, and gating—are properly refined. By addressing the mathematical mismatch of standard scaling factors and the gradient issues of saturated gates, ReGLA provides a robust, efficient alternative for long-sequence modeling. While currently tested at the 160M parameter scale, its stability and performance suggest it is a strong candidate for future multi-billion parameter "Large" Language Models.

Summary updated

BibTeX
@inproceedings{lu2025regla,
  author = {Peng Lu and Ivan Kobyzev and Mehdi Rezagholizadeh and Boxing Chen and Philippe Langlais},
  title = {{ReGLA: Refining Gated Linear Attention}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2025},
  doi = {10.18653/v1/2025.naacl-long.147},
}
Figure