How models
pay attention.
Compare attention mechanisms and memory layouts with interactive examples.
exact · io-aware
FlashAttention
Computes attention in on-chip tiles to avoid storing the full score matrix in GPU memory.
Llama / Mistral
kv sharing
Grouped-Query
Shares key and value heads across query heads, reducing the KV cache.
Mistral / Gemma / Llama
compressed kv
Multi-head Latent
Caches a compressed latent vector and a separate positional key for each token.
DeepSeek / Kimi
local attention
Sliding Window
Restricts each token to a local window, reducing the number of attention pairs.
Mistral / Gemma
native sparse attention
DeepSeek Sparse
Uses a learned indexer to select token positions before main attention.
DeepSeek
linear / recurrent
Gated DeltaNet
Updates a fixed-size state with learned decay gates and delta-rule corrections.
Qwen
fine-grained memory
Kimi Delta Attention
Applies channel-wise decay gates to a fixed-size recurrent state.
Kimi
serving
Paged Attention
Allocates the KV cache in blocks, reducing unused reservations and supporting shared prefixes.
vLLM