Stochastic Gradient Descent, Weighted Sampling, and the Randomized Kaczmarz Algorithm: SGD with Step γ < 1/sup L Has E‖x_k − x⋆‖² ≤ [1 − 2γμ(1 − γ sup L)]^k ‖x₀ − x⋆‖² + γσ²/(μ(1 − γ sup L))Research Paper
Motivation
Stochastic gradient descent (SGD) minimizes an objective that is an expectation, , by stepping along the gradient of one randomly drawn component at a time. It is the workhorse of large-scale machine learning, where is an average loss over training examples, and it also contains the randomized Kaczmarz method for linear systems, where each component is a single squared residual (Strohmer & Vershynin 2009).
For smooth, strongly convex objectives, the question is how fast a fixed step size drives the iterates to the minimizer , and how the rate depends on the smoothness constants of the components. Bach & Moulines (2011) showed that an iteration count scaling with the squared conditioning suffices. Needell, Srebro and Ward (arXiv:1310.5715v5, Theorem 2.1) replaced this by a dependence that is linear in the uniform conditioning . Their theorem is the base of the rest of the paper: Corollary 2.2 (choice of step size), the importance-sampling results of Section 3 (weighting components by ), and the Kaczmarz rates of Section 5 are all derived from it.
Timeline:
- 1951, Robbins and Monro: stochastic approximation.
- 2009, Strohmer and Vershynin: expected linear convergence of randomized Kaczmarz with rows sampled proportionally to their squared norms.
- 2011, Bach and Moulines: fixed-step SGD on strongly convex smooth objectives, with an iteration count of order .
- 2013–2015, Needell, Srebro and Ward: the bound below, linear in , and its importance-sampling and Kaczmarz corollaries.
Setting
Let be a probability distribution, the source distribution, on an arbitrary measurable index space . Let be a real Hilbert space (for example with the Euclidean norm ), and let , , be a family of functions. The objective is
and is a minimizer of . The paper assumes:
- each is convex and differentiable, and its gradient is Lipschitz with constant : ;
- is -strongly convex: for all .
The number is an almost-sure upper bound on , and the residual is
which vanishes exactly when is a stationary point of every component (the realizable case).
The SGD iterates with fixed step size start at and follow (2.2):
where are drawn independently from . The iterate is a random point that depends on . In Lean these objects are objective D f, residual D f xstar, iidLaw D (the law of the index sequence) and sgdIter f γ x0 k ω in the namespace SGDKaczmarz.SGD.
Formalization targets
Goal: Theorem 2.1, (2.4)
If , then for every
where the expectation is over the sampling of . The constants are the paper's; nothing is left unfixed.
Milestones
In the order of the paper's proof (Appendix A):
- (A.1): at a minimizer of a function with -Lipschitz gradient, ;
- Lemma A.1 (co-coercivity): ;
- the pathwise one-step bound on ;
- unbiasedness: ;
- the expected one-step recursion for ;
- the unrolled recursion, with the finite geometric sum .
Significance
The bound has two terms: a contraction at rate and a floor proportional to . Choosing to balance them (Corollary 2.2) gives an iteration count of order , linear rather than quadratic in the conditioning. In the realizable case it is a pure linear rate. Reweighting the distribution by turns into the average (Section 3), and specializing to least squares yields convergence rates for randomized Kaczmarz with uniform, weighted and hybrid row selection (Section 5). These consequences are stated in terms of Theorem 2.1, so a formal version of the theorem is the prerequisite for formalizing any of them.
The result is proved on paper (Appendix A.2). The work here is to formalize that proof: co-coercivity in a Hilbert space, differentiation of under the expectation, and the passage from a conditional one-step bound to the unconditional bound over an i.i.d. sequence. To our knowledge no machine-checked proof of Theorem 2.1 exists. The platform has formal results on projected SGD with decaying steps and on the finite-sum Kaczmarz iteration, which state different results.
Difficulty
The one-step algebra is routine once co-coercivity is available. What is hard is making the expectation rigorous. On the page, "" in the recursion is an expectation over the index alone, with held fixed. Iterating it requires that be a measurable function of , that be independent of it, and that expectations of possibly non-integrable nonnegative quantities be handled without junk values. The unbiasedness step is a differentiation under the integral sign in a possibly infinite-dimensional space, and it needs a dominating bound that comes from the almost-sure bound on together with the finiteness of . A tempting shortcut, assuming for every , gives only the realizable special case and is not the theorem.
Formalization scope
- Space. is a complete real inner-product space with its Borel σ-algebra and a second-countable topology (every separable Hilbert space, including ). Separability makes the iterates random variables.
- Gradients. These are Mathlib's
gradient. Assumption (1) isLipschitzWith (L i) (gradient (f i))withL i : ℝ≥0, together withDifferentiable ℝ (f i)andConvexOn ℝ Set.univ (f i)for every . - The objective. is the Bochner integral , under the hypothesis that is integrable for every . The gradient maps are assumed measurable.
- Strong convexity. Assumption (2) is stated in the paper's gradient-monotone form for
gradient (objective D f). Differentiability of is not assumed separately: it follows whenever (milestone "unbiasedness"). - The constant . It is any real number with almost surely. This is equivalent to the paper's essential supremum, because the bound is increasing in .
- Step-size conditions. is written
γ * supL < 1(and asγ * supL ≤ 1), with and . - Expectations. and are lower Lebesgue integrals in : the first over the infinite product law
Measure.infinitePiof the index sequence, the second over . A non-integrable iterate therefore cannot satisfy the bound vacuously, and makes the right side , which is the paper's meaning. - Indexing. is the initial point and is the point after steps.
- Hypotheses. The co-coercivity lemma carries convexity of , which its proof uses and without which it is false. No hypothesis such as , or is added to the goal.
Infrastructure that a complete development needs, and that is reusable beyond this mission:
- co-coercivity of gradients of smooth convex functions on Hilbert spaces;
- differentiation under the expectation for families with uniformly Lipschitz gradients;
- the tower property for a measurable recursion driven by
Measure.infinitePi.
Contributions of any of these as separate lemmas are welcome.
Selected references
- D. Needell, N. Srebro, R. Ward, Stochastic gradient descent, weighted sampling, and the randomized Kaczmarz algorithm, arXiv:1310.5715v5, 2015 (Mathematical Programming 155, 2016). https://arxiv.org/abs/1310.5715v5
- F. Bach, E. Moulines, Non-asymptotic analysis of stochastic approximation algorithms for machine learning, NIPS 2011. https://hal.science/hal-00608041
- T. Strohmer, R. Vershynin, A randomized Kaczmarz algorithm with exponential convergence, J. Fourier Anal. Appl. 15(2):262–278, 2009. https://doi.org/10.1007/s00041-008-9030-4
- H. Robbins, S. Monro, A stochastic approximation method, Ann. Math. Statist. 22:400–407, 1951. https://doi.org/10.1214/aoms/1177729586
- Y. Nesterov, Introductory Lectures on Convex Optimization, Kluwer, 2004. https://doi.org/10.1007/978-1-4419-8853-9