DNT: a Deeply Normalized Transformer that can be trained by Momentum SGD

Xianbiao Qi, Marco Chen, Wenjie Xiao, Jiaquan Ye, Yelin He, Chun-Guang Li, Zhouchen Lin · DOI

Abstract

Transformers typically require memory-intensive adaptive optimizers like AdamW because their gradients exhibit erratic, heavy-tailed distributions. This paper presents the Deeply Normalized Transformer (DNT), which utilizes strategic normalization layers to stabilize these gradients. This architectural refinement allows Transformers to be trained using standard Momentum SGD (mSGDW), achieving performance parity with AdamW while reducing optimizer memory consumption by approximately 50%.

Introduction: The Optimizer Dilemma

While Convolutional Neural Networks (CNNs) have long been successfully trained using standard Momentum SGD, Transformers have historically resisted this simple approach. The AI community has largely settled on AdamW as the default optimizer for Large Language Models (LLMs) and Vision Transformers (ViTs). However, AdamW's reliance on tracking both first and second moments of gradients makes it memory-expensive, requiring twice the optimizer state memory compared to SGD.

The root cause of SGD's failure on Transformers is the "heavy-tailed" distribution of their gradients. These gradients span a vast range of amplitudes, making it difficult for non-adaptive optimizers to take stable steps. Rather than developing increasingly complex optimizers, the authors of this paper propose fixing the Transformer architecture itself to ensure well-behaved, concentrated gradients.

The Deeply Normalized Transformer (DNT)

The authors introduce the Deeply Normalized Transformer (DNT), an architecture derived from a mathematical analysis of the Jacobian matrix. By strategically placing normalization layers, DNT bounds the singular values of the Jacobian, preventing gradient explosion or vanishing.

Key architectural components include:

  • InputNorm: Applied immediately after initial embeddings to prevent gradient vanishing in subsequent layers.
  • PreNorm: Placed before self-attention and feed-forward blocks for input stability.
  • MidNorm: A critical addition positioned after attention/feed-forward blocks but before the residual connection, preventing weight matrices from blowing up gradient magnitudes.
  • QKNorm (Query-Key Normalization): Normalizes queries and keys to stabilize gradients as weight singular values grow during training.
  • Removal of PostNorm: The authors mathematically demonstrate that PostNorm (normalization after residual blocks) causes gradient vanishing and is therefore omitted.

Gradient Stabilization

The primary goal of DNT is to transform the gradient distribution. In standard ViT architectures, gradients are heavy-tailed, meaning they are spread across a wide range of values. In contrast, the DNT architecture produces gradients that are highly concentrated near zero, making them much easier for a simple optimizer to handle.

Comparison of gradient density distributions between standard ViT and the proposed V-DNT across different weight matrices.

As shown in the figure above, the orange curves (V-DNT) are significantly more peaked than the blue curves (standard ViT). This concentration allows Momentum SGD to effectively navigate the loss landscape without the need for the per-parameter scaling provided by AdamW.

Experimental Results

The DNT architecture was evaluated across vision and language tasks, demonstrating that mSGDW can indeed compete with AdamW when the architecture is properly normalized.

Performance Benchmarks

  • Vision (ImageNet): A 307M parameter V-DNT trained with mSGDW achieved 81.5% accuracy, nearly matching the 81.7% of a standard ViT trained with AdamW. Crucially, a standard ViT trained with mSGDW only reached 78.2%, highlighting the necessity of the DNT modifications.
  • Language (OpenWebText): A 124M parameter L-DNT trained with mSGDW achieved a validation loss of 2.849, slightly outperforming a standard GPT-2 baseline trained with AdamW (2.867).

Memory Efficiency

The shift from AdamW to mSGDW yields substantial memory savings. For a 1.4 billion parameter model, the mSGDW optimizer state requires only 5.7 GB of memory, compared to 11.5 GB for AdamW. This reduction is vital for training large-scale models on hardware with limited VRAM.

Conclusion

The Deeply Normalized Transformer demonstrates that the "need" for adaptive optimizers in Transformer training is an architectural artifact rather than a fundamental requirement. By carefully managing gradient flow through strategic normalization, DNT enables the use of memory-efficient Momentum SGD. This work suggests that future improvements in model efficiency may come as much from architectural stabilization as from optimizer innovation.

Summary updated

BibTeX
@inproceedings{qi2026dnt,
  author = {Xianbiao Qi and Marco Chen and Wenjie Xiao and Jiaquan Ye and Yelin He and Chun-Guang Li and Zhouchen Lin},
  title = {{DNT: a Deeply Normalized Transformer that can be trained by Momentum SGD}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=62pn18XmAg},
}
Figure