Transformers with Learnable Activation Functions
Not on the map. Why?
Abstract (arXiv)
Activation functions can have a significant impact on reducing the topological complexity of input data and therefore improve the performance of the model. Selecting a suitable activation function is an essential step in neural model design. However, the choice of activation function is seldom discussed or explored in Transformer-based language models. Their activation functions are chosen beforehand and then remain fixed from pre-training to fine-tuning. As a result, the inductive biases they imposed on models cannot be adjusted during this long life cycle. Moreover, subsequently developed models (e.g., RoBERTa, BART, and GPT-3) often follow up prior work (e.g., BERT) to use the same activation function without justification. In this paper, we investigate the effectiveness of using Rational Activation Function (RAF), a learnable activation function, in the Transformer architecture. In contrast to conventional, predefined activation functions, RAFs can adaptively learn optimal activation functions during training according to input data. Our experiments show the RAF-based Transformer (RAFT) achieves a lower validation perplexity than a vanilla BERT with the GELU function. We further evaluate RAFT on downstream tasks in low- and full-data settings. Our results show that RAFT outperforms the counterpart model across the majority of tasks and settings. For instance, RAFT outperforms vanilla BERT on the GLUE benchmark by 5.71 points on average in low-data scenario (where 100 training examples are available) and by 2.05 points on SQuAD in full-data setting. Analysis of the shapes of learned RAFs further unveils that they substantially vary between different layers of the pre-trained model and mostly look very different from conventional activation functions. RAFT opens a new research direction for analyzing and interpreting pre-trained models according to the learned activation functions.
Key facts. Cited by 5 papers in the map (data through 7 Oct 2026). Builds on 50 of its 75 references that are in the map. First posted on arXiv 30 Aug 2022.
Builds on
50 of 75 references.
References · 50
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2019BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehensioncited by 5,874
- 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,854
- 2019Parameter-Efficient Transfer Learning for NLPcited by 4,195
- 2016SQuAD: 100,000+ Questions for Machine Comprehension of Textcited by 4,115
- 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,464
- 2022Training Compute-Optimal Large Language Modelscited by 2,927
- 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,898
38 more
- 2017TriviaQA: A Large Scale Distantly Supervised Challenge Dataset for Reading Comprehensioncited by 2,895
- 2019XLNet: Generalized Autoregressive Pretraining for Language Understandingcited by 2,801
- 2019ALBERT: A Lite BERT for Self-supervised Learning of Language Representationscited by 2,772
- 2017A Broad-Coverage Challenge Corpus for Sentence Understanding through Inferencecited by 2,665
- 2020DeBERTa: Decoding-enhanced BERT with Disentangled Attentioncited by 2,157
- 2015A large annotated corpus for learning natural language inferencecited by 1,837
- 2019Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelismcited by 1,829
- 2018DARTS: Differentiable Architecture Searchcited by 1,782
- 2020GLU Variants Improve Transformercited by 1,724
- 2016Neural Architecture Search with Reinforcement Learningcited by 1,489
- 2021BitFit: Simple Parameter-efficient Fine-tuning for Transformer-based Masked Language-modelscited by 1,234
- 2022LaMDA: Language Models for Dialog Applicationscited by 1,218
- 2021Scaling Language Models: Methods, Analysis & Insights from Training Gophercited by 1,199
- 2017SemEval-2017 Task 1: Semantic Textual Similarity - Multilingual and Cross-lingual Focused Evaluationcited by 998
- 2018Neural Network Acceptability Judgmentscited by 952
- 2016Language Modeling with Gated Convolutional Networkscited by 688
- 2022Using DeepSpeed and Megatron to Train Megatron-Turing NLG 530B, A Large-Scale Generative Language Modelcited by 557
- 2020AdapterHub: A Framework for Adapting Transformerscited by 441
- 2016Using the Output Embedding to Improve Language Modelscited by 266
- 2021CANINE: Pre-training an Efficient Tokenization-Free Encoder for Language Representationcited by 229
- 2022Delta Tuning: A Comprehensive Study of Parameter Efficient Methods for Pre-trained Language Modelscited by 179
- 2022DeepNet: Scaling Transformers to 1,000 Layerscited by 176
- 2021Primer: Searching for Efficient Transformers for Language Modelingcited by 162
- 2021Activation Functions in Deep Learning: A Comprehensive Survey and Benchmarkcited by 153
- 2018Activation Functions: Comparison of trends in Practice and Research for Deep Learningcited by 130
- 2020What Happens To BERT Embeddings During Fine-tuning?cited by 113
- 2020Topology of deep neural networkscited by 111
- 2021How to Train BERT with an Academic Budgetcited by 80
- 2019Pad'e Activation Units: End-to-end Learning of Flexible Activation Functions in Deep Networkscited by 65
- 2021A Closer Look at How Fine-tuning Changes BERTcited by 42
- 2017Neural networks and rational functionscited by 40
- 2020On the Interplay Between Fine-tuning and Sentence-level Probing for Linguistic Knowledge in Pre-trained Transformerscited by 39
- 2020Attention-Based Transformers for Instance Segmentation of Cells in Microstructurescited by 38
- 2020Discovering Parametric Activation Functionscited by 21
- 2018Learning Combinations of Activation Functionscited by 20
- 2020Evolutionary Optimization of Deep Learning Activation Functionscited by 18
- 2018Adaptive Blending Units: Trainable Activation Functions for Deep Neural Networkscited by 13
- 2022Adaptable Adapterscited by 13
Built on by
Citing papers per year: 2024: 3; 2025: 1; 2026: 1.
5 papers.
- 2024Rethinking Attention: Polynomial Alternatives to Softmax in Transformerscited by 8
- 2026Rational Neural Networks have Expressivity Advantagescited by 1
- 2024A Novel Stochastic Transformer-based Approach for Post-Traumatic Stress Disorder Detection using Audio Recording of Clinical Interviewscited by 0
- 2024Activations Through Extensions: A Framework To Boost Performance Of Neural Networkscited by 0
- 2025Polynomial, trigonometric, and tropical activationscited by 0
- 2026Rational Neural Networks have Expressivity Advantages12 Feb 2026
- 2025Polynomial, trigonometric, and tropical activations3 Feb 2025
- 2024Rethinking Attention: Polynomial Alternatives to Softmax in Transformers24 Oct 2024
- 2024Activations Through Extensions: A Framework To Boost Performance Of Neural Networks7 Aug 2024
- 2024A Novel Stochastic Transformer-based Approach for Post-Traumatic Stress Disorder Detection using Audio Recording of Clinical Interviews28 Mar 2024