---
title: You're given a training notebook where the code runs without errors but the loss barely moves. Describe, step by step…
url: https://gurkanozkan.ai/learn/questions/research-model-that-doesnt-learn-047/
markdown: https://gurkanozkan.ai/learn/questions/research-model-that-doesnt-learn-047.md
kind: question
role: Research
stage: Technical
difficulty: Medium
json: https://gurkanozkan.ai/api/learn/questions/research-model-that-doesnt-learn-047.json
robots: noindex
---

# 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.

Research · Technical · Medium

Theme reported publicly: [Google DeepMind](https://www.sundeepteki.org/advice/the-ultimate-ai-research-scientist-interview-guide-cracking-anthropic-openai-google-deepmind-top-ai-labs-in-2026), [OpenAI](https://www.aced.io/guides/openai-research-engineer-interview)

## 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.

*Corrected by an independent AI reviewer.*

## 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.

## Topic guides

- [Debugging ML and LLM systems](https://gurkanozkan.ai/learn/topics/debugging.md)
- [Deep learning fundamentals](https://gurkanozkan.ai/learn/topics/deep-learning.md)
---

*Study material compiled with AI: drafted by a local model (Inkling 2 Mini) from public sources, then checked against those sources by independent AI reviewers (Claude) in November 2026. Not reviewed line by line by a person.*
