arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.06484cs.LGcs.CL
收藏

线性Transformers的Delta序列长度分解法

Parallelizing Linear Transformers with the Delta Rule over Sequence Length

Massachusetts Institute of Technology(麻省理工学院);Soochow University(苏州大学);MIT-IBM Watson AI Lab(麻省理工学院-IBM沃森人工智能实验室)

Songlin Yang, Bailin Wang, Yu Zhang, Yikang Shen, Yoon Kim

摘要:

具有线性注意力的Transformers(即,线性Transformers)和状态空间模型最近被建议作为具有softmax关注的Transformers的可行线性时间替代。然而,这些模型仍然不如transformer,特别是在需要上下文检索的任务上。虽然已经发现用增量规则(DeltaNet)替换线性Transformers中的加法更新的线性Transformers的更有表现力的变体在关联召回方面更有效,但是用于训练这种模型的现有算法在序列长度上不并行化,因此在现代硬件上训练效率低下。这项工作描述了一个硬件高效的算法,用于训练线性Transformers的delta规则,它利用了一个内存高效的表示计算产品的Householder矩阵。该算法允许我们将DeltaNet扩展到标准语言建模设置。我们训练了一个1.3B模型,用于100 B令牌,发现它在下游任务的困惑和zero-shot性能方面优于最近的线性时间基线,如Mamba和GLA。我们还对两个混合模型进行了实验,这些模型将DeltaNet层与(1)每隔一层的滑动窗口注意力层或(2)两个全局注意力层相结合,并发现这些混合模型的性能优于强Transformer基线。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑