SSA: Sparse Sparse Attention by Aligning Full and Sparse Attention Outputs in Feature Space
这篇论文提出了SSA(Sparse Sparse Attention),一种通过在特征空间中对齐全注意力和稀疏注意力的输出,以提高稀疏注意力模型性能的统一训练框架。
更新于 2025-12-03。作者:Zhenyi Shen、Junru Lu、Lin Gui、Jiazheng Li、Yulan He、Di Yin、Xing Sun。
中文摘要
二次复杂度限制了大型语言模型(LLMs)中全注意力机制的高效长上下文处理。稀疏注意力通过限制每个查询只关注先前标记的子集来减轻这种成本;然而,无训练方法往往会导致性能严重下降。原生稀疏注意力方法(例如,NSA、MoBA)缓解了这个问题,但存在一个关键的悖论:尽管旨在近似全注意力,但它们产生的注意力稀疏度低于全注意力模型,这可能会限制其有效性。我们将这种悖论归因于梯度更新不足:在稀疏训练期间被排除的低排名键值对既没有前向贡献也没有反向梯度,因此从未学会适当的抑制。为了克服这一限制,我们提出了SSA(稀疏稀疏注意力),这是一个统一的训练框架,它同时考虑了稀疏和全注意力,并在每一层强制执行双向对齐。这种设计保留了所有标记的梯度流动,同时明确鼓励稀疏注意力输出与其全注意力对应项对齐,从而促进更强的稀疏性。因此,SSA在多个常识基准测试中,在稀疏和全注意力推理方面都实现了最先进的性能。此外,SSA使模型能够平滑地适应不同的稀疏性预算;随着允许更多标记进行注意力,性能持续提高,支持推理时间点的灵活计算性能权衡。最后,我们表明,原生稀疏注意力训练通过减轻汇流区域注意力值的过度分配,意外地改善了长上下文外推,而SSA展示了最强的外推能力。
英文摘要
The quadratic complexity of full attention limits efficient long-context processing in large language models (LLMs). Sparse attention mitigates this cost by restricting each query to attend to a subset of previous tokens; however, training-free approaches often lead to severe performance degradation. Native sparse-attention methods (e.g., NSA, MoBA) alleviate this issue, yet exhibit a critical paradox: they produce lower attention sparsity than full-attention models, despite aiming to approximate full attention, which may constrain their effectiveness. We attribute this paradox to gradient update deficiency: low-ranked key-value pairs excluded during sparse training receive neither forward contribution nor backward gradients, and thus never learn proper suppression. To overcome this limitation, we propose SSA (Sparse Sparse Attention), a unified training framework that considers both sparse and full attention and enforces bidirectional alignment at every layer. This design preserves gradient flow to all tokens while explicitly encouraging sparse-attention outputs to align with their full-attention counterparts, thereby promoting stronger sparsity. As a result, SSA achieves state-of-the-art performance under both sparse and full attention inference across multiple commonsense benchmarks. Furthermore, SSA enables models to adapt smoothly to varying sparsity budgets; performance improves consistently as more tokens are allowed to attend, supporting flexible compute-performance trade-offs at inference time. Finally, we show that native sparse-attention training surprisingly improves long-context extrapolation by mitigating the over-allocation of attention values in sink areas, with SSA demonstrating the strongest extrapolation capability.
解读
一句话总结
这篇论文提出了SSA(Sparse Sparse Attention),一种通过在特征空间中对齐全注意力和稀疏注意力的输出,以提高稀疏注意力模型性能的统一训练框架。
问题1:这篇论文想要解决什么具体问题?
- 问题背景:大型语言模型(LLMs)在处理长上下文时,全注意力机制的二次复杂度限制了其效率。
- 现有方案不足:无监督的稀疏注意力方法虽然降低了计算成本,但往往会导致性能下降;本地的稀疏注意力方法虽然性能较好,但注意力稀疏度低于全注意力模型。
- 研究目标:提出SSA,通过联合训练稀疏和全注意力,并在每个层强制双向对齐,以增强稀疏注意力的性能。
问题2:论文的核心创新点是什么?
- 技术创新:提出SSA,一种联合训练框架,考虑稀疏和全注意力,并在每个层强制双向对齐。
- 方法改进:通过注意力输出对齐实现显式的稀疏度正则化。
- 优势:与全注意力和稀疏注意力模型相比,SSA在稀疏和全注意力推理中均达到最先进的性能。
问题3:实验结果如何验证了方法的有效性?
- 关键实验:在多个常识基准测试中评估SSA的性能。
- 性能提升:SSA在稀疏和全注意力推理中均达到最先进的性能。
- 对比结果:SSA在多个基准测试中优于基线方法。
问题4:这个研究的实际应用价值是什么?
- 应用场景:适用于需要高效长上下文处理的各种场景,如长文档理解、扩展推理轨迹和深入研究工作流程。
- 实施建议:在训练过程中联合使用稀疏和全注意力,并在每个层强制双向对齐。
- 局限与展望:SSA在长上下文推理中表现出色,但未来可以探索更复杂的模型结构和训练策略,以进一步提高性能。
来源
机器可读索引:llms.txt