Introduction
The most dramatic training failure is a loss that suddenly becomes nan ("not a number") or inf. Once a single nan appears, it spreads: every weight it touches becomes nan on the next update, and the whole run is ruined. A milder cousin is the loss spike: the loss jumps up sharply, then slowly recovers, wasting training time and sometimes leaving the model worse.
Think of a smoke alarm in a kitchen. The alarm (the nan) tells you something went wrong, but the fire started a little earlier and somewhere specific: a pan left on high heat, a towel too close to the stove. Debugging divergence means finding where and when the numbers first went bad, not just noticing that they did.