Transformers with Learnable Activation Functions
Fang, Haishuo, Lee, Ji-Ung, Moosavi, Nafise Sadat, Gurevych, Iryna
–arXiv.org Artificial Intelligence
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.
arXiv.org Artificial Intelligence
Feb-14-2023
- Country:
- Oceania > Australia
- New South Wales > Sydney (0.04)
- North America
- United States
- Texas (0.04)
- Washington > King County
- Seattle (0.14)
- New York > New York County
- New York City (0.04)
- Minnesota > Hennepin County
- Minneapolis (0.14)
- Louisiana > Orleans Parish
- New Orleans (0.04)
- California > Los Angeles County
- Long Beach (0.04)
- Canada > British Columbia
- United States
- Europe
- Austria (0.04)
- Spain (0.04)
- France (0.04)
- Romania > Sud - Muntenia Development Region
- Giurgiu County > Giurgiu (0.04)
- United Kingdom > England
- Hampshire > Southampton (0.04)
- Portugal > Lisbon
- Lisbon (0.04)
- Italy
- Lazio > Rome (0.04)
- Calabria > Catanzaro Province
- Catanzaro (0.04)
- Germany > Hesse
- Darmstadt Region > Darmstadt (0.04)
- Ireland > Leinster
- County Dublin > Dublin (0.04)
- Asia
- South Korea (0.14)
- Middle East > Jordan (0.04)
- Japan > Honshū
- Tōhoku > Fukushima Prefecture > Fukushima (0.04)
- China > Beijing
- Beijing (0.04)
- Africa > Ethiopia
- Addis Ababa > Addis Ababa (0.04)
- Oceania > Australia
- Genre:
- Research Report > New Finding (1.00)
- Technology: