Understanding the Difficulty of Training Transformers

By Liyuan Liu, Xiaodong Liu, Jianfeng Gao, Weizhu Chen, Jiawei Han. 2020

315 citations recorded by the source corpus.

Transformers have been proved effective for many deep learning tasks. Training transformers, however, requires non-trivial efforts regarding carefully designing learning rate schedulers and cutting-edge optimizers (the standard SGD fails to train Transformers effectively). In this paper, we study Transformer training from both theoretical and empirical perspectives. Our analysis reveals that unbalanced gradients are not the root cause of the instability of training. Instead, we identify an amplification effect that substantially influences training. Specifically, we observe that for each layer in a multi-layer Transformer model, heavy dependency on its residual branch makes training unstable since it amplifies small parameter perturbations (e.g., parameter updates) and result in significant disturbances in the model output, yet a light dependency limits the potential of model training and can lead to an inferior trained model. Inspired by our analysis, we propose Admin ($\mathbf{Ad}$aptive $\mathbf{m}$odel $\mathbf{in}$itialization) to stabilize the training in the early stage and unleash its full potential in the late stage. Extensive experiments show that Admin is more stable, converges faster, and leads to better performance.

Subfields: Artificial Intelligence, Model Architectures, 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 Artificial Intelligence

  1. Jianfeng Gao
  2. Mohit Bansal
  3. Luke S. Zettlemoyer
  4. Percy Liang
  5. Furu Wei
  6. Quoc V. Le
  7. Yoshua Bengio
  8. Graham Neubig

In Model Architectures

  1. Christopher R'e
  2. Tri Dao
  3. Jianfeng Gao
  4. Jiashi Feng
  5. Yoshua Bengio
  6. Furu Wei
  7. Xinchao Wang
  8. Alan L. Yuille

In Optimization & Training

  1. Yoshua Bengio
  2. Alan L. Yuille
  3. Jianfeng Gao
  4. Christopher R'e
  5. Jiashi Feng
  6. Ilya Sutskever
  7. Sanjeev Arora
  8. Shuicheng Yan

Citations in the corpus