An exploding gradient appears when gradient magnitudes become excessively large, causing loss to explode or trend toward NaN and making training unstable. Treat it as a signal to inspect both optimization settings and implementation or preprocessing errors. section 9.1.3
Use this troubleshooting sequence when the loss suddenly rises or becomes NaN:
- Check feature–target correlation, sample–label ordering, and possible NaNs in the data. section 9.1.3
- Lower the learning rate to reduce unstable movement through parameter space. section 9.1.3
- Try gradient clipping or different weight-initialization techniques when the gradient itself has exploded. section 9.1.3
- Test a single batch or 10–100 samples, overfit them, and add model complexity only after a simpler baseline works. section 9.1.3
Figure 9.4 A model was converging until something went wrong.
Use the loss-curve figure to recognize training that converges before something goes wrong. section 9.1.3




