We use a few cookies

Essential cookies keep the library working. With your permission, we'd also like to use analytics to see what's useful and improve the experience. Read our Privacy Policy or Cookie Policy.

Skip to main content
Home/e-Resources/Architecture & Planning/On Layer Normalization in the Transformer Architecture
Conference ProceedingsArchitecture & Planning

On Layer Normalization in the Transformer Architecture

2020

Checking your access to this record.

Abstract & Overview

The Transformer is widely used in natural language processing tasks. To train a Transformer however, one usually needs a carefully designed learning rate warm-up stage, which is shown to be crucial to the final performance but will slow down the optimization and bring more hyper-parameter tunings. In this paper, we first study theoretically why the learning rate warm-up stage is essential and show that the location of layer normalization matters. Specifically, we prove with mean field theory that at initialization, for the original-designed Post-LN Transformer, which places the layer normalization between the residual blocks, the expected gradients of the parameters near the output layer are large. Therefore, using a large learning rate on those gradients makes the training unstable. The warm-up stage is practically helpful for avoiding this problem. On the other hand, our theory also shows that if the layer normalization is put inside the residual blocks (recently proposed as Pre-LN Transformer), the gradients are well-behaved at initialization. This motivates us to remove the warm-up stage for the training of Pre-LN Transformers. We show in our experiments that Pre-LN Transformers without the warm-up stage can reach comparable results with baselines while requiring significantly less training time and hyper-parameter tuning on a wide range of applications.

Cite this record

Ruibin Xiong, Yunchang Yang, Di He, Kai Wen Zheng, Zheng, Shuxin, Chen Xing, et al. (2020). On Layer Normalization in the Transformer Architecture. International Conference on Machine Learning. https://doi.org/10.48550/arxiv.2002.04745

Copy in another style

Xiong, R., Yang, Y., He, D., Zheng, K. W., Shuxin, Z., Xing, C., Zhang, H., Lan, Y., Wang, L., & Liu, T. (2020). On Layer Normalization in the Transformer Architecture. International Conference on Machine Learning. https://doi.org/10.48550/arxiv.2002.04745
Author names are used as deposited, so check their order before you submit.

Metadata is harvested from open-access indexes and can be incomplete. Check a citation against the published version before relying on it — see our open access & attribution policy.