Optimization / Training
verifiedStochastic Gradient Descent
Computing the gradient over the whole dataset for every step is unaffordable. Stochastic gradient descent estimates it from a small random batch instead — noisier, but hundreds of times cheaper, so it takes many more steps in the same wall-clock time and gets further.
Sample a minibatch, compute its gradient, step. The noise is not purely a cost: it helps escape sharp regions and is part of why these methods generalise. Batch size trades gradient quality against step count, and the useful range is bounded at the top by diminishing returns rather than by memory alone.
θ sub t+1 = θ sub t − η∇L sub B (θ sub t ) for a batch B, with E[∇L sub B ] = ∇L and variance falling as 1/|B|. Halving noise therefore costs four times the batch, which is the shape of the diminishing return.
Loss over 1000 training steps, starting near 6.0. It falls to about 2.11, with 87% of the total improvement arriving in the first half.
Loss over steps with gradient noise from a finite batch. Drag the batch size to watch the trajectory smooth out while each step costs more.
Reviewed by opendroid · 2026-08-04
- arXiv:1706.02677 — Accurate, Large Minibatch SGD: Training ImageNet in 1 Hour