TL;DR
Modern large language models suffer from a "Curse of Depth" where nearly half of their deeper layers barely contribute to the model's representation power. This paper identifies Pre-Layer Normalization (Pre-LN) as the root cause and introduces LayerNorm Scaling (LNS), a simple, hyperparameter-free fix that scales down layer variance to unlock the full potential of deep layers, significantly boosting performance across scales up to 7B parameters.
What Problem Does This Paper Address?
Large Language Models (LLMs) are incredibly expensive to train, yet recent studies show that many of their deeper layers are highly redundant. In fact, you can often prune away the top 20-30% of layers from a pre-trained model with almost zero impact on performance. The authors formalize this inefficiency as the Curse of Depth (CoD).
Why does this happen? The paper proves mathematically and empirically that the culprit is Pre-Layer Normalization (Pre-LN). While Pre-LN is essential for stabilizing early training, it causes the output variance of the residual blocks to grow exponentially with network depth. As a result, the mathematical gradients through deep layers force them to behave like simple identity matrices ($I$), meaning they pass data along without transforming it or adding any new representational value.
Methods
To break this curse, the authors propose LayerNorm Scaling (LNS). Instead of letting the variance explode, LNS dynamically scales the output of each Layer Normalization block inversely by the square root of its layer index ($\ell$):
$$h^{(\ell)} = \text{LayerNorm}(h^{(\ell)}) \times \frac{1}{\sqrt{\ell}}$$
This simple tweak tames the exponential variance growth into a manageable polynomial growth rate. Crucially, LNS is completely hyperparameter-free, adds zero extra parameters, and requires no complex tuning, making it an easy drop-in replacement for standard Pre-LN in existing Transformer codebases.
Datasets
The authors validated their approach across several configurations:
- Pre-training: Evaluated using the C4 dataset and the OLMo repository framework on a 20-billion token budget, as well as Qwen2.5-0.5B trained on 6 billion tokens.
- Downstream Tasks / Fine-tuning: Evaluated via Supervised Fine-Tuning (SFT) on the Commonsense170K dataset and tested across eight standard benchmarks including MMLU, BoolQ, ARC-e, PIQA, Hellaswag, OBQA, and Winogrande.
- Vision: ImageNet-1K was used to test the generalizability of LNS on Vision Transformers (ViT-S).
Key Insights and Ideas
- The Identity Map Collapse: In standard Pre-LN models, the angular distance between subsequent deep layers drops close to zero. The layers are literally doing nothing new. LNS restores a healthy angular distance, meaning deep layers continue to transform features meaningfully.
- Variance is the Dial: Controlling variance growth directly controls layer expressivity. By changing the variance growth rate from exponential to sub-linear, deep layers are forced to actually learn distinct features rather than coasting as identity maps.
- Pruning Sensitivity as a Success Metric: After applying LNS, pruning deep layers suddenly causes a massive drop in performance. This counterintuitive result is actually a major victory: it proves that the deep layers are finally contributing critical, non-redundant information to the network.
Key Results
- Substantial Loss Reductions: On a 7B parameter model (OLMo), LNS reduced the final language modeling loss from 2.69 to 2.50. This performance gain is so substantial that an LNS model can achieve the same loss as a baseline model while using up to 66% fewer parameters.
- Consistent Perplexity Gains: Across LLaMA architectures ranging from 130M to 1B parameters, LNS consistently achieved the lowest perplexity compared to Post-LN, DeepNorm, Mix-LN, and standard Pre-LN. For instance, it reduced LLaMA-1B perplexity from 17.02 (Pre-LN) to 15.71.
- Downstream Boost: The improvements seamlessly transferred to downstream tasks after fine-tuning, yielding an average performance boost of 1.86% over the best baseline for the LLaMA-1B model.
Limitations and Future Work
- Architectural Scope: The study focuses primarily on standard Transformer-based LLMs using Pre-LN. It does not explore how LNS interacts with Mixture-of-Experts (MoE), state-space models (like Mamba), or alternative normalization-free architectures.
- Task Coverage: Evaluation was mostly limited to general-purpose benchmarks like MMLU. The dynamics of deep layers under LNS for long-context reasoning or highly domain-specific tasks remain an open question.
- Fine-grained Representation: While LNS improves feature diversity (angular distance), the exact nature of what these newly activated deep layers are learning (e.g., factual knowledge vs. syntactic structures) is not yet fully analyzed.
Summary updated