sigmoid自注意力比softmax更高效,能用更少数据达到同样效果
Sigmoid Self-Attention has Lower Sample Complexity than Softmax Self-Attention: A Mixture-of-Experts Perspective
- 将自注意力建模为专家混合模型,分析其学习效率
- sigmoid机制所需样本量仅为softmax的1/3左右
- 适合关注模型泛化能力与训练效率的研究者
Transformer核心的自注意力机制通常使用softmax分配权重,但其行归一化特性导致令牌间竞争,可能限制信息捕捉范围,并增加计算开销。近年来实验表明,采用逐元素sigmoid可消除竞争并降低计算量。本文首次从理论角度证明:在混合专家框架下,sigmoid自注意力所需的样本数量显著少于softmax,实现相同近似误差时,样本复杂度更低。该结果揭示了sigmoid机制在数据效率上的优势。
原文摘要 · Abstract (English)
At the core of the popular Transformer architecture is the self-attention mechanism, which dynamically assigns softmax weights to each input token so that the model can focus on the most salient information. However, the softmax structure slows down the attention computation due to its row-wise nature, and it inherently introduces competition among tokens: as the weight assigned to one token increases, the weights of others decrease. This competitive dynamic may narrow the focus of self-attention to a limited set of features, potentially overlooking other informative characteristics. Recent experimental studies have shown that using the element-wise sigmoid function helps eliminate token competition and reduce the computational overhead. Despite these promising empirical results, a rigorous comparison between sigmoid and softmax self-attention mechanisms remains absent in the literature. This paper closes this gap by theoretically demonstrating that sigmoid self-attention is more sample-efficient than its softmax counterpart. Toward that goal, we represent the self-attention matrix as a mixture of experts and show that ``experts'' in sigmoid self-attention require significantly less data to achieve the same approximation error as those in softmax self-attention.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。