betaFeedback

WorksMathematics

Nearly Tight Almost Sure Convergence Rates for the Last iterate of SGD

Abstract

We study the almost sure convergence of the last-iterate optimization error of Stochastic (sub)Gradient Descent (SGD) for convex objectives. For smooth objectives, we establish convergence rates of order k−1/3k^{-1/3} when a stationary minimizer exists, and k−1/4k^{-1/4} otherwise, up to polylogarithmic factors, where kk denotes the iteration counter. We further show that the latter rate extends to nonsmooth convex objectives. All these rates are achieved by deterministic, anytime stepsize policies. Finally, we establish matching lower bounds showing that the exponents −1/3-1/3 and −1/4-1/4 are optimal, up to polylogarithmic factors, for the corresponding problem classes.

Introduction

Stochastic (sub)Gradient Descent (SGD) [35] and its nonsmooth generalization [13] are the workhorse of modern machine learning: from linear prediction to deep neural networks, large-scale models are trained by cheap noisy gradient steps on samples or mini-batches [5, 22, 6]. Its classical guarantees, however, concern averaged iterates, which attain optimal rates by suppressing the fluctuations of individual iterates [34, 31]. In practice, it is the last iterate that is monitored, deployed, and used to decide when to stop. This mismatch has shifted the community’s attention from averaged to last-iterate guarantees, a question raised explicitly by Shamir [ [39] and since addressed by a growing literature on sharp last-iterate rates in expectation and with high probability [29, 40, 15, 19] (Liu and Zhou 2024).

Nonasymptotic analyses provide expectation or high-probability bounds at prescribed iterations, as well as time-uniform high-probability bounds that support repeated monitoring and data-dependent stopping [8, 23]. Almost-sure rates address a complementary question: how fast does the optimization error decay along almost every realization of a single run? Such a rate holds at every sufficiently large iteration on a probability-one event, with a path-dependent constant and starting time, but need not provide an explicit finite-time confidence bound. Pointwise high-probability bounds for a single horizon-free run can also yield almost-sure rates through the Borel–Cantelli lemma. When their dependence on 1/δ1/\delta is polylogarithmic (for bounds holding with probability at least 1−δ1-\delta), choosing summable failure probabilities costs only polylogarithmic factors in the iteration counter, as in light-tailed analyses [15, 12]. Under second-moment assumptions alone, however, polynomial dependence on 1/δ1/\delta can arise [37], and this direct conversion may worsen the convergence exponent or yield no decaying bound. This motivates a direct study of optimal almost-sure last-iterate rates under such assumptions: do rare, late stochastic fluctuations impose a fundamental limitation?

Even in the basic convex setting, almost sure convergence analyses are scarce, and the optimal rate remains unknown. Beyond classical qualitative (i.e., without an explicit rate) convergence results [35, 36], Sebbouh et al. [ [38] established almost-sure rates for weighted averages, while Liu and Yuan [2024] proved last-iterate rates O(k−1/3+β)\mathcal{O}(k^{-1/3+\beta}) with any β∈(0,1/3)\beta\in(0,1/3) for smooth convex objectives under a standard variance assumption on the gradient noise [20], with further results in related settings [43, 8] (Hudiani 2025). For nonsmooth convex objectives, qualitative almost-sure convergence of the stochastic subgradient method is classical [13, 33, 21], and almost-sure rates for weighted averages follow from the Robbins–Siegmund theorem [36], by the argument of Sebbouh et al. [ [38], which uses smoothness only to bound the second moment of the oracle. Notwithstanding these advances, there are still fundamental gaps unresolved. In particular, for smooth objectives, it remains unknown whether the exponent −1/3-1/3 is intrinsic and how it changes if we add constraints. For nonsmooth objectives, to the best of our knowledge, no almost-sure rate is known for its last iterate under a uniform bound on the second moment of the stochastic subgradients.

Contributions. We establish nearly matching lower and upper bounds for the almost-sure convergence of the last iterate of SGD only requiring conditions on the moment of the stochastic (sub)gradients.

  • Lower bounds. For a broad class of stepsize policies, including all deterministic (bounded) schedules and certain randomized and adaptive policies, we prove almost-sure last-iterate lower bounds of order k−1/3k^{-1/3} for smooth convex objectives with a stationary minimizer (Theorem 3.1 (ii)), and k−1/4k^{-1/4} for smooth convex objectives without a stationary minimizer and for nonsmooth convex objectives, up to logarithmic factors (Theorem 3.1 (i) and Theorem 4.1). These bounds show that the exponent −1/3-1/3 in existing smooth analyses is intrinsic and that, without a stationary minimizer, smoothness does not improve the worst-case exponent over the nonsmooth case.

  • Matching upper bounds. We give deterministic, anytime stepsize policies attaining these rates up to polylogarithmic factors (Theorems 3.2 and 4.2). For smooth objectives with a stationary minimizer, this sharpens the k−1/3+βk^{-1/3+\beta} rates of Liu and Yuan [2024], valid for arbitrarily small β>0\beta> 0, by replacing the polynomial slack with polylogarithmic factors. For nonsmooth convex objectives, we provide, to the best of our knowledge, the first almost-sure last-iterate rate under a bounded conditional second-moment assumption alone.

Related Works.

Expected Error Analysis. For smooth convex objectives, Moulines and Bach [ [29] obtained a last-iterate rate of order k−1/3k^{-1/3} with stepsizes proportional to k−2/3k^{-2/3}, under suitable second-moment assumptions on the stochastic gradients. Under uniformly bounded gradient-noise variance, Liu and Zhou [2024] established a last-iterate rate of order k−1/2k^{-1/2}, up to logarithmic factors, within a framework also covering nonsmooth objectives and general domains. This nearly matches the minimax rate under bounded-variance noise [32, 1]. For nonsmooth convex objectives on bounded domains, with uniformly bounded stochastic subgradient second moments, Shamir and Zhang [ [40] proved a last-iterate rate of order (log⁡k)⋅k−1/2(\log k) \cdot k^{-1/2} with horizon-independent stepsizes proportional to k−1/2k^{-1/2}.

Error Tail Bounds. Markov’s inequality converts expected error bounds into high-probability guarantees with a 1/δ1/\delta overhead. Under almost-surely bounded oracle noise, Harvey et al. [ [15] obtained a last-iterate bound of order (log⁡k)⋅k−1/2⋅log⁡(1/δ)(\log k) \cdot k^{-1/2} \cdot\log(1/\delta) for nonsmooth convex Lipschitz objectives on bounded domains, with extensions to sub-Gaussian noise. For both smooth and nonsmooth convex objectives on general domains, Liu and Zhou [2024] established last-iterate rates of order k−1/2k^{-1/2}, up to logarithmic factors in kk and 1/δ1/\delta, under conditionally sub-Gaussian noise, including with horizon-independent stepsizes. Their extended version also covers conditionally sub-Weibull noise [41], with polylogarithmic dependence on 1/δ1/\delta. Similar results have also been obtained by Eldowa and Paudice [ [12], who also consider, at a cost of a worse dependence on 1/δ1/\delta, the case of polynomially tailed noise. Under bounded variance alone, however, Sadiev et al. [ [37] showed that constant-stepsize SGD can require polynomial dependence on 1/δ1/\delta, even for smooth strongly convex objectives.

Problem Setting

In this work, we consider the following problem:

minimize⁡x∈XF(x)(1)\begin{aligned} \underset{x \in\mathcal{X}}{\operatorname{minimize}}\quad F(x) \tag*{(1)} \end{aligned}

with access only to a stochastic first-order oracle, whose response at step kk is denoted by ∇^kF(Xk)\widehat{\nabla}_k F(X_k). To make (P) tractable, we make the following standard assumptions.

Assumption 1 (Convexity). H\mathcal{H} is a real separable Hilbert space and F:H→RF : \mathcal{H} \to\mathbb{R} is convex.

Assumption 2 (Feasibility). X⊆H\mathcal{X} \subseteq\mathcal{H} is closed and convex, and X⋆:=arg min⁡x∈XF(x)≠∅\mathcal{X}_\star:= \operatorname*{arg\,min}_{x \in\mathcal{X}} F(x) \ne\varnothing. We define F⋆:=min⁡x∈XF(x)F_\star:= \min_{x \in\mathcal{X}} F(x).

Notation. Throughout we mainly use uppercase letters for random iterates; their coordinates and oracle noises may use lowercase letters. For a set AA, define the extended-valued indicator ιA(a)=0\iota_A(a) = 0 when a∈Aa \in A and +∞+\infty otherwise. We use kk to denote the step counter, and therefore it will always be a natural number. All random variables are defined on a common probability space (Ω,F,P)(\Omega,\mathcal{F},\mathbb{P}) equipped with a filtration (Fk)k≥1(\mathcal{F}_k)_{k \ge1}. Here, Fk\mathcal{F}_k represents the information available before the oracle call at iteration kk, including any algorithmic randomness used to select the step-size. The iterate XkX_k is Fk\mathcal{F}_k-measurable, and the oracle response ∇^kF(Xk)\widehat{\nabla}_k F(X_k) is Fk+1\mathcal{F}_{k+1}-measurable. The conditional distribution of this response may depend on the information in Fk\mathcal{F}_k. We define the conditional expectation by Ek[⋅]:=E[⋅∣Fk]\mathbb{E}_k[\cdot] := \mathbb{E}[\cdot\mid\mathcal{F}_k]1 and the conditional probability by Pk(⋅):=P(⋅∣Fk)\mathbb{P}_k(\cdot) := \mathbb{P}(\cdot\mid\mathcal{F}_k) for k≥1k \ge1. Since conditional expectation and conditional probability are defined up to null sets, all formulas involving Ek\mathbb{E}_k and Pk\mathbb{P}_k are understood almost surely. Denote by ∂f\partial f the subdifferential of any proper convex ff. With abuse of notation, denote by ∇^kF(Xk)\widehat{\nabla}_k F(X_k) the stochastic gradient (resp. subgradient) oracle in the smooth (resp. nonsmooth) setting. Given a sequence of random variables (Yk)k≥1(Y_k)_{k\ge1} and a sequence of reals (yk)k≥1(y_k)_{k\ge1}, when we write Yk≡ykY_k \equiv y_k we mean that, for every k≥1k \ge1, Yk(ω)=ykY_k(\omega) = y_k for every ω∈Ω\omega\in\Omega. For g>0g > 0, we write f(n)=o(g(n))f(n) = o(g(n)) if f(n)/g(n)→0f(n)/g(n) \to0 as n→∞n \to\infty, understood pathwise for random sequences. Finally, for x∈Xx \in\mathcal{X}, let us define the optimization error as Δ(x):=F(x)−F⋆\Delta(x) := F(x) - F_\star.

Stochastic (Sub)Gradient Descent (SGD). Let x1∈Xx_1 \in\mathcal{X} and (Γk)k≥1(\Gamma_k)_{k\ge1} be a (possibly random) sequence of nonnegative, finite step-sizes. We consider the following stochastic recurrence

∀k≥1,Xk+1=ΠX(Xk−Γk⋅∇^kF(Xk)),(2)\forall k \ge1,\quad X_{k+1} = \Pi_{\mathcal{X}}\left(X_k - \Gamma_k \cdot\widehat{\nabla}_k F(X_k)\right), \tag*{(2)}

where X1=x1X_1 = x_1 almost surely and ΠX\Pi_{\mathcal{X}} is the orthogonal projection operator onto X\mathcal{X}. Specifically, we consider predictable step-size policies as defined by the following.

Definition 2.1. Let α>0\alpha> 0. A sequence of positive real-valued random variables (Γk)(\Gamma_k) is α\alpha-bounded and predictable w.r.t. the filtration (Fk)k≥1(\mathcal{F}_k)_{k\ge1} if for every k≥1k \ge1, Γk\Gamma_k is Fk\mathcal{F}_k-measurable and Γk∈(0,α]\Gamma_k \in(0,\alpha] almost surely. We denote the collection of all such sequences with Sα\mathcal{S}_\alpha. We also consider the class Sfin:={(Γk)k≥1:for every k≥1, Γk is Fk-measurable and 0≤Γk<+∞}\mathcal{S}_{\mathrm{fin}} := \{(\Gamma_k)_{k\ge1}: \text{for every } k \ge1,\ \Gamma_k \text{ is } \mathcal{F}_k\text{-measurable and } 0 \le\Gamma_k < +\infty\}, and observe that Sα⊆Sfin\mathcal{S}_\alpha\subseteq\mathcal{S}_{\mathrm{fin}} for every α>0\alpha> 0.

The definition of Sα\mathcal{S}_\alpha includes all deterministic schedules, given by Γk≡γk\Gamma_k \equiv\gamma_k for (γk)k≥1(\gamma_k)_{k\ge1} satisfying 0<γk≤α0 < \gamma_k \le\alpha for every k≥1k \ge1. In particular, it includes positive nonincreasing schedules with γ1≤α\gamma_1 \le\alpha. It also includes bounded adaptive rules depending on past oracle responses, such as the scalar adaptive schedule based on past gradients in Li and Orabona [ [24], as well as randomized policies whose internal randomization is available before the current oracle call. In contrast, gradient clipping [14] and the usual AdaGrad-Norm [42] update are generally not covered: when expressed in the form (2) with the original oracle response, their effective scalar step-sizes also depend on the current response. See Appendix § 6 for details.

Our focus is on the convergence rate of Δ(Xk)\Delta(X_k) as captured by the following definition.

Definition 2.2 (Almost sure convergence). Let (ρk)k≥1(\rho_k)_{k\ge1} be a sequence of positive real numbers such that ρk→0\rho_k \to0 for k→+∞k \to+\infty, and (Yk)k≥1(Y_k)_{k\ge1} a sequence of real valued random variables. We say that (Yk)k≥1(Y_k)_{k\ge1} converges to 00 almost surely with rate ρk\rho_k and write Yk∈oa.s.(ρk)Y_k \in o_{\mathrm{a.s.}}(\rho_k) iff

P(lim⁡k→∞Ykρk=0)=1.\mathbb{P}\left(\lim_{k\to\infty}\frac{Y_k}{\rho_k}=0\right)=1.

If this does not hold, then we write Yk∉oa.s.(ρk)Y_k \notin o_{\mathrm{a.s.}}(\rho_k).

For consistency with our definition of almost-sure convergence rates, we state the lower bounds in Theorem 3.1 and 4.1 in terms of oa.s.o_{\mathrm{a.s.}} notation. However, our constructions establish a stronger conclusion. Specifically, for the corresponding hard instances and associated rate sequences (ρk)k≥1(\rho_k)_{k\ge1}, we show that

P(lim sup⁡k→∞Δ(Xk)ρk=∞)=1,\mathbb{P}\left(\limsup_{k\to\infty}\frac{\Delta(X_k)}{\rho_k}=\infty\right)=1,

References

  1. [1]Alekh Agarwal, Martin J. Wainwright, Peter L. Bartlett, and Pradeep K. Ravikumar. Information-theoretic lower bounds on the oracle complexity of convex optimization. In Advances in Neural Information Processing Systems, 2009.
  2. [2]Heinz H. Bauschke and Patrick L. Combettes. Convex Analysis and Monotone Operator Theory in Hilbert Spaces. CMS Books in Mathematics. Springer, Cham, 2 edition, 2017. doi:10.1007/978-3-319-48311-5.DOI
  3. [3]Axel Böhm and Stephen J. Wright. Variable smoothing for weakly convex composite functions. Journal of Optimization Theory and Applications, 188(3):628–649, 2021.
  4. [4]Radu Ioan Boț and Axel Böhm. Variable smoothing for convex optimization problems using stochastic gradients. Journal of Scientific Computing, 85(2):33, 2020.DOI
  5. [5]Léon Bottou. Large-scale machine learning with stochastic gradient descent. In Proceedings of COMPSTAT’2010, pages 177–186. Physica-Verlag, 2010.
  6. [6]Léon Bottou, Frank E. Curtis, and Jorge Nocedal. Optimization methods for large-scale machine learning. SIAM Review, 60(2):223–311, 2018.arxiv.org/abs/1606.04838
  7. [7]Haïm Brezis. Opérateurs Maximaux Monotones et Semi-Groupes de Contractions dans les Espaces de Hilbert, volume 5 of North-Holland Mathematics Studies. North-Holland, Amsterdam, 1973.
  8. [8]Kang Chen, Yasong Feng, and Tianyu Wang. Revisiting stochastic gradient descent for strongly convex objectives: Tight uniform-in-time bounds. Systems & Control Letters, 212:106419, 2026.DOI
  9. [9]Patrick L. Combettes and Jean-Christophe Pesquet. Stochastic quasi-Fejér block-coordinate fixed point iterations with random sweeping. SIAM Journal on Optimization, 25(2):1221–1248, 2015. doi:10.1137/140971233.DOI
  10. [10]Damek Davis and Dmitriy Drusvyatskiy. Stochastic model-based minimization of weakly convex functions. SIAM Journal on Optimization, 29(1):207–239, 2019.arxiv.org/abs/1803.06523
  11. [11]Rick Durrett. Probability: theory and examples, volume 49. Cambridge university press, 2019.
  12. [12]Khaled Eldowa and Andrea Paudice. General tail bounds for non-smooth stochastic mirror descent. In International Conference on Artificial Intelligence and Statistics (AISTATS), 2024.arxiv.org/abs/2312.07142
  13. [13]Yu. M. Ermol’ev. On the method of generalized stochastic gradients and quasi-Fejér sequences. Cybernetics, 5:208–220, 1969. doi:10.1007/BF01071091.
  14. [14]Eduard Gorbunov, Marina Danilova, and Alexander Gasnikov. Stochastic optimization with heavy-tailed noise via accelerated gradient clipping. In Advances in Neural Information Processing Systems, 2020.arxiv.org/abs/2005.10785
  15. [15]Nicholas J. A. Harvey, Christopher Liaw, Yaniv Plan, and Sikander Randhawa. Tight analyses for non-smooth stochastic gradient descent. In Proceedings of the Thirty-Second Conference on Learning Theory, 2019.arxiv.org/abs/1812.05217
  16. [16]Elad Hazan, Kfir Y. Levy, and Shai Shalev-Shwartz. Beyond convexity: Stochastic quasi-convex optimization. In Advances in Neural Information Processing Systems, 2015.arxiv.org/abs/1507.02030
  17. [18]Tuomas Hytönen, Jan van Neerven, Mark Veraar, and Lutz Weis. Analysis in Banach Spaces: Volume I: Martingales and Littlewood–Paley Theory. Springer, Cham, 2016. doi:10.1007/978-3-319-48520-1.DOI
  18. [19]Prateek Jain, Dheeraj M. Nagaraj, and Praneeth Netrapalli. Making the last iterate of SGD information theoretically optimal. SIAM Journal on Optimization, 31(2):1108–1130, 2021.arxiv.org/abs/1904.12443
  19. [20]Ahmed Khaled and Peter Richtárik. Better theory for sgd in the nonconvex world. arXiv preprint arXiv:2002.03329, 2020.arxiv.org/abs/2002.03329
  20. [21]Harold J. Kushner and G. George Yin. Stochastic Approximation and Recursive Algorithms and Applications, volume 35 of Stochastic Modelling and Applied Probability. Springer, New York, 2 edition, 2003.
  21. [22]Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436–444, 2015.DOI
  22. [23]Ruijie Li, Kang Chen, and Tianyu Wang. The exact time-uniform rate frontier for stochastic gradient descent on smooth convex objectives. arXiv preprint arXiv:2609.08537, 2026.arxiv.org/abs/2609.08537
  23. [24]Xiaoyu Li and Francesco Orabona. On the convergence of stochastic gradient descent with adaptive stepsizes. In Proceedings of the Twenty-Second International Conference on Artificial Intelligence and Statistics, 2019.arxiv.org/abs/1805.08114
  24. [27]Nicolas Loizou, Sharan Vaswani, Issam Hadj Laradji, and Simon Lacoste-Julien. Stochastic Polyak stepsize for SGD: An adaptive learning rate for fast convergence. In Proceedings of the 24th International Conference on Artificial Intelligence and Statistics, volume 130 of Proceedings of Machine Learning Research, pages 1306–1314. PMLR, 2021.arxiv.org/abs/2002.10542
  25. [28]Jean-Jacques Moreau. Proximité et dualité dans un espace hilbertien. Bulletin de la Société mathématique de France, 93:273–299, 1965.DOI
  26. [29]Eric Moulines and Francis R. Bach. Non-asymptotic analysis of stochastic approximation algorithms for machine learning. In Advances in Neural Information Processing Systems, 2011.
  27. [30]Daniele Musso. Stochastic gradient descent with random learning rate. arXiv preprint arXiv:2003.06926, 2020.arxiv.org/abs/2003.06926
  28. [31]Arkadi Nemirovski, Anatoli Juditsky, Guanghui Lan, and Alexander Shapiro. Robust stochastic approximation approach to stochastic programming. SIAM Journal on Optimization, 19(4):1574–1609, 2009.DOI
  29. [32]Arkadi S. Nemirovsky and David B. Yudin. Problem Complexity and Method Efficiency in Optimization. Wiley, New York, 1983.
  30. [33]Boris T. Polyak. Introduction to Optimization. Optimization Software, Inc., Publications Division, New York, 1987.
  31. [34]Boris T. Polyak and Anatoli B. Juditsky. Acceleration of stochastic approximation by averaging. SIAM Journal on Control and Optimization, 30(4):838–855, 1992.DOI
  32. [35]Herbert Robbins and Sutton Monro. A stochastic approximation method. The Annals of Mathematical Statistics, 22(3):400–407, 1951.
  33. [36]Herbert Robbins and David Siegmund. A convergence theorem for non negative almost supermartingales and some applications. In Jagdish S. Rustagi, editor, Optimizing Methods in Statistics, pages 233–257. Academic Press, New York, 1971.
  34. [37]Abdurakhmon Sadiev, Marina Danilova, Eduard Gorbunov, Samuel Horváth, Gauthier Gidel, Pavel Dvurechensky, Alexander Gasnikov, and Peter Richtárik. High-probability bounds for stochastic optimization and variational inequalities: the case of unbounded variance. In Proceedings of the 40th International Conference on Machine Learning, volume 202 of Proceedings of Machine Learning Research, pages 29563–29648. PMLR, 2023.arxiv.org/abs/2302.00999
  35. [38]Othmane Sebbouh, Robert M. Gower, and Aaron Defazio. Almost sure convergence rates for stochastic gradient descent and stochastic heavy ball. In Proceedings of the Thirty-Fourth Conference on Learning Theory, 2021.
  36. [39]Ohad Shamir. Open problem: Is averaging needed for strongly convex stochastic gradient descent? In Proceedings of the 25th Annual Conference on Learning Theory, volume 23 of Proceedings of Machine Learning Research, pages 47.1–47.3. PMLR, 2012.
  37. [40]Ohad Shamir and Tong Zhang. Stochastic gradient descent for non-smooth optimization: Convergence results and optimal averaging schemes. In Proceedings of the 30th International Conference on Machine Learning, 2013.arxiv.org/abs/1212.1824
  38. [41]Mariia Vladimirova, Stéphane Girard, Hien Nguyen, and Julyan Arbel. Sub-Weibull distributions: Generalizing sub-Gaussian and sub-Exponential properties to heavier tailed distributions. Stat, 9(1):e318, 2020. doi:10.1002/sta4.318.DOI
  39. [42]Rachel Ward, Xiaoxia Wu, and Léon Bottou. AdaGrad stepsizes: Sharp convergence over nonconvex landscapes. Journal of Machine Learning Research, 21(219):1–30, 2020.
  40. [43]Simon Weissmann, Sara Klein, Waïss Azizian, and Leif Döring. Almost sure convergence rates of stochastic gradient methods under gradient domination. arXiv preprint arXiv:2405.13592, 2024.arxiv.org/abs/2405.13592
  41. [44]Jingzhao Zhang, Tianxing He, Suvrit Sra, and Ali Jadbabaie. Why gradient clipping accelerates training: A theoretical justification for adaptivity. In International Conference on Learning Representations, 2020.arxiv.org/abs/1905.11881

Paper details

vlnc:W_zp99kh6q
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 9

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Mathematics

Not recorded for this paper

View statement
Looking for related papers…
Contents