Parallelizing Linear Transformers with the Delta Rule over Sequence Length

Transformers with linear attention (i.e., linear transformers) and state-space models have recently been suggested as a viable linear-time alternative to transformers with softmax attention. However, these models still underperform transformers especially on tasks that require in-context retrieval. While more expressive variants of linear transformers which replace the additive update in linear transformers with the delta rule (DeltaNet) have been found to be more effective at associative recall, existing algorithms for training such models do not parallelize over sequence length and are thus inefficient to train on modern hardware. This work describes a hardware-efficient algorithm for training linear transformers with the delta rule, which exploits a memory-efficient representation for computing products of Householder matrices. This algorithm allows us to scale up DeltaNet to standard language modeling settings. We train a 1.3B model for 100B tokens and find that it outperforms recent linear-time baselines such as Mamba and GLA in terms of perplexity and zero-shot performance on downstream tasks. We also experiment with two hybrid models which combine DeltaNet layers with (1) sliding-window attention layers every other layer or (2) two global attention layers, and find that these hybrids outperform strong transformer baselines.

Paper

Similar papers

Peer review

Reviewer dem47/10 · confidence 4/52024-07-11

Summary

This paper proposes the Delta Rule method to construct the state updates for Linear Attention. Furthermore, the paper introduces a chunk-wise training approach, allowing the computational cost of training to grow subquadratically with the text length. Experimentally, the paper validates the effectiveness of the model architecture using three synthetic benchmarks: MQAR, MAD, and RegBench. Additionally, the paper uses Common Sense Reasoning and Retrieval tasks in LLM pre-training to verify the model's performance in real-world tasks. The model has been validated at scales ranging from 340M to 1.3B parameters. Furthermore, this paper explores the possibility of combining the Delta Rule with Sliding Window Attention and Global Attention, demonstrating the positive impact of the hybrid architecture on model performance.

Strengths

1. Solid work. The paper provides a good derivation, offering a more general method for state updates in Linear Models. 2. The experiments are comprehensive and effectively demonstrate the validity of the model architecture.

Weaknesses

1. Have you conducted experiments on long context? For example, measuring extrapolation and scenarios akin to "looking for a needle in a haystack"? As a linear model, I would like you to further discuss its capability to generalize to long context. 2. The algorithmic speed of Delta Net increases linearly, but it seems to be slower than GLA. Can you analyze the factors contributing to this? 3. Could you further explain the insights of the Delta Net updates? I understand there are algorithmic differences compared to GLA operators, but what unique benefits do they bring? Is there any theoretical analysis?

Questions

I would like to discuss the following questions with you: Do you think linear models can fundamentally bridge the gap with transformers in memory-based tasks? Is there an inherent conflict between the ability to handle long context and the performance of memory-based tasks?

Rating

7

Confidence

4

Soundness

3

Presentation

3

Contribution

3

Limitations

N/A

Reviewer pqA28/10 · confidence 3/52024-07-13

Summary

This paper introduces a novel algorithm for the efficient training of DeltaNet Linear Transformers. DeltaNet enhances contextual associative recall using a delta rule-like update but was previously limited by inefficient parallelization in its training algorithm. The work described in this paper presents a hardware-efficient algorithm that leverages the memory-efficient WY representation for computing products of Householder matrices, enabling the scaling of DeltaNet similar to other linear Transformer models. The authors trained a 1.3B parameter model on 100B tokens and found that it outperforms strong linear-time baselines such as Mamba and GLA in terms of perplexity and zero-shot performance on downstream tasks.

Strengths

- The paper introduces a novel hardware-efficient algorithm for training DeltaNet Linear Transformers, leveraging the WY representation of Householder matrices, which effectively addresses the parallelization limitations of previous algorithms. - Through large-scale experiments, the authors demonstrate that DeltaNet significantly outperforms existing models like Mamba and GLA in terms of perplexity and zero-shot performance on downstream tasks. - The new algorithm enables the scaling of DeltaNet to larger datasets and parameter sizes, which is crucial for large language models.

Weaknesses

The algorithms presented in this paper are satisfactory in terms of efficiency and performance.

Questions

I have no questions for this paper.

Rating

8

Confidence

3

Soundness

4

Presentation

3

Contribution

3

Limitations

Yes

Reviewer eUyw7/10 · confidence 4/52024-07-13

Summary

This paper proposes a hardware-efficient algorithm for training linear transformers with a delta update (DeltaNet; SMS21). This architecture has an attention formulation that prevents the direct application of chunk-wise parallel algorithms for computing its output. To address this issue, the authors introduce a re-parameterization of DeltaNet as a matrix-valued RNN whose recurrence is given by a generalized Householder transformation. This enables the use of WY representation which is memory efficient and eliminates the need to materialize the hidden state matrices. Experiments on synthetic benchmarks and language modeling tasks shows competitive performance compared to strong baselines (Mamba, GLA) and faster speed than the original Deltanet implementation.

Strengths

- The paper is well motivated and situated with respect to prior work. It provides sufficient background for linear transformers, demonstrates great scholarship in crediting prior work, and has a clear exposition of the proposed idea. In addition, it presents an informative overview that compares the formulations of recent linear transformers that highlights their differences. - Proposes an efficient algorithm for training linear transformers with the delta update which is a competitive variant. The re-parameterization is non-obvious and leverages WY representation for Householder matrices in a novel way. Previously, this architecture could not be easily scaled to larger models and datasets with a recurrent formulation. In addition, it introduces two competitive hybrid methods based on DeltaNet that leverage local and global full attention. - Demonstrates the effectiveness of the proposed approach on two synthetic benchmarks and eleven language modeling and understanding tasks compared to strong baselines such as Mamba and GLA. The results are consistent, have a good coverage, and are important for the researchers working on efficient transformers. - The experiments are thorough and have convincing settings, namely all the variants are trained from scratch with the same configurations, there are ablations to justify the design choices, and the experimental reporting is very detailed.

Weaknesses

- W1. In terms of scale, the model explores two different architectures of increasing size up to 1.3B parameters. Even though this size is considerable, it is still relatively small compared to the LLMs that are widely used such as Llama, Mistral (7B+ size). There is always the question of whether the quality is maintained with further model increase. - W2. The improved results compared to Mamba and GLA make use of additional architectural components: convolution and local/global attention, without them the results are comparable to the other models.

Questions

- Q1: What is the effect of chunk size in the chunk-wise parallel algorithm for DeltaNet? Varying the chunk size $C$ and showing its effect in efficiency would be interesting to explore. - Q2: The chunk-level hidden states $S_{[t]}$'s are discarded to save memory. From Eq. 7, it seems that their computation depends on the previous hidden states $S_{[t-1]}$'s. Are these kept in memory for the re-computation in the backward pass? - Q3: GLA with convolution performs worse than w/o convolution with the larger model size. Do you expect this to be the case for DeltaNet as well? It would be good to add this result if possible. Minor: - In Table 2, is the L1/L2 norm referring to the normalization of queries and keys? Please specify. - In Eq.1, why is this equation showing the state $S_{[t+1]}$ instead of $S_{[t]}$? The latter is used in Eq. 2. Same for Eq. 7. - l172: stable -> stabilize - l213-214: we -> we follow - l321: vallina -> vanilla

Rating

7

Confidence

4

Soundness

3

Presentation

4

Contribution

3

Limitations

Yes, they have.

Reviewer eUyw2024-08-12

Response to authors

Thank you for answering my questions and providing additional results! - The experiments with 3B model provide evidence that performance is comparable to that of a Transformer as model size increases to 3B. Given the compute constraints, my concern has been addressed adequately. - Regarding the convolutional component, I am not challenging the fairness of the comparison. The potential issue is that DeltaNet without convolution is in several tasks worse than GLA without convolution. Any insight on why that is? For completeness, I'd suggest adding some discussion about it to emphasize that it's essential to the performance of DeltaNet and reporting the results of DeltaNet w/o convolution for the 1.3B model, which are currently missing. - I found the results about the effect of chunk size insightful; it'd be good to include these results in the final version. My questions and concerns have been answered adequately except the second bullet point above. Hence, I decided to keep my original scores.

Authorsrebuttal2024-08-12

Thanks for your feedback! ## The potential issue is that DeltaNet without convolution is in several tasks worse than GLA without convolution. Any insight on why that is? Local information plays a critical role in NLP tasks. As highlighted in [3], incorporating more local features can significantly enhance the performance of linear attention. Many recent studies also demonstrate that additional local attention mechanisms greatly improve linear attention. Short convolutions are one method to enhance local information, while the gating mechanism in GLA imposes a strong inductive bias towards local context. DeltaNet’s update rule, on its own, doesn’t prioritize local information, so without short convolutions, it may underperform in NLP tasks. However, when short convolutions are applied, DeltaNet’s ability to leverage local context is improved. Since GLA already incorporates gating mechanisms to enhance local information, short convolutions may not provide additional benefits. Additionally, it’s important to note that both the delta rule and the vanilla linear attention update rules can be seen as "context-based addressing" mechanisms. [1] emphasizes the importance of "location-based addressing," and [2] also highlights that a drawback of linear attention is its "lack of precise local token shifts and comparisons." The gating mechanism in GLA addresses this by emphasizing nearby tokens, while short convolutions can be considered another form of location-based addressing. - [1] https://arxiv.org/abs/1410.5401 Neural Turing Machines - [2] https://arxiv.org/abs/2402.18668 Simple linear attention language models balance the recall-throughput tradeoff - [3] https://arxiv.org/abs/2312.11135 Linear Attention via Orthogonal Memory ## For completeness, I'd suggest adding some discussion about it to emphasize that it's essential Thank you for your suggestion! We will include this discussion in the next iteration of the paper draft to emphasize its importance.

Reviewer dem42024-08-12

Thanks for the response, the authors addressed my concerns, and I have raised my score.

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC