Parameter initialization: symmetry before scale
参数初始化
Trace matched and distinct hidden units, prove a zero stationary state and distinguish seeds from initialization rules.
initializationA starting point can hide the network’s width
A two-unit hidden layer has two places to learn features. If the units begin with the same incoming weights, biases and outgoing connections, they make identical predictions and receive identical gradient updates. Under an update rule that treats them equally, they can remain copies forever. The architecture has two units, but the computation behaves like one repeated feature.
Parameter initialization sets the state before the first learning update. Its jobs include avoiding such symmetry traps and setting a useful numerical scale. A random seed controls a draw; it does not decide whether the chosen distribution, scale or parameter ties are appropriate.
D2L, Sections 5.4.1.3–5.4.2 discusses symmetry and initialization. Glorot and Bengio,2010, Section 4.2.1 studies scale under a linearized model. Read multilayer perceptrons and gradient descent first.
Symmetry requires matching connections, not just inputs
Consider two sigmoid hidden units and one affine output, trained on the two points(−1,−1) and(1,1):
The seven parameters are w₁,w₂,b₁,b₂,v₁,v₂,c. L is the mean of half squared error over the two samples. The target is a signed real value; the final output is not a sigmoid probability. Hidden sigmoids simply supply smooth features.
For residual r(x)=f(x)−x, the relevant gradients are:
If both units’ triples(wⱼ,bⱼ,vⱼ) match, each corresponding gradient matches. Equal learning rates and equal optimizer states preserve that equality by induction over steps. The same reasoning holds for a common minibatch: randomly choosing examples does not by itself give the two identical units different gradients.
Matching only incoming weights is insufficient. If v₁ and v₂ differ, the first two gradient formulas can differ immediately. Our final printed counterexample checks that qualification rather than repeating the broader but incomplete claim that equal hidden weights always remain equal.
All zeros can be stationary in this specific model
With every parameter zero, h₁=h₂=1/2 and f=0. The hidden gradients contain vⱼ=0, while the two residuals cancel in the output-weight and output-bias gradients:
This is a proved stationary trajectory for the specified balanced data and loss. It is not a theorem that every zero-initialized model fails. Linear regression can start at zero, and a sigmoid network on other data can receive nonzero output gradients at zero. Biases can also start at zero while randomly initialized weights distinguish units.
Compare three starts under the same update rule
The complete Python 3.12 program uses full-batch gradient descent with rate 0.2 for 40 steps. It compares an all-zero start, two matching nonzero units and a deliberately different pair. These are deterministic teaching initializations, not random draws or a ranking of initialization distributions.
from math import exp, isfinite
def loss_gradient(parameters):
p=list(parameters)
if len(p)!=7 or any(type(v) not in (int,float) or not isfinite(v) or abs(v)>100 for v in p):
raise ValueError('seven finite parameters in [-100,100] required')
w=p[:2];b=p[2:4];v=p[4:6];c=p[6];gradient=[0.0]*7;loss=0.0
for x,y in [(-1,-1),(1,1)]:
hidden=[];slopes=[]
for j in range(2):
z=w[j]*x+b[j];e=exp(-abs(z))
hidden.append(1/(1+e) if z>=0 else e/(1+e));slopes.append(e/(1+e)**2)
residual=sum(vj*hj for vj,hj in zip(v,hidden))+c-y
loss+=residual**2/4
for j in range(2):
gradient[j]+=residual*v[j]*slopes[j]*x/2
gradient[2+j]+=residual*v[j]*slopes[j]/2
gradient[4+j]+=residual*hidden[j]/2
gradient[6]+=residual/2
return loss,gradient
def train(parameters, steps=40):
if type(steps) is not int or not 0<=steps<=40:raise ValueError('zero to 40 steps required')
p=list(parameters);history=[(p.copy(),loss_gradient(p)[0])]
for _ in range(steps):
_,gradient=loss_gradient(p)
p=[a-0.2*g for a,g in zip(p,gradient)]
history.append((p.copy(),loss_gradient(p)[0]))
return history
if __name__=='__main__':
starts={'zero':[0]*7,'matched':[0.2,0.2,0,0,0.1,0.1,0],
'different':[-0.5,0.5,0,0,-0.5,0.5,0]}
for name,p in starts.items():
path=train(p);final=path[-1][0]
print(name,'initial/final loss:',f'{path[0][1]:.9f}',f'{path[-1][1]:.9f}',
'hidden weights still equal:',final[0]==final[1])
_,g=loss_gradient([0.2,0.2,0,0,0.1,0.3,0])
print('same incoming, unequal outgoing: hidden-weight gradients:',*[f'{v:.9f}' for v in g[:2]])
Actual output:
zero initial/final loss: 0.500000000 0.500000000 hidden weights still equal: True
matched initial/final loss: 0.495082869 0.341158898 hidden weights still equal: True
different initial/final loss: 0.385038813 0.023285549 hidden weights still equal: False
same incoming, unequal outgoing: hidden-weight gradients: -0.024258268 -0.072774803
The zero case remains at loss 1/2. The matched units remain identical even though their parameters can move. The different start makes progress on this tiny task; its result alone does not show that every asymmetric start converges or that random initialization must outperform a structured one.
Tests check all seven derivatives by centered differences, the exact zero gradient, equality along the matched trajectory and the unequal-outgoing-weight counterexample. Each step processes two examples and two units, so this fixed experiment has constant work per step. For a general network, initialization costs at least writing its parameters; training cost is separate.
Seed, scale and structure answer different questions
A fixed seed helps reproduce a particular pseudorandom sequence in a specified runtime and call order. Reusing that seed separately for two same-shaped layers can accidentally generate identical arrays. Independent draws, independent streams and deliberate parameter sharing should be explicit choices; see randomness and seeds.
Too-small weights can shrink useful signals, while too-large weights can push activations into saturation or amplify derivatives. Fan-based rules address parts of that problem under statistical assumptions. They do not guarantee that every layer is well conditioned or that a finite realization has exactly the distribution’s advertised variance.
Parameter roles also differ. A pretrained model’s weights, normalization scales, residual branches, embeddings and output biases need not all use one generic random rule. The appropriate initialization depends on the architecture and training objective. This chapter’s symmetry demonstration does not prescribe values for those systems.
Which equality is preserved?
- Why do fully matched hidden units remain matched under the stated gradient update?
Answer 1: Their incoming, bias and outgoing gradients match, and the update rule treats them equally at every step.
- Are matching incoming weights alone sufficient if outgoing weights differ?
Answer 2: No. The hidden gradient contains the outgoing weight, so the gradients can already differ on the first step.
- Why is the all-zero seven-parameter state stationary on this dataset?
Answer 3: Zero outgoing weights block hidden gradients, and the balanced residuals cancel output-weight and output-bias gradients.
- Does a fixed random seed make an unsuitable initialization scale suitable?
Answer 4: No. It controls a reproducible draw under a specified process, not the statistical or architectural suitability of the distribution.
Break the symmetry, then inspect the scale
The sources motivate symmetry breaking and signal-scale analysis. Our data, complete gradient calculation, three trajectories and outgoing-weight counterexample are original. No source experiment is reproduced, and no successful 40-step run is treated as a convergence theorem.
Continue with Xavier initialization and He initialization for different moment assumptions. Then examine vanishing gradients to see why a per-layer scale calculation is only part of a network’s behavior.
Make a prediction, then check
Do equal incoming weights force equal hidden gradients when outgoing weights differ?
Learning objectives
- State the full conditions preserving hidden-unit symmetry.
- Separate seed, scale and architecture choices.
Prerequisites & connections
Explore related knowledge →References
- Numerical Stability and Initialization — Dive into Deep Learning 1.0.3
D2L authors · 2023 - Understanding the difficulty of training deep feedforward neural networks
Xavier Glorot; Yoshua Bengio · 2010
Version1 · Editorial status: Recorded technical checks completed
View technical check record (AI)
Codex · 2026-09-06 · Codex single-agent authored technical review: cited primary-source scope, explicit assumptions, original calculations and counterexamples, runnable tests and bilingual review; not independent human or second-agent review.
- Single-agent authored technical review: bounded primary-source locations, assumptions, original derivations, exact/literal references and matching bilingual equations/examples/exercises. Not independent human or second-agent review.
- Four focused CPython3.12.4 tests passed per chapter. Symmetry trajectories, exact sign-law moments, initializer sampling and directional Jacobian products are checked against literal references, analytic identities and finite differences. All four examples use the standard library.
- Promoted the full prose, equations, code and exercises. Tests read formal MDX only; removed temporary fallbacks/draft skips and updated review assertion to checked. Algorithm and independent references are unchanged; final record binds both locale hashes.
- Publication navigation points published topics to complete articles and removes corresponding pending wording, retaining directory entries for unwritten targets. Principles, equations, programs and exercises are unchanged; final article SHA values rebound.
Source locations checked:
- Numerical Stability and Initialization — Dive into Deep Learning 1.0.3 · Sections5.4.1.3–5.4.2 symmetry/initialization; outgoing-weight equality made explicit beyond informal hidden-weight claim.
- Understanding the difficulty of training deep feedforward neural networks · Section4.2.1 pp253–254 linearized initialization scale; no training experiment reproduced.
Related topics