Skip to main content
QUICK REVIEW

[论文解读] Parallelizing Linear Transformers with the Delta Rule over Sequence Length

Songlin Yang, Bailin Wang|arXiv (Cornell University)|Jun 10, 2024
Cellular Automata and ApplicationsComputer Science被引用 3
一句话总结

本文提出了一种硬件高效、可并行化的训练算法,用于DeltaNet——一种使用delta规则改进关联记忆的线性变换器变体。通过将DeltaNet重参数化为带有Householder变换的矩阵值RNN,并利用内存高效的WY表示法,该方法实现了序列长度的并行训练,使模型可扩展至13亿参数、1000亿词元规模,其困惑度和零样本下游性能均优于Mamba和GLA。

ABSTRACT

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.

研究动机与目标

  • 为解决现有DeltaNet序列化训练算法效率低下、难以在现代硬件上扩展的问题。
  • 实现DeltaNet中前向与反向传播在序列长度上的并行化,突破顺序计算的瓶颈。
  • 在保持长上下文与检索密集型任务高性能的前提下,将DeltaNet扩展至大规模语言建模(13亿参数,1000亿词元)。
  • 证明DeltaNet在语言建模与零样本下游性能方面优于强线性时间基线模型Mamba与GLA。

提出的方法

  • 将DeltaNet重表述为由广义Householder变换控制的矩阵值RNN。
  • 采用WY表示法处理Householder矩阵的乘积,避免显式生成大型隐藏状态,降低I/O与内存开销。
  • 将线性注意力模型中的分块并行训练策略适配至DeltaNet场景,实现在序列长度上的高效并行化。
  • 采用一种参数化方式,使状态更新通过Householder反射实现秩一校正,支持高效矩阵更新。
  • 引入可微分且内存高效的递归机制,在保持delta规则关联记忆能力的同时支持反向传播。
  • 将并行化的DeltaNet层集成至FlashLinearAttention库中,以支持实际部署与基准测试。

实验结果

研究问题

  • RQ1能否在现代硬件并行训练范式下,高效地对DeltaNet中的delta规则进行大规模训练?
  • RQ2与现有线性时间模型相比,DeltaNet的并行训练算法是否能在长上下文与检索密集型任务上实现更优性能?
  • RQ3DeltaNet能否在大规模语言建模中实现与标准Transformer或Mamba、GLA等线性基线模型相当或更优的性能?
  • RQ4将DeltaNet与局部或全局注意力层结合后,对性能与泛化能力有何影响?
  • RQ5内存高效的Householder矩阵表示法对训练吞吐量与模型可扩展性有何影响?

主要发现

  • 所提出的并行训练算法使DeltaNet可扩展至13亿参数、1000亿词元规模的模型,验证了其大规模可行性。
  • 在标准语言建模范例中,DeltaNet的困惑度低于Mamba与GLA,表明其序列建模能力更强。
  • 在零样本下游任务(包括需要上下文检索的任务)中,DeltaNet优于Mamba与GLA,证实其在关联记忆方面的优势。
  • 结合DeltaNet与滑动窗口注意力或全局注意力层的混合模型,性能超越强基线Transformer模型,表明二者具有互补优势。
  • 采用内存高效的WY表示法处理Householder矩阵乘积,可在不显式生成大型中间状态的前提下实现高吞吐量训练,显著降低I/O开销。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。