Gradient clipping
Gradient clipping is an optimization technique that limits gradient values or their norm before parameter updates to reduce excessively large or unstable updates.
Inside Deep Learning: Math, Algorithms, Models
A training stabilization method that caps gradient values to a chosen threshold to prevent excessively large updates.
- How it is used
- Stabilizes neural-network training when exploding gradients cause unreasonable updates or prevent convergence.
- How deep it goes
- Defines elementwise thresholding and demonstrates PyTorch hooks and clamp, but does not develop alternative clipping algorithms.
- Examples
- Uses a vector threshold example, parameter hooks, FashionMNIST comparisons, and an autoregressive character GRU.
- What you can do after
- Apply it via PyTorch parameter hooks and torch.clamp, then compare training results empirically.
Read how Inside Deep Learning: Math, Algorithms, Models explains gradient clipping →
Machine Learning System Design
Gradient clipping is a training technique that bounds gradient values or their norm before parameter updates.
- How it is used
- Uses gradient clipping to stabilize training when loss explodes or trends toward NaN.
- How deep it goes
- Defines clipping as an exploding-gradient remedy but stops short of implementation details or parameter choices.
- Examples
- Uses exploding or NaN loss as the diagnostic case, alongside oscillation and small-batch overfitting checks.
- What you can do after
- Diagnose/debug with it by recognizing exploding-gradient symptoms and comparing clipping with learning-rate or initialization changes.
Read how Machine Learning System Design explains gradient clipping →
Related concepts
- exploding gradientaddresses · An exploding gradient is a training instability in which gradient magnitudes grow excessively, causing unstable parameter updates or numerical and convergence failures.
- quantization-aware trainingused by · Quantization-aware training optimizes a model while simulating or incorporating reduced-precision effects so it adapts to quantized representations.
- trainingused by · Training is a process of developing or improving a person’s or model’s capabilities through instruction, experience, or adjustment using data.
- gradientaddresses · A gradient is the vector of partial derivatives of a scalar function with respect to its variables, indicating its local rate and direction of change.
- thresholduses · A threshold is a boundary value against which a quantity is compared to determine whether a condition is met or an action or decision is triggered.
- clippinguses · Clipping is the operation of restricting a value, signal, or content to specified bounds or a region, typically by replacing or removing what lies outside them.
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.

