SWGDN: Improving Gated Delta Networks with Sliding-Window Attention
Abstract
Sliding-window attention in Delta-Rule linear attention improves the construction of key-value learning pairs and yields better performance than baseline models across several benchmarks.
Linear attention compresses historical context into a fixed-size recurrent state, reducing the computational and memory costs of long-sequence modeling. From the perspective of test-time regression (TTR), the state matrix can be viewed as an online-learned regression model, where keys and values serve as inputs and targets respectively, and queries are used to read from the model. From this perspective, the effectiveness of state learning depends not only on the update rule but also on how the key-value learning pairs used for state updates are constructed. While existing work has largely focused on how the state is updated and organized, we investigate how the learning pairs used for state updates are constructed. To this end, we propose Sliding-Window Gated DeltaNet (SWGDN), which replaces short convolutions in Delta-Rule linear attention with sliding-window attention to perform content-dependent local aggregation of projected queries, keys, and values. Our experiments show that SWGDN makes the key-value pairs used in consecutive updates more similar than the baseline. The local mixing strategy can be incorporated into any Delta-Rule-based linear attention architecture without changing its state update equations or chunkwise parallel algorithms. We apply this strategy to two Delta-Rule variants, GDN2 and KDA, at the 340M-parameter scale. Experimental results demonstrate that SWGDN outperforms the original Delta-Rule baselines across multiple benchmarks.
Community
We introduce SWGDN (Sliding Window Gated DeltaNet), a simple modification to Delta-rule-based linear attention architectures.
Instead of using short convolutions for local token mixing, SWGDN employs pseudo-query-driven sliding window attention to enable content-dependent aggregation of Q, K, and V, while preserving the original recurrent update and chunkwise parallelization.
Our experiments demonstrate improvements across multiple language modeling and downstream benchmarks. We also explore the mechanism from a test-time learning perspective.
We welcome any feedback and discussion, particularly from researchers working on linear attention, recurrent architectures, and efficient language models!
Since our approach can directly leverage existing infrastructure, we have not open-sourced our implementation yet. We have already made several optimizations to better accommodate our architecture and achieve higher throughput. We are currently cleaning up the code and will open-source it in the next release.
Models citing this paper 0
No model linking this paper
Datasets citing this paper 0
No dataset linking this paper
Spaces citing this paper 0
No Space linking this paper