Efficient attention variants

Attention & transformers · component · 2020 · text · any domain

What it is

Ways to dodge the quadratic attention matrix: sparse patterns, low-rank projections, kernels, clustering, or memory.

When to use it

Very long contexts where exact attention is affordable nowhere: Longformer, BigBird, Reformer, Performer, Linformer, FlashAttention as the implementation-level answer.

Caveats

Each variant buys speed with an approximation (sparsity, low rank, kernels or locality) that can miss long-range interactions full attention would catch. The gains mostly appear at very long sequence lengths; at ordinary lengths, well-optimized full attention is often just as fast.

Key ideas

  • Sparse/local patterns assume nearby tokens matter most
  • Linear attention trades expressiveness for O(n) scaling

Related architectures

Original paper

Longformer: The Long-Document Transformer (2020, arXiv)

Browse all 198 architectures

The architecture landscape, in one place.

Two things get called “ML architecture”: the classical statistical model families, and the neural network wirings. Both are here, tagged by what they are and what data they eat.

Start from your problem

Architectures

0 shortlisted