Reproduce “On Layer Normalization in the Transformer Architecture” on OpenResearch

Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Ruibin Xiong, Yunchang Yang, Di He, Kai Zheng, Shuxin Zheng, Chen Xing, Huishuai Zhang, Yanyan Lan and 2 more

The authors test whether moving normalization before Transformer attention and feed-forward sublayers can remove learning-rate warm-up. Their Pre-LN design places normalization inside the residual path and adds a final normalization before prediction. On IWSLT14 German-to-English translation, it reaches about 34 BLEU and validation loss 4 without warm-up, comparable to warm-up-trained Post-LN; this result is limited to tested settings.

Key insights

  • At initialization, Post-LN Transformers exhibit large, depth-independent gradients near the output layer, leading to training instability without warm-up.
  • Pre-LN Transformers show well-behaved gradients at initialization, scaling inversely with the square root of the number of layers (O(d√(ln d / L))), which intrinsically resolves instability.
  • The placement of Layer Normalization fundamentally alters gradient dynamics at initialization, with Pre-LN ensuring better-controlled signal propagation throughout the network.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.