Machine Learning Engineer Interview Question

You double the batch size on a training run. What do you do to the learning rate, and why?

What the interviewer is probing, how to structure your answer, and a spoken example you can adapt.

Quick answer

Scale the learning rate up, roughly linearly with batch size for moderate increases, or by the square root under some analyses. A larger batch gives a lower variance gradient estimate, so you can afford a bigger step. In practice you also need warmup, since the linear rule breaks down early in training, and very large batches eventually stop improving generalization.

Why interviewers ask this

This is a quick check on whether you have actually trained models at scale or only run tutorials. The interviewer wants the reasoning about gradient variance rather than a memorized rule, plus awareness that linear scaling has limits and needs warmup. Candidates who say nothing changes reveal they have never watched a run diverge after moving to a bigger GPU.

How to structure your answer

  • State the linear scaling rule up front.
  • Justify it with gradient variance, not just convention.
  • Add warmup as the practical requirement.
  • Say where the rule breaks down and what you watch for.

Example answer

Spoken example, first person

Default is linear scaling: double the batch, double the learning rate. The logic is that the gradient you compute on a batch is an estimate of the true gradient, and its variance falls with batch size, so a bigger batch gives you a more trustworthy direction and you can take a proportionally bigger step in it. What people skip is warmup. Right at the start the weights are random and the loss surface is not friendly, so a large learning rate applied immediately after a batch size jump will blow the run up in the first few hundred steps. So I ramp linearly from near zero to the target over a warmup window, then decay. Beyond a certain batch size the rule stops paying, both because the gradient estimate is already low variance so you gain nothing, and because you take far fewer optimizer steps per epoch, which seems to hurt generalization. I have hit that ceiling around a few thousand samples per batch on the models I have worked on. So my routine after any batch size change is scale, warm up, then watch the loss curve for the first thousand steps rather than walking away.

Walking into this interview soon? GhostPilot listens to your live call, spots the question the moment it is asked, and puts a structured answer on your screen in real time. Try it on your next mock, or grab a $29 Session Pass, no subscription, for the real thing.

See how it works

Follow-up questions to expect

  • How long a warmup would you use, and what determines it?
  • What is gradient accumulation and when does it substitute for a bigger batch?
  • Why might a very large batch hurt final validation accuracy?

Related machine learning engineer questions

Your interviewer will ask their own version of this. Paste your actual job description into the free Question Predictor and get the 20 questions that role is most likely to ask, with what each one is really probing.

Predict my questions

Rehearse the hard questions before they are asked

Practise with a live copilot, then walk in ready. A $29 Session Pass gets you through the interview with no subscription and no lock-in.

Get GhostPilot