arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2601.15305cs.AI
收藏

门控稀疏注意力:结合计算效率与训练稳定性以长上下文语言模型

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

Amazon(亚马逊)

Alfred Shen, Aaron Shen

AI总结:

GSA通过结合门控和稀疏注意力机制,在提升长上下文语言模型计算效率的同时,显著增强了训练稳定性与模型质量。

摘要:

长上下文语言模型中的注意力计算负担推动了两个大体独立的研究方向:稀疏注意力机制通过仅关注选定的标记来降低复杂度,以及门控注意力变体通过提高训练稳定性并缓解注意力沉没现象。我们发现这些方法解决了互补的弱点,并提出门控稀疏注意力(GSA),一种实现两者优势的架构。GSA结合了具有Sigmoid激活的门控闪电索引器,产生有界且可解释的选择分数,一个自适应稀疏控制器,根据局部不确定性调节所关注的标记数量,并在值和输出阶段进行双门控。我们为该方法建立了理论基础,包括复杂度分析、表达性结果和收敛保证。在训练了4000亿个标记的170亿参数模型实验中,GSA在128K上下文情况下与仅稀疏的基线相比效率相当(12-16倍加速),同时实现了门控注意力相关的质量提升:困惑度从6.03降至5.70,128K上下文的RULER分数几乎翻倍,对第一个标记的关注度,即注意力沉没的代理,从47%降至不足4%。训练稳定性显著提高,损失峰值减少了98%。

英文摘要:

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%.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑