XAttention: Block Sparse Attention with Antidiagonal Scoring
Ruyi Xu, Guangxuan Xiao, Haofeng Huang, Junxian Guo, Song Han
摘要
Long-Context Transformer Models (LCTMs) are vital for real-world applications but suffer high computational costs due to attention's quadratic complexity. Block-sparse attention mitigates this by focusing computation on critical regions, yet existing methods struggle with balancing accuracy and efficiency due to costly block importance measurements. In this paper, we introduce XAttention, a plug-and-play framework that dramatically accelerates long-context inference in Transformers models using sparse attention. XAttention's key innovation is the insight that the sum of antidiagonal values (i.e., from the lower-left to upper-right) in the attention matrix provides a powerful proxy for block importance. This allows for precise identification and pruning of non-essential blocks, resulting in high sparsity and dramatically accelerated inference. Across comprehensive evaluations on demanding long-context benchmarks-including RULER and LongBench for language, VideoMME for video understanding, and VBench for video generation-XAttention achieves accuracy comparable to full attention while delivering substantial computational gains. We demonstrate up to 13.5× acceleration in attention computation. These results underscore XAttention's ability to unlock the practical potential of block sparse attention, paving the way for scalable and efficient deployment of LCTMs in real-world applications.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 54 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Efficient Streaming Language Models with Attention Sinks 引用了 Big Bird: Transformers for Longer Sequences
- 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
- Flow Caching for Autoregressive Video Generation 引用了 Scalable Diffusion Models with Transformers
- Flow Caching for Autoregressive Video Generation 引用了 Sparse VideoGen2: Accelerate Video Generation with Sparse Attention via Semantic-Aware Permutation
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness 引用了 Big Bird: Transformers for Longer Sequences
- FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning 引用了 Big Bird: Transformers for Longer Sequences
- FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- 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 引用了 Big Bird: Transformers for Longer Sequences
- InfLLM-V2: Dense-Sparse Switchable Attention for Seamless Short-to-Long Adaptation 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- Radial Attention: 𝒪(n log n) Sparse Attention with Energy Decay for Long Video Generation 引用了 Efficient Streaming Language Models with Attention Sinks
- Radial Attention: 𝒪(n log n) Sparse Attention with Energy Decay for Long Video Generation 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- Radial Attention: 𝒪(n log n) Sparse Attention with Energy Decay for Long Video Generation 引用了 Scalable Diffusion Models with Transformers
- Radial Attention: 𝒪(n log n) Sparse Attention with Energy Decay for Long Video Generation 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- Neural Attention Search 引用了 Efficient Streaming Language Models with Attention Sinks
- Neural Attention Search 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- Neural Attention Search 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- Sparse VideoGen2: Accelerate Video Generation with Sparse Attention via Semantic-Aware Permutation 引用了 Efficient Streaming Language Models with Attention Sinks
引用它的顶会 Paper54
- Neural Attention SearchDifan Deng, Marius LindauerNeurIPS 2025 · 431 次引用
- Sparse VideoGen2: Accelerate Video Generation with Sparse Attention via Semantic-Aware PermutationShuo Yang, Haocheng Xi, Yilong Zhao, Muyang Li 等NeurIPS 2025 · 114 次引用
- Radial Attention: 𝒪(n log n) Sparse Attention with Energy Decay for Long Video GenerationXingyang Li, Muyang Li, Tianle Cai, Haocheng Xi 等NeurIPS 2025 · 66 次引用
- InfLLM-V2: Dense-Sparse Switchable Attention for Seamless Short-to-Long AdaptationWeilin Zhao, Zihan Zhou, Zhou Su, Chaojun Xiao 等ICLR 2026 · 32 次引用
- Flow Caching for Autoregressive Video GenerationYuexiao Ma, Xuzhe Zheng, Jing Xu, Xiwei Xu 等ICLR 2026 · 20 次引用
它引用的 Paper22
- Scalable Diffusion Models with TransformersWilliam Peebles, Saining XieICCV 2023 · 5,568 次引用
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-AwarenessTri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra 等NeurIPS 2022 · 5,493 次引用
- Big Bird: Transformers for Longer SequencesManzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie 等NeurIPS 2020 · 3,159 次引用
- 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
- VecAttention: Vector-wise Sparse Attention for Accelerating Long Context InferenceAnmin Liu, Ruixuan Yang, Huiqiang Jiang, Bin Lin 等CVPR 2026 · 4 次引用
- Token Sparse Attention: Efficient Long-Context Inference with Interleaved Token SelectionDongwon Jo, Beomseok Kang, Jiwon Song, jae-joon kimICML 2026 · 1 次引用
- DuSA: Fast and Accurate Dual-Stage Sparse Attention Mechanism Accelerating Both Training and InferenceChong Wu, Jiawang Cao, Renjie Xu, Zhuoheng Ran 等NeurIPS 2025 · 5 次引用
- Evolving Sparsity: Leveraging Token Importance Dynamics for Efficient LLM Decoding with Sparse AttentionRuizi Han, Miao Zhang, Ziyue Qiao, Liqiang NieACL 2026
- A Unified Sparse Attention via Multi-Granularity CompressionSiran Liu, Zheng Cao, Yongchao HeICML 2026
