arXiv:2506.14095cs.LG2025-06NeurIPS

输入相关稀疏注意力让Transformer学得更快更准

Transformers Learn Faster with Semantic Focus

论文配图:Transformers Learn Faster with Semantic Focus
图 1 · 摘自论文原文
  • 用输入相关的稀疏注意力聚焦语义,提升学习效率
  • 实验显示收敛速度和泛化能力均优于标准注意力
  • 理论证明输入无关稀疏无优势,适合关注学习速度的研究者

为缓解Transformer中注意力机制的二次计算与内存开销,已有多种稀疏注意力形式被研究。本文不从效率视角出发,而是聚焦于可学习性与泛化能力。实证研究表明,输入相关的稀疏注意力模型收敛更快、泛化性能更好,而输入无关的稀疏注意力则无此优势——这一现象在不同架构与优化超参数下均稳定存在。这表明,通过输入依赖的稀疏注意力集中模型对当前输入的语义关注,能加速学习过程。我们建立理论框架解释该行为:关联标准softmax稳定性与损失函数的Lipschitz性质,揭示稀疏性如何影响softmax稳定性,进而影响注意力机制的收敛与泛化保证。理论证明输入无关稀疏注意力无法带来收益;同时刻画了输入相关稀疏注意力能提升性能的条件,并验证这些条件在实际实验中成立。

原文摘要 · Abstract (English)

Various forms of sparse attention have been explored to mitigate the quadratic computational and memory cost of the attention mechanism in transformers. We study sparse transformers not through a lens of efficiency but rather in terms of learnability and generalization. Empirically studying a range of attention mechanisms, we find that input-dependent sparse attention models appear to converge faster and generalize better than standard attention models, while input-agnostic sparse attention models show no such benefits -- a phenomenon that is robust across architectural and optimization hyperparameter choices. This can be interpreted as demonstrating that concentrating a model's "semantic focus" with respect to the tokens currently being considered (in the form of input-dependent sparse attention) accelerates learning. We develop a theoretical characterization of the conditions that explain this behavior. We establish a connection between the stability of the standard softmax and the loss function's Lipschitz properties, then show how sparsity affects the stability of the softmax and the subsequent convergence and generalization guarantees resulting from the attention mechanism. This allows us to theoretically establish that input-agnostic sparse attention does not provide any benefits. We also characterize conditions when semantic focus (input-dependent sparse attention) can provide improved guarantees, and we validate that these conditions are in fact met in our empirical evaluations.

Transformer注意力机制学习速度稀疏性

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