Skip to content
RED SAGSkills
easyMachine Learning Engineer interview question

How does gradient descent work, and what is the role of the learning rate?

What the interviewer wants to hear

  • Minimises a loss function by moving parameters against the gradient
  • Learning rate sets the step size
  • Too high diverges, too low is slow
  • Mini-batch SGD and adaptive optimisers like Adam are common

Model answer

Gradient descent is a way to minimise a loss function. We compute the gradient of the loss with respect to each parameter, which points in the direction of steepest increase, and then move the parameters a small step in the opposite direction. We repeat this until the loss stops improving. The learning rate controls the size of each step. If it is too high, updates overshoot and the loss can oscillate or explode. If it is too low, training is very slow and can get stuck. In practice we use mini-batch stochastic gradient descent, computing gradients on small batches, which is faster and adds helpful noise. Optimisers like Adam adapt the step size per parameter, and schedules such as warmup followed by cosine decay often make training more stable.

Can you answer it under time pressure?

Take a timed easy round and get scored on every answer.

Start mock interview

More easy Machine Learning Engineer questions