Understanding the Failure of Batch Normalization for Transformers in NLP
Not on the map. Why?
Abstract (arXiv)
Batch Normalization (BN) is a core and prevalent technique in accelerating the training of deep neural networks and improving the generalization on Computer Vision (CV) tasks. However, it fails to defend its position in Natural Language Processing (NLP), which is dominated by Layer Normalization (LN). In this paper, we are trying to answer why BN usually performs worse than LN in NLP tasks with Transformer models. We find that the inconsistency between training and inference of BN is the leading cause that results in the failure of BN in NLP. We define Training Inference Discrepancy (TID) to quantitatively measure this inconsistency and reveal that TID can indicate BN's performance, supported by extensive experiments, including image classification, neural machine translation, language modeling, sequence labeling, and text classification tasks. We find that BN can obtain much better test performance than LN when TID keeps small through training. To suppress the explosion of TID, we propose Regularized BN (RBN) that adds a simple regularization term to narrow the gap between batch statistics and population statistics of BN. RBN improves the performance of BN consistently and outperforms or is on par with LN on 17 out of 20 settings, involving ten datasets and two common variants of Transformer Our code is available at https://github.com/wjxts/RegularizedBN.
Key facts. Cited by 12 papers in the map (data through 7 Oct 2026). Builds on 41 of its 67 references that are in the map. First posted on arXiv 11 Oct 2022.
Builds on
41 of 67 references.
References · 41
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2015Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shiftcited by 6,979
- 2016Layer Normalizationcited by 5,579
- 2016Pointer Sentinel Mixture Modelscited by 2,992
- 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,830
- 2018Group Normalizationcited by 1,514
- 2019fairseq: A Fast, Extensible Toolkit for Sequence Modelingcited by 1,486
- 2019Root Mean Square Layer Normalizationcited by 1,425
- 2018Averaging Weights Leads to Wider Optima and Better Generalizationcited by 1,194
- 2020On Layer Normalization in the Transformer Architecturecited by 906
29 more
- 2015Optimizing Neural Networks with Kronecker-factored Approximate Curvaturecited by 776
- 2015Train faster, generalize better: Stability of stochastic gradient descentcited by 547
- 2015Bidirectional LSTM-CRF Models for Sequence Taggingcited by 544
- 2020Improving robustness against common corruptions by covariate shift adaptationcited by 427
- 2018How Does Batch Normalization Help Optimization?cited by 355
- 2016Revisiting Batch Normalization For Practical Domain Adaptationcited by 285
- 2020Evaluating Prediction-Time Batch Normalization for Robustness under Covariate Shiftcited by 235
- 2019Understanding and Improving Layer Normalizationcited by 213
- 2018Understanding Batch Normalizationcited by 157
- 2017Batch Renormalization: Towards Reducing Minibatch Dependence in Batch-Normalized Modelscited by 127
- 2019Iterative Normalization: Beyond Standardization towards Efficient Whiteningcited by 92
- 2019A Tensorized Transformer for Language Modelingcited by 85
- 2020Gradient Centralization: A New Optimization Technique for Deep Neural Networkscited by 82
- 2018Chinese NER Using Lattice LSTMcited by 81
- 2019TENER: Adapting Transformer Encoder for Named Entity Recognitioncited by 69
- 2018Towards Understanding Regularization in Batch Normalizationcited by 56
- 2020Revisiting Batch Normalization for Improving Corruption Robustnesscited by 55
- 2021Rethinking "Batch" in BatchNormcited by 44
- 2018Understanding the Disharmony between Dropout and Batch Normalization by Variance Shiftcited by 36
- 2018Differentiable Learning-to-Normalize via Switchable Normalizationcited by 33
- 2019Online Normalization for Training Neural Networkscited by 29
- 2019Four Things Everyone Should Know to Improve Batch Normalizationcited by 28
- 2021Batch Normalization Orthogonalizes Representations in Deep Random Networkscited by 28
- 2019EvalNorm: Estimating Batch Normalization Statistics for Evaluationcited by 20
- 2020Cross-Iteration Batch Normalizationcited by 20
- 2020Towards Stabilizing Batch Statistics in Backward Propagation of Batch Normalizationcited by 19
- 2022Delving into the Estimation Shift of Batch Normalization in a Networkcited by 7
- 2020Layer-wise Conditioning Analysis in Exploring the Learning Dynamics of DNNscited by 4
- 2021More Identifiable yet Equally Performant Transformers for Text Classificationcited by 3
Built on by
Citing papers per year: 2023: 2; 2024: 6; 2025: 2; 2026: 2.
12 papers.
- 2023Converting Transformers to Polynomial Form for Secure Inference Over Homomorphic Encryptioncited by 19
- 2024Self-calibration for Language Model Quantization and Pruningcited by 10
- 2025Transformers Don't Need LayerNorm at Inference Time: Scaling LayerNorm Removal to GPT-2 XL and the Implications for Mechanistic Interpretabilitycited by 7
- 2024Preconditioning for Accelerated Gradient Descent Optimization and Regularizationcited by 4
- 2024UnitNorm: Rethinking Normalization for Transformers in Time Seriescited by 2
- 2024A Note on Bias to Completecited by 1
- 2025IML-Spikeformer: Input-aware Multi-Level Spiking Transformer for Speech Processingcited by 1
- 2023Unified Batch Normalization: Identifying and Alleviating the Feature Condensation in Batch Normalization and a Unified Frameworkcited by 0
- 2024NAS-Cap: Deep-Learning Driven 3-D Capacitance Extraction with Neural Architecture Search and Data Augmentationcited by 0
- 2024Batch Normalization Decomposedcited by 0
- 2026U-Harmony: Enhancing Joint Training for Segmentation Models with Universal Harmonizationcited by 0
- 2026SpikeDecoder: Realizing the GPT Architecture with Spiking Neural Networkscited by 0
- 2026SpikeDecoder: Realizing the GPT Architecture with Spiking Neural Networks10 Jun 2026
- 2026U-Harmony: Enhancing Joint Training for Segmentation Models with Universal Harmonization21 Jan 2026
- 2025IML-Spikeformer: Input-aware Multi-Level Spiking Transformer for Speech Processing10 Jul 2025
- 2025Transformers Don't Need LayerNorm at Inference Time: Scaling LayerNorm Removal to GPT-2 XL and the Implications for Mechanistic Interpretability3 Jul 2025
- 2024Batch Normalization Decomposed3 Dec 2024
- 2024Self-calibration for Language Model Quantization and Pruning22 Oct 2024
- 2024Preconditioning for Accelerated Gradient Descent Optimization and Regularization30 Sep 2024
- 2024NAS-Cap: Deep-Learning Driven 3-D Capacitance Extraction with Neural Architecture Search and Data Augmentation23 Aug 2024
- 2024UnitNorm: Rethinking Normalization for Transformers in Time Series24 May 2024
- 2024A Note on Bias to Complete18 Feb 2024
- 2023Unified Batch Normalization: Identifying and Alleviating the Feature Condensation in Batch Normalization and a Unified Framework27 Nov 2023
- 2023Converting Transformers to Polynomial Form for Secure Inference Over Homomorphic Encryption15 Nov 2023