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
摘要
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
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 30 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention 引用了 Reformer: The Efficient Transformer
- Efficient Streaming Language Models with Attention Sinks 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- Efficient Streaming Language Models with Attention Sinks 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- Efficient Streaming Language Models with Attention Sinks 引用了 Reformer: The Efficient Transformer
- Block-Sparse Global Attention for Efficient Multi-View Geometry Transformers 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- Block-Sparse Global Attention for Efficient Multi-View Geometry Transformers 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- AVGGT: Rethinking Global Attention for Accelerating VGGT 引用了 Block-Sparse Global Attention for Efficient Multi-View Geometry Transformers
- AVGGT: Rethinking Global Attention for Accelerating VGGT 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness 引用了 Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness 引用了 Reformer: The Efficient Transformer
- Think-at-Hard: Selective Latent Iterations to Improve Reasoning Language Models 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- Think-at-Hard: Selective Latent Iterations to Improve Reasoning Language Models 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning 引用了 Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning 引用了 Reformer: The Efficient Transformer
- BLADE: Block-Sparse Attention Meets Step Distillation for Efficient Video Generation 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- BLADE: Block-Sparse Attention Meets Step Distillation for Efficient Video Generation 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- InfLLM-V2: Dense-Sparse Switchable Attention for Seamless Short-to-Long Adaptation 引用了 Efficient Streaming Language Models with Attention Sinks
- InfLLM-V2: Dense-Sparse Switchable Attention for Seamless Short-to-Long Adaptation 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- InfLLM-V2: Dense-Sparse Switchable Attention for Seamless Short-to-Long Adaptation 引用了 Reformer: The Efficient Transformer
引用它的顶会 Paper30
- InfLLM-V2: Dense-Sparse Switchable Attention for Seamless Short-to-Long AdaptationWeilin Zhao, Zihan Zhou, Zhou Su, Chaojun Xiao 等ICLR 2026 · 32 次引用
- Block-Sparse Global Attention for Efficient Multi-View Geometry TransformersChung-Shien Brian Wang, Christian Schmidt, Jens Piekenbrinck, Bastian LeibeCVPR 2026 · 22 次引用
- Think-at-Hard: Selective Latent Iterations to Improve Reasoning Language ModelsTianyu Fu, Yichen You, Zekai Chen, Guohao Dai 等ICML 2026 · 20 次引用
- AVGGT: Rethinking Global Attention for Accelerating VGGTXianbing Sun, Zhikai Zhu, Zhengyu Lou, Bo Yang 等CVPR 2026 · 16 次引用
- BLADE: Block-Sparse Attention Meets Step Distillation for Efficient Video GenerationYouping Gu, Xiaolong Li, Yuhao Hu, Minqi Chen 等ICLR 2026 · 13 次引用
它引用的 Paper38
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-AwarenessTri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra 等NeurIPS 2022 · 5,493 次引用
- Reformer: The Efficient TransformerNikita Kitaev, Lukasz Kaiser, Anselm LevskayaICLR 2020 · 2,878 次引用
- Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 2,665 次引用
- FlashAttention-2: Faster Attention with Better Parallelism and Work PartitioningTri DaoICLR 2024 · 2,600 次引用
- Efficient Streaming Language Models with Attention SinksGuangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han 等ICLR 2024 · 1,714 次引用
相关 Paper
- SageAttention: Accurate 8-Bit Attention for Plug-and-play Inference AccelerationJintao Zhang, Jia Wei, Pengle Zhang, Jun Zhu 等ICLR 2025
- SageAttention2: Efficient Attention with Thorough Outlier Smoothing and Per-thread INT4 QuantizationJintao Zhang, Haofeng Huang, Pengle Zhang, Jia Wei 等ICML 2025
- SALE : Low-bit Estimation for Efficient Sparse Attention in Long-context LLM PrefillingXiaodong Ji, Hailin Zhang, Fangcheng Fu, Bin CuiICML 2026 · 3 次引用
- SAS: Sparse Attention Synthesizer for Efficient Language Model InferenceYuan Zhou, Shaojie Xiang, Lingfan Yu, Zhenyu Song 等EuroSys 2026
- FSA: An Alternative Efficient Implementation of Native Sparse Attention KernelRan Yan, Youhe Jiang, Zhuoming Chen, Haohui Mai 等ICLR 2026 · 10 次引用
