Abstract
Gated Slot Attention (GSA) is a novel linear-time sequence model designed to bridge the gap between the high memory capacity of Transformers and the computational efficiency of Recurrent Neural Networks (RNNs). By reformulating Attention with Bounded-Memory Control (ABC) into a hardware-efficient, two-pass gated linear attention mechanism, GSA overcomes the quadratic complexity of standard attention while maintaining superior performance in recall-intensive tasks. Our evaluations demonstrate that GSA significantly outperforms existing linear-time models like Mamba and GLA in associative recall tasks and provides a cost-effective pathway for finetuning pretrained Transformers into efficient RNNs.
Introduction: The Quadratic Bottleneck
Standard Transformers have become the foundation of modern AI, yet they face a fundamental "quadratic bottleneck." As sequence length ($T$) increases, computation and memory requirements grow by $T^2$, making the processing of long-form content like extended documents or high-resolution video prohibitively expensive.
While linear-time alternatives such as State Space Models (e.g., Mamba) and Linear Attention models have emerged, they often suffer from a recall-memory tradeoff. To maintain a small recurrent state, these models frequently lose the ability to recall specific details from earlier in a long prompt. Furthermore, most linear models utilize mathematical kernels that differ significantly from standard softmax attention, complicating the process of converting pretrained Transformers into efficient RNN-like models.
Gated Slot Attention Architecture
GSA addresses these challenges by building upon the Attention with Bounded-Memory Control (ABC) architecture. The key innovation is the reformulation of GSA into a Two-Pass Gated Linear Attention (GLA) mechanism.
In this architecture, the first pass aggregates historical context into a "context-aware" query, while the second pass performs the final memory readout. Crucially, GSA retains the softmax operation, which preserves the "spikiness" of attention necessary for precise retrieval. To manage memory dynamically, GSA incorporates data-dependent forget gates inspired by LSTMs, allowing the model to clear its memory slots as needed. This structure is optimized for modern hardware, utilizing chunkwise training algorithms to leverage the parallel processing power of GPUs while maintaining $O(T)$ inference efficiency.
Experimental Results: Superior Recall and Efficiency
The authors evaluated GSA across a variety of benchmarks, including pretraining on the 100B-token SlimPajama dataset and various common-sense reasoning tasks. A standout result was GSA's performance in the Multi-Query Associative Recall (MQAR) task, a synthetic benchmark designed to test a model's ability to retrieve specific key-value pairs from memory.
As shown in the figure above, GSA significantly outperforms competitors like Mamba, GLA, and RetNet, particularly at lower model dimensions. This suggests that the softmax-driven slot mechanism allows GSA to utilize its recurrent state more efficiently than models relying on simpler linear kernels. Beyond synthetic tasks, GSA demonstrated competitive performance on real-world long-context benchmarks like Qasper and NarrativeQA with sequences up to 16K tokens.
Transformer-to-RNN (T2R) Compatibility
One of the most promising applications of GSA is its compatibility with existing pretrained models. Because GSA retains the softmax operator, it can be initialized with weights from a pretrained Transformer (such as Mistral-7B) and finetuned into an efficient RNN. This "Transformer-to-RNN" (T2R) approach is approximately 100x cheaper than training a linear model from scratch. In testing, a GSA-finetuned Mistral-7B achieved an average score of 56.9 across various benchmarks, surpassing other T2R methods and even some models trained from scratch on significantly more data.
Conclusion and Future Work
Gated Slot Attention represents a significant step toward efficient, high-capacity sequence modeling. By combining the architectural strengths of softmax attention with the efficiency of gated recurrence, it provides a viable path for scaling models to massive sequence lengths without sacrificing recall. Future research may explore hybrid architectures that combine GSA with standard attention layers to further balance precision and efficiency at the frontier scale.
Summary updated