mlsanityData to 7 Oct 2026

Escaping the Gradient Vanishing: Periodic Alternatives of Softmax in Attention Mechanism

arXiv 2108.07153 ↗First posted 16 Aug 2021cs.CV cs.LGcited by 7

Not on the map. Why?

Abstract (arXiv)

Softmax is widely used in neural networks for multiclass classification, gate structure and attention mechanisms. The statistical assumption that the input is normal distributed supports the gradient stability of Softmax. However, when used in attention mechanisms such as transformers, since the correlation scores between embeddings are often not normally distributed, the gradient vanishing problem appears, and we prove this point through experimental confirmation. In this work, we suggest that replacing the exponential function by periodic functions, and we delve into some potential periodic alternatives of Softmax from the view of value and gradient. Through experiments on a simply designed demo referenced to LeViT, our method is proved to be able to alleviate the gradient problem and yield substantial improvements compared to Softmax and its variants. Further, we analyze the impact of pre-normalization for Softmax and our methods through mathematics and experiments. Lastly, we increase the depth of the demo and prove the applicability of our method in deep structures.

Key facts. Cited by 7 papers in the map (data through 7 Oct 2026). Builds on 19 of its 20 references that are in the map. First posted on arXiv 16 Aug 2021.

Builds on

19 of 20 references.

References · 19

  1. 2017Attention Is All You Needcited by 59,932
  2. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
  3. 2021Swin Transformer: Hierarchical Vision Transformer using Shifted Windowscited by 12,082
  4. 2015Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shiftcited by 6,979
  5. 2016Layer Normalizationcited by 5,579
  6. 2020Training data-efficient image transformers & distillation through attentioncited by 4,560
  7. 2020Implicit Neural Representations with Periodic Activation Functionscited by 2,214
  8. 2018Group Normalizationcited by 1,514
  9. 2017SphereFace: Deep Hypersphere Embedding for Face Recognitioncited by 733
  10. 2021LeViT: a Vision Transformer in ConvNet's Clothing for Faster Inferencecited by 475
  11. 2016Large-Margin Softmax Loss for Convolutional Neural Networkscited by 296
  12. 2021Escaping the Big Data Paradigm with Compact Transformerscited by 261
7 more
  1. 2017NormFace: L2 Hypersphere Embedding for Face Verificationcited by 237
  2. 2017L2-constrained Softmax Loss for Discriminative Face Verificationcited by 96
  3. 2018Ring loss: Convex Feature Normalization for Face Recognitioncited by 39
  4. 2015An Exploration of Softmax Alternatives Belonging to the Spherical Loss Familycited by 27
  5. 2020Exploring Alternatives to Softmax Functioncited by 16
  6. 2014Efficient Exact Gradient Update for training Deep Networks with Very Large Sparse Targetscited by 10
  7. 2018Ensemble Soft-Margin Softmax Loss for Image Classificationcited by 3

Built on by

Cited by year

Citing papers per year: 2022: 1; 2023: 1; 2024: 3; 2025: 2.

7 papers.