[Paper Review] Language Modeling using LMUs: 10x Better Data Efficiency or Improved Scaling Compared to Transformers
This paper proposes a Legendre Memory Unit (LMU)-based language model that achieves 10x better data efficiency than Transformers, requiring only 1/10th the training tokens to match loss. By leveraging an O(n) memory and O(n ln n) computation complexity through Legendre polynomial projection, the model outperforms Transformers and LSTMs in scaling, especially when combined with global self-attention.
Recent studies have demonstrated that the performance of transformers on the task of language modeling obeys a power-law relationship with model size over six orders of magnitude. While transformers exhibit impressive scaling, their performance hinges on processing large amounts of data, and their computational and memory requirements grow quadratically with sequence length. Motivated by these considerations, we construct a Legendre Memory Unit based model that introduces a general prior for sequence processing and exhibits an $O(n)$ and $O(n \ln n)$ (or better) dependency for memory and computation respectively. Over three orders of magnitude, we show that our new architecture attains the same accuracy as transformers with 10x fewer tokens. We also show that for the same amount of training our model improves the loss over transformers about as much as transformers improve over LSTMs. Additionally, we demonstrate that adding global self-attention complements our architecture and the augmented model improves performance even further.
Motivation & Objective
- To address the high data and computational demands of Transformers in language modeling, particularly their O(n²) memory and compute growth with sequence length.
- To explore whether a non-parametric, memory-efficient architecture like the Legendre Memory Unit (LMU) can achieve superior scaling laws and data efficiency compared to Transformers.
- To evaluate whether implicit self-attention via LMU states can match or exceed the performance of explicit self-attention in Transformers.
- To investigate whether augmenting the LMU with global self-attention further improves performance and long-context modeling.
- To validate power-law scaling behavior of the LMU model across model sizes and compare its scaling exponent to Transformers and LSTMs.
Proposed method
- The model uses the Legendre Memory Unit (LMU), a non-parametric Linear Time-Invariant (LTI) system that projects a sliding window of input tokens onto q Legendre polynomials, enabling efficient temporal representation.
- The LMU state is updated via a fixed matrix recurrence: $\mathbf{m}_t = \bar{\mathbf{A}} \mathbf{m}_{t-1} + \bar{\mathbf{B}} x_t$, where $\bar{\mathbf{A}}$ and $\bar{\mathbf{B}}$ are frozen matrices derived from the LTI system.
- The LTI update is computed in parallel as a convolution: $\mathbf{m}_t = \sum_{j=1}^{t} \bar{\mathbf{A}}^{t-j} \bar{\mathbf{B}} x_j$, enabling O(n) memory and O(n ln n) computation complexity.
- The model employs 'implicit self-attention' by applying a global attention mechanism only on the LMU’s hidden states at each time step, not across time steps.
- A variant with global self-attention is introduced to improve long-context modeling, combining the efficiency of LMU with the representational power of attention.
- The model is trained on the WebText2 dataset, and scaling laws are evaluated by fitting power-law relationships between model size (non-embedding parameters) and cross-entropy loss.
Experimental results
Research questions
- RQ1Does the LMU-based model exhibit a power-law scaling relationship between model size and language modeling loss, similar to Transformers and LSTMs?
- RQ2Can the LMU model achieve comparable or better performance than Transformers with significantly less training data, due to improved data efficiency?
- RQ3Does the implicit self-attention mechanism in the LMU model effectively capture long-range dependencies without explicit cross-step attention?
- RQ4How does adding global self-attention to the LMU architecture affect performance and scaling behavior compared to the base LMU and Transformers?
- RQ5To what extent does the LMU model’s O(n) memory and O(n ln n) computation complexity enable better scaling than the O(n²) complexity of Transformers?
Key findings
- The LMU model achieves the same cross-entropy loss as Transformers with 10x fewer training tokens, demonstrating 10x better data efficiency.
- At the same training budget, the LMU model improves loss over Transformers by approximately the same margin that Transformers improve over LSTMs.
- The LMU model exhibits a power-law scaling relationship with model size: $\text{LMU}(N) = \left(\frac{N}{1.95 \cdot 10^{14}}\right)^{-0.072}$, with a scaling exponent close to that of Transformers.
- The LMU model with global self-attention scales as $\text{LMU}_G(N) = \left(\frac{N}{3.80 \cdot 10^{14}}\right)^{-0.069}$, indicating slightly better scaling than the base LMU.
- The LMU model with global attention continues to outperform Transformers trained on 10x more tokens, confirming its superior data efficiency and performance.
- Per-token loss plots show that the base LMU model flattens early (around 100 tokens), indicating limited long-context modeling, while the global-attention variant sustains improvement with longer context, similar to Transformers.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.