Mid-level interview questionAsked at Luma AI · interview write-up
Debug a notebook that trains an MNIST denoiser so training loss falls steadily and evaluation loss tracks it, starting with a train-test distribution mismatch.
Model answer
Start with the data, since a distribution mismatch splits the curves whatever the model does. Check train and test share normalisation, scale and noise level. Then the loop: the loss compares the output with the clean target, not the noisy input; zero_grad, backward and step run in order; train and eval modes are set. Overfit one batch first: if loss won't fall there, the bug is in the code.
Practise the rest
35 Training questions, 492 in all, each with a model answer. Free.
More from Luma AI interview questions.
More Training interview questions
- Implement masked cross-entropy in NumPy that stays numerically stable, with label smoothing and a temperature.
- Build a pipeline that finds math documents in web crawls and scores their quality.
- Explain KL divergence for language models: which direction is which, what happens when supports don't match, and how it's used as a regulariser.
- When would you use mean squared error versus cross-entropy? And what is LoRA?
- Explain Adam and its bias correction, and why AdamW decouples weight decay.
- Explain policy types in RL and modern policy-gradient methods such as TRPO, PPO and GAE, then compare linear attention and grouped-query attention.