NSA是一种硬件对齐且原生可训练的稀疏注意力机制,专为超快速长上下文训练与推理设计。其核心采用动态分层稀疏策略,结合粗粒度token压缩与细粒度token选择。通过针对现代硬件的优化,NSA在加速推理、降低预训练成本的同时不损失性能,在通用基准、长上下文任务及指令推理中匹配或超越Full Attention模型。
DeepSeek 推出硬件对齐稀疏注意力 NSA,长上下文训练推理双提速,预训练成本显著降低
🚀 Introducing NSA: A Hardware-Aligned and Natively Trainable Sparse Attention mechanism for ultra-fast long-context training & inference!
Core components of NSA:
• Dynamic hierarchical sparse strategy
• Coarse-grained token compression
• Fine-grained token selection
💡 With optimized design for modern hardware, NSA speeds up inference while reducing pre-training costs—without compromising performance. It matches or outperforms Full Attention models on general benchmarks, long-context tasks, and instruction-based reasoning.
📖 For more details, check out our paper here: https://arxiv.org/abs/2502.11089
来源:DeepSeek · x.com