arXiv:2601.15305cs.AI2026-01被引 1

提出GSA模型,让长文本模型既快又稳,训练更可靠。

Gated Sparse Attention: Combining Computational Efficiency with Training Stability for Long-Context Language Models

  • 用门控机制选关键词,动态控制注意力范围
  • 128K上下文下速度提升12-16倍,困惑度降至5.70
  • 适合追求高效稳定的长文本生成任务

长上下文语言模型的注意力计算负担催生了两类独立研究:稀疏注意力通过只关注部分词元降低复杂度,门控注意力则提升训练稳定性并缓解注意力塌陷。本文发现二者互补,提出门控稀疏注意力(Gated Sparse Attention, GSA),融合两者优势。GSA采用带Sigmoid激活的门控索引器,生成有界可解释的选择分数;引入基于局部不确定性的自适应稀疏控制器,动态调节关注词元数量;在值和输出阶段均设双门控。理论分析包括复杂度、表达能力及收敛性证明。在17亿参数模型上用4000亿词训练,GSA在128K上下文实现12-16倍加速,困惑度从6.03降至5.70,RULER得分接近翻倍,首词注意力从47%降至不足4%,训练损失峰值减少98%。

原文摘要 · Abstract (English)

The computational burden of attention in long-context language models has motivated two largely independent lines of work: sparse attention mechanisms that reduce complexity by attending to selected tokens, and gated attention variants that improve training sta-bility while mitigating the attention sink phenomenon. We observe that these approaches address complementary weaknesses and propose Gated Sparse Attention (GSA), an architecture that realizes the benefits of both. GSA incorporates a gated lightning indexer with sigmoid activations that produce bounded, interpretable selection scores, an adaptive sparsity controller that modulates the number of attended tokens based on local uncertainty, and dual gating at the value and output stages. We establish theoretical foundations for the approach, including complexity analysis, expressiveness results, and convergence guarantees. In experiments with 1.7B parameter models trained on 400B tokens, GSA matches the efficiency of sparse-only baselines (12-16x speedup at 128K context) while achieving the quality gains associated with gated attention: perplexity improves from 6.03 to 5.70, RULER scores at 128K context nearly double, and attention to the first token, a proxy for attention sinks, drops from 47% to under 4%. Training stability improves markedly, with loss spikes reduced by 98%.

注意力机制长文本建模训练稳定稀疏计算

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。