Architecture

Memory Efficient Attention

An umbrella architectural family of attention computation methods that reduce the memory footprint of the attention operation from O(N²) toward O(N), including **FlashAttention** (kernel-level tile-based recomputation), **PagedAttention** (block-allocated KV-cache management), **Multi-Query Attention (MQA)** and **Grouped-Query Attention (GQA)** (head-count reduction on K and V), and **Multi-head Latent Attention (MLA)** (compressed shared latent representation). Each represents a different point on the memory-quality-throughput Pareto frontier; modern LLM architectures combine multiple.

5 connections1 post

Definition

What it is

An umbrella architectural family of attention computation methods that reduce the memory footprint of the attention operation from O(N²) toward O(N), including FlashAttention (kernel-level tile-based recomputation), PagedAttention (block-allocated KV-cache management), Multi-Query Attention (MQA) and Grouped-Query Attention (GQA) (head-count reduction on K and V), and Multi-head Latent Attention (MLA) (compressed shared latent representation). Each represents a different point on the memory-quality-throughput Pareto frontier; modern LLM architectures combine multiple.

Why it exists

Naive scaled-dot-product attention materializes an N×N attention score matrix and an N×N value-weighted output, consuming O(N²) memory and bandwidth. For N=128k, this is hundreds of GB per layer — infeasible. Memory Efficient Attention is the foundational architectural family that lets transformers scale to 100k+ context windows on practical hardware, and it is the prerequisite architecture for every long-context model on the market.

Primary use cases

Every modern transformer language model uses at least one Memory Efficient Attention variant — Llama 3/4 use GQA + FlashAttention, DeepSeek-V3/V4 use MLA + FlashAttention, Gemma 4 uses shared-KV layers + FlashAttention. The architecture is invisible to model users but determines what context lengths are feasible at what cost.

Connections5

Outbound3
Inbound2
depends_on1

Featured in