On Layer Normalization in the Transformer Architecture. Xiong, R., Yang, Y., He, D., Zheng, K., Zheng, S., Xing, C., Zhang, H., Lan, Y., Wang, L., & Liu, T. 2020. cite arxiv:2002.04745
Paper abstract bibtex 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.
@misc{xiong2020layer,
abstract = {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.},
added-at = {2023-08-23T21:05:33.000+0200},
author = {Xiong, Ruibin and Yang, Yunchang and He, Di and Zheng, Kai and Zheng, Shuxin and Xing, Chen and Zhang, Huishuai and Lan, Yanyan and Wang, Liwei and Liu, Tie-Yan},
biburl = {https://www.bibsonomy.org/bibtex/20e7e589f20732b9e618449260b1ba5d1/arthi706},
description = {On Layer Normalization in the Transformer Architecture},
interhash = {4c0ba8cd34fcfaaad43dd0bb6c7c72ac},
intrahash = {0e7e589f20732b9e618449260b1ba5d1},
keywords = {deeplearning transformer},
note = {cite arxiv:2002.04745},
timestamp = {2023-08-23T21:05:33.000+0200},
title = {On Layer Normalization in the Transformer Architecture},
url = {http://arxiv.org/abs/2002.04745},
year = 2020
}
Downloads: 0
{"_id":"jG62gJtErt8CEJRTz","bibbaseid":"xiong-yang-he-zheng-zheng-xing-zhang-lan-etal-onlayernormalizationinthetransformerarchitecture-2020","author_short":["Xiong, R.","Yang, Y.","He, D.","Zheng, K.","Zheng, S.","Xing, C.","Zhang, H.","Lan, Y.","Wang, L.","Liu, T."],"bibdata":{"bibtype":"misc","type":"misc","abstract":"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.","added-at":"2023-08-23T21:05:33.000+0200","author":[{"propositions":[],"lastnames":["Xiong"],"firstnames":["Ruibin"],"suffixes":[]},{"propositions":[],"lastnames":["Yang"],"firstnames":["Yunchang"],"suffixes":[]},{"propositions":[],"lastnames":["He"],"firstnames":["Di"],"suffixes":[]},{"propositions":[],"lastnames":["Zheng"],"firstnames":["Kai"],"suffixes":[]},{"propositions":[],"lastnames":["Zheng"],"firstnames":["Shuxin"],"suffixes":[]},{"propositions":[],"lastnames":["Xing"],"firstnames":["Chen"],"suffixes":[]},{"propositions":[],"lastnames":["Zhang"],"firstnames":["Huishuai"],"suffixes":[]},{"propositions":[],"lastnames":["Lan"],"firstnames":["Yanyan"],"suffixes":[]},{"propositions":[],"lastnames":["Wang"],"firstnames":["Liwei"],"suffixes":[]},{"propositions":[],"lastnames":["Liu"],"firstnames":["Tie-Yan"],"suffixes":[]}],"biburl":"https://www.bibsonomy.org/bibtex/20e7e589f20732b9e618449260b1ba5d1/arthi706","description":"On Layer Normalization in the Transformer Architecture","interhash":"4c0ba8cd34fcfaaad43dd0bb6c7c72ac","intrahash":"0e7e589f20732b9e618449260b1ba5d1","keywords":"deeplearning transformer","note":"cite arxiv:2002.04745","timestamp":"2023-08-23T21:05:33.000+0200","title":"On Layer Normalization in the Transformer Architecture","url":"http://arxiv.org/abs/2002.04745","year":"2020","bibtex":"@misc{xiong2020layer,\n abstract = {The Transformer is widely used in natural language processing tasks. To train\r\na Transformer however, one usually needs a carefully designed learning rate\r\nwarm-up stage, which is shown to be crucial to the final performance but will\r\nslow down the optimization and bring more hyper-parameter tunings. In this\r\npaper, we first study theoretically why the learning rate warm-up stage is\r\nessential and show that the location of layer normalization matters.\r\nSpecifically, we prove with mean field theory that at initialization, for the\r\noriginal-designed Post-LN Transformer, which places the layer normalization\r\nbetween the residual blocks, the expected gradients of the parameters near the\r\noutput layer are large. Therefore, using a large learning rate on those\r\ngradients makes the training unstable. The warm-up stage is practically helpful\r\nfor avoiding this problem. On the other hand, our theory also shows that if the\r\nlayer normalization is put inside the residual blocks (recently proposed as\r\nPre-LN Transformer), the gradients are well-behaved at initialization. This\r\nmotivates us to remove the warm-up stage for the training of Pre-LN\r\nTransformers. We show in our experiments that Pre-LN Transformers without the\r\nwarm-up stage can reach comparable results with baselines while requiring\r\nsignificantly less training time and hyper-parameter tuning on a wide range of\r\napplications.},\n added-at = {2023-08-23T21:05:33.000+0200},\n author = {Xiong, Ruibin and Yang, Yunchang and He, Di and Zheng, Kai and Zheng, Shuxin and Xing, Chen and Zhang, Huishuai and Lan, Yanyan and Wang, Liwei and Liu, Tie-Yan},\n biburl = {https://www.bibsonomy.org/bibtex/20e7e589f20732b9e618449260b1ba5d1/arthi706},\n description = {On Layer Normalization in the Transformer Architecture},\n interhash = {4c0ba8cd34fcfaaad43dd0bb6c7c72ac},\n intrahash = {0e7e589f20732b9e618449260b1ba5d1},\n keywords = {deeplearning transformer},\n note = {cite arxiv:2002.04745},\n timestamp = {2023-08-23T21:05:33.000+0200},\n title = {On Layer Normalization in the Transformer Architecture},\n url = {http://arxiv.org/abs/2002.04745},\n year = 2020\n}\n\n","author_short":["Xiong, R.","Yang, Y.","He, D.","Zheng, K.","Zheng, S.","Xing, C.","Zhang, H.","Lan, Y.","Wang, L.","Liu, T."],"key":"xiong2020layer","id":"xiong2020layer","bibbaseid":"xiong-yang-he-zheng-zheng-xing-zhang-lan-etal-onlayernormalizationinthetransformerarchitecture-2020","role":"author","urls":{"Paper":"http://arxiv.org/abs/2002.04745"},"keyword":["deeplearning transformer"],"metadata":{"authorlinks":{}},"html":""},"bibtype":"misc","biburl":"http://www.bibsonomy.org/bib/author/zhang?items=1000","dataSources":["6yXn8CtuzyEbCSr2m"],"keywords":["deeplearning transformer"],"search_terms":["layer","normalization","transformer","architecture","xiong","yang","he","zheng","zheng","xing","zhang","lan","wang","liu"],"title":"On Layer Normalization in the Transformer Architecture","year":2020}