MSWA: Refining Local Attention with Multi-ScaleWindow Attention

Yixing Xu, Shivank Nag, Dong Li, Lu Tian, Emad Barsoum
1/2/2025
cs.CLcs.AI
transformer-attention

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

Transformer-based LLMs have achieved exceptional performance across a wide range of NLP tasks. However, the standard self-attention mechanism suffers from quadratic time complexity and linearly increased cache size.

Show full abstract

Sliding window attention (SWA) solves this problem by restricting the attention range to a fixed-size local context window. Nevertheless, SWA employs a uniform window size for each head in each layer, making it inefficient in capturing context of varying scales. To mitigate this limitation, we propose Multi-Scale Window Attention (MSWA) which applies diverse window sizes across heads and layers in the Transformer. It not only allows for different window sizes among heads within the same layer but also progressively increases window size allocation from shallow to deep layers, thus enabling the model to capture contextual information with different lengths and distances. Experimental results on language modeling and common-sense reasoning tasks substantiate that MSWA outperforms traditional local attention in both effectiveness and efficiency.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{xu2025mswa,
  title  = {MSWA: Refining Local Attention with Multi-ScaleWindow Attention},
  author = {Yixing Xu and Shivank Nag and Dong Li and Lu Tian and Emad Barsoum},
  year   = {2025},
  eprint = {2501.01039},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2501.01039v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2501.01039.svg)](https://codeofpaper.com/paper/2501.01039)

Discussion