Category
Attention Mechanisms
MHA → MQA → GQA → MLA; full, sliding-window, linear, and lightning attention.
- Multi-Head Attention MHA foundational
Let attention specialize. Instead of one big attention over the whole d_model space, run H independent attention heads in lower-rank subspaces and concatenate — each head free to learn a different relation type.
- Sparse Transformer Sparse Transformer foundational
Replace dense O(T²) attention with structured sparsity — two fixed patterns (strided and fixed) that together let any pair of tokens reach each other in at most two hops while attending to only O(T·√T) total keys.
- Multi-Query Attention MQA production-adopted
Cut the KV cache by H× — share a single K, V across all H query heads. Solves decoder-side inference memory pressure that MHA's per-head cache creates.
- Reformer — LSH Attention Reformer research
Replace dense O(N²) attention with locality-sensitive hashing — bucket similar Q, K together and only attend within buckets. O(N · log N) attention, learnable rather than fixed sparsity pattern.
- Sliding Window Attention SWA production-adopted
Make per-layer attention compute and KV cache scale linearly with sequence length instead of quadratically — by restricting each query to a fixed window of recent keys.
- Linear Attention Linear Attention production-adopted
Replace softmax with a kernel that lets you reorder QKV multiplications — making attention compute linear in sequence length, with a constant-size recurrent state at autoregressive inference.
- Linformer — Low-Rank Attention Projection Linformer research
Project keys and values down to a fixed low-rank subspace before attention — making attention O(N) by replacing the N×N attention matrix with an N×k one, where k is a fixed projection rank.
- BigBird BigBird research
Combine three structured sparse-attention patterns (random, window, global) so the model preserves universal-approximation properties while running in O(N) attention. The first theoretically-grounded sparse attention with a Turing-completeness proof.
- Performer — Random Feature Softmax Approximation Performer research
Approximate softmax attention with random features that decompose the kernel — letting attention scale linearly in sequence length while remaining an unbiased estimator of the original softmax operator.
- FlashAttention FlashAttention production-adopted
Compute exact attention 2–4× faster and with 5–20× less peak memory by recognizing that attention is memory-bandwidth-bound and tiling the computation to keep operations on-chip.
- Grouped-Query Attention GQA production-adopted
Get most of Multi-Query Attention's KV-cache savings without the quality drop — by sharing K, V across small groups of query heads instead of all heads.
- Lightning Attention Lightning production-adopted
Make linear attention actually fast at moderate sequence lengths by tile-fusing the computation so the constant overhead of the linear recurrence doesn't dominate against optimized FlashAttention kernels.
- Multi-Head Latent Attention MLA production-adopted
Cut KV cache memory below MQA/GQA while preserving or improving quality.
- DeepSeek Sparse Attention DSA production-adopted
Push attention compute below MLA's already-low cache floor by routing each query to a small top-K subset of historical keys, selected by a lightweight learned indexer.