What is mini-batch gradient descent?

Quick Overview

Asks you to explain mini-batch gradient descent: its update rule, its training loop and how it compares with full-batch gradient descent and single-example SGD. Tests understanding of gradient noise, memory and hardware trade-offs, and how batch size interacts with the learning rate.

What is mini-batch gradient descent?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: easy

Interview Round: Other

What is mini-batch gradient descent? It is usually discussed alongside full-batch gradient descent and single-example stochastic gradient descent, so place it relative to both. ```hint Cost and noise per step Compare what one parameter update costs, and how noisy its gradient is, when you compute it from 1 example, from B examples, or from all N. ``` ### What a Strong Answer Covers - The update rule: an averaged gradient over a random batch, and how many updates one epoch gives - The training loop, including reshuffling every epoch - Trade-offs against full-batch GD and single-example SGD in compute, memory, gradient noise and hardware use - How batch size interacts with the learning rate and with optimizers such as momentum or Adam ### Follow-up Questions - If you multiply the batch size by 4, how should the learning rate change, and why? - Why can very large batches generalize worse than smaller ones trained for the same number of epochs? - What goes wrong if the training data is sorted by label and you skip shuffling? - How would you train with an effective batch of 1,024 examples on a GPU that only fits 128 at a time?

Overview: Asks you to explain mini-batch gradient descent: its update rule, its training loop and how it compares with full-batch gradient descent and single-example SGD. Tests understanding of gradient noise, memory and hardware trade-offs, and how batch size interacts with the learning rate.

General logo
General
Nov 24, 2026
easyMachine Learning EngineerOtherMachine Learning
0
0

What is mini-batch gradient descent?

It is usually discussed alongside full-batch gradient descent and single-example stochastic gradient descent, so place it relative to both.

What a Strong Answer Covers Guidance

  • The update rule: an averaged gradient over a random batch, and how many updates one epoch gives
  • The training loop, including reshuffling every epoch
  • Trade-offs against full-batch GD and single-example SGD in compute, memory, gradient noise and hardware use
  • How batch size interacts with the learning rate and with optimizers such as momentum or Adam

Follow-up Questions Guidance

  • If you multiply the batch size by 4, how should the learning rate change, and why?
  • Why can very large batches generalize worse than smaller ones trained for the same number of epochs?
  • What goes wrong if the training data is sorted by label and you skip shuffling?
  • How would you train with an effective batch of 1,024 examples on a GPU that only fits 128 at a time?