atlas

Research map / Architectures and efficiency / Attention and transformers

Gated Linear Attention Transformers with Hardware-Efficient Training

ICML 2024 · Architectures and efficiency › Attention and transformers · approach: Linear attention approximations · 5 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes FlashLinearAttention, an I/O-aware chunkwise algorithm for linear attention, and extends it to gated linear attention (GLA) Transformers with data-dependent gates, evaluated on moderate-scale language modeling against Transformer++, RetNet and Mamba.

Problem

Linear attention Transformers underperform softmax attention in language modeling and are slower in wall-clock time than optimized softmax attention because existing chunkwise implementations are not I/O-aware; prior gated variants either use only scalar decays or materialize hidden states in HBM.

Approach

An I/O-aware chunkwise algorithm (FlashLinearAttention) with materialized or non-materialized inter-chunk states, plus a data-dependent low-rank gate G_t = alpha_t^T 1 whose chunkwise form is computed via two-level (secondary) chunking so most intra-chunk matmuls use half-precision tensor cores, and a closed-form gradient for the gates that avoids materializing per-step states.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
add data-dependent gating rather than use linear attention without a gate (ablation)GLA Transformer · 340M model, 7B tokenstraining perplexity: 23.21 -> 14.77Helped
use data-dependent fine-grained gates rather than data-independent scalar decay (ablation)GLA Transformer · 340M model, 7B tokenstraining perplexity: 16.55 -> 14.77Helped
use fine-grained gates rather than data-dependent scalar gates (ablation)GLA Transformer · 340M model, 7B tokenstraining perplexity: 15.56 -> 14.77Helped
increase the number of heads from 4 to 8 (ablation)GLA Transformer · 340M model, 7B tokenstraining perplexity: 14.77 -> 15.29Hurt
reduce the number of heads from 4 to 1 (ablation)GLA Transformer · 340M model, 7B tokenstraining perplexity: 14.77 -> 14.61Helped
replace data-independent decay with data-dependent gatesGLA Transformer versus RetNet · language modeling and zero-shot tasks, 340M and 1.3Btask performanceHelped
use GLA instead of Mamba1.3B models · SQUADscore: 35.2 -> 42.6Helped
use GLA instead of Transformer++1.3B models · HellaSwagnormalized accuracy: 49.6 -> 49.8Helped
use GLA instead of Transformer++1.3B models · FDA and SWDEscore: 27.4 -> 19.9; 66.6 -> 50.6Hurt
train GLA on longer contexts rather than 2K contextsGLA · SlimPajama and PG19 test setsperplexityNo clear effect
use GLA instead of Mamba1.3B language models · training sequences beyond 4096training throughputHelped

Surprising findings

Limitations

Experimental setup

Datasets: SlimPajama PG19 Wikitext LAMBADA PIQA HellaSwag WinoGrande ARC-easy ARC-challenge FDA SWDE SQuAD

Benchmarks: Wikitext LAMBADA PIQA HellaSwag WinoGrande ARC-easy ARC-challenge FDA SWDE SQuAD MQAR PG19

Metrics: perplexity accuracy acc_norm throughput memory footprint training ppl

Baselines: Transformer++ RetNet Mamba FlashAttention-2 Hyena RWKV-4

Builds on: FlashAttention RetNet Mamba Transformer++ (LLaMA architecture) HGRN

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy