paper-with-me

Papers

Gated Linear Attention Transformers with Hardware-Efficient Training

2023-12-11 · Songlin Yang, Bailin Wang, Yikang Shen, Rameswar Panda, Yoon Kim

Transformers with linear attention allow for efficient parallel training but can simultaneously be formulated as an RNN with 2D (matrix-valued) hidden states, thus enjoying linear-time inference complexity. However, linear attention generally underperforms ordinary softmax attention. Moreover, current implementations of linear attention lack I/O-awareness and are thus slower than highly optimized implementations of softmax attention. This work describes a hardware-efficient algorithm for linear attention that trades off memory movement against parallelizability. The resulting implementation, dubbed FLASHLINEARATTENTION, is faster than FLASHATTENTION-2 (Dao, 2023) as a standalone layer even on short sequence lengths (e.g., 1K). We then generalize this algorithm to a more expressive variant of linear attention with data-dependent gates. When used as a replacement for the standard attention layer in Transformers, the resulting gated linear attention (GLA) Transformer is found to perform competitively against the LLaMA-architecture Transformer (Touvron et al., 2023) as well recent linear-time-inference baselines such as RetNet (Sun et al., 2023a) and Mamba (Gu & Dao, 2023) on moderate-scale language modeling experiments. GLA Transformer is especially effective at length generalization, enabling a model trained on 2K to generalize to sequences longer than 20K without significant perplexity degradations. For training speed, the GLA Transformer has higher throughput than a similarly-sized Mamba model.

📄 PDF Abstract BibTeX arXiv:2312.06635

Code (6)

berlino/gated_linear_attention 공식 구현 pytorch
fla-org/flash-linear-attention pytorch
hustvl/dig pytorch
sustcsonglin/flash-linear-attention pytorch
theodorblackbird/lina-speech pytorch
torchrwkv/flash-linear-attention pytorch

Tasks

2kLanguage ModelingLanguage ModellingMamba

Methods 이 논문이 사용한 방법론

Multi-Head Attention 설명 없음
Attention 설명 없음
Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
Residual Connection 설명 없음
Layer Normalization Unlike batch normalization, Layer Normalization directly estimates the normalization statistics from the summed inputs…
Dropout Dropout is a regularization technique for neural networks that drops a unit (along with connections) at training time with a specified probability $p$ (a common value is…
Dense Connections Dense Connections, or Fully Connected Connections, are a type of layer in a deep neural network that use a linear operation where every input is connected to every output…
Position-Wise Feed-Forward Layer 설명 없음

Similar Papers 제목 키워드 기반

Gated Slot Attention for Efficient Linear-Time Sequence Modeling

2024-09-11 · Yu Zhang, Songlin Yang, Ruijie Zhu, Yue Zhang 외

Linear attention Transformers and their gated variants, celebrated for enabling parallel training and efficient recurrent inference, still fall short in recall-intensive tasks compared to traditional Transformers and dem…

Griffin: Mixing Gated Linear Recurrences with Local Attention for Efficient Language Models

2024-02-29 · Soham De, Samuel L. Smith, Anushan Fernando, Aleksandar Botev 외

Recurrent neural networks (RNNs) have fast inference and scale efficiently on long sequences, but they are difficult to train and hard to scale. We propose Hawk, an RNN with gated linear recurrences, and Griffin, a hybri…

Language ModellingMamba

Gated Delta Networks: Improving Mamba2 with Delta Rule

2024-12-09 · Songlin Yang, Jan Kautz, Ali Hatamizadeh

Linear Transformers have gained attention as efficient alternatives to standard Transformers, but their performance in retrieval and long-context tasks has been limited. To address these limitations, recent work has expl…

Common Sense ReasoningLanguage ModelingLanguage ModellingLong-Context Understanding+1

Parallelizing Linear Transformers with the Delta Rule over Sequence Length

2024-06-10 · Songlin Yang, Bailin Wang, Yu Zhang, Yikang Shen 외

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 u…

Language ModelingLanguage ModellingMambaState Space Models

Mamba: Linear-Time Sequence Modeling with Selective State Spaces

2023-12-01 · Albert Gu, Tri Dao

Foundation models, now powering most of the exciting applications in deep learning, are almost universally based on the Transformer architecture and its core attention module. Many subquadratic-time architectures such as…

2D Pose EstimationCommon Sense ReasoningComputational EfficiencyLanguage Modeling+5