Sparse attention
Attention variants that let each token look at only a subset of the other tokens, instead of all of them — to break full attention's quadratic cost and enable much longer sequences. The basis for many long-context models.
Problem: regular ("dense") self-attention lets each token compare itself with all others → the cost grows quadratically with sequence length (O(n²)), which becomes untenable for long documents. Sparse attention restricts the pattern: each token looks only at, say, its nearest neighbors (a local window) plus a few global "anchor" tokens. Examples: Longformer (local + global), BigBird (local + global + random), and sliding-window attention (Mistral). Win: linear or near-linear scaling → much longer context for the same compute. Trade-off: a token can no longer directly "see" everything, which can miss long-range dependencies if the pattern is poorly chosen. One of the main routes to extending context length. Related to sliding-window attention and context-length extension.