Vanishing gradient problem
In machine learning, the vanishing gradient problem is the problem of greatly diverging gradient magnitudes between earlier and later layers encountered when training neural networks with backpropagation. In such methods, neural network weights are updated proportional to their partial derivative of the loss function. As the number of forward propagation steps in a network increases, for instance due to greater network depth, the gradients of earlier weights are calculated with increasingly many multiplications. These multiplications shrink the gradient magnitude. Consequently, the gradients of earlier weights will be exponentially smaller than the gradients of later weights. This difference in gradient magnitude might introduce instability in the training process, slow it, or halt it entirely. For instance, consider the hyperbolic tangent activation function. The gradients of this function are in range . The product of repeated multiplication with such gradients decreases exponentially. The inverse problem, when weight gradients at earlier layers get exponentially larger, is called the exploding gradient problem. Backpropagation allowed researchers to train supervised deep artificial neural networks from scratch, initially with little success.…
In machine learning, the vanishing gradient problem is the problem of greatly diverging gradient magnitudes between earlier and later layers encountered when training neural networks with backpropagation. In such methods, neural network weights are updated proportional to their partial derivative of the loss function. As the number of forward propagation steps in a network increases, for instance due to greater network depth, the gradients of earlier weights are calculated with increasingly many multiplications. These multiplications shrink the gradient magnitude. Consequently, the gradients of earlier weights will be exponentially smaller than the gradients of later weights. This difference in gradient magnitude might introduce instability in the training process, slow it, or halt it entirely. For instance, consider the hyperbolic tangent activation function. The gradients of this function are in range . The product of repeated multiplication with such gradients decreases exponentially. The inverse problem, when weight gradients at earlier layers get exponentially larger, is called the exploding gradient problem. Backpropagation allowed researchers to train supervised deep artificial neural networks from scratch, initially with little success. Hochreiter's diplom thesis of 1991 formally identified the reason for this failure in the "vanishing gradient problem", which not only affects many-layered feedforward networks, but also recurrent networks. The latter are trained by unfolding them into very deep feedforward networks, where a new layer is created for each time-step of an input sequence processed by the network (the combination of unfolding and backpropagation is termed backpropagation through time). (h_t, x_t) = F(h_{t-1}, u_t, \theta) Often, the output x_t is a function of as some The vanishing gradient problem already presents itself clearly when x_t = h_t , so we simplify our notation to the special case with: x_t = F(x_{t-1}, u_t, \theta) Now, take its differential: \begin{align} dx_t &= \nabla_\theta F(x_{t-1}, u_t, \theta) d\theta + \nabla_x F(x_{t-1}, u_t, \theta) dx_{t-1} \\ &= \nabla_\theta F(x_{t-1}, u_t, \theta) d\theta + \nabla_x F(x_{t-1}, u_t, \theta) \left[\nabla_\theta F(x_{t-2}, u_{t-1}, \theta) d\theta + \nabla_x F(x_{t-2}, u_{t-1}, \theta) dx_{t-2}\right] \\ & \;\; \vdots \\ &= \left[\nabla_\theta F(x_{t-1}, u_t, \theta) + \nabla_x F(x_{t-1}, u_t, \theta) \nabla_\theta F(x_{t-2}, u_{t-1}, \theta) + \cdots \right] d\theta \end{align} Training the network requires us to define a loss function to be minimized. Let it be L(x_T, u_1, \dots, u_T) , then minimizing it by gradient descent gives \Delta \theta = -\eta \cdot\left[ \nabla_x L(x_T)\left(\nabla_\theta F(x_{t-1}, u_t, \theta) + \nabla_x F(x_{t-1}, u_t, \theta) \nabla_\theta F(x_{t-2}, u_{t-1}, \theta) + \cdots \right) \right]^T where \eta is the learning rate. The vanishing/exploding gradient problem appears because there are repeated multiplications, of the form \nabla_x F(x_{t-1}, u_t, \theta) \nabla_x F(x_{t-2}, u_{t-1}, \theta)\nabla_x F(x_{t-3}, u_{t-2}, \theta) \cdots x_t = F(x_{t-1}, u_t, \theta) = W_\text{rec} \sigma(x_{t-1}) + W_\text{in} u_t + b where \theta = (W_\text{rec}, W_\text{in}) is the network parameter, \sigma is the sigmoid activation function , applied to each vector coordinate separately, and b is the bias vector. Then, \nabla_x F(x_{t-1}, u_t, \theta) = W_\text{rec} \operatorname{diag}(\sigma'(x_{t-1})) , and so \begin{align} & \nabla_x F(x_{t-1}, u_t, \theta) \nabla_x F(x_{t-2}, u_{t-1}, \theta) \cdots \nabla_x F(x_{t-k}, u_{t-k+1}, \theta) \\ & = W_\text{rec} \operatorname{diag}(\sigma'(x_{t-1})) W_\text{rec} \operatorname{diag}(\sigma'(x_{t-2})) \cdots W_\text{rec} \operatorname{diag}(\sigma'(x_{t-k})) \end{align} Since the operator norm of the above multiplication is bounded above by \left\|W_\text{rec}\right\|^k . So if the spectral radius of W_\text{rec} is \gamma , then at large k , the above multiplication has operator norm bounded above by \gamma^k \to 0 . This is the prototypical vanishing gradient problem. The effect of a vanishing gradient is that the network cannot learn long-range effects. Recall Equation ( ): \nabla_\theta L = \nabla_x L(x_T, u_1, \dots, u_T) \left[\nabla_\theta F(x_{t-1}, u_t, \theta) + \nabla_x F(x_{t-1}, u_t, \theta) \nabla_\theta F(x_{t-2}, u_{t-1}, \theta) + \cdots \right] The components of \nabla_\theta F(x, u, \theta) are just components of \sigma(x) and u , so if u_t, u_{t-1}, \dots are bounded, then \left\|\nabla _{\theta} F(x_{t-k-1},u_{t-k}, \theta)\right\| is also bounded by some M>0 , and so the terms in \nabla_\theta L decay as M\gamma^k . This means that, effectively, \nabla_\theta L is affected only by the first O(\gamma^{-1}) terms in the sum. If \gamma\geq 1 , the above analysis does not quite work. For the prototypical exploding gradient problem, the next model is clearer. x_{t+1} = (1-\varepsilon) x_t + \varepsilon \sigma(wx_t + b) + \varepsilon w' u_t At the small \varepsilon limit, the dynamics of the network becomes \frac{dx}{dt} = -x(t) + \sigma(wx(t)+b) + w' u(t) Consider first the autonomous case, with Set and vary b in [-3, -2] . As b decreases, the system has 1 stable point, then has 2 stable points and 1 unstable point, and finally has 1 stable point again. Explicitly, the stable points are Now consider \frac{\Delta x(T)}{\Delta x(0)} and \frac{\Delta x(T)}{\Delta b} , where T is large enough that the system has settled into one of the stable points. If (x(0), b) puts the system very close to an unstable point, then a tiny variation in x(0) or b would make x(T) move from one stable point to the other. This makes \frac{\Delta x(T)}{\Delta x(0)} and \frac{\Delta x(T)}{\Delta b} both very large, a case of the exploding gradient. If (x(0), b) puts the system far from an unstable point, then a small variation in x(0) would have no effect on x(T) , making \frac{\Delta x(T)}{\Delta x(0)}= 0 , a case of the vanishing gradient. Note that in this case, \frac{\Delta x(T)}{\Delta b}\approx \frac{\partial x(T)}{\partial b} = \left(\frac{1}{x(T)(1-x(T))}-5\right)^{-1} neither decays to zero nor blows up to infinity. Indeed, it's the only well-behaved gradient, which explains why early researches focused on learning or designing recurrent networks systems that could perform long-ranged computations (such as outputting the first input it sees at the very end of an episode) by shaping its stable attractors. For the general case, the intuition still holds ( Figures 3, 4, and 5). Continue using the above one-neuron network, fixing w = 5, x(0) = 0.5, u(t) = 0 , and consider a loss function defined by L(x(T)) = (0.855 - x(T))^2 . This produces a rather pathological loss landscape: as b approach -2.5 from above, the loss approaches zero, but as soon as b crosses -2.5 , the attractor basin changes, and loss jumps to 0.50. Consequently, attempting to train b by gradient descent would "hit a wall in the loss landscape", and cause exploding gradient. A slightly more complex situation is plotted in, Figures 6. ===Faster hardware=== Hardware advances have meant that from 1991 to 2015, computer power (especially as delivered by GPUs) has increased around a million-fold, making standard backpropagation feasible for networks several layers deeper than when the vanishing gradient problem was recognized. Schmidhuber notes that this "is basically what is winning many of the image recognition competitions now", but that it "does not really overcome the problem in a fundamental way" since the original models tackling the vanishing gradient problem by Hinton and others were trained in a Xeon processor, not GPUs.
References
No reference rows published for this article.
Cite this article
MLA
"Vanishing gradient problem." encyclopegia.org, 2026, https://encyclopegia.org/wiki/vanishing-gradient-problem. Accessed 24 November 2026.
Chicago
"Vanishing gradient problem." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/vanishing-gradient-problem.
APA
encyclopegia.org. (2026). Vanishing gradient problem. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/vanishing-gradient-problem
Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON