01 Hybrid attention forms
Most layers mix tokens with a cheap fixed-size state; only a few layers keep full attention.
VideoThe idea in a few minutes
The problem
Full attention on every layer: KV cache grows with context on every layer.
VisualizationMemory per layer vs. context length
The idea
A layer stack where linear / state-space / sliding-window layers alternate with occasional full-attention layers.
VisualizationLayer stack, colored by layer type
The trade-off
What you keep and lose: exact recall vs. memory and decode speed as the full-attention ratio changes.
VisualizationRatio slider → memory, speed, recall
Sources
Papers and model reports.