You’re given a training notebook where the code runs without errors but the loss barely moves. Describe, step by step, how you find the problem.
Theme reported publicly: Google DeepMind, OpenAI
Answer
Model answer, written in a candidate's voice
In short
- Inspect the data pipeline: visualise samples, verify label alignment, shuffling, splits and normalisation.
- Check the loss at initialisation and overfit one small batch to prove the model/loss can learn.
- Verify gradients flow: grad norms, stray detach/no_grad, zero_grad before backward, learning-rate scale.
- Check train/eval modes, tensor shapes, broadcasting and loss reduction.
- Compare against a known-good baseline and change one thing at a time.
In full
I’d start by proving the pipeline is sane: print or visualise a few batches, confirm each input is paired with the right label, check the split/shuffle and normalisation, and look at the loss at initialisation to see whether it is near the expected baseline (about ln K for K balanced classes) rather than accidentally tiny or huge. Then I’d overfit one small batch for a few hundred steps—if the loss won’t drop there, the bug is in the model, loss, or optimisation, not the data scale. Next I’d instrument gradients: log grad norms per layer, search for stray detach/no_grad/inference-mode, confirm zero_grad is called before backward and that the learning rate is scaled sensibly for the loss and parameter magnitudes. I’d also verify train/eval mode, tensor shapes and broadcasting, and that the loss reduction matches the metric I care about. Finally I’d compare against a known-good baseline and change only one thing at a time—data, model, loss, LR, or training loop—so I can attribute the fix.
What a strong answer covers
- Check the data pipeline: visualise samples, check label alignment and shuffling.
- Overfit one small batch; check the loss at initialisation.
- Confirm gradients flow: grad norms, stray
detach,zero_grad, learning-rate scale. - Check train/eval modes, shapes and broadcasting.
- Compare against a known-good baseline, changing one thing at a time.
Common mistakes
- Tuning hyperparameters before checking correctness.
- Making random edits without a hypothesis.