Rectified Sparse Attention

Yutao Sun, Tianzhu Ye, Li Dong, Yuqing Xia, Jian Chen +4 more
6/4/2025
cs.CL

No confident code implementation found for this paper. 2 possible matches can be shown below.

Abstract

Efficient long-sequence generation is a critical challenge for Large Language Models. While recent sparse decoding methods improve efficiency, they suffer from KV cache misalignment, where approximation errors accumulate and degrade generation quality. In this work, we propose Rectified Sparse Attention (ReSA), a simple yet effective method that combines block-sparse attention with periodic dense rectification. By refreshing the KV cache at fixed intervals using a dense forward pass, ReSA bounds error accumulation and preserves alignment with the pretraining distribution. Experiments across math reasoning, language modeling, and retrieval tasks demonstrate that ReSA achieves near-lossless generation quality with significantly improved efficiency. Notably, ReSA delivers up to 2.42$\times$ end-to-end speedup under decoding at 256K sequence length, making it a practical solution for scalable long-context inference. Code is available at https://aka.ms/ReSA-LM.

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. 2 weaker matches are 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{sun2025rectified,
  title  = {Rectified Sparse Attention},
  author = {Yutao Sun and Tianzhu Ye and Li Dong and Yuqing Xia and Jian Chen and Yizhao Gao and Shijie Cao and Jianyong Wang and Furu Wei},
  year   = {2025},
  eprint = {2506.04108},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2506.04108v2}
}

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/2506.04108.svg)](https://codeofpaper.com/paper/2506.04108)

Discussion