Debugging training runs
Overfit a single batch first, loss-curve pathology (NaNs, plateaus), learning-rate finding, gradient clipping. "My loss is not going down" is a live-interview staple.
The mental model
Debugging a training run is triage in an emergency room, not brain surgery. When "my loss isn't going down," you do not immediately reach for exotic architectures or hyperparameter sweeps — you run a fixed sequence of cheap diagnostic tests that localize the problem to a stage: is it the data, the model, the loss, or the optimization? Each test rules out a whole category. The person who fixes training fast is not smarter; they follow the protocol instead of guessing.
The single most powerful test — the one that opens every good answer — is overfit a single batch. Take one batch of a few examples, turn off all regularization, and train on it for a few hundred steps. A correct model must drive that loss to near zero, because it has enough capacity to memorize a handful of examples. If it cannot, the bug is upstream of any hyperparameter: the labels are wrong, the loss is wired incorrectly, the data and targets are misaligned, or gradients are not flowing. If it can overfit one batch but not generalize, the model and optimization are fine and the problem is data quantity, regularization, or distribution. This one test cleanly splits "the plumbing is broken" from "the plumbing works but the learning is hard" — and that split is the whole game.
The WHY behind the protocol: loss curves have shapes, and each pathology has a signature. A loss that is flat from step one is a plumbing problem. A loss that explodes to NaN is numerical (learning rate, no clipping, a log of zero). A loss that descends then plateaus is a learning-rate-schedule or capacity problem. A training loss that keeps falling while validation rises is overfitting. Reading the curve tells you which test to run next, so debugging is pattern recognition against a small catalogue of failure modes — which is exactly why "my loss is not going down" is a live-interview staple: it tests whether you have a protocol or just vibes.
- Deep dive
- Internal architecture
- Real-world use cases
- Best practices
- Common mistakes
- Performance
- Security
- Production troubleshooting
- Advantages & disadvantages
- Alternatives
- Interview expectations
- Interview questions
- Facts to remember
- Cheat sheet
- Quick revision