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

TL;DR

The Deeply Normalized Transformer (DNT) redesigns the standard Transformer architecture with strategic normalization layers to eliminate the "heavy-tailed" gradient distributions that usually make AdamW a necessity. By stabilizing the gradient flow, DNT allows for training with vanilla Momentum SGD (mSGDW), achieving performance on par with AdamW while significantly reducing GPU memory overhead.

What Problem Does This Paper Address?

In the world of Deep Learning, Transformers are the undisputed champions, but they come with a catch: they are notoriously difficult to train using simple optimizers like Stochastic Gradient Descent (SGD). Instead, researchers almost exclusively use AdamW, an adaptive optimizer that tracks both first and second-order moments of gradients.

The reason for this reliance is the statistical nature of Transformer gradients. Standard architectures produce "heavy-tailed" gradient distributions, where a few entries have massive amplitudes while most are tiny. Simple SGD struggles to "keep step" with these disparate scales, leading to instability or poor convergence. AdamW solves this by normalizing updates based on their history, but this comes at a cost: AdamW requires significantly more GPU memory to store those extra optimizer states—a major bottleneck as models scale to billions of parameters.

Gradient distributions of various weight matrices in standard ViT (blue) versus V-DNT (orange).

Methods

The authors introduce DNT (Deeply Normalized Transformer). Rather than fixing the optimizer, they fix the architecture to ensure gradients are "well-concentrated" (small and uniform). They achieve this by meticulously placing four types of normalization (specifically RMSNorm) throughout the block:

  1. InputNorm: Applied immediately after word or patch embeddings to prevent the initial input scale from dominating the gradient flow.
  2. PreNorm: The standard practice of normalizing before self-attention or Feed-Forward Networks (FFN).
  3. MidNorm: A novel placement after the attention/FFN module but before the residual shortcut. This ensures that the magnitude of weight matrices doesn't blow up the Jacobian matrix (the "map" of how outputs change relative to inputs).
  4. QKNorm: Normalizing the Queries and Keys within the attention mechanism to prevent "rank collapse" or "entropy collapse" caused by the fast-growing singular values of the $W_q^\top W_k$ product.

The paper provides a rigorous mathematical analysis of the Jacobian matrices for each module, proving that these specific placements make the gradient updates independent of the sheer magnitude of weights and activations.

Datasets

The authors evaluated DNT across two primary domains:

  • Computer Vision: ImageNet-1K classification using the Vision Transformer (ViT) variant, V-DNT.
  • Natural Language Processing: The OpenWebText corpus for language modeling using the GPT variant, L-DNT.

They tested various scales, ranging from small 124M parameter models to "Huge" 1.4B parameter models.

Key Insights and Ideas

  • The Optimizer Problem is an Architecture Problem: The paper suggests that our reliance on complex adaptive optimizers like Adam is actually a symptom of architectural instability. If you "tame" the gradients through normalization, the need for adaptive learning rates diminishes.
  • Jacobian Modulation: The core "aha moment" is that normalization isn't just about keeping activations in check; it's about modulating the Jacobian of each layer. By ensuring the singular values of these matrices are stable, the authors ensure that backpropagation doesn't result in the extreme "heavy tails" that derail SGD.
  • Memory Efficiency: Because mSGDW doesn't need to store the second-order moments (the "variance" of the gradients), it is much leaner. For a 1.4B parameter model, switching from AdamW to mSGDW saves roughly 6GB of GPU memory, which could be the difference between fitting a model on a single chip or needing expensive multi-GPU setups.

Key Results

  • Performance Parity: On ImageNet, V-DNT-Large trained with mSGDW achieved 81.5% accuracy, nearly matching the 81.7% of a standard ViT trained with AdamW.
  • Outperforming Baselines: When a standard Transformer is forced to train with mSGDW, it performs poorly (e.g., 78.2% on ImageNet). DNT bridges this gap entirely.
  • Stability: In ablation studies, the authors found that QKNorm is the most critical component for stability. Without it, models often collapsed or "crashed" early in training when using high learning rates.
  • Scaling: The benefits held true as models scaled from 124M to 1.4B parameters, proving that DNT is a viable strategy for Large Language Models (LLMs).

Limitations and Future Work

While the results are promising, the authors acknowledge a few areas for further exploration:

  • Hyperparameter Sensitivity: Although DNT makes mSGDW viable, the authors noted they didn't perform a "fine-grained" search for the optimal SGD learning rates due to resource constraints.
  • PostNorm Risks: The paper explicitly avoids "PostNorm" (normalizing after the residual add) because it can lead to gradient vanishing if not handled with extreme care.
  • Broader Architectures: The study focused on ViT and GPT. It remains to be seen how these specific normalization strategies translate to more exotic architectures like MoE (Mixture of Experts) or Mamba.

In summary, DNT offers a path toward more memory-efficient training of massive models by returning to the simplicity of Momentum SGD, provided we are willing to be more "deeply normalized" in our architectural choices.

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