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
Abstract
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.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
143 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Efficient Streaming Language Models with Attention Sinks cites Big Bird: Transformers for Longer Sequences
- MemAgent: Reshaping Long-Context LLM with Multi-Conv RL-based Memory Agent cites Efficient Streaming Language Models with Attention Sinks
- MemAgent: Reshaping Long-Context LLM with Multi-Conv RL-based Memory Agent cites MoBA: Mixture of Block Attention for Long-Context LLMs
- MoBA: Mixture of Block Attention for Long-Context LLMs cites Efficient Streaming Language Models with Attention Sinks
- MoBA: Mixture of Block Attention for Long-Context LLMs cites Big Bird: Transformers for Longer Sequences
- Generative Agents: Interactive Simulacra of Human Behavior cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Gated Attention for Large Language Models: Non-linearity, Sparsity, and Attention-Sink-Free cites Efficient Streaming Language Models with Attention Sinks
- Gated Attention for Large Language Models: Non-linearity, Sparsity, and Attention-Sink-Free cites Measuring Massive Multitask Language Understanding
- Neural Attention Search cites Efficient Streaming Language Models with Attention Sinks
- Neural Attention Search cites MoBA: Mixture of Block Attention for Long-Context LLMs
Cited by top-tier papers143
- Neural Attention SearchDifan Deng, Marius LindauerNeurIPS 2025 · 431 citations
- Gated Attention for Large Language Models: Non-linearity, Sparsity, and Attention-Sink-FreeZihan Qiu, Zekun Wang, Bo Zheng, Zeyu Huang et al.NeurIPS 2025 · 336 citations
- MemAgent: Reshaping Long-Context LLM with Multi-Conv RL-based Memory AgentHongli Yu, Tinghong Chen, Jiangtao Feng, Jiangjie Chen et al.ICLR 2026 · 231 citations
- MoBA: Mixture of Block Attention for Long-Context LLMsEnzhe Lu, Zhejun Jiang, Jingyuan Liu, Yulun Du et al.NeurIPS 2025 · 219 citations
- Direct3D-S2: Gigascale 3D Generation Made Easy with Spatial Sparse AttentionShuang Wu, Youtian Lin, Feihu Zhang, Yifei Zeng et al.NeurIPS 2025 · 114 citations
Builds on25
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.NeurIPS 2022 · 22,562 citations
- Measuring Massive Multitask Language UnderstandingDan Hendrycks, Collin Burns, Steven Basart, Andy Zou et al.ICLR 2021 · 7,905 citations
- Big Bird: Transformers for Longer SequencesManzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie et al.NeurIPS 2020 · 3,159 citations
- Generative Agents: Interactive Simulacra of Human BehaviorJoon Sung Park, Joseph C. O'Brien, Carrie Jun Cai, Meredith Ringel Morris et al.UIST 2023 · 1,882 citations
- Efficient Streaming Language Models with Attention SinksGuangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han et al.ICLR 2024 · 1,714 citations
Related papers
- FSA: An Alternative Efficient Implementation of Native Sparse Attention KernelRan Yan, Youhe Jiang, Zhuoming Chen, Haohui Mai et al.ICLR 2026 · 10 citations
- Optimizing Native Sparse Attention with Latent Attention and Local Global Alternating StrategiesYuxuan Hu, Jianchao Tan, Jiaqi Zhang, Wen Zan et al.ACL Findings 2026
- Token Sparse Attention: Efficient Long-Context Inference with Interleaved Token SelectionDongwon Jo, Beomseok Kang, Jiwon Song, jae-joon kimICML 2026 · 1 citation
- 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 et al.ACL Findings 2025 · 1 citation
