Where the n comes from: a matrix product of random numbers

Every entry below is a random variable, drawn as its density with one sample marked on it. A layer multiplies an m×n weight matrix by an n-vector, so each output adds up n random products, and variances add. On the way back, the upstream gradient is a row vector that multiplies W from the left, so each input's gradient adds up m of them instead. Run both, and try to get both results to unit variance.

A weight matrix W with the upstream gradient row vector to its left, the input column vector x to its right, and every entry drawn as a small probability density with its sampled value. Forward, x deals its entries onto the columns, each cell becomes a product, and the rows slide right into h. Backward, the gradient row deals its entries beside the rows, each cell becomes a product, and the columns slide down into the gradient with respect to x. Each result is marked with a check when its standard deviation is 1.
n inputs 6 m outputs 3 weight std σw 1.00

Stacking square layers: the factor compounds, forward and backward

Layers only stack when each layer's output can feed the next one's input, so the layer has to be square: set n = m above to unlock the stacked view.
Four panels. Top: one layer's input and output histograms, and activation variance through eight stacked tanh layers on a log scale. Bottom: gradient variance backpropagated through the same eight layers, and one layer's upstream gradient and input-gradient histograms.
the square layer above, n = m, stacked eight deep, with the σw and weight distribution set above
Activations are green and gradients red, as in the figure. Top row, forward, left to right: the layer above, fed x ~ N(0, 1), as many draws of one h against x (gray); then the activation variance through eight stacked square tanh layers of width n, each with fresh weights at the σw set above. Bottom row, backward, right to left: the layer above again, now turning an upstream gradient ~ N(0, 1) (gray) into ∂L/∂x, which sums m terms; then, leftward, the gradient variance as an N(0, 1) gradient arriving at layer 8 is backpropagated through the same stack, multiplied at every layer by tanh′ and WT. The dashed lines are the linear predictions, which ignore tanh. Drag σw above and everything follows: the factor per square layer is n·σw² in both directions, so it compounds to vanishing below 1/√n and to blowing up above it. The backward bars also pay tanh′ ≤ 1 at every layer, which is why they fall faster than the dashed line even at a factor of 1: that is saturation starving the gradient, the paper's main worry. The standard preset is the paper's standard init, uniform with half-width 1/√n, so σw = 1/√(3n) and the factor is 1/3 per layer; had 1/√n been the standard deviation instead (as LeCun et al. recommended in 1998), the factor would be 1 (see standard vs. normalized init). Even at a factor of 1 the bars fall below the dashed line, steeply at first and then slowly: tanh flattens values beyond about ±0.5, so Var(tanh h) < Var(h), and a unit-variance input keeps only about 40% of its variance through the first tanh; and when the factor is above 1, tanh caps the bars near 1 while the prediction keeps climbing, which is saturation. The variance page has the rules behind all of this, and forward vs. backward has Glorot's compromise between 1/n and 1/m.
Weights are either Gaussian, w ~ N(0, σw²), or uniform as Glorot & Bengio drew them, on [−a, a] with a = √3·σw so the variance is the same (see why a²/3); the inputs x and the upstream gradients ∂L/∂h are N(0, 1). Every cell uses the same horizontal scale, −4 to 4, so a wider curve means a bigger variance; each curve is drawn as a fine histogram would show it, scaled to its own peak. Products are not normal: w·x has variance σw²·1 either way, but a sharp peak at 0. With Gaussian w its density is K0(|z|/σw)/(πσw), a Bessel function with exponential tails; with uniform w it is E1(z²/2a²)/(2a√(2π)), an exponential integral whose tails fall off like a Gaussian's, since |w| ≤ a. Both are drawn exactly. Sums become normal: adding several independent products gives a curve close to a Gaussian (the central limit theorem), with variance the sum of theirs. Forward, hi = Σj wijxj adds n products. Backward, the chain rule gives ∂L/∂xj = Σi ∂L/∂hiwij: the row vector ∂L/∂h times column j of W (the same thing as WT∂L/∂h, written as a column), so it adds m products. A result gets a green ✓ when its standard deviation is within 3% of 1. With both run, the presets show the dilemma: 1/√n checks h, 1/√m checks ∂L/∂x, and unless n = m nothing checks both; Glorot's 2/(n+m) leaves one a little bigger and the other a little smaller. The dashed curve on each result is N(0, 1), the spread that went in.