Skip to main content
QUICK REVIEW

[Paper Review] Understanding the Difficulty of Training Transformers

Liyuan Liu, Xiaodong Liu|arXiv (Cornell University)|Apr 17, 2020
Topic ModelingComputer Science38 references28 citations
TL;DR

This paper identifies that training instability in Transformers stems from excessive dependency on residual branches, which amplify parameter perturbations. To address this, the authors propose Admin, an adaptive initialization method that reduces residual dependency early in training to enhance stability and later unleashes model capacity, achieving state-of-the-art performance on long-sequence translation tasks, including a 43.80 BLEU score on WMT’14 En-Fr with a 72-layer Transformer.

ABSTRACT

Transformers have proved effective in many NLP tasks. However, their training requires non-trivial efforts regarding designing cutting-edge optimizers and learning rate schedulers carefully (e.g., conventional SGD fails to train Transformers effectively). Our objective here is to understand $ extit{what complicates Transformer training}$ from both empirical and theoretical perspectives. Our analysis reveals that unbalanced gradients are not the root cause of the instability of training. Instead, we identify an amplification effect that influences training substantially -- 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 results in significant disturbances in the model output. Yet we observe that a light dependency limits the model potential and leads to inferior trained models. Inspired by our analysis, we propose Admin ($ extbf{Ad}$aptive $ extbf{m}$odel $ extbf{in}$itialization) to stabilize stabilize the early stage's training and unleash its full potential in the late stage. Extensive experiments show that Admin is more stable, converges faster, and leads to better performance. Implementations are released at: https://github.com/LiyuanLucasLiu/Transforemr-Clinic.

Motivation & Objective

  • To understand why training Transformers is difficult despite their success in NLP tasks.
  • To investigate whether unbalanced gradients or other factors are the primary cause of training instability.
  • To identify structural design choices—particularly residual branch dependency—that affect training stability and model capacity.
  • To develop a method that stabilizes early training without sacrificing model potential in later stages.
  • To achieve state-of-the-art performance on deep Transformer architectures, especially in long-sequence translation tasks.

Proposed method

  • The authors analyze the dependency of each Transformer layer on its residual branch using variance ratios, defining dependency as Var[f(x)] / Var[x + f(x)], where f(x) is the residual output.
  • They compare Post-LN and Pre-LN Transformer architectures, showing that Post-LN layers have stronger residual dependencies, leading to instability under parameter updates.
  • They propose Admin (Adaptive Model Initialization), which dynamically adjusts the scale of residual connections during initialization to reduce dependency in early training.
  • Admin uses a learnable scaling factor that is initialized to suppress residual updates initially and gradually increases to unleash model capacity as training progresses.
  • The method is applied during model initialization and does not require additional hyperparameters or architectural changes.
  • Experiments are conducted on IWSLT’14 De-En, WMT’14 En-De, and WMT’14 En-Fr with various depth configurations, including 72-layer models.

Experimental results

Research questions

  • RQ1What structural factor in Transformers causes training instability beyond unbalanced gradients?
  • RQ2Why does Post-LN training diverge more easily than Pre-LN training despite similar gradient behavior?
  • RQ3How does the dependency on residual branches affect the propagation of parameter perturbations during training?
  • RQ4Can we stabilize deep Transformer training by controlling residual dependency during initialization without sacrificing model capacity?
  • RQ5Can an adaptive initialization method outperform both Post-LN and Pre-LN baselines in deep architectures?

Key findings

  • Post-LN Transformers exhibit significantly higher residual dependency than Pre-LN variants, which amplifies small parameter perturbations and leads to training instability.
  • Pre-LN models are more stable but suffer from limited model capacity due to weak residual dependency, resulting in inferior performance.
  • Admin stabilizes training across all evaluated datasets and architectures, including 72-layer Transformers on WMT’14 En-Fr, which previously failed to train with standard methods.
  • On WMT’14 En-Fr with a 60-layer encoder and 12-layer decoder, Admin achieves a new state-of-the-art BLEU score of 43.80.
  • Admin outperforms both standard Post-LN and Pre-LN baselines, as well as pre-trained T5 models, demonstrating its ability to unlock full model potential.
  • The method achieves faster convergence and better stability without introducing additional hyperparameters or architectural modifications.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.