Is it true that (a) a uniformly sampled mini-batch gradient is an unbiased estimator of the full-batch gradient, (b) every SGD step decreases the training objective, and (c) SGD with a fixed learning rate converges to the exact minimum, and why?
Linear algebra and optimisation, Stochastic optimisation
Level L3 Intermediate. Length Medium. Nature Th+Mat Both.
What's being asked
Whether you can separate exact expectations from per-step behaviour and asymptotic noise in stochastic gradient descent (SGD).
Key idea
By linearity of expectation, averaging gradients over a uniformly sampled mini-batch gives the full-batch gradient in expectation. However, each single step has variance, so it can go uphill on the full loss and—with a constant learning rate—keeps bouncing in a noise ball around the minimum.
Steps
- (a) True. Let be the average loss over samples, where is the loss on sample , and draw a mini-batch of indices uniformly at random. Without replacement, each index lies in the subset with probability , giving ; with replacement, each of the independent draws has expectation , so their average still equals .
- (b) False. The mini-batch gradient at step equals only on average, not on every draw. When points at an obtuse angle to (so the update points uphill, ) or when the step is large relative to curvature, on that step.
- (c) False (unless the gradient noise vanishes at the optimum). Even at the global minimiser , individual sample gradients are usually non-zero, so . With a fixed learning rate , SGD cannot stay at and settles instead into a stationary noise ball of root-mean-square radius (and expected excess loss ).
Common mistakes
- Writing only for batch size 1 and thinking larger batches change the mean. Mini-batch size changes the variance (), not the expectation.
- Claiming SGD diverges with a fixed learning rate. For small enough fixed on a smooth, strongly convex loss with bounded variance, it does not blow up; it converges to a neighbourhood of .
How long your answer should be
One short paragraph per statement; 2–3 minutes.
Read this
Previous in Linear algebra and optimisation: What are the four fundamental subspaces of a matrix of rank , how do they pair up as orthogonal complements, and how does the SVD give an orthonormal basis for every one of them?
Next in Linear algebra and optimisation: Why are the non-negative weighted sum (), the pointwise maximum , and the affine composition convex whenever each and is convex, and how do these rules show that the L2-regularised hinge loss is convex without computing any Hessian?