Table of Contents
Fetching ...

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

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

TL;DR

This work analyzes sigmoid versus softmax self-attention through a Mixture-of-Experts lens, proving that sigmoid self-attention can be more sample-efficient than softmax in the prevalent dense gating regime while remaining comparable in the sparse regime. By representing each attention row as an MoE with quadratic affinity scores, the authors derive convergence and identifiability-based rates for both strongly identifiable and weakly identifiable experts, and for fully and partially quadratic score functions. Theoretical results show that, under dense gating, sigmoid self-attention achieves faster parameter and function-convergence rates (often near $O_P(\sqrt{\log n / n})$) than softmax, especially for polynomial or weakly identifiable experts, with empirical simulations corroborating these gains. The findings highlight practical implications for Transformer design, suggesting sigmoid-based attention can reduce data requirements and computation in realistic, dense-configured models, and point to future work incorporating multi-head attention within a hierarchical MoE framework.

Abstract

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.

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

TL;DR

This work analyzes sigmoid versus softmax self-attention through a Mixture-of-Experts lens, proving that sigmoid self-attention can be more sample-efficient than softmax in the prevalent dense gating regime while remaining comparable in the sparse regime. By representing each attention row as an MoE with quadratic affinity scores, the authors derive convergence and identifiability-based rates for both strongly identifiable and weakly identifiable experts, and for fully and partially quadratic score functions. Theoretical results show that, under dense gating, sigmoid self-attention achieves faster parameter and function-convergence rates (often near ) than softmax, especially for polynomial or weakly identifiable experts, with empirical simulations corroborating these gains. The findings highlight practical implications for Transformer design, suggesting sigmoid-based attention can reduce data requirements and computation in realistic, dense-configured models, and point to future work incorporating multi-head attention within a hierarchical MoE framework.

Abstract

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.

Paper Structure

This paper contains 28 sections, 14 theorems, 198 equations, 2 figures, 1 table.

Key Result

Proposition 1

Under the sparse regime of the gating parameters,

Figures (2)

  • Figure 1: Log-log plots of the convergence rates of Voronoi losses for softmax and sigmoid quadratic gating MoE models. \ref{['fig:relu-experts']} Comparison between softmax quadratic gating and sigmoid quadratic gating MoE with ReLU experts. \ref{['fig:linear-experts']} Comparison between softmax quadratic gating and sigmoid quadratic gating with linear experts. Each plot illustrates the empirical Voronoi loss convergence rates, with solid lines representing the Voronoi losses and dash-dotted lines showing fitted trends.
  • Figure 2: Log-log plots of empirical convergence rates of Voronoi losses for softmax and sigmoid quadratic gating mechanisms. \ref{['fig:sparse-regime']} Comparison between sigmoid quadratic gating MoE with ReLU and linear experts under a sparse regime for ground-truth parameters. \ref{['fig:dense-regime']} Comparison between sigmoid quadratic gating with ReLU and linear experts under a dense regime for ground-truth parameters. Each plot illustrates the empirical Voronoi loss convergence rates, with solid lines representing the Voronoi losses and dash-dotted lines showing fitted trends to emphasize the empirical rates.

Theorems & Definitions (29)

  • Proposition 1
  • Corollary 1
  • Definition 1: Strong identifiability
  • Theorem 1
  • Theorem 2
  • Definition 2: Weak identifiability
  • Theorem 3
  • Lemma 1
  • proof
  • proof
  • ...and 19 more