Weight initialization sets a layer’s starting scale before data or optimization can correct it. Which weight variance prevents repeated shrinking or growth through a simple ReLU chain?
Summary
Track the activation second moment , not just centered variance. For a layer with four inputs and zero bias, compare weight variances , , and . Under the assumptions below, their per-layer second-moment multipliers are , , and . Four layers therefore yield , , and from .
Learning objective
Separate ten-layer chain: uncompensated second-moment loss compounds
Reference drawing
Learning objective
Compensating for ReLU can preserve the second moment through depth
Derivation
Forward scaling counts four inputs; backward scaling counts eight outputs in the unequal-width example below.
The variance argument
Let with and zero bias. At initialization, weights are mutually independent, zero-mean, symmetric, and independent of the inputs. Each input coordinate has finite second moment . Write . Cross terms vanish because distinct weights have zero expected product:
This expectation averages the initialized weights as well as the input law. It is not an exact guarantee for every sampled matrix. For zero-mean inputs, equals input variance.
Symmetry of makes each half-line contribute half its second moment. Therefore
Setting preserves this expected second moment: the He/Kaiming fan-in rule. For , variance gives multiplier one. Variances and give multipliers and .
ReLU outputs need not be centered. If is equally likely to be or , its ReLU second moment is . Its mean is and its centered variance is only .
Change the activation
Leaky ReLU passes negative inputs with slope . Under symmetry, it retains of the preactivation second moment. The preserving rule becomes
At , the activation is linear and this becomes . At and fan-in four, it gives . Recompute the activation factor rather than treating GELU or sigmoid as exact ReLU cases.
Change the path structure
Adding a centered branch to stream requires covariance accounting:
Independent unit-variance stream and branch give variance two when . If , the same addition gives variance four, not two. For mutually uncorrelated unit-variance branches, scaling each by makes their total added variance one. Correlated residual branches require their covariance terms; a serial-chain rule alone cannot justify that scaling.
Change the direction
The linear backward map uses , so its analogous independent-gradient calculation counts terms. With unequal widths, one variance cannot preserve both linear directions exactly. Glorot’s compromise is . For fan-in four and fan-out eight, gives forward factor and backward factor . Real backpropagated gradients can depend on weights; this scale argument is an initialization approximation.
Reconstruct: can a rectangular orthogonal map preserve all forward and backward vector norms?
Answer
No, not in both unequal-dimensional spaces. Orthonormal columns give , preserving every forward input norm. Orthonormal rows give , preserving the reverse direction instead. The other direction generally preserves only the corresponding subspace.
Practical defaults
| Component | Starting point | Limit to check |
|---|---|---|
| ReLU linear or convolution | He scale in the intended fan direction | Correct connectivity and weight layout |
| Near-linear centered activation | Glorot scale | Sigmoid offsets and tanh saturation change propagation |
| GELU | Architecture-tested scale | Its second-moment factor depends on its input law |
| Embedding | Architecture-specific distribution | Vocabulary, width, scaling, and downstream normalization |
| Normalization affine parameters | Often scale one, shift zero | Residual designs sometimes choose another scale |
| Bias | Often zero | Recurrent gates and architectural offsets can justify nonzero values |
Do not infer a framework default from an initializer’s name. Check its version, arguments, fan convention, and resulting bounds.
Special cases
Residual output scaling is architecture-specific; it depends on branch count and covariance, not only network depth. Embedding scales such as are model conventions, not universal variance laws. Identity initialization for ReLU recurrent networks changes recurrent products but does not remove temporal state. Orthogonal recurrent weights preserve a linear multiplication’s norm; nonlinear derivatives can still shrink gradients. Rectangular matrices need the row/column distinction above.
Common pitfalls
- Balanced expected moments do not prove convergence or control every finite-width realization.
- Nonzero bias changes preactivation symmetry; random weights, not zero bias alone, break neuron symmetry.
- Normalization, optimizer state, residual correlations, and activation saturation lie outside the simple serial-chain calculation.
- A training run succeeding does not establish the assumed propagation law or an optimal scale.