SpargeAttention: Accurate and Training-free Sparse Attention Accelerating Any Model Inference
Jintao Zhang, Chendong Xiang, Haofeng Huang, Jia Wei, Haocheng Xi, Jun Zhu, Jianfei Chen
Abstract
An efficient attention implementation is essential for large models due to its quadratic time complexity. Fortunately, attention commonly exhibits sparsity, i.e., many values in the attention map are near zero, allowing for the omission of corresponding computations. Many studies have utilized the sparse pattern to accelerate attention. However, most existing works focus on optimizing attention within specific models by exploiting certain sparse patterns of the attention map. A universal sparse attention that guarantees both the speedup and end-to-end performance of diverse models remains elusive. In this paper, we propose SpargeAttn, a universal sparse and quantized attention for any model. Our method uses a two-stage online filter: in the first stage, we rapidly and accurately predict the attention map, enabling the skip of some matrix multiplications in attention. In the second stage, we design an online softmaxaware filter that incurs no extra overhead and further skips some matrix multiplications. Experiments show that our method significantly accelerates diverse models, including language, image, and video generation, without sacrificing end-toend metrics. The code is available at https: //github.com/thu-ml/SpargeAttn . 1
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext ac1372d6-9f77-4d84-86b2-3462a0799890Cited by top-tier papers30
- InfLLM-V2: Dense-Sparse Switchable Attention for Seamless Short-to-Long AdaptationWeilin Zhao, Zihan Zhou, Zhou Su, Chaojun Xiao et al.ICLR 2026 · 32 citations
- Block-Sparse Global Attention for Efficient Multi-View Geometry TransformersChung-Shien Brian Wang, Christian Schmidt, Jens Piekenbrinck, Bastian LeibeCVPR 2026 · 22 citations
- Think-at-Hard: Selective Latent Iterations to Improve Reasoning Language ModelsTianyu Fu, Yichen You, Zekai Chen, Guohao Dai et al.ICML 2026 · 20 citations
- AVGGT: Rethinking Global Attention for Accelerating VGGTXianbing Sun, Zhikai Zhu, Zhengyu Lou, Bo Yang et al.CVPR 2026 · 16 citations
- BLADE: Block-Sparse Attention Meets Step Distillation for Efficient Video GenerationYouping Gu, Xiaolong Li, Yuhao Hu, Minqi Chen et al.ICLR 2026 · 13 citations
Builds on38
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-AwarenessTri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra et al.NeurIPS 2022 · 5,493 citations
- Reformer: The Efficient TransformerNikita Kitaev, Lukasz Kaiser, Anselm LevskayaICLR 2020 · 2,878 citations
- Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 2,665 citations
- FlashAttention-2: Faster Attention with Better Parallelism and Work PartitioningTri DaoICLR 2024 · 2,600 citations
- Efficient Streaming Language Models with Attention SinksGuangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han et al.ICLR 2024 · 1,714 citations
Related papers
- SageAttention: Accurate 8-Bit Attention for Plug-and-play Inference AccelerationJintao Zhang, Jia Wei, Pengle Zhang, Jun Zhu et al.ICLR 2025
- SageAttention2: Efficient Attention with Thorough Outlier Smoothing and Per-thread INT4 QuantizationJintao Zhang, Haofeng Huang, Pengle Zhang, Jia Wei et al.ICML 2025
- SALE : Low-bit Estimation for Efficient Sparse Attention in Long-context LLM PrefillingXiaodong Ji, Hailin Zhang, Fangcheng Fu, Bin CuiICML 2026 · 3 citations
- SAS: Sparse Attention Synthesizer for Efficient Language Model InferenceYuan Zhou, Shaojie Xiang, Lingfan Yu, Zhenyu Song et al.EuroSys 2026
- FSA: An Alternative Efficient Implementation of Native Sparse Attention KernelRan Yan, Youhe Jiang, Zhuoming Chen, Haohui Mai et al.ICLR 2026 · 10 citations
