Stochastic Gradient and Mirror Descent
Anchor (Master): Nemirovski & Yudin 1983 Problem Complexity and Method Efficiency in Optimization (Wiley) Ch. 3-5 (the mirror-descent scheme, the prox-function / distance-generating-function machinery, and the dimension-dependence of the non-Euclidean setup); Bubeck 2015 Convex Optimization: Algorithms and Complexity §4, §6 (mirror descent as the canonical non-Euclidean method, the regret/online-convex-optimization viewpoint, and the SGD rates); Beck 2017 First-Order Methods in Optimization (SIAM) §9 (the Bregman proximal map and convergence)
Intuition Beginner
Imagine you are trying to find the lowest point of a huge landscape, but the landscape is the average of millions of smaller bumpy surfaces — one per training example. Measuring the true downhill direction means touching all millions of bumps at once, which is far too slow. So you cheat. You pick one bump at random, feel its slope, and step against that. On its own this single slope is a poor guess at the true downhill direction. But averaged over many random picks, the guesses point the right way, and you drift toward the bottom. This is stochastic gradient descent, and it is how almost every large model is trained.
The price of cheating is noise. Each random slope wobbles around the true direction, so your path is jittery, like walking downhill in fog while someone keeps nudging you sideways. Two things tame the wobble. Averaging several random bumps before stepping — a mini-batch — gives a steadier guess. And shrinking your stride over time lets the early big strides cover ground while the later small strides stop you from bouncing around the bottom forever. Clever variants even remember old slopes to cancel the noise, restoring the fast steady progress of the slow exact method while keeping the cheap steps.
The second idea changes not what you measure but how you measure distance. Ordinary steps treat all directions the same, as if the world were flat. But some problems live on a special shape — a set of probabilities that must be positive and sum to one. There, "moving the same amount in every direction" is the wrong notion of a step. Mirror descent picks a distance ruler matched to the shape: you carry your point into a mirror world where stepping is easy, step there, and carry the result back. The famous case uses a ruler built from entropy, and its update multiplies each coordinate by a factor and renormalises — the multiplicative-weights rule behind many learning algorithms.
Why bother with a different ruler? Because the right ruler makes the cost of a problem grow far more slowly with the number of variables. With the flat ruler, working over probabilities costs like the square root of . With the entropy ruler, it costs like the square root of the logarithm of — almost flat. Choosing the geometry, not just the step, is the whole point.
Visual Beginner
Picture two pictures. On the left, stochastic gradient descent: the true downhill path is a smooth curve, but the actual steps are a noisy zig-zag that nonetheless trends the same way, tightening as the strides shrink. On the right, mirror descent on a triangle of probabilities: an ordinary step would shoot off the triangle and need to be dragged back, while the entropy ruler bends the step to stay on the triangle naturally.
stochastic gradient descent mirror descent on the simplex
(noisy steps, true trend) (entropy ruler stays on the triangle)
start * /\
\ . noisy zig-zag / \
\. . around the / x_t\ flat-ruler step
.\. true path / | \ leaves the triangle
.\. . / v \ and must be dragged back
\.. . / x_{t+1} \
min ------>* (tightens as steps shrink) /____________\ entropy step bends to stay on| idea | what it changes | effect |
|---|---|---|
| one random slope (SGD) | use a cheap noisy direction | fast cheap steps, jittery path |
| mini-batch | average a few slopes | steadier direction, less wobble |
| shrinking stride | step size goes to zero | stops bouncing near the bottom |
| variance reduction | reuse remembered slopes | cancels noise, fast steady progress |
| entropy ruler (mirror) | measure distance by entropy | cost grows like √(log n), not √n |
Worked example Beginner
We average out noise by hand. Suppose the true slope at our point is the number , but we can only see noisy readings: each reading equals plus a random nudge that is half the time and half the time. So a single reading is either or , never exactly .
Step 1. One reading is a poor guess. If we step against a single reading of , we over-step; against a reading of , we under-step. Either way we miss the true slope .
Step 2. Average two readings. Take a mini-batch of two readings. The possible pairs are , , , , each with the same chance. Their averages are , , , . So two of the four times we land exactly on , and the other two times we are off by only instead of by every time.
Step 3. Average four readings. With four readings the average clusters even tighter around . The spread of a -reading average shrinks like over the square root of : four readings halve the wobble of one.
Step 4. A multiplicative-weights step. Now switch rulers. Say we have two choices with current weights and observed costs — the first choice did worse. The entropy update multiplies each weight by with stride : the new unnormalised weights are . Renormalising to sum to one gives about . The worse choice lost weight, the better choice gained, and the two still sum to one.
What this tells us. Noisy slopes are useless one at a time but reliable on average, and averaging more readings tightens the guess at a square-root rate. Switching to the entropy ruler turns a step into a multiply-and-renormalise rule that automatically keeps weights positive and summing to one.
Check your understanding Beginner
Formal definition Intermediate+
Let be convex (notation from 44.01.01) with optimal value and a minimiser on a closed convex feasible set . The subgradient inequality and the subgradient method are as in 44.06.01.
Definition (stochastic first-order oracle). A stochastic subgradient oracle at returns a random vector with
that is, is an unbiased estimate of some subgradient with bounded second moment . The canonical instance is the finite-sum / expectation objective or , where drawing (or an index ) uniformly and returning gives such an oracle; the unbiasedness is the sample-average / law-of-large-numbers fact of 37.02.02.
Definition (stochastic gradient descent). Choose and step sizes . With the Euclidean projection, stochastic gradient descent (SGD) generates
where is the history. The convergence object is the averaged iterate (or the uniform average), not the last iterate.
Definition (mini-batch). A mini-batch oracle averages independent draws, ; it is unbiased with second moment reduced to when is the per-sample variance, trading the per-iteration cost against a smaller noise term.
Definition (mirror map / distance-generating function). Let be a norm with dual norm . A mirror map (or distance-generating function) on is a function , with , that is differentiable and -strongly convex with respect to :
Its Bregman divergence is
Taking () recovers and the Euclidean geometry of 44.06.01-44.06.02.
Definition (mirror descent). With a subgradient (or a stochastic ) and step , mirror descent is the proximal-mirror update
equivalently the mirror step then Bregman projection followed by . The Euclidean map gives projected subgradient descent of 44.06.01; replacing by a general Bregman distance is the non-Euclidean generalisation of the proximal step of 44.06.02.
Definition (entropic mirror map). On the probability simplex take the negative entropy , which is -strongly convex with respect to (Pinsker). Its Bregman divergence is the Kullback-Leibler divergence , and the update becomes the exponentiated-gradient / multiplicative-weights rule
Counterexamples to common slips Intermediate+
"SGD converges in the last iterate." In general it does not: with constant step the last iterate fluctuates in a noise ball forever. The averaged iterate (or diminishing steps) is what converges; reporting alone can be badly off.
"A biased gradient estimate is fine if it is close." The analysis uses to make the cross-term collapse to in expectation. A fixed bias does not average away and changes the fixed point; unbiasedness, not mere closeness, is the load-bearing hypothesis.
"Mirror descent is just a change of variables in subgradient descent." The step updates in the dual space ( is the mirror to the dual); the rate constant depends on the radius of measured by and on for the chosen norm, not on the Euclidean radius. Choosing changes the dimension-dependence, which a coordinate change cannot.
Key theorem with proof Intermediate+
The stochastic and non-Euclidean analyses both rest on one Bregman recursion that generalises the fundamental inequality of 44.06.01; taking expectations or telescoping then reads off each rate.
Theorem (mirror-descent / stochastic fundamental inequality and the rate). Let be convex and let be a mirror map that is -strongly convex with respect to on . Run mirror descent with , , and constant step . Then for every and each ,
Consequently, with and ,
In the stochastic case with and , the same bound holds for .
Proof. Let minimise over . The optimality condition is for all , and since ,
The three-point identity for any reads
which is a direct expansion of the three Bregman terms. Substituting (2) into (1) gives, for every ,
Split . The subgradient inequality gives . For the remaining term, Fenchel-Young / Cauchy-Schwarz in the pair and give
the last step maximising the quadratic in . Collecting terms and using yields .
Sum over to telescope the Bregman differences; dropping the nonnegative and using convexity ,
Putting , , dividing by , and optimising gives . In the stochastic case, take conditional expectation given : by unbiasedness, and bounds the noise term; the tower property over the telescoped sum reproduces in expectation.
Bridge. This single Bregman recursion is the foundational reason both stochastic and non-Euclidean first-order methods converge, and it builds toward the strongly-convex rate and the simplex dimension-dependence of the Advanced results, where the entropy map is read off directly. This is exactly the non-Euclidean analogue of the fundamental inequality of 44.06.01: where that argument used the Euclidean distance as the Lyapunov quantity, here the Bregman divergence plays the role, and the proof generalises projected subgradient descent to an arbitrary geometry with no loss of rate. The mirror update is dual to the proximal step of 44.06.02 — both minimise a linearised objective plus a divergence — and the central insight is that the rate constant , set by the geometry of rather than its Euclidean radius, is what the entropy map shrinks from to . Putting these together, the stochastic and mirror generalisations share one recursion, and it appears again in the regret analysis of online convex optimization and in the variance-reduced methods that recover linear rates.
Exercises Intermediate+
Advanced results Master
Mirror descent is the update , and the results below extend the single recursion to the strongly-convex rate, the simplex dimension-dependence, variance reduction, and the regret viewpoint that unifies the stochastic and online settings.
Theorem 1 (rates of stochastic gradient descent). For convex -Lipschitz (so ) and a stochastic oracle with , SGD with (or constant on a fixed horizon) attains . If is additionally -strongly convex, the step with the weighted average gives (Exercise 6) [Bubeck, S. — Convex Optimization: Algorithms and Complexity (2015)]. Both rates are minimax-optimal for the respective stochastic first-order classes, so SGD is the rate-optimal stochastic method; the only freedom is in the constant, which mini-batching and variance reduction improve.
Theorem 2 (the simplex and the entropic dimension-dependence). On with convex and , take the entropy map , -strongly convex with respect to (Pinsker), with for the uniform start. Then gives [Nemirovski, A. & Yudin, D. — Problem Complexity and Method Efficiency in Optimization (1983)]. Projected (Euclidean) subgradient descent on achieves only with the subgradient bound, and since the worst-case ratio is in favour of the entropic map. The improvement is the original motivation of the mirror-descent scheme: the rate constant tracks the prox-radius of in the intrinsic geometry, and entropy is the geometry of the simplex.
Theorem 3 (variance reduction recovers linear rates). For the finite sum with each convex -smooth and -strongly convex, plain SGD with constant step converges only to a noise ball and with diminishing step only at . SVRG periodically computes a full gradient at a snapshot and uses the corrected estimate , which is unbiased and has variance as ; SAG/SAGA maintain a running table of per-component gradients to the same effect. Each attains a linear rate with , matching full-batch gradient descent in rate at per-iteration cost amortised [Bubeck, S. — Convex Optimization: Algorithms and Complexity (2015)]. The variance term, not the bias, is what the snapshot cancels; once it vanishes the strongly-convex contraction of the deterministic method is restored.
Theorem 4 (regret and online convex optimization). In the online model, against any comparator , mirror descent on linearised losses satisfies , optimised to ; on the simplex with the entropy map this is the regret of Hedge / multiplicative weights [Beck, A. — First-Order Methods in Optimization (SIAM, 2017)]. Online-to-batch conversion (Exercise 8) turns any regret into an stochastic-optimization rate, so the offline rates of Theorem 1 and the online regret are the same statement read in two directions. The strongly-convex refinement uses to reach regret, the online face of the rate.
Synthesis. The single Bregman recursion is the foundational reason the entire stochastic and non-Euclidean theory coheres, and the central insight is that the Bregman divergence , not the Euclidean distance, is the Lyapunov quantity — this is exactly why the rate constant tracks the intrinsic geometry of and why the entropy map turns the simplex factor from into . The stochastic rates of Theorem 1 are the in-expectation form of , with unbiasedness the load-bearing hypothesis that makes the cross-term collapse and the bounded second moment the noise floor; variance reduction is dual to this, cancelling precisely the noise term so the deterministic strongly-convex contraction reappears, and the foundational reason it works is that the snapshot correction leaves the estimate unbiased while driving its variance to zero. The regret viewpoint of Theorem 4 is not a separate theory but the same recursion summed against a fixed comparator, and online-to-batch conversion shows the offline and the online are one fact; putting these together, mirror descent generalises the projected subgradient method of 44.06.01 and is dual to the proximal-gradient method of 44.06.02, both being minimisers of a linearised objective plus a divergence, and the bridge to the rest of large-scale optimization is precisely the freedom to choose — the geometry, not merely the step, is the design variable that powers large-scale machine-learning training.
Full proof set Master
Proposition 1 (three-point Bregman identity). For differentiable and any , .
Proof. This is Exercise 7; the computation expands the three divergences from the definition , cancels all values, combines the two inner products into , and adds ; the residual vanishes, leaving .
Proposition 2 (mirror-descent fundamental inequality). Let be -strongly convex with respect to , with , and . Then for all , .
Proof. The constrained optimality condition for the convex problem defining is for all . Rearranged, by Proposition 1 (with , ). Write . The subgradient inequality gives . By the generalised Cauchy-Schwarz and strong convexity ,
Combining the displayed inequalities, .
Proposition 3 ( averaged-iterate rate). Under Proposition 2 with constant and , , minimised over at .
Proof. Sum Proposition 2 with over : the Bregman terms telescope to , so . Convexity gives , hence ; divide by . Minimising over : gives , and at this is .
Proposition 4 (stochastic rate in expectation). With , , , the bound of Proposition 3 holds for .
Proof. The deterministic step of Proposition 2 uses and . Replace these by conditional expectations: since is -measurable and is a subgradient, and the noise term is bounded by . Thus . Take total expectation, sum over (the telescope survives by the tower property since is integrable), and apply Jensen to reach the stated bound.
Proposition 5 (entropy map is -strongly convex in ; the simplex rate). On , satisfies , and mirror descent with attains .
Proof. The Bregman divergence of the negative entropy is ; on the terms sum to , leaving . Pinsker's inequality is exactly -strong convexity of with respect to (so and the dual norm is ). The prox-radius is at the uniform : , since entropy . Hence , , in Proposition 3, giving .
Proposition 6 (Euclidean mirror descent is projected subgradient descent). For , the mirror update equals .
Proof. Here , so . Completing the square, , whose constrained minimiser over is by definition the Euclidean projection . The mirror scheme contains projected subgradient descent of 44.06.01 as the case , .
Connections Master
Mirror descent generalises the projected subgradient method of
44.06.01: the Euclidean mirror map reduces the Bregman fundamental inequality to that unit's recursion and recovers the rate, while the stochastic version randomises that unit's deterministic subgradient into an unbiased oracle and keeps the rate in expectation. The lower bound proved there caps the deterministic nonsmooth class, and SGD/mirror descent are the rate-optimal members of the stochastic and non-Euclidean refinements of it.The proximal-gradient method of
44.06.02and mirror descent are dual constructions: both minimise a linearised objective plus a regulariser — the Euclidean prox versus the Bregman prox — so the mirror update is the non-Euclidean proximal step, and the Moreau-envelope smoothing of that unit corresponds to the strong convexity of here. The composite mirror-prox and the proximal-gradient method meet in the Bregman proximal-gradient algorithm.Stochastic gradient descent rests on the unbiased-estimator mechanism formalised by the strong law of large numbers in
37.02.02: the sample-average gradient converges to the true gradient , and the variance term in the rate is the second-moment quantity that unit's law controls; mini-batching is the finite-sample form of that convergence, and variance reduction engineers the error to vanish along the trajectory.
Historical & philosophical context Master
The stochastic-approximation idea — replacing an exact gradient by a noisy unbiased estimate and shrinking the step — originates with Herbert Robbins and Sutton Monro in 1951 [Robbins & Monro 1951], whose convergence conditions , are still the canonical diminishing-step regime; Kiefer and Wolfowitz (1952) extended it to gradient estimation by finite differences. Mirror descent is due to Arkadi Nemirovski and David Yudin, whose 1983 monograph introduced the prox-function / distance-generating-function scheme and proved that the geometry of the feasible set, not the Euclidean norm, governs the complexity — the demonstration that the entropy prox-function gives a rather than dependence on the simplex is theirs [Nemirovski & Yudin 1983]. The multiplicative-weights / exponentiated-gradient instance was rediscovered repeatedly across learning theory, notably by Littlestone and Warmuth (1994) for the weighted-majority algorithm and by Freund and Schapire (1997) for Hedge and boosting [Freund & Schapire 1997]. The modern synthesis — mirror descent as the canonical non-Euclidean and online method, the regret / online-to-batch viewpoint, and the SGD rates — is presented by Bubeck [Bubeck 2015] and by Beck [Beck 2017], the source whose Bregman-prox formulation this unit follows. Variance reduction (SAG, SVRG, SAGA) was developed by Le Roux-Schmidt-Bach (2012), Johnson-Zhang (2013), and Defazio-Bach-Lacoste-Julien (2014).
Bibliography Master
@article{robbinsmonro1951,
author = {Robbins, Herbert and Monro, Sutton},
title = {A Stochastic Approximation Method},
journal = {The Annals of Mathematical Statistics},
volume = {22},
number = {3},
pages = {400--407},
year = {1951}
}
@book{nemirovskiyudin1983,
author = {Nemirovski, Arkadi S. and Yudin, David B.},
title = {Problem Complexity and Method Efficiency in Optimization},
publisher = {Wiley-Interscience},
year = {1983}
}
@article{bubeck2015convex,
author = {Bubeck, S\'ebastien},
title = {Convex Optimization: Algorithms and Complexity},
journal = {Foundations and Trends in Machine Learning},
volume = {8},
number = {3-4},
pages = {231--357},
year = {2015}
}
@book{beck2017fom,
author = {Beck, Amir},
title = {First-Order Methods in Optimization},
series = {MOS-SIAM Series on Optimization},
number = {25},
publisher = {SIAM},
year = {2017}
}
@article{freundschapire1997,
author = {Freund, Yoav and Schapire, Robert E.},
title = {A Decision-Theoretic Generalization of On-Line Learning and an Application to Boosting},
journal = {Journal of Computer and System Sciences},
volume = {55},
number = {1},
pages = {119--139},
year = {1997}
}
@article{johnsonzhang2013svrg,
author = {Johnson, Rie and Zhang, Tong},
title = {Accelerating Stochastic Gradient Descent using Predictive Variance Reduction},
journal = {Advances in Neural Information Processing Systems},
volume = {26},
year = {2013}
}
@article{bottoucurtisnocedal2018,
author = {Bottou, L\'eon and Curtis, Frank E. and Nocedal, Jorge},
title = {Optimization Methods for Large-Scale Machine Learning},
journal = {SIAM Review},
volume = {60},
number = {2},
pages = {223--311},
year = {2018}
}