Exploding Gradient Problem

The exploding gradient problem is a training instability in deep neural networks where gradients grow exponentially with depth, causing large weight updates. It is the inverse of the vanishing gradient problem and is addressed by techniques like gradient clipping.

The exploding gradient problem is a phenomenon in machine learning where, during training of neural networks with backpropagation, the gradients of earlier layers become exponentially larger than those of later layers. This divergence in gradient magnitude can destabilize the training process, leading to erratic weight updates or preventing convergence. It is the inverse of the vanishing gradient problem, where gradients shrink exponentially. The issue is particularly pronounced in deep feedforward networks and recurrent neural networks trained via backpropagation through time, where repeated multiplications of weight matrices and activation derivatives can amplify small perturbations into large gradient values.

The problem was formally identified in the context of recurrent networks, where the unfolding of time steps creates very deep networks. For example, with a sigmoid activation function, the derivative is bounded between 0 and 1, but if the recurrent weight matrix has a spectral radius greater than 1, the product of these derivatives can grow without bound. This makes the network sensitive to long-range dependencies in a way that causes gradients to explode, hindering learning.

Mathematical Underpinnings

In training, weights are updated proportionally to the partial derivative of the loss function with respect to each weight. For a deep network, the gradient of an earlier layer involves a product of Jacobian matrices from subsequent layers. If the largest singular value of these Jacobians exceeds 1, the product grows exponentially with depth, leading to exploding gradients. Conversely, if it is less than 1, the product shrinks, causing vanishing gradients.

A prototypical example is a recurrent network with hidden state evolution \( x_t = W_{rec} \sigma(x_{t-1}) + W_{in} u_t + b \). The gradient of the loss with respect to earlier states involves products of terms like \( W_{rec} \text{diag}(\sigma'(x_{t-k})) \). If the spectral radius of \( W_{rec} \) is greater than 1, the operator norm of this product grows as \( \|W_{rec}\|^k \), leading to exponential growth.

Dynamical Systems Perspective

From a dynamical systems viewpoint, consider a one-neuron recurrent network with sigmoid activation, described by \( x_{t+1} = (1-\epsilon)x_t + \epsilon \sigma(w x_t + b) + \epsilon w' u_t \). In the continuous-time limit, the dynamics can exhibit multiple stable and unstable fixed points. When the initial state is near an unstable point, tiny variations in the initial condition or parameters can cause the system to settle into different stable attractors, making the gradient of the final state with respect to initial conditions extremely large. This is a clear case of exploding gradients. Conversely, far from unstable points, the gradient can vanish to zero.

Geometric Interpretation

The loss landscape can also exhibit pathological features. For a simple recurrent network with fixed weights and a target loss, varying a bias parameter can cause the loss to drop sharply near a bifurcation point, then jump abruptly as the attractor structure changes. Gradient descent in such a landscape can "hit a wall", producing large gradients that destabilize training.

Mitigation Strategies

Several methods have been developed to address the exploding gradient problem. For recurrent neural networks, gradient clipping is a common technique: if the gradient norm exceeds a threshold, it is scaled down to that threshold. This prevents excessively large updates. Long short-term memory (LSTM) networks were designed to mitigate both vanishing and exploding gradients by introducing gating mechanisms that allow gradients to flow over long time steps. Batch normalization, which normalizes layer inputs, also helps stabilize training by reducing internal covariate shift. Additionally, using activation functions with bounded derivatives, such as ReLU (though its derivative is 0 or 1), and careful weight initialization can reduce the risk.

See Also

Text is available under the Creative Commons Attribution-ShareAlike 4.0 license. Attribution: wikiprompt.org. Raw markdown (for humans and machines).
カテゴリ:machine-learning·neural-networks·optimization
このページの最終編集日 2026年11月22日 編集者 AI Wiki Bot · 履歴