Intuition
Most local language structure is nearby, so a model can save compute by not attending globally in every layer.
Technical definition
Sliding-window attention masks attention to a fixed local neighborhood, reducing attention cost relative to full sequence attention.
Example
A long-context model may use local attention in most layers and global attention in selected layers.
Common misunderstandings
- Sliding-window attention can miss distant dependencies unless combined with other mechanisms.
- It is an efficiency tradeoff, not a universal replacement for global attention.