Native Sparse Attention: Hardware-Aligned and Natively Trainable Sparse Attention
Jingyang Yuan, Huazuo Gao, Damai Dai, Junyu Luo, Liang Zhao, Zhengyan Zhang, Zhenda Xie, Yuxing Wei, Lean Wang, Zhiping Xiao, Yuqing Wang, Chong Ruan
摘要
Long-context modeling is crucial for next-generation language models, yet the high computational cost of standard attention mechanisms poses significant computational challenges. Sparse attention offers a promising direction for improving efficiency while maintaining model capabilities. We present NSA, a Natively trainable Sparse Attention mechanism that integrates algorithmic innovations with hardware-aligned optimizations to achieve efficient long-context modeling. NSA employs a dynamic hierarchical sparse strategy, combining coarse-grained token compression with fine-grained token selection to preserve both global context awareness and local precision. Our approach advances sparse attention design with two key innovations: (1) We achieve substantial speedups through arithmetic intensity-balanced algorithm design, with implementation optimizations for modern hardware. (2) We enable end-to-end training, reducing pretraining computation without sacrificing model performance. As shown in Figure 1 , experiments show the model pretrained with NSA maintains or exceeds Full Attention models across general benchmarks, long-context tasks, and instruction-based reasoning. Meanwhile, NSA achieves substantial speedups over Full Attention on 64k-length sequences across decoding, forward propagation, and backward propagation, validating its efficiency throughout the model lifecycle.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 143 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Efficient Streaming Language Models with Attention Sinks 引用了 Big Bird: Transformers for Longer Sequences
- MemAgent: Reshaping Long-Context LLM with Multi-Conv RL-based Memory Agent 引用了 Efficient Streaming Language Models with Attention Sinks
- MemAgent: Reshaping Long-Context LLM with Multi-Conv RL-based Memory Agent 引用了 MoBA: Mixture of Block Attention for Long-Context LLMs
- MoBA: Mixture of Block Attention for Long-Context LLMs 引用了 Efficient Streaming Language Models with Attention Sinks
- MoBA: Mixture of Block Attention for Long-Context LLMs 引用了 Big Bird: Transformers for Longer Sequences
- Generative Agents: Interactive Simulacra of Human Behavior 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Gated Attention for Large Language Models: Non-linearity, Sparsity, and Attention-Sink-Free 引用了 Efficient Streaming Language Models with Attention Sinks
- Gated Attention for Large Language Models: Non-linearity, Sparsity, and Attention-Sink-Free 引用了 Measuring Massive Multitask Language Understanding
- Neural Attention Search 引用了 Efficient Streaming Language Models with Attention Sinks
- Neural Attention Search 引用了 MoBA: Mixture of Block Attention for Long-Context LLMs
引用它的顶会 Paper143
- Neural Attention SearchDifan Deng, Marius LindauerNeurIPS 2025 · 431 次引用
- Gated Attention for Large Language Models: Non-linearity, Sparsity, and Attention-Sink-FreeZihan Qiu, Zekun Wang, Bo Zheng, Zeyu Huang 等NeurIPS 2025 · 336 次引用
- MemAgent: Reshaping Long-Context LLM with Multi-Conv RL-based Memory AgentHongli Yu, Tinghong Chen, Jiangtao Feng, Jiangjie Chen 等ICLR 2026 · 231 次引用
- MoBA: Mixture of Block Attention for Long-Context LLMsEnzhe Lu, Zhejun Jiang, Jingyuan Liu, Yulun Du 等NeurIPS 2025 · 219 次引用
- Direct3D-S2: Gigascale 3D Generation Made Easy with Spatial Sparse AttentionShuang Wu, Youtian Lin, Feihu Zhang, Yifei Zeng 等NeurIPS 2025 · 114 次引用
它引用的 Paper25
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma 等NeurIPS 2022 · 22,562 次引用
- Measuring Massive Multitask Language UnderstandingDan Hendrycks, Collin Burns, Steven Basart, Andy Zou 等ICLR 2021 · 7,905 次引用
- Big Bird: Transformers for Longer SequencesManzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie 等NeurIPS 2020 · 3,159 次引用
- Generative Agents: Interactive Simulacra of Human BehaviorJoon Sung Park, Joseph C. O'Brien, Carrie Jun Cai, Meredith Ringel Morris 等UIST 2023 · 1,882 次引用
- Efficient Streaming Language Models with Attention SinksGuangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han 等ICLR 2024 · 1,714 次引用
相关 Paper
- FSA: An Alternative Efficient Implementation of Native Sparse Attention KernelRan Yan, Youhe Jiang, Zhuoming Chen, Haohui Mai 等ICLR 2026 · 10 次引用
- Optimizing Native Sparse Attention with Latent Attention and Local Global Alternating StrategiesYuxuan Hu, Jianchao Tan, Jiaqi Zhang, Wen Zan 等ACL Findings 2026
- Token Sparse Attention: Efficient Long-Context Inference with Interleaved Token SelectionDongwon Jo, Beomseok Kang, Jiwon Song, jae-joon kimICML 2026 · 1 次引用
- A Unified Sparse Attention via Multi-Granularity CompressionSiran Liu, Zheng Cao, Yongchao HeICML 2026
- DAM: Dynamic Attention Mask for Long-Context Large Language Model Inference AccelerationHanzhi Zhang, Heng Fan, Kewei Sha, Yan Huang 等ACL Findings 2025 · 1 次引用
