Weight Initialization and Variance Dynamics in Deep Neural Networks and Large Language Models
Yankun Han
TL;DR
The paper addresses how weight initialization affects signal propagation and gradient flow in deep networks and large language models. It develops a theory of forward and backward variance propagation for rectifiers (ReLU/GELU) and examines its implications for GPT-2–style transformers, complemented by a logarithmic sweep to identify a practical stability band, $\sigma \in [10^{-2}, 10^{-1}]$. Empirically, it shows that Kaiming (fan-in) initialization yields faster, more stable convergence than Xavier under ReLU, and that in a from-scratch 12-layer GPT-2–style model, layerwise weight variance exhibits depth-dependent equilibration: shallow layers adapt quickly while deeper layers evolve more gradually, converging to narrow variance bands. The practical takeaway is simple: use Kaiming initialization for rectifiers, initialize transformer projections with small std (about $0.02$), monitor per-layer variance and gradient norms, and apply residual scaling or warmup adjustments to maintain healthy variance flow across depth.
Abstract
Weight initialization governs signal propagation and gradient flow at the start of training. This paper offers a theory-grounded and empirically validated study across two regimes: compact ReLU multilayer perceptrons and GPT-2-style transformers. First, a logarithmic sweep of the initial standard deviation maps vanishing and exploding regimes and identifies a broad stability band with standard deviations between 1e-2 and 1e-1. Second, a controlled comparison shows that Kaiming (fan-in) initialization converges faster and more stably than Xavier under ReLU, consistent with variance-preserving theory. Third, in a from-scratch 12-layer GPT-2-style model, this paper tracks layerwise Q/K/V weight variance through pretraining and observe depth-dependent equilibration into narrow bands: shallow layers expand rapidly while deeper layers change more gradually. Together, these results connect classic initialization principles with modern transformer behavior and yield simple, practical recipes for robust training.
