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 B examples sampled independently, the mini-batch gradient g^B=1B∑i∈B∇ℓi has the right average, E[g^B]=∇L, and covariance Σ/B, where Σ is the covariance of a single example's gradient. Over t steps the drift is ηt ∇L while the accumulated noise covariance is tη2Σ/B=(ηt)⋅ηBΣ. So, for the same distance travelled, the noise level is set by the ratio η/B.

Steps

  1. Define the full gradient ∇L=1n∑i∇ℓi, where ℓi is the loss on example i. Define the per-example covariance Σ=E[(∇ℓi−∇L)(∇ℓi−∇L)⊤], taken over a randomly chosen example i.
  2. Show it is unbiased: each sampled ∇ℓi has mean ∇L, so their average does too. Find the variance: the average of B independent terms has covariance Σ/B. (Sampling without replacement multiplies this by n−Bn−1.) So the standard deviation falls only as 1/B: four times the batch halves the noise.
  3. Write one step as “true gradient plus noise”: θt+1=θt−η∇L−ηξt, where the noise term ηξt has covariance η2Σ/B.
  4. Derive linear scaling. Compare k steps with batch B and rate η against one step with batch kB and rate kη. If the gradient barely changes over k steps, both move by about kη∇L. Their noise covariances are k⋅η2Σ/B and (kη)2Σ/(kB)=kη2Σ/B, which are equal. So when you multiply the batch size by k, multiply η by k (Goyal et al., 2017), with a short warm-up at the start.
  5. State the limits. The rule breaks once kη passes the stability limit 2/λmax⁡, 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

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 f(x,y)=4x2+2y2+5 from (−1,2), and why is Newton's method not used to train large neural networks?
Next in Linear algebra and optimisation: If a data matrix X∈Rn×d has singular values σ1≥⋯≥σd≥0, how does adding λI (λ>0) change the eigenvalues and condition number of X⊤X, and why does this explain both numerical stability and Tikhonov regularisation?