NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Transformers without Tears: Improving the Normalization of Self-Attention

Toan Q. Nguyen, Julian Salazar

Abstract

Training Transformer models often requires significant "black magic," such as delicate learning rate warmups and complex normalization schemes, to ensure convergence. This paper proposes three simple modifications—PRENORM, SCALENORM, and FIXNORM—designed to stabilize training, eliminate the need for warmups, and improve performance in low-resource scenarios. Our results show an average improvement of +1.1 BLEU on low-resource translation tasks while achieving a 5% increase in training speed compared to standard implementations.

Introduction

The standard Transformer architecture, while highly effective, is notoriously difficult to train. The traditional "Post-Norm" configuration, where Layer Normalization (LayerNorm) occurs after residual connections, frequently suffers from early training divergence unless a "warmup" period is employed. Furthermore, LayerNorm itself is computationally expensive and introduces $2d$ learnable parameters per layer, which can lead to overfitting in data-scarce environments. This work seeks to simplify the architecture and provide a more robust framework for internal activation scaling.

Methodology

The authors evaluate several normalization-centric modifications:

  1. PRENORM: By placing normalization immediately before each sublayer (rather than after the residual addition), a "clean" identity path is maintained throughout the network. This significantly improves backpropagation efficiency and training stability.
  2. SCALENORM: This method replaces the complex LayerNorm with a simpler $\ell_2$ normalization scaled by a single learned parameter, $g$: $$ \text{SCALENORM}(x; g) = g \frac{x}{\|x\|} $$ This reduces the parameter count from $2d$ to just 1 per layer, simplifying the loss landscape and speeding up computation.

  3. FIXNORM: Word embeddings are normalized to a fixed length to prevent high-frequency words from dominating the representation space due to vector magnitude alone.

  4. SMALLINIT: A reduced weight initialization for attention layers is tested to assist Post-Norm models in converging without failure.

Experimental Setup

The study focuses primarily on low-resource Neural Machine Translation (NMT) using the following datasets:

  • TED Talks: Galician→English, Slovak→English, Arabic→English, and English→Hebrew.
  • IWSLT '15: English→Vietnamese (a standard benchmark).
  • WMT '14: English→German (serving as a high-resource baseline).

Analysis and Insights

A key finding is that the learning rate warmup is a "patch" for the instabilities inherent in Post-Norm architectures. Switching to PRENORM allows for large learning rates from the start of training without divergence.

Gradient global norm stability across different configurations.

As shown in the gradient analysis, PRENORM models exhibit much smoother gradient norms compared to the "spiky" and volatile gradients seen in standard Post-Norm models. Additionally, the learned scale parameter $g$ in SCALENORM tends to increase linearly with decoder depth, suggesting that deeper layers require higher-magnitude activations to represent complex features.

Key Results

The combination of PRENORM, SCALENORM, and FIXNORM yielded substantial benefits:

  • Translation Quality: An average improvement of +1.1 BLEU was observed across five low-resource language pairs.
  • State-of-the-Art: The authors achieved a new benchmark of 32.8 BLEU on IWSLT '15 English-Vietnamese (bitext-only).
  • Efficiency: SCALENORM is approximately 5% faster than standard LayerNorm due to its reduced parameter count and simpler operations.
Development BLEU scores on English-Vietnamese for various normalization strategies.

Conclusion and Limitations

While these techniques offer significant advantages for low-resource tasks and training stability, a slight performance degradation was noted in high-resource settings (WMT'14). This suggests that the inherent instability of Post-Norm might provide a beneficial regularizing effect when data is abundant. Future research will explore the interaction of these techniques with advanced optimizers and alternative $\ell_p$ norms to further refine Transformer normalization.

Summary updated

BibTeX
@inproceedings{nguyen2019transformers,
  author = {Toan Q. Nguyen and Julian Salazar},
  title = {{Transformers without Tears: Improving the Normalization of Self-Attention}},
  booktitle = {IWSLT},
  year = {2019},
  url = {https://openreview.net/forum?id=UkptJ6yKdYE},
}
Figure