Sigmoid Transformer
- Sigmoid Transformer is a self-attention variant that replaces softmax with an element-wise sigmoid function, eliminating the sum-to-one constraint.
- It uses precise scaling and bias adjustments to maintain stability and improve sample complexity during training.
- Empirical results show that sigmoid attention delivers enhanced performance, faster convergence, and higher throughput in language, vision, graph, and biological tasks.
The Sigmoid Transformer refers to a class of Transformer architectures in which the canonical row-wise softmax operation within self-attention is replaced by an element-wise sigmoid function or related sigmoid-based gating. This architectural deviation eliminates the sum-to-one normalization constraint of softmax, fundamentally altering the dynamics of attention, gradient propagation, and representation learning. Contemporary research demonstrates that this modification, properly normalized, provides advantageous regularity properties, improved sample complexity, and practical performance gains across language, vision, graph, and biological domains (Ramapuram et al., 2024, Sadashivaiah et al., 29 Apr 2026, Yan et al., 1 Feb 2025, Guo et al., 19 Apr 2026).
1. Mathematical Formulation of Sigmoid Attention
Let be a sequence of token embeddings. Standard softmax-based self-attention forms queries, keys, and values as , , and produces, for each token :
where .
In the Sigmoid Transformer, the attention mechanism replaces the row-wise softmax with an element-wise sigmoid, resulting in: where , and 0. Proper scaling is essential: the only exponent 1 that prevents vanishing or exploding outputs as 2 is 3 (Ramapuram et al., 2024). Thus, the canonical form is: 4 Other implementation variants add a bias 5 to the pre-sigmoid logits, yielding similar mean scales as the softmax (Sadashivaiah et al., 29 Apr 2026, Yan et al., 1 Feb 2025).
2. Theoretical Properties and Scaling Laws
Sigmoid attention exhibits distinct theoretical properties relative to softmax:
Bounded Derivatives and Jacobian Structure: The derivative of 6 is globally bounded by 0.25. Consequently, the Jacobian of the sigmoid attention nonlinearity is diagonal with all entries in 7. In contrast, the softmax Jacobian is dense and its operator norm can grow exponentially with the input scale, leading to potential gradient instabilities.
Scaling with Sequence Length: The necessity of 8 normalization in sigmoid attention arises from two arguments (Ramapuram et al., 2024):
- Mean-convergence: 9 converges to a finite expectation as 0; any other scaling leads to vanishing or divergent outputs.
- Sequence-doubling invariance: Duplicating every token should not change the attention output; this property uniquely fixes the scaling exponent at 1.
Statistical Sample Complexity: The mixture-of-experts formalism demonstrates that sigmoid attention enjoys polynomial sample complexity for function classes where softmax gating requires exponential data—particularly for polynomial expert networks in the dense regime (Yan et al., 1 Feb 2025). For instance, achieving 2 error 3 with polynomial experts requires 4 samples for sigmoid gating versus 5 for softmax.
3. Empirical Results and Training Stability
Empirical evaluations corroborate the theoretical findings across several domains.
Single-Cell Foundation Models: On six held-out single-cell RNA-seq datasets, sigmoid attention achieves approximately 6 higher cell-type separation (Maximum Mean Discrepancy), dominates on cohesion metrics (Leiden NMI, ARI), and yields systematically lower validation loss. Training is up to 7 faster, with large-scale models (160M–1.4B parameters) demonstrating enhanced convergence and robustness (no catastrophic divergence observed in contrast to softmax attention) (Sadashivaiah et al., 29 Apr 2026).
Gradient Stability: Stress tests (training at 8K token context, no gradient clipping) show that softmax attention models experience catastrophic divergence (gradient norms increase by 8, attention logits reach 9), while sigmoid attention maintains stable gradients (range 0–1) and bounded attention scores (≤ 5).
Computational Efficiency: Sigmoid attention obviates the need for row-wise normalization, enabling fully parallel element-wise operations. Throughput gains of 2–3 on GPUs have been observed compared to softmax-based attention (Yan et al., 1 Feb 2025, Sadashivaiah et al., 29 Apr 2026).
4. Applications: Biological, Graph, and LLMs
Biological Foundation Models: The adoption of sigmoid attention in biological foundation models has enabled stable training on large, variable-length sequences (e.g., single-cell transcriptomics), with kernel implementations (TritonSigmoid) achieving 4 TFLOPS on H100 GPUs and demonstrating superior speed and padding support over FlashAttention-2 (Sadashivaiah et al., 29 Apr 2026).
Graph Transformers and Over-Smoothing: In graph domains, sigmoid-gated attention (SigGate-GT) breaks the sum-to-one constraint of softmax, addressing over-smoothing and attention entropy degeneration. Element-wise learned gating with sigmoid allows each attention head to selectively silence uninformative connections, raising the effective rank of outputs and maintaining higher embedding diversity. On molecular benchmarks (ZINC, ogbg-molhiv), SigGate-GT achieves state-of-the-art results, with 30% reduction in over-smoothing and robust training across a 5 learning rate range (Guo et al., 19 Apr 2026).
Natural Language and General Sequence Modeling: Sigmoid attention matches or outperforms softmax attention across varied NLP tasks, achieving sample-efficiency gains and removing token competition bias. Synthetic and real-world tasks (ARC, HellaSwag, etc.) confirm competitive or improved generalization with faster computation (Yan et al., 1 Feb 2025).
5. Implementation Practices and Hardware Considerations
GPU Kernels: The TritonSigmoid kernel leverages block-sparse execution and fused sigmoid calculations for efficiency. It natively supports arbitrary padding patterns essential for variable-length inputs, delivering 7.156 forward speedup over PyTorch baselines and maintaining performance when up to 25% of the sequence is padded (Sadashivaiah et al., 29 Apr 2026). Compared to FlashAttention-2, TritonSigmoid achieves 10–20% higher throughput, with negligible overhead from padding due to block skipping.
Transformer Block Integration: Replacing softmax attention in existing Transformer blocks involves substituting the normalization with element-wise sigmoid, introducing a bias term 7 to center the mean scale, and maintaining standard query/key scaling by 8. Standard initialization (e.g., Xavier uniform) and learning rate schedules remain effective. Owing to the bounded derivative of sigmoid, higher learning rates or omitting gradient clipping are often tolerable.
3 This direct code adaptation supports efficient, numerically stable sigmoid attention in production settings (Sadashivaiah et al., 29 Apr 2026).
6. Sigmoid Gating Variants in Transformer Architectures
Beyond direct softmax-to-sigmoid substitution, sigmoid gating has been incorporated into attention as an auxiliary mechanism, particularly in graph domains (Guo et al., 19 Apr 2026). In SigGate-GT, for each attention head 9, a learned gate 0 is computed per token, and the traditional softmax attention output 1 is post-multiplied element-wise by 2. This gating enables heads to “say nothing” when no informative connections are present, breaking mandatory attention sinks and improving representational diversity, entropy, and depth stability. Ablation studies confirm that post-attention per-head gating is most effective, with only a 1% parameter overhead.
7. Modeling Implications, Limitations, and Open Questions
Sigmoid-based attention mechanisms fundamentally alter self-attention’s inductive bias by removing inter-token competition and enabling independent contribution scaling. This allows for higher sample efficiency, stability (via bounded derivatives and decoupled gradients), and improved representational richness (especially in molecular and graph domains). Computationally, element-wise sigmoid is more amenable to parallelism and less memory-bound than softmax.
Known limitations include the current theoretical bounds focusing primarily on single-head attention (the fully general multi-head MoE setting remains open) and the dependency of empirical results on correct scaling and bias calibration (Ramapuram et al., 2024, Yan et al., 1 Feb 2025). Open research directions include hybrid gating schemes, further multi-head theoretical analysis, and domain-specific optimizations.
Key references:
- (Ramapuram et al., 2024)
- (Sadashivaiah et al., 29 Apr 2026)
- (Yan et al., 1 Feb 2025)
- (Guo et al., 19 Apr 2026)