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

Sigmoid 自注意力比 Softmax 自注意力具有更低的样本复杂度:一种混合专家视角

Sigmoid Self-Attention has Lower Sample Complexity than Softmax Self-Attention: A Mixture-of-Experts Perspective

The University of Texas at Austin(德克萨斯大学奥斯汀分校)

Fanqi Yan, Huy Nguyen, Pedram Akbarian, Nhat Ho, Alessandro Rinaldo

AI总结:

本文从混合专家视角理论证明,sigmoid 自注意力比 softmax 自注意力具有更低的样本复杂度,即达到相同近似误差所需数据更少,从而更高效。

摘要:

在流行的 Transformer 架构的核心是自注意力机制,该机制动态地为每个输入令牌分配 softmax 权重,以便模型能够聚焦于最显著的信息。然而,softmax 结构由于其逐行的特性而减慢了注意力计算的速度,并且它固有地引入了令牌之间的竞争:随着分配给一个令牌的权重增加,其他令牌的权重会减少。这种竞争动态可能会将自注意力的焦点缩小到有限的一组特征,从而可能忽略其他有信息量的特征。最近的实验研究表明,使用逐元素的 sigmoid 函数有助于消除令牌竞争并减少计算开销。尽管这些实证结果很有前景,但文献中仍然缺乏对 sigmoid 和 softmax 自注意力机制之间的严格比较。本文通过理论证明 sigmoid 自注意力比其 softmax 对应物更具样本效率,从而填补了这一空白。为此,我们将自注意力矩阵表示为专家的混合,并表明 sigmoid 自注意力中的“专家”需要显著更少的数据来达到与 softmax 自注意力中专家相同的近似误差。

英文摘要:

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.

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

↑