Abstract
Large language models have become increasingly difficult to train because of the growing computation time and cost. In this work, we present SRU++, a highly-efficient architecture that combines fast recurrence and attention for sequence modeling. SRU++ exhibits strong modeling capacity and training efficiency. On standard language modeling tasks such as ENWIK8, WIKI-103 and BILLION WORD datasets, our model obtains better bits-per-character and perplexity while using 3x-10x less training cost compared to top-performing Transformer models. For instance, our model achieves a state-of-the-art result on the ENWIK8 dataset using 1.6 days of training on an 8-GPU machine. We further demonstrate that SRU++ requires minimal attention for near state-of-the-art performance. Our results suggest jointly leveraging fast recurrence with little attention as a promising direction for accelerating model training and inference.
Introduction: Overcoming the Compute Wall
The "compute wall" in AI is a significant barrier for researchers and sustainability. As large language models (LLMs) scale, the time and financial costs of training become astronomical. While the Transformer architecture is the current industry standard, its self-attention mechanism incurs a quadratic cost relative to sequence length and lacks inherent positional awareness. Conversely, traditional Recurrent Neural Networks (RNNs) naturally handle sequence order but suffer from slow, sequential processing. SRU++ addresses these challenges by combining the best of both worlds: the modeling power of attention with the efficiency of fast recurrence.
Methods: The SRU++ Architecture
SRU++ builds upon the Simple Recurrent Unit (SRU), a specialized RNN designed for high parallelism on GPUs by offloading heavy computation to element-wise operations. The architecture introduces several key innovations to enhance performance and efficiency:
- Self-Attentive Recurrence: Instead of standard linear transformations, SRU++ incorporates a self-attention module to compute the queries, keys, and values used for the recurrence.
- Matrix Factorization (The Projection Trick): To maintain a low parameter count, the model uses a small attention dimension ($d'$) that is significantly smaller than the hidden state dimension ($d$).
- Sparse Attention: A key discovery is that attention is not required in every layer. The authors found that placing attention sparingly—even in just a single layer at the end of a deep stack—is highly effective.
- Implicit Position Awareness: By using a recurrent backbone, the model naturally understands sequence order, eliminating the need for the artificial positional encodings required by Transformers.
Key Results: Efficiency and Performance
SRU++ was evaluated on standard NLP benchmarks including ENWIK8, WIKI-103, and the Billion Word dataset, demonstrating significant gains in both speed and accuracy.
- State-of-the-Art Efficiency: On the ENWIK8 dataset, SRU++ achieved a state-of-the-art Bits-Per-Character (BPC) of 0.96. It matched the performance of Transformer-XL while using only 1/8th of the training resources.
- Training Speedup: Across various tasks, SRU++ demonstrated a 3x to 10x reduction in training cost. For instance, it reached its ENWIK8 results in just 1.6 days on an 8-GPU machine.
- Inference Speed: On the WIKI-103 test set, the SRU++ Large model was 4.5x faster at generating text than baseline models.
Insights and Future Work
The success of SRU++ suggests that "attention is not all you need." Recurrence is exceptionally good at handling local context and sequence order, while attention is best utilized as a "long-range booster." The authors found that placing attention in later layers—after the recurrence has built a rich representation—yields the best results.
While SRU++ is a major step toward "Green AI," future research will explore scaling the architecture to the size of massive models like GPT-4 and integrating it with other efficient attention variants to further push the boundaries of long-sequence modeling.
Summary updated