AI Logic

Glossary

Exploding Gradient Problem

Updated:

A graph of gradient magnitude. The horizontal axis is the number of layers traced back from the output layer (output layer on the left, input-layer side on the right), and the vertical axis is the gradient magnitude on a logarithmic scale. A gradient of 1 at the output layer is multiplied by 4 at each layer and grows toward the right, reaching about 10⁶ after 10 layers. The lightly shaded band at the top is the region where gradients are extremely large and updates take abnormal values, sometimes causing divergence. An arrow at the top shows the direction of backpropagation (left to right).

Explanation

Exploding gradients (gradient explosion) are one of the problems with optimization algorithms in deep learning. Specifically, the term refers to a phenomenon in which the gradients computed during backpropagation in a neural network become extremely large, causing the model's parameter updates to take abnormal values. As a result, training becomes unstable and may even diverge. Exploding gradients are especially pronounced in deep networks with many layers and when nonlinear activation functions are used. In gradient computation, the gradients of the layers are multiplied together in a chain and thus amplified, so the problem surfaces when the initial weights or the learning rate are not set appropriately. A related concept is the vanishing gradient problem, in which gradients instead become too small.

Use cases

The following methods are commonly used to counter exploding gradients. First, gradient clipping limits the magnitude of the gradient when it exceeds a threshold. Next, adaptive learning rates, provided by optimization methods such as Adam and RMSprop, adjust the learning rate automatically and dampen the growth of gradients. Improving the weight initialization method also makes gradients less likely to grow; specifically, Xavier initialization and He initialization are effective. Finally, introducing normalization methods such as batch normalization and layer normalization keeps gradients stable. Combining these methods is expected to stabilize the training of deep learning models.

FAQ

Q. What happens when gradients explode?
A.

Parameter updates become extremely large, and training can diverge, degrading the model's performance or preventing training from progressing at all.

Q. When is it likely to occur?
A.

It tends to occur in deep networks, when the learning rate is set too large, or when initialization is inappropriate.

Q. How can it be addressed?
A.

Gradient stability is maintained by using gradient clipping, adaptive learning rates (such as Adam), weight initialization (Xavier, He), batch normalization, and similar techniques.