A Study on ReLU and Softmax in Transformer
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
- 2017Attention Is All You Needcited by 60,361
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2014Adam: A Method for Stochastic Optimizationcited by 37,240
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2016Layer Normalizationcited by 5,669
- 2015Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classificationcited by 3,611
- 2017Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layercited by 3,509
- 2021Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsitycited by 3,073
- 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,918
- 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,850
- 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,336
- 2019How Contextual are Contextualized Word Representations? Comparing the Geometry of BERT, ELMo, and GPT-2 Embeddingscited by 784
12 more
- 2021Knowledge Neurons in Pretrained Transformerscited by 601
- 2015Sequence Level Training with Recurrent Neural Networkscited by 576
- 2016From Softmax to Sparsemax: A Sparse Model of Attention and Multi-Label Classificationcited by 341
- 2019Sparse Sequence-to-Sequence Modelscited by 170
- 2016An Actor-Critic Algorithm for Sequence Predictioncited by 159
- 2019Large Memory Layers with Product Keyscited by 124
- 2018Achieving Human Parity on Automatic Chinese to English News Translationcited by 119
- 2019Augmenting Self-attention with Persistent Memorycited by 93
- 2019Selective Attention for Context-aware Neural Machine Translationcited by 60
- 2021Sparse Attention with Linear Unitscited by 41
- 2018Non-Autoregressive Neural Machine Translation with Enhanced Decoder Inputcited by 39
- 2022Kformer: Knowledge Injection in Transformer Feed-Forward Layerscited by 37
Built on by
Citing papers per year: 2023: 11; 2024: 20; 2025: 15; 2026: 7.
53 papers.
Sort:
By area:
- 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 298
- 2023ReLU Strikes Back: Exploiting Activation Sparsity in Large Language Modelscited by 94
- 2023Transformers as Decision Makers: Provable In-Context Reinforcement Learning via Supervised Pretrainingcited by 83
- 2024Beyond the Limits: A Survey of Techniques to Extend the Context Length in Large Language Modelscited by 76
- 2023How Do Transformers Learn In-Context Beyond Simple Functions? A Case Study on Learning with Representationscited by 75
- 2023Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear Regressioncited by 49
- 2024ProSparse: Introducing and Enhancing Intrinsic Activation Sparsity within Large Language Modelscited by 45
- 2023Replacing softmax with ReLU in Vision Transformerscited by 44
- 2024Improving fine-grained understanding in image-text pre-trainingcited by 44
- 2023What can a Single Attention Layer Learn? A Study Through the Random Features Lenscited by 40
- 2024Frequency Decoupling for Motion Magnification via Multi-Level Isomorphic Architecturecited by 28
- 2023Approximating Two-Layer Feedforward Networks for Efficient Transformerscited by 27
38 more
- 2024On Provable Length and Compositional Generalizationcited by 22
- 2024HSR-Enhanced Sparse Attention Accelerationcited by 19
- 2024Ultra-Sparse Memory Networkcited by 19
- 2024Attention layers provably solve single-location regressioncited by 17
- 2023Eureka-Moments in Transformers: Multi-Step Tasks Reveal Softmax Induced Optimization Problemscited by 14
- 2024More Expressive Attention with Negative Weightscited by 9
- 2025ZETA: Leveraging Z-order Curves for Efficient Top-k Attentioncited by 9
- 2024Rethinking Attention: Polynomial Alternatives to Softmax in Transformerscited by 8
- 2024Unification of Symmetries Inside Neural Networks: Transformer, Feedforward and Neural ODEcited by 7
- 2024Learning Neural Networks with Sparse Activationscited by 6
- 2025Quantum Doubly Stochastic Transformerscited by 6
- 2024Mitigating Sycophancy in Decoder-Only Transformer Architectures: Synthetic Data Interventioncited by 5
- 2026Threshold Differential Attention for Sink-Free, Ultra-Sparse, and Non-Dispersive Language Modelingcited by 5
- 2026ZeroS: Zero-Sum Linear Attention for Efficient Transformerscited by 5
- 2024A Non-negative VAE:the Generalized Gamma Belief Networkcited by 4
- 2025PERK: Long-Context Reasoning as Test-Time Learningcited by 4
- 2025On Space Folds of ReLU Neural Networkscited by 3
- 2025Self-Adjust Softmaxcited by 3
- 2025Disentangling Feature Structure: A Mathematically Provable Two-Stage Training Dynamics in Transformerscited by 3
- 2025Transformers as Unsupervised Learning Algorithms: A study on Gaussian Mixturescited by 3
- 2025Unpacking Softmax: How Temperature Drives Representation Collapse, Compression, and Generalizationcited by 3
- 2026HyperMLP: An Integrated Perspective for Sequence Modelingcited by 3
- 2023Inhibitor Transformers and Gated RNNs for Torus Efficient Fully Homomorphic Encryptioncited by 2
- 2024Optimized Speculative Sampling for GPU Hardware Acceleratorscited by 2
- 2024Improving Image Clustering with Artifacts Attenuation via Inference-Time Attention Engineeringcited by 2
- 2026Gradient Flow Structure and Quantitative Dynamics of Multi-Head Self-Attentioncited by 2
- 2024FFNet: MetaMixer-based Efficient Convolutional Mixer Designcited by 1
- 2024In-context Learning for Mixture of Linear Regressions: Existence, Generalization and Training Dynamicscited by 1
- 2024USEFUSE: Uniform Stride for Enhanced Performance in Fused Layer Architecture of Deep Neural Networkscited by 1
- 2025Softplus Attention with Re-weighting Boosts Length Extrapolation in Large Language Modelscited by 1
- 2025Revisiting Transformers through the Lens of Low Entropy and Dynamic Sparsitycited by 1
- 2025Learning Explainable Imaging-Genetics Associations Related to a Neurological Disordercited by 1
- 2026Multi-Headed Transformer Architectures as Time-dependent Wasserstein Gradient Flowscited by 1
- 2026Attention Kernels for Learning Maps Between Heavy-Tailed Measurescited by 1
- 2023The Inhibitor: ReLU and Addition-Based Attention for Efficient Transformers under Fully Homomorphic Encryption on the Toruscited by 0
- 2024Sampling Foundational Transformer: A Theoretical Perspectivecited by 0
- 2025UltraSTF: Ultra-Compact Model for Large-Scale Spatio-Temporal Forecastingcited by 0
- 2025InhibiDistilbert: Knowledge Distillation for a ReLU and Addition-based Transformercited by 0
50 most cited of 53 All 53 (JSON)
- 2026Attention Kernels for Learning Maps Between Heavy-Tailed Measures30 Sep 2026
- 2026Pretraining Transformers with Quantized Softmax in Attention27 Sep 2026
- 2026Multi-Headed Transformer Architectures as Time-dependent Wasserstein Gradient Flows15 May 2026
- 2026Gradient Flow Structure and Quantitative Dynamics of Multi-Head Self-Attention5 May 2026
- 2026HyperMLP: An Integrated Perspective for Sequence Modeling13 Feb 2026
- 2026ZeroS: Zero-Sum Linear Attention for Efficient Transformers5 Feb 2026
- 2026Threshold Differential Attention for Sink-Free, Ultra-Sparse, and Non-Dispersive Language Modeling17 Jan 2026
- 2025Learning Explainable Imaging-Genetics Associations Related to a Neurological Disorder22 Aug 2025
- 2025PERK: Long-Context Reasoning as Test-Time Learning8 Jul 2025
- 2025Capacity Matters: a Proof-of-Concept for Transformer Memorization on Real-World Data17 Jun 2025
- 2025Unpacking Softmax: How Temperature Drives Representation Collapse, Compression, and Generalization2 Jun 2025
- 2025Dual Attention Residual U-Net for Accurate Brain Ultrasound Segmentation in IVH Detection23 May 2025
38 more
- 2025Transformers as Unsupervised Learning Algorithms: A study on Gaussian Mixtures17 May 2025
- 2025Revisiting Transformers through the Lens of Low Entropy and Dynamic Sparsity26 Apr 2025
- 2025Quantum Doubly Stochastic Transformers22 Apr 2025
- 2025InhibiDistilbert: Knowledge Distillation for a ReLU and Addition-based Transformer20 Mar 2025
- 2025Disentangling Feature Structure: A Mathematically Provable Two-Stage Training Dynamics in Transformers28 Feb 2025
- 2025UltraSTF: Ultra-Compact Model for Large-Scale Spatio-Temporal Forecasting28 Feb 2025
- 2025Self-Adjust Softmax25 Feb 2025
- 2025On Space Folds of ReLU Neural Networks14 Feb 2025
- 2025ZETA: Leveraging Z-order Curves for Efficient Top-k Attention24 Jan 2025
- 2025Softplus Attention with Re-weighting Boosts Length Extrapolation in Large Language Models23 Jan 2025
- 2024USEFUSE: Uniform Stride for Enhanced Performance in Fused Layer Architecture of Deep Neural Networks18 Dec 2024
- 2024Ultra-Sparse Memory Network19 Nov 2024
- 2024Mitigating Sycophancy in Decoder-Only Transformer Architectures: Synthetic Data Intervention15 Nov 2024
- 2024More Expressive Attention with Negative Weights11 Nov 2024
- 2024Rethinking Attention: Polynomial Alternatives to Softmax in Transformers24 Oct 2024
- 2024In-context Learning for Mixture of Linear Regressions: Existence, Generalization and Training Dynamics18 Oct 2024
- 2024HSR-Enhanced Sparse Attention Acceleration14 Oct 2024
- 2024Improving Image Clustering with Artifacts Attenuation via Inference-Time Attention Engineering7 Oct 2024
- 2024Attention layers provably solve single-location regression2 Oct 2024
- 2024Sampling Foundational Transformer: A Theoretical Perspective11 Aug 2024
- 2024A Non-negative VAE:the Generalized Gamma Belief Network6 Aug 2024
- 2024Learning Neural Networks with Sparse Activations26 Jun 2024
- 2024Optimized Speculative Sampling for GPU Hardware Accelerators16 Jun 2024
- 2024FFNet: MetaMixer-based Efficient Convolutional Mixer Design4 Jun 2024
- 2024Frequency Decoupling for Motion Magnification via Multi-Level Isomorphic Architecture12 Mar 2024
- 2024ProSparse: Introducing and Enhancing Intrinsic Activation Sparsity within Large Language Models21 Feb 2024
- 2024On Provable Length and Compositional Generalization7 Feb 2024
- 2024Unification of Symmetries Inside Neural Networks: Transformer, Feedforward and Neural ODE4 Feb 2024
- 2024Beyond the Limits: A Survey of Techniques to Extend the Context Length in Large Language Models3 Feb 2024
- 2024Improving fine-grained understanding in image-text pre-training18 Jan 2024
- 2023Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear Regression26 Oct 2023
- 2023Eureka-Moments in Transformers: Multi-Step Tasks Reveal Softmax Induced Optimization Problems19 Oct 2023
- 2023Approximating Two-Layer Feedforward Networks for Efficient Transformers16 Oct 2023
- 2023How Do Transformers Learn In-Context Beyond Simple Functions? A Case Study on Learning with Representations16 Oct 2023
- 2023Transformers as Decision Makers: Provable In-Context Reinforcement Learning via Supervised Pretraining12 Oct 2023
- 2023ReLU Strikes Back: Exploiting Activation Sparsity in Large Language Models6 Oct 2023
- 2023The Inhibitor: ReLU and Addition-Based Attention for Efficient Transformers under Fully Homomorphic Encryption on the Torus3 Oct 2023
- 2023Replacing softmax with ReLU in Vision Transformers15 Sep 2023
50 newest of 53 All 53 (JSON)
- 2024Ultra-Sparse Memory Networkcited by 19
- 2024Ultra-Sparse Memory Network19 Nov 2024
- 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 298
- 2023ReLU Strikes Back: Exploiting Activation Sparsity in Large Language Modelscited by 94
- 2023How Do Transformers Learn In-Context Beyond Simple Functions? A Case Study on Learning with Representationscited by 75
- 2023Replacing softmax with ReLU in Vision Transformerscited by 44
- 2024Improving fine-grained understanding in image-text pre-trainingcited by 44
- 2023What can a Single Attention Layer Learn? A Study Through the Random Features Lenscited by 40
- 2024Frequency Decoupling for Motion Magnification via Multi-Level Isomorphic Architecturecited by 28
- 2023Approximating Two-Layer Feedforward Networks for Efficient Transformerscited by 27
- 2024On Provable Length and Compositional Generalizationcited by 22
- 2024HSR-Enhanced Sparse Attention Accelerationcited by 19
- 2024Attention layers provably solve single-location regressioncited by 17
- 2023Eureka-Moments in Transformers: Multi-Step Tasks Reveal Softmax Induced Optimization Problemscited by 14
12 most cited of 44 All 44 (JSON)
- 2026Attention Kernels for Learning Maps Between Heavy-Tailed Measures30 Sep 2026
- 2026Pretraining Transformers with Quantized Softmax in Attention27 Sep 2026
- 2026Multi-Headed Transformer Architectures as Time-dependent Wasserstein Gradient Flows15 May 2026
- 2026Gradient Flow Structure and Quantitative Dynamics of Multi-Head Self-Attention5 May 2026
- 2026HyperMLP: An Integrated Perspective for Sequence Modeling13 Feb 2026
- 2026ZeroS: Zero-Sum Linear Attention for Efficient Transformers5 Feb 2026
- 2026Threshold Differential Attention for Sink-Free, Ultra-Sparse, and Non-Dispersive Language Modeling17 Jan 2026
- 2025Learning Explainable Imaging-Genetics Associations Related to a Neurological Disorder22 Aug 2025
- 2025Capacity Matters: a Proof-of-Concept for Transformer Memorization on Real-World Data17 Jun 2025
- 2025Unpacking Softmax: How Temperature Drives Representation Collapse, Compression, and Generalization2 Jun 2025
- 2025Dual Attention Residual U-Net for Accurate Brain Ultrasound Segmentation in IVH Detection23 May 2025
- 2025Transformers as Unsupervised Learning Algorithms: A study on Gaussian Mixtures17 May 2025
12 newest of 44 All 44 (JSON)