Xavier initialization is a weight initialization method that draws each layer's weights from a distribution with mean 0 and variance ( is the number of inputs connected to one output, and the number of outputs one input connects to). This keeps the variance of both the activations flowing forward and the gradients flowing back in backpropagation from changing much as layers are stacked. It was proposed in 2010 by Xavier Glorot and Yoshua Bengio (AISTATS 2010). The paper calls it "normalized initialization", and after the first author it is known as Xavier initialization or Glorot initialization.
At the time, it was known that deep networks did not train well from random initial values with gradient descent alone. A commonly used initialization drew weights from the uniform distribution . Its variance is , so the variance shrinks by about 1/3 at each layer, and after 10 layers it falls to times (vanishing gradients). Xavier initialization brought this "per-layer factor" close to 1, so that signals and gradients reach their destinations even in deep networks.
The left side of the figure at the top shows how the variance changes as layers of equal width are stacked. The right side compares the forward and backward factors for a layer whose output is half as wide as its input. Matching only the forward pass or only the backward pass leaves the other off by 1/2 or 2 times, but Xavier initialization takes the middle ground.

![On the left, a graph of the variance when 10 layers of equal width are stacked (log-scale vertical axis): Xavier initialization stays at 1×, while the earlier uniform distribution U[−1/√n, 1/√n] shrinks by 1/3 per layer to about 1.7×10^−5 at layer 10. On the right, a bar chart of the per-layer factor for a layer whose output is half as wide as its input: matching fan_in gives 1 forward and 1/2 backward, Xavier gives 4/3 and 2/3, and matching fan_out gives 2 and 1](/note/images/articles/weight-initialization/xavier-init.en.png)