Sliding Window Attention
A mechanism that restricts attention computation so that each token attends only to a fixed-size window of preceding tokens rather than the full sequence. This reduces attention complexity below O(n²) and is commonly used for memory optimization in long-context language models.
Core Facts
The computational complexity of standard self-attention is quadratic with respect to sequence length, and achieving a context of one million tokens requires introducing techniques such as sparse attention, sliding window attention, and KV Cache compression.
Memory injection consumes context tokens, which is a trade-off of spending tokens to reduce tool-call conversation turns and the need to search through content.
Timeline (last 90 days)
Ripple 65B's architecture has 80 layers, uses more attention heads than usual together with more sliding-window attention layers, adopts gated attention, and applies no positional encoding in the global layers.
Sliding-window attention limits the visible range of each position to a nearby fixed window, reducing computation but losing long-distance information.
Sliding window attention lets each token attend only to neighboring tokens within a fixed-length window, thereby reducing attention computation and the KV cache from linear growth with sequence length to constant level.
Some of DeepSeek's model layers use sliding window attention, attending only to the most recent 128 tokens; SWA bounded replay replays only a short window at the end of the prompt, which is said to nearly eliminate total prefill work.
The architecture's sliding window is 128 tokens, and the KV cache of the window layers stops growing after 128 positions, no matter how long the context is.
For this architecture, the cached bytes per token is not a constant; the equivalent bytes/token of the window layers alone is about 688.0 at a context of 8,192, about 43.0 at 131,072, and about 5.4 at 1,048,576.
Muse Spark Open supports a 1-million-token context window, achieved through a hybrid attention architecture that alternates between sliding window attention and full attention across layers.
Sliding window attention is a local attention variant in the Transformer architecture, where each token only attends to tokens within a fixed-length window before and after it, reducing the attention computation complexity from O(n²) to O(n·w).
The implementation of unlimited context typically relies on retrieval-augmented generation (RAG) or variants of the sliding window attention mechanism.
Memory injection consumes context tokens, which is a trade-off of spending tokens to reduce tool-call conversation turns and the need to search through content.
3 more timeline events
All Facts (19)
The computational complexity of standard self-attention is quadratic with respect to sequence length, and achieving a context of one million tokens requires introducing techniques such as sparse attention, sliding window attention, and KV Cache compression.
70%VerifiedMemory injection consumes context tokens, which is a trade-off of spending tokens to reduce tool-call conversation turns and the need to search through content.
65%UnverifiedGemma 4使用滑动窗口注意力(SWA)架构,该架构在处理数千行混淆JavaScript时导致模型遗忘早先读入的关键上下文
80%UnverifiedThe KV Cache size of sliding window attention is constant, achieving O(1) memory usage rather than O(n).
70%UnverifiedSliding Window Attention reduces the standard Transformer's O(n²) complexity to O(n·w), but the model cannot directly see information outside the window.
70%UnverifiedSliding window attention is a local attention variant in the Transformer architecture, where each token only attends to tokens within a fixed-length window before and after it, reducing the attention computation complexity from O(n²) to O(n·w).
60%UnverifiedIndustry solutions for improving long-context attention decay include sparse attention, sliding window attention, and RoPE positional encoding extrapolation, but currently no solution can completely eliminate this fundamental limitation.
60%UnverifiedSliding window attention (such as the approach adopted by Mistral) reduces complexity from O(n²) to O(n·w) by limiting each token to attending only to history within a fixed window.
60%UnverifiedSliding Window Attention (SWA), widely adopted by Mistral AI, reduces attention complexity from O(N²) to O(N×W).
60%UnverifiedRipple 65B's architecture has 80 layers, uses more attention heads than usual together with more sliding-window attention layers, adopts gated attention, and applies no positional encoding in the global layers.
50%UnverifiedSliding-window attention limits the visible range of each position to a nearby fixed window, reducing computation but losing long-distance information.
50%UnverifiedSliding window attention lets each token attend only to neighboring tokens within a fixed-length window, thereby reducing attention computation and the KV cache from linear growth with sequence length to constant level.
50%UnverifiedSome of DeepSeek's model layers use sliding window attention, attending only to the most recent 128 tokens; SWA bounded replay replays only a short window at the end of the prompt, which is said to nearly eliminate total prefill work.
50%UnverifiedThe architecture's sliding window is 128 tokens, and the KV cache of the window layers stops growing after 128 positions, no matter how long the context is.
50%UnverifiedFor this architecture, the cached bytes per token is not a constant; the equivalent bytes/token of the window layers alone is about 688.0 at a context of 8,192, about 43.0 at 131,072, and about 5.4 at 1,048,576.
50%UnverifiedMuse Spark Open supports a 1-million-token context window, achieved through a hybrid attention architecture that alternates between sliding window attention and full attention across layers.
50%UnverifiedThe implementation of unlimited context typically relies on retrieval-augmented generation (RAG) or variants of the sliding window attention mechanism.
50%UnverifiedSpark X 2.5 has 36 layers in total and uses a repeating '4-layers-per-group' structure, where each group contains three sliding window layers that attend only to the most recent 512 tokens and one global layer that reads the entire text
50%UnverifiedKV cache optimization has four main technical approaches: quantization, sparse attention, low-rank approximation, and multi-query/grouped-query attention (MQA/GQA).
50%