What are the typical reasons for exploding gradient?
Answer
Exploding gradients occur when gradients grow exponentially during backpropagation, producing huge weight updates that make training unstable: the loss oscillates, spikes, or diverges to NaN. The mechanism mirrors the vanishing problem: the gradient at an early layer is a chain-rule product of per-layer factors, and when those factors are consistently larger than 1 in magnitude (from poorly scaled weight initialization, deep unnormalized architectures, or activation regimes with derivatives above 1), the product blows up with depth. Recurrent networks are especially vulnerable because the same weight matrix is multiplied once per time step, so long sequences amplify the effect. A learning rate set too high then converts already-large gradients into catastrophic updates.
(1) Deep Chains of Large Factors: Products of weight matrices with spectral norm grow exponentially with depth (or RNN time steps).
(2) Bad Initialization: Weights initialized too large produce outsized activations and derivatives from the start.
(3) Compounding Learning Rate: A high learning rate turns large gradients into weight updates that overshoot and destabilize training.

Figure 1: Gradient norm flowing backward through a deep network: without control it grows geometrically layer by layer (note the log scale); gradient clipping caps the norm at a fixed threshold, keeping updates bounded regardless of depth.
Mathematical Formulation:
Where:
is the pre-activation of layer
;
and
are the per-layer weight and activation-derivative factors.
is the operator (spectral) norm of the weight matrix; when the typical product exceeds 1, the gradient norm grows geometrically with depth.
is the full gradient vector and
the clipping threshold: if
exceeds
, the gradient is rescaled down to norm
without changing its direction.
Leave a Reply