[Paper Review] Rethinking Batch Normalization in Transformers
This paper proposes Power Normalization (PN), a novel normalization technique for Transformers in NLP that addresses the instability of batch normalization (BN) caused by high batch-wise statistical fluctuations in NLP data. By relaxing zero-mean constraints, using running quadratic means, and employing approximate backpropagation, PN achieves better training stability and performance than both BN and layer normalization (LN), outperforming LN by 0.6 BLEU on WMT14 and 5.6 PPL on WikiText-103.
The standard normalization method for neural network (NN) models used in Natural Language Processing (NLP) is layer normalization (LN). This is different than batch normalization (BN), which is widely-adopted in Computer Vision. The preferred use of LN in NLP is principally due to the empirical observation that a (naive/vanilla) use of BN leads to significant performance degradation for NLP tasks; however, a thorough understanding of the underlying reasons for this is not always evident. In this paper, we perform a systematic study of NLP transformer models to understand why BN has a poor performance, as compared to LN. We find that the statistics of NLP data across the batch dimension exhibit large fluctuations throughout training. This results in instability, if BN is naively implemented. To address this, we propose Power Normalization (PN), a novel normalization scheme that resolves this issue by (i) relaxing zero-mean normalization in BN, (ii) incorporating a running quadratic mean instead of per batch statistics to stabilize fluctuations, and (iii) using an approximate backpropagation for incorporating the running statistics in the forward pass. We show theoretically, under mild assumptions, that PN leads to a smaller Lipschitz constant for the loss, compared with BN. Furthermore, we prove that the approximate backpropagation scheme leads to bounded gradients. We extensively test PN for transformers on a range of NLP tasks, and we show that it significantly outperforms both LN and BN. In particular, PN outperforms LN by 0.4/0.6 BLEU on IWSLT14/WMT14 and 5.6/3.0 PPL on PTB/WikiText-103. We make our code publicly available at \url{this https URL}.
Motivation & Objective
- To investigate why batch normalization (BN) underperforms in NLP Transformers compared to layer normalization (LN).
- To identify the root cause of BN's poor performance in NLP, particularly instability due to large batch-wise statistical fluctuations.
- To design a new normalization scheme that stabilizes training in NLP by addressing these fluctuations while maintaining training efficiency.
- To theoretically justify the proposed method by showing a smaller Lipschitz constant for the loss and bounded gradients.
Proposed method
- Relaxing the zero-mean constraint in batch normalization to reduce sensitivity to batch-level statistics.
- Replacing per-batch statistics with a running quadratic mean to stabilize statistics across training steps.
- Introducing an approximate backpropagation scheme that incorporates running statistics into the forward pass for better gradient flow.
- Theoretical analysis shows PN leads to a smaller Lipschitz constant for the loss function under mild assumptions.
- The approximate backpropagation scheme is proven to yield bounded gradients, improving training stability.
- The method is integrated into Transformer architectures and evaluated across multiple NLP benchmarks.
Experimental results
Research questions
- RQ1Why does standard batch normalization degrade performance in NLP Transformers compared to layer normalization?
- RQ2What specific property of NLP data causes instability when using naive batch normalization?
- RQ3Can a modified normalization scheme that uses running statistics improve training stability and performance in NLP?
- RQ4Does the proposed normalization method lead to better generalization and faster convergence than existing methods?
- RQ5Can theoretical guarantees such as bounded gradients and reduced Lipschitz constant be established for the proposed method?
Key findings
- Power Normalization (PN) significantly outperforms layer normalization (LN) on IWSLT14, achieving a 0.4 BLEU improvement.
- On WMT14, PN improves over LN by 0.6 BLEU, demonstrating consistent gains across translation tasks.
- On the PTB language modeling benchmark, PN reduces perplexity by 5.6 points compared to LN.
- On WikiText-103, PN achieves a 3.0 perplexity improvement over LN, indicating stronger language modeling performance.
- Theoretical analysis confirms that PN leads to a smaller Lipschitz constant for the loss function than BN under mild assumptions.
- The approximate backpropagation scheme in PN ensures bounded gradients, contributing to training stability.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.