Exploding gradient
An exploding gradient is a training instability in which gradient magnitudes grow excessively, causing unstable parameter updates or numerical and convergence failures.
Transformers in Action
The exploding gradient problem is a training failure in which gradients become excessively large, causing unstable parameter updates and potentially preventing convergence.
- How it is used
- Motivates attention-based architectures by contrasting their sequence connections with recurrent gradient instability.
- How deep it goes
- Explains recurrent gradient growth, clipping, and attention-score scaling, but does not implement gradient clipping.
- Examples
- Illustrates recurrent training on repetitive text or extreme numeric sequences and scaled attention with key vectors of 512 dimensions.
- What you can do after
- Evaluate and understand how gradient clipping and attention-score scaling address sources of training instability.
Read how Transformers in Action explains exploding gradient →
LLMs in Production
An exploding gradient is a training condition in which propagated derivatives grow excessively large and destabilize optimization.
- How it is used
- Explains why sequence processing makes deep recurrent neural networks difficult to train and motivates LSTM architectures.
- How deep it goes
- Defines the failure mode and demonstrates its sequence-length consequence, but does not detail derivative calculations or direct stabilization procedures.
- Examples
- Uses paired sentiment sentences and PyTorch RNN/LSTM implementations trained on Twitter sentiment data.
- What you can do after
- Understand how exploding gradients destabilize recurrent training and why LSTM memory cells and gates provide an alternative.
Inside Deep Learning: Math, Algorithms, Models
A training instability where gradient magnitude becomes very large, leading to excessively large parameter updates.
- How it is used
- Motivates clipping as a way to limit oversized updates that disrupt neural-network training.
- How deep it goes
- Defines exploding gradients by their norm, then explains elementwise clipping and demonstrates a PyTorch hook.
- Examples
- Uses a threshold-5 gradient vector example, a PyTorch clamp hook, and contour plots of gradient-descent paths.
- What you can do after
- Apply gradient clipping in PyTorch by registering parameter hooks that clamp gradients to a chosen bound.
Read how Inside Deep Learning: Math, Algorithms, Models explains exploding gradient →
Evolutionary Deep Learning: Genetic algorithms and neural networks
An exploding gradient is a neural-network training failure in which backpropagated gradient values become extremely large across successive layers.
- How it is used
- Diagnoses unstable backpropagation in deeper or more complex neural networks.
- How deep it goes
- Explains signal magnification across layers and normalization-based mitigation, but stops short of detailed optimization algorithms.
- Examples
- Uses a deep-network problem figure and a convolutional feature-map calculation to illustrate gradient instability and normalization.
- What you can do after
- Diagnose gradient instability and evaluate normalization or dropout as practical architectural responses.
Machine Learning System Design
An exploding gradient is a training condition in which gradient magnitudes become excessively large and destabilize optimization.
- How it is used
- Diagnoses unstable training from loss curves and guides practical checks before deployment.
- How deep it goes
- Identifies symptoms and provides stabilization checks, but stops short of mathematical derivation or algorithmic detail.
- Examples
- Uses oscillating, exploding, or NaN-valued loss curves and small-batch overfitting as debugging artifacts.
- What you can do after
- Diagnose unstable training and apply learning-rate, clipping, initialization, data, and model-complexity checks.
Read how Machine Learning System Design explains exploding gradient →
Related concepts
- gradient clippingaddressed by · Gradient clipping is an optimization technique that limits gradient values or their norm before parameter updates to reduce excessively large or unstable updates.
- clippingaddressed by · Clipping is an operation that restricts a value, signal, sequence, or rendered region to specified bounds by limiting or removing portions outside them.
- normalizationaddressed by · Normalization is the process of transforming a value, representation, or data structure to satisfy a specified standard, scale, or structural constraint.
- weight initializationaddressed by · Weight initialization is the process of assigning starting values to a model’s trainable parameters before training or optimization.
- batch normalizationaddressed by · Batch normalization is a neural-network operation that normalizes activations using statistics computed across a batch.
- recurrent neural networkproduced by · A recurrent neural network is a neural network that processes ordered inputs by carrying and updating an internal state, allowing information from earlier inputs to influence later computations.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.




