How does the mini-batch size affect the noise in stochastic gradient descent? What is the variance of a mini-batch gradient, and what is the “linear scaling rule” for the learning rate?
Linear algebra and optimisation, Stochastic optimisation
Level L4 Advanced. Length Medium. Nature Th+Mat Both.
What's being asked
Whether you can treat the mini-batch gradient as a random estimate, and reason about how batch size and learning rate trade off.
Key idea
With examples sampled independently, the mini-batch gradient has the right average, , and covariance , where is the covariance of a single example's gradient. Over steps the drift is while the accumulated noise covariance is . So, for the same distance travelled, the noise level is set by the ratio .
Steps
- Define the full gradient , where is the loss on example . Define the per-example covariance , taken over a randomly chosen example .
- Show it is unbiased: each sampled has mean , so their average does too. Find the variance: the average of independent terms has covariance . (Sampling without replacement multiplies this by .) So the standard deviation falls only as : four times the batch halves the noise.
- Write one step as “true gradient plus noise”: , where the noise term has covariance .
- Derive linear scaling. Compare steps with batch and rate against one step with batch and rate . If the gradient barely changes over steps, both move by about . Their noise covariances are and , which are equal. So when you multiply the batch size by , multiply by (Goyal et al., 2017), with a short warm-up at the start.
- State the limits. The rule breaks once passes the stability limit , or once the batch is larger than the “critical batch size”, beyond which curvature, not noise, limits progress. Larger batches use hardware better, while some of the noise from small batches may help generalisation.
Common mistakes
- Saying the variance falls as . It falls as , so the standard deviation falls as .
- Calling mini-batch gradients biased. With uniform sampling they are unbiased.
- Applying linear scaling without limit. It fails past the critical batch size or when hits the stability limit.
How long your answer should be
Half a page; 4–5 minutes.
Last checked on 4 December 2026.
Read this
Previous in Linear algebra and optimisation: How does Newton's method compare with gradient descent? What does one Newton step do on from , and why is Newton's method not used to train large neural networks?
Next in Linear algebra and optimisation: If a data matrix has singular values , how does adding () change the eigenvalues and condition number of , and why does this explain both numerical stability and Tikhonov regularisation?