Layer Normalization and RMSNorm in Large Language Models: How Pre-LN, Scaling Invariance, and QK-Norm Stabilize Deep Transformers
Training deep autoregressive Transformers requires maintaining numerical stability across dozens or hundreds of stacked attention and feed-forward blocks. As models scale from 7 billion to hundreds of billions of parameters, uncontrolled variance growth along the residual stream or unbounded attention logits can trigger catastrophic loss spikes, gradient underflow, or numerical divergence. Normalization layers act as the primary stabilizing mechanism in modern Large Language Models (LLMs). Whil









