How does the batch size affect the variance of the gradient estimate?

Quick Overview

A gradient descent question about how the mini-batch size changes the variance of the stochastic gradient estimate. It tests the averaging argument, the finite-dataset correction, diminishing returns per unit of compute, and how batch size interacts with the learning rate.

How does the batch size affect the variance of the gradient estimate?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

How does the batch size affect the variance of the gradient estimate in mini-batch stochastic gradient descent? ```hint Write the estimator down Express the mini-batch gradient as an average of per-example gradients and ask what averaging does to variance. ``` ```hint Connect it to training Once you have the scaling, compare how compute and noise change when the batch size doubles, and what that suggests for the learning rate. ``` ### What a Strong Answer Covers - How the variance and the standard deviation of the gradient estimate scale with batch size, and the assumptions behind that scaling - The correction for sampling without replacement from a finite dataset - The diminishing return in noise reduction per unit of compute - How batch size interacts with the learning rate - The practical trade-off between small and large batches ### Follow-up Questions - What is the critical batch size, and how could you estimate it during training? - If you increase the batch size 8x, how would you change the learning rate for SGD, and would the same rule hold for Adam? - If examples within a batch are correlated, for example many rows from the same user, how does the variance scale? - Why can a model trained with very large batches generalize worse, and what can be done about it?

Overview: A gradient descent question about how the mini-batch size changes the variance of the stochastic gradient estimate. It tests the averaging argument, the finite-dataset correction, diminishing returns per unit of compute, and how batch size interacts with the learning rate.

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

How does the batch size affect the variance of the gradient estimate in mini-batch stochastic gradient descent?

What a Strong Answer Covers Guidance

  • How the variance and the standard deviation of the gradient estimate scale with batch size, and the assumptions behind that scaling
  • The correction for sampling without replacement from a finite dataset
  • The diminishing return in noise reduction per unit of compute
  • How batch size interacts with the learning rate
  • The practical trade-off between small and large batches

Follow-up Questions Guidance

  • What is the critical batch size, and how could you estimate it during training?
  • If you increase the batch size 8x, how would you change the learning rate for SGD, and would the same rule hold for Adam?
  • If examples within a batch are correlated, for example many rows from the same user, how does the variance scale?
  • Why can a model trained with very large batches generalize worse, and what can be done about it?