What is an exploding gradient?

An exploding gradient is a sudden, very large rise in the gradient norm computed by backpropagation during training. In recurrent networks especially, contributions from distant time steps can grow exponentially until one update wrecks the parameters.

The vanishing gradient is the opposite: distant contributions shrink towards zero and links between events far apart in time go unlearnt. Both stem from long chains of multiplied matrices.

Topic
Machine learning, models and training
Also known as
Exploding gradient problem
Origin
1994 study; 2013 ICML study proposed gradient norm clipping

How an exploding gradient works

  1. Backpropagation multiplies matrices across layers or time steps.
  2. Such a product can shrink to zero or blow up; a recurrent matrix whose largest eigenvalue exceeds 1 is necessary for explosion.
  3. Steep walls form in the error surface; a gradient step hitting one can be thrown out of the valley.
  4. Rescaling gradients whose norm crosses a threshold limits the damage; normalised initialisation and normalisation layers also largely address it in deep networks.

In more detail

The necessary condition for explosion

In the analysis of a linear recurrent network, a largest eigenvalue of the recurrent weight matrix below 1 is sufficient for long term components to vanish, while a largest eigenvalue above 1 is necessary for gradients to explode. The same study generalised these results to nonlinear activation functions whose derivative is bounded.

Commonly confused terms

TermHow it differs
Gradient clippingAn exploding gradient is a problem that arises during training; gradient clipping is a remedy that rescales a gradient whose norm crosses a threshold while keeping its direction. Clipping does not remove the cause of the explosion; it limits the damage a single step can do.

Why an exploding gradient matters for on-premises AI

A 2013 study revisited this problem (first detailed in 1994) and proposed gradient norm clipping, finding that clipping solves an optimisation issue rather than acting as a regulariser. The threshold can be set from the average gradient norm over many updates, so long runs log the norm at every step.

ON-PREMISES EXAMPLE

A logistics company training a recurrent delivery time model on its own servers sees the loss jump at some steps. The team logs the gradient norm, finds the spikes cluster in long shipment histories, enables norm clipping and sets the threshold from earlier average norms.

Common questions

How is an exploding gradient spotted?

The clearest sign is a gradient norm that suddenly becomes very large while the loss jumps within a few steps. That is why the gradient norm is logged throughout training.

Does it only happen in recurrent networks?

No. It is most visible in recurrent networks but can also block convergence from the start in very deep networks. There, normalised initialisation and normalisation layers largely reduce the problem.

Sources

In the glossary: Glossary, E to L

What does this term mean for your infrastructure?

We can work out together in a technical assessment how it maps onto your data, hardware and security requirements.

Request a technical assessment →

This site sets no cookies. Visitor numbers are counted in aggregate using a cookieless method that does not identify anyone. See the Privacy Policy for details.