AI Glossary Term
What does “Sliding Window Attention” mean?
Definition
An attention pattern where each token attends only to a fixed-size window of nearby tokens to reduce compute.
How Sliding Window Attention works
Example
With a window of 4,096, a token at position 50,000 attends only to the previous 4,096 tokens. Stacked layers still pass information further, so earlier content can influence it indirectly.
Why it matters
It makes long inputs cheaper to process. Details outside the window can be lost unless layers carry them forward.
Common questions
Which models use it?
Several open models, including some from Mistral and Longformer-style designs, use windowed attention.
Does the model forget old text?
Direct access is limited, though information can propagate through layers.
Window size vs context length?
The window limits direct attention; total context can be larger because layers stack.