Skip to main content
QUICK REVIEW

[Paper Review] PowerNorm: Rethinking Batch Normalization in Transformers

Sheng Shen, Zhewei Yao|arXiv (Cornell University)|Mar 17, 2020
Advanced Neural Network ApplicationsComputer Science47 references16 citations
TL;DR

This paper proposes PowerNorm (PN), a novel normalization technique for Transformers that addresses the instability of batch normalization (BN) in NLP by relaxing zero-mean constraints and using running quadratic means to stabilize batch statistics. PN significantly outperforms both standard layer normalization (LN) and vanilla BN, achieving 0.4/0.6 BLEU gains on IWSLT14/WMT14 and 5.6/3.0 PPL improvements on PTB/WikiText-103 without hyperparameter changes.

ABSTRACT

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{https://github.com/sIncerass/powernorm}.

Motivation & Objective

  • To investigate why standard batch normalization (BN) fails in NLP despite its success in computer vision (CV).
  • To identify the root cause of BN's poor performance in NLP, particularly instability due to high variance in batch statistics.
  • To develop a normalization method that retains the benefits of BN while overcoming its instability in NLP tasks.
  • To demonstrate that PowerNorm (PN) outperforms both BN and layer normalization (LN) across multiple NLP benchmarks without hyperparameter tuning.

Proposed method

  • Proposes PowerNorm (PN) as a modified BN that relaxes the zero-mean constraint, replacing variance with a running quadratic mean to stabilize statistics.
  • Introduces PN-V as a variant that uses only the running quadratic mean without zero-centering, preserving first-order smoothness.
  • Develops an approximate backpropagation scheme to incorporate running statistics into the forward pass, ensuring bounded gradients.
  • Theoretical analysis shows PN leads to a smaller Lipschitz constant for the loss and bounded gradients under mild assumptions.
  • Empirically evaluates PN on machine translation (IWSLT14, WMT14) and language modeling (PTB, WikiText-103) with consistent improvements.
  • Uses singular value decomposition (SVD) of embedding layers to analyze representational power and show PN leads to better-conditioned embeddings.

Experimental results

Research questions

  • RQ1Why does standard batch normalization (BN) fail in NLP models despite its success in CV?
  • RQ2What causes the instability of BN in NLP, particularly in terms of batch statistics variance?
  • RQ3Can a modified BN variant be designed to stabilize training in NLP while preserving the benefits of BN?
  • RQ4How does PowerNorm compare to layer normalization (LN) and vanilla BN in terms of performance and robustness across different batch sizes?
  • RQ5Does PowerNorm lead to better representational capacity in learned embeddings, as measured by singular value distribution?

Key findings

  • Batch statistics in NLP data exhibit significantly higher variance throughout training compared to CV data, leading to instability in vanilla BN.
  • PowerNorm (PN) outperforms layer normalization (LN) by 0.4/0.6 BLEU on IWSLT14/WMT14 and 5.6/3.0 PPL on PTB/WikiText-103, with no hyperparameter changes.
  • PN-V, the variant without zero-centering, matches LN only at large batch sizes (e.g., 4K), while PN consistently outperforms LN across all batch sizes.
  • Vanilla BN degrades performance by over 7.5/6.3 PPL on PTB/WikiText-103, while PN achieves state-of-the-art results without pre-training.
  • Singular value analysis shows that PN leads to slower-decaying singular values in embedding layers, indicating better representational power.
  • The approximate backpropagation scheme in PN ensures bounded gradients, a necessary condition for stable training, as proven theoretically.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.