mlsanityData to 14 Oct 2026

A Study on ReLU and Softmax in Transformer

arXiv 2302.06461 ↗First posted 13 Feb 2023cs.CL cs.AI cs.LGcited by 53

Not on the map. Why?

Abstract (arXiv)

The Transformer architecture consists of self-attention and feed-forward networks (FFNs) which can be viewed as key-value memories according to previous works. However, FFN and traditional memory utilize different activation functions (i.e., ReLU and Softmax respectively), which makes them not equivalent. In this paper, we first rebuild the connections between FFN and key-value memory by conducting extensive studies on ReLU and Softmax, and find they are equivalent when adding an additional layer normalization module on Softmax. In addition, ReLU outperforms Softmax on both FFN and key-value memory when the number of value slots is large. We analyze the reasons and then explore this good property of ReLU on the self-attention network where the original Softmax activation performs poorly on long input sequences. We then propose a full ReLU architecture named ReLUFormer which performs better than the baseline Transformer on long sequence tasks such as document translation. This paper sheds light on the following points: 1) Softmax and ReLU use different normalization methods over elements which lead to different variances of results, and ReLU is good at dealing with a large number of key-value slots; 2) FFN and key-value memory are equivalent, and thus the Transformer can be viewed as a memory network where FFNs and self-attention networks are both key-value memories.

Key facts. Cited by 53 papers in the map (data through 14 Oct 2026). Builds on 24 of its 33 references that are in the map. First posted on arXiv 13 Feb 2023.

Builds on

24 of 33 references.

References · 24

  1. 2017Attention Is All You Needcited by 60,361
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  3. 2014Adam: A Method for Stochastic Optimizationcited by 37,240
  4. 2020Language Models are Few-Shot Learnerscited by 32,419
  5. 2016Layer Normalizationcited by 5,669
  6. 2015Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classificationcited by 3,611
  7. 2017Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layercited by 3,509
  8. 2021Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsitycited by 3,073
  9. 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,918
  10. 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,850
  11. 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,336
  12. 2019How Contextual are Contextualized Word Representations? Comparing the Geometry of BERT, ELMo, and GPT-2 Embeddingscited by 784
12 more
  1. 2021Knowledge Neurons in Pretrained Transformerscited by 601
  2. 2015Sequence Level Training with Recurrent Neural Networkscited by 576
  3. 2016From Softmax to Sparsemax: A Sparse Model of Attention and Multi-Label Classificationcited by 341
  4. 2019Sparse Sequence-to-Sequence Modelscited by 170
  5. 2016An Actor-Critic Algorithm for Sequence Predictioncited by 159
  6. 2019Large Memory Layers with Product Keyscited by 124
  7. 2018Achieving Human Parity on Automatic Chinese to English News Translationcited by 119
  8. 2019Augmenting Self-attention with Persistent Memorycited by 93
  9. 2019Selective Attention for Context-aware Neural Machine Translationcited by 60
  10. 2021Sparse Attention with Linear Unitscited by 41
  11. 2018Non-Autoregressive Neural Machine Translation with Enhanced Decoder Inputcited by 39
  12. 2022Kformer: Knowledge Injection in Transformer Feed-Forward Layerscited by 37

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2023: 11; 2024: 20; 2025: 15; 2026: 7.

53 papers.

Sort:

By area:

  1. 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 298
  2. 2023ReLU Strikes Back: Exploiting Activation Sparsity in Large Language Modelscited by 94
  3. 2023Transformers as Decision Makers: Provable In-Context Reinforcement Learning via Supervised Pretrainingcited by 83
  4. 2024Beyond the Limits: A Survey of Techniques to Extend the Context Length in Large Language Modelscited by 76
  5. 2023How Do Transformers Learn In-Context Beyond Simple Functions? A Case Study on Learning with Representationscited by 75
  6. 2023Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear Regressioncited by 49
  7. 2024ProSparse: Introducing and Enhancing Intrinsic Activation Sparsity within Large Language Modelscited by 45
  8. 2023Replacing softmax with ReLU in Vision Transformerscited by 44
  9. 2024Improving fine-grained understanding in image-text pre-trainingcited by 44
  10. 2023What can a Single Attention Layer Learn? A Study Through the Random Features Lenscited by 40
  11. 2024Frequency Decoupling for Motion Magnification via Multi-Level Isomorphic Architecturecited by 28
  12. 2023Approximating Two-Layer Feedforward Networks for Efficient Transformerscited by 27
38 more
  1. 2024On Provable Length and Compositional Generalizationcited by 22
  2. 2024HSR-Enhanced Sparse Attention Accelerationcited by 19
  3. 2024Ultra-Sparse Memory Networkcited by 19
  4. 2024Attention layers provably solve single-location regressioncited by 17
  5. 2023Eureka-Moments in Transformers: Multi-Step Tasks Reveal Softmax Induced Optimization Problemscited by 14
  6. 2024More Expressive Attention with Negative Weightscited by 9
  7. 2025ZETA: Leveraging Z-order Curves for Efficient Top-k Attentioncited by 9
  8. 2024Rethinking Attention: Polynomial Alternatives to Softmax in Transformerscited by 8
  9. 2024Unification of Symmetries Inside Neural Networks: Transformer, Feedforward and Neural ODEcited by 7
  10. 2024Learning Neural Networks with Sparse Activationscited by 6
  11. 2025Quantum Doubly Stochastic Transformerscited by 6
  12. 2024Mitigating Sycophancy in Decoder-Only Transformer Architectures: Synthetic Data Interventioncited by 5
  13. 2026Threshold Differential Attention for Sink-Free, Ultra-Sparse, and Non-Dispersive Language Modelingcited by 5
  14. 2026ZeroS: Zero-Sum Linear Attention for Efficient Transformerscited by 5
  15. 2024A Non-negative VAE:the Generalized Gamma Belief Networkcited by 4
  16. 2025PERK: Long-Context Reasoning as Test-Time Learningcited by 4
  17. 2025On Space Folds of ReLU Neural Networkscited by 3
  18. 2025Self-Adjust Softmaxcited by 3
  19. 2025Disentangling Feature Structure: A Mathematically Provable Two-Stage Training Dynamics in Transformerscited by 3
  20. 2025Transformers as Unsupervised Learning Algorithms: A study on Gaussian Mixturescited by 3
  21. 2025Unpacking Softmax: How Temperature Drives Representation Collapse, Compression, and Generalizationcited by 3
  22. 2026HyperMLP: An Integrated Perspective for Sequence Modelingcited by 3
  23. 2023Inhibitor Transformers and Gated RNNs for Torus Efficient Fully Homomorphic Encryptioncited by 2
  24. 2024Optimized Speculative Sampling for GPU Hardware Acceleratorscited by 2
  25. 2024Improving Image Clustering with Artifacts Attenuation via Inference-Time Attention Engineeringcited by 2
  26. 2026Gradient Flow Structure and Quantitative Dynamics of Multi-Head Self-Attentioncited by 2
  27. 2024FFNet: MetaMixer-based Efficient Convolutional Mixer Designcited by 1
  28. 2024In-context Learning for Mixture of Linear Regressions: Existence, Generalization and Training Dynamicscited by 1
  29. 2024USEFUSE: Uniform Stride for Enhanced Performance in Fused Layer Architecture of Deep Neural Networkscited by 1
  30. 2025Softplus Attention with Re-weighting Boosts Length Extrapolation in Large Language Modelscited by 1
  31. 2025Revisiting Transformers through the Lens of Low Entropy and Dynamic Sparsitycited by 1
  32. 2025Learning Explainable Imaging-Genetics Associations Related to a Neurological Disordercited by 1
  33. 2026Multi-Headed Transformer Architectures as Time-dependent Wasserstein Gradient Flowscited by 1
  34. 2026Attention Kernels for Learning Maps Between Heavy-Tailed Measurescited by 1
  35. 2023The Inhibitor: ReLU and Addition-Based Attention for Efficient Transformers under Fully Homomorphic Encryption on the Toruscited by 0
  36. 2024Sampling Foundational Transformer: A Theoretical Perspectivecited by 0
  37. 2025UltraSTF: Ultra-Compact Model for Large-Scale Spatio-Temporal Forecastingcited by 0
  38. 2025InhibiDistilbert: Knowledge Distillation for a ReLU and Addition-based Transformercited by 0

50 most cited of 53 All 53 (JSON)