Parallelizing Linear Transformers with the Delta Rule over Sequence Length

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Yang, Songlin, Wang, Bailin, Zhang, Yu, Shen, Yikang, Kim, Yoon
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866929676242386944
author Yang, Songlin
Wang, Bailin
Zhang, Yu
Shen, Yikang
Kim, Yoon
author_facet Yang, Songlin
Wang, Bailin
Zhang, Yu
Shen, Yikang
Kim, Yoon
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2406_06484
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Parallelizing Linear Transformers with the Delta Rule over Sequence Length
Yang, Songlin
Wang, Bailin
Zhang, Yu
Shen, Yikang
Kim, Yoon
Machine Learning
Computation and Language
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.
title Parallelizing Linear Transformers with the Delta Rule over Sequence Length
topic Machine Learning
Computation and Language
url https://arxiv.org/abs/2406.06484