On the Stability of Fine-tuning BERT: Misconceptions, Explanations, and Strong Baselines

By Marius Mosbach, Maksym Andriushchenko, Dietrich Klakow. 2020

475 citations recorded by the source corpus.

Fine-tuning pre-trained transformer-based language models such as BERT has become a common practice dominating leaderboards across various NLP benchmarks. Despite the strong empirical performance of fine-tuned models, fine-tuning is an unstable process: training the same model with multiple random seeds can result in a large variance of the task performance. Previous literature (Devlin et al., 2019; Lee et al., 2020; Dodge et al., 2020) identified two potential reasons for the observed instability: catastrophic forgetting and a small size of the fine-tuning datasets. In this paper, we show that both hypotheses fail to explain the fine-tuning instability. We analyze BERT, RoBERTa, and ALBERT, fine-tuned on three commonly used datasets from the GLUE benchmark and show that the observed instability is caused by optimization difficulties that lead to vanishing gradients. Additionally, we show that the remaining variance of the downstream task performance can be attributed to differences in generalization where fine-tuned models with the same training loss exhibit noticeably different test performance. Based on our analysis, we present a simple but strong baseline that makes fine-tuning BERT-based models significantly more stable than previously proposed approaches. Code to reproduce our results is available online: this https URL .

Subfields: Aerospace Engineering, Nuclear and High Energy Physics, Statistical and Nonlinear Physics, Large Language Models, Optimization & Training

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Aerospace Engineering

  1. A. D'Amour
  2. Lihi Zelnik-Manor
  3. Ajit Rajasekharan
  4. Anthony Man-Cho So
  5. Douwe Kiela
  6. Massimo Caccia
  7. Luke S. Zettlemoyer
  8. Steven Bethard

In Nuclear and High Energy Physics

  1. Ajit Rajasekharan
  2. Steven Bethard
  3. Ruijie Chen
  4. Clara Vania
  5. Samuel R. Bowman
  6. Sivanesan Sangeetha
  7. William Huang
  8. Haokun Liu

In Statistical and Nonlinear Physics

  1. Jason Wei
  2. Iulia Turc
  3. Angela Bitto-Nemling
  4. Dipanjan Das
  5. Jacob Eisenstein
  6. Tu Vu
  7. He He
  8. Wai Lam

In Large Language Models

  1. Luke S. Zettlemoyer
  2. Samuel R. Bowman
  3. Michael Lewis
  4. Douwe Kiela
  5. Zhiyuan Liu
  6. Hinrich Schütze
  7. Mohit Bansal
  8. Yoav Goldberg

In Optimization & Training

  1. Luke S. Zettlemoyer
  2. Quoc V. Le
  3. Jie Tang
  4. Asaf Noy
  5. Tal Ridnik
  6. Lihi Zelnik-Manor
  7. Minh-Thang Luong
  8. Yuxiong He

Citations in the corpus