Manuscript Offprint
arXiv:2608.25551Beyond Optimal Rates in Stochastic Optimization: Trajectory-Adaptive Stopping Rules
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Stochastic gradient descent (SGD) is typically analyzed at a deterministic horizon chosen before the algorithm is run, even though practical stopping decisions are made adaptively by inspecting the evolving trajectory. This mismatch creates a fundamental certification problem: fixed-time guarantees do not generally remain valid at data-dependent stopping times, while deterministic horizons derived from worst-case bounds can be highly conservative. We address this problem for strongly convex stochastic optimization by constructing fully observable, trajectory-adaptive upper confidence sequences for the squared distance of the last iterate to the optimizer and the suboptimality of a weighted average. These bounds hold simultaneously over time, attain the optimal 1/t decay rate up to iterated-logarithmic factors in the worst case, and adapt to the realized stochastic gradients, allowing SGD to stop as soon as a prescribed accuracy is certified without sacrificing statistical validity. Our approach treats the evolving SGD trajectory as a sequential experiment whose observations provide evidence about the unknown optimization error. To formalize this perspective, we develop new recursive confidence-sequence techniques and a general time-uniform empirical Bernstein inequality for adapted processes with time-varying conditional means and predictable ranges that may grow without bound. We further extend these confidence-sequence constructions to minibatch SGD, with the empirical Bernstein bounds exploiting the realized second-moment structure within each minibatch. Numerical experiments show that the resulting stopping rules can require several orders of magnitude fewer iterations than natural deterministic horizons.
1 Introduction
Stochastic optimization is a foundational computational paradigm across machine learning, operations research, statistics, and scientific computing. When objectives are expectations under unknown distributions or finite sums over prohibitively large datasets, stochastic gradient methods make optimization possible using only samples or noisy first-order information [41, 32]. Their scalability has made them the principal computational workhorses of modern machine learning [5]. Yet a basic operational question remains unresolved: when should a stochastic optimization algorithm stop?
Existing theoretical analyses of stochastic gradient descent (SGD) are predominantly ex ante. Before the algorithm is run, one specifies a stepsize schedule and a deterministic horizon T, and then studies its performance at that horizon. This perspective has produced a deep understanding of stochastic first-order methods: it has identified optimal rates, clarified the roles of averaging and strong convexity, and provided principled guidance for selecting stepsizes [34, 4, 36, 26]. Its guarantees, however, are attached to horizons chosen independently of the realized run. In other words, they answer the forward-looking question of what can be guaranteed if SGD is run until a predetermined time T, but not the online question of whether the trajectory observed so far provides enough evidence that the algorithm should stop.
In practice, however, this online question is unavoidable. Practitioners alter stepsizes when progress slows and stop a run when the observed trajectory appears to have stabilized. Yet the quantities that would directly certify optimization progress are usually unknown: the objective is often a population loss defined by an expectation under an unknown distribution, and its optimizer and optimal value are unknown. Consequently, neither the true suboptimality nor the distance to the optimizer is directly observable during the run. Practitioners therefore rely on observable proxies, such as empirical losses computed from validation samples [35], and use these proxies together with the evolving stochastic trajectory to decide whether to tune, continue, or stop the algorithm. These proxies are themselves random and dependent on the particular samples used to construct them. They may be informative, but favorable behavior of a proxy is not itself a certificate for suboptimality or distance to the optimizer.
Existing fixed-horizon guarantees do not certify this adaptive mode of operation: a high-probability statement proved at a deterministic time T does not, in general, remain valid at a data-dependent stopping time selected after repeatedly inspecting the iterates, stochastic gradients, or validation losses [16, 1, 39]. The stochastic-oracle assumptions may remain unchanged, but the stopping time is now coupled to the random fluctuations revealed along the observed run. Among the many iterations examined, an unusually favorable fluctuation may be precisely what triggers termination. Therefore, a guarantee calibrated for one predetermined time does not automatically account for this selection over time.
One can preserve validity by fixing the stopping horizon in advance. Given a fixed-time high-probability bound and a target accuracy , one may solve for a time at which the bound falls below , and then run SGD for exactly that many iterations. This produces a valid certified stopping rule, but typically a very conservative one. Because is obtained by inverting a worst-case guarantee before the trajectory is observed, it reflects the most adverse behavior permitted by the assumptions rather than the behavior of the realized run. In practice, SGD can perform substantially better than these guarantees predict, sometimes by several orders of magnitude, so the resulting deterministic horizon may require many more iterations than would be sufficient on the realized run. This limitation is not resolved by choosing a stepsize schedule that attains the optimal worst-case rate: such optimality describes performance over a broad problem class, whereas stopping asks whether the particular run has already reached a prescribed accuracy. Existing theory is therefore indispensable for ex ante algorithm design, but it is not itself an online stopping mechanism.
This leaves a clear gap between rigorous but potentially conservative fixed-horizon guarantees and adaptive early-stopping procedures that generally lack a certificate. Bridging this gap requires more than another fixed-time convergence bound. It requires a theory in which the evolving trajectory is itself allowed to determine, with statistical validity, when sufficient progress has been made. This suggests a different perspective on stochastic optimization: a running SGD trajectory can be viewed as a sequential experiment. Its iterates and stochastic gradients do not merely update the decision variable; they also provide evidence about the unknown optimization error. The stopping problem then becomes one of determining whether the observed trajectory has produced enough evidence to certify that a prescribed accuracy has been reached. This leads to the central question of the paper:
Can SGD certify, from its own realized trajectory, when it should stop?
The statistical theory underlying this question has deep roots in anytime-valid sequential inference, which studies how to construct inferential guarantees that remain valid when observations are examined sequentially and the decision to continue or stop depends on what has already been observed [47, 49, 39, 38]. In the present setting, the relevant objects are confidence sequences: observable, trajectory-dependent upper bounds that, with high probability, bound a target quantity, such as suboptimality or distance to the optimizer, simultaneously at every iteration [7, 27, 24]. SGD may therefore be monitored continuously and stopped at the first time the bound falls below a prescribed tolerance, while the certificate remains valid at the selected stopping time. Constructing sharp confidence sequences for SGD requires optimization-specific tools because the unknown errors evolve recursively with the iterates and are driven by the same stochastic gradients from which the certificates must be constructed.
A first step toward meeting this challenge was taken by Aolaritei and Jordan [2], who developed anytime-valid confidence sequences and certified stopping rules for SGD under general convexity and smooth nonconvexity. Specifically, that work constructed fully observable certificates for suboptimality in the convex setting and for stationarity in the smooth nonconvex setting. These certificates allow the algorithm to be monitored continuously and stopped at a data-dependent time while retaining a valid guarantee.
In the present paper, we substantially expand this line of work by developing a considerably sharper theory for strongly convex stochastic optimization that exploits the contractive structure of the dynamics. Retaining trajectory adaptivity and time-uniform validity in this setting requires new constructions, including a recursive confidence-sequence argument and an empirical Bernstein theory for adapted processes with time-varying conditional means and growing predictable ranges. The resulting fully observable certificates bound the squared distance of the last iterate to the optimizer and the suboptimality of a weighted-average iterate. They recover the canonical 1/t rate, up to the generally unavoidable log log t factors associated with time-uniform validity [8, 24], and adapt to the stochastic behavior observed along the realized trajectory. In our numerical experiments, the corresponding stopping rules terminate orders of magnitude earlier than natural deterministic horizons obtained by inverting conventional fixed-time guarantees.
where is a closed convex set and is differentiable. Throughout, we assume that the objective satisfies the following condition.
Assumption 1.1 (Strong convexity). The function f is -strongly convex on , meaning that
The analysis extends directly to the nondifferentiable setting by replacing gradients and stochastic gradients with subgradients and stochastic subgradients, respectively.
Under Assumption 1.1, the minimizer is unique; we denote it by . We study projected stochastic gradient descent (SGD), defined recursively by
and initialized from almost surely. Here, denotes the Euclidean projection onto , are stochastic gradients, and is a stepsize sequence. We work with the natural filtration
Thus, contains the complete SGD trajectory observed through iteration t. We assume that each stepsize is selected using only information available before the corresponding stochastic gradient is observed.
Assumption 1.2 (Predictable stepsizes). For every , the stepsize is -measurable.
Assumption 1.2 permits both deterministic and data-dependent stepsize rules, provided they depend only on the past trajectory. It includes constant and diminishing schedules, as well as adaptive choices based on previously observed iterates and stochastic gradients (e.g., AdaGrad-type schedules and related adaptive methods [13, 50]). The stochastic gradients satisfy the following standard unbiasedness and tail conditions.
Assumption 1.3 (Stochastic gradients). For every , the stochastic gradient satisfies:
(i) Unbiasedness:
(ii) Conditional sub-Gaussian noise: defining , there exists a constant such that, for every and every ,
almost surely.
(2)
Assumption 1.3(i) is the standard conditional unbiasedness requirement in stochastic approximation [32]. Assumption 1.3(ii) imposes a conditional sub-Gaussian bound on the gradient noise while allowing its distribution to vary along the trajectory. This condition is satisfied by Gaussian and many light-tailed noise models. It also holds whenever almost surely, in which case one may take by the conditional Hoeffding lemma [23].
To ensure that the resulting contraction factors are positive, we impose an upper bound on the stepsizes after an initial period.
Assumption 1.4 (Upper bound on stepsizes). There exists a deterministic integer such that
Assumption 1.4 is satisfied by the standard diminishing stepsize schedules used for strongly convex stochastic optimization. It is imposed only from the deterministic time onward, allowing arbitrary predictable stepsizes during the initial phase of the algorithm. The index serves as the starting point of our time-uniform analysis.
Our goal is to provide anytime-valid, trajectory-adaptive guarantees for the progress of SGD. Given the stochastic gradients, predictable stepsizes, and observed iterates, we seek upper bounds on suitable performance measures that remain valid simultaneously over the entire run. We formalize this objective through the following definition.
Definition 1.5 (Anytime-valid upper confidence sequence). Let be a real-valued stochastic process. For any , a sequence of random variables is an anytime-valid upper confidence sequence for at level if
When represents a performance measure of the current optimization trajectory, such as the squared distance to the optimizer or a notion of suboptimality, Definition 1.5 provides a sequence of upper bounds that are valid simultaneously over time. Consequently, the bounds may be monitored continuously and evaluated at a time selected from the observed trajectory without invalidating the coverage guarantee.
To evaluate our confidence sequences, we assume access to the problem constants that enter their construction. In particular, the strong-convexity parameter is assumed known, and is a known valid upper bound on the conditional sub-Gaussian proxy in Assumption 1.3(ii). In the bounded-gradient setting considered later, we assume that a known constant satisfies almost surely, in which case one may take as explained earlier. The fully observable constructions additionally require an observable upper bound on ; under bounded gradients, the choice is always valid. By contrast, , , and the performance measures considered below are not assumed known. Importantly, and need only be valid upper bounds rather than tightly calibrated values: the numerical experiments in Section 5.5 show that, for the empirical-Bernstein confidence sequences, the effect of conservative choices of these quantities is largely transient.
We now introduce the two performance measures considered in this paper and the stopping rules induced by their corresponding upper confidence sequences.
Squared distance to the optimizer. Our first performance measure is
This quantity measures the accuracy of the current iterate and therefore defines a natural last-iterate stopping criterion: ideally, the algorithm would stop as soon as . Since is unknown, however, this criterion is not directly observable. An anytime-valid upper confidence sequence provides a natural trajectory-adaptive surrogate.
At time , after observing , the algorithm computes , so is -measurable. We therefore seek a computable, -measurable upper bound for . Suppose that is an anytime-valid upper confidence sequence for with this property. Then certifies the accuracy of the newly computed iterate , leading to the stopping rule
with the convention . Consequently, is a stopping time with respect to . When finite, it returns , the first iterate certified to lie within squared distance of .
Weighted average suboptimality. Our second performance measure is the linearly weighted average suboptimality
The corresponding weighted average iterate is
By convexity of f,
Thus, an upper bound on certifies the suboptimality of the observable iterate . The linearly increasing weights emphasize later iterates and were introduced in [26], together with the stepsize , to recover the optimal convergence rate for strongly convex stochastic optimization; we adopt the same stepsize for this performance metric.
Suppose that is an anytime-valid upper confidence sequence for and that is -measurable for every . Using the same target accuracy , define
with the convention . When finite, this rule returns , the first weighted average iterate certified to be -suboptimal.
The validity of the two stopping rules follows directly from the simultaneous-coverage property.
Proposition 1.6 (Certified stopping rules). Fix and .
(i) If is an anytime-valid upper confidence sequence for , then
(ii) If is an anytime-valid upper confidence sequence for , then
Thus, for each stopping rule separately, with probability at least , whenever the stopping time is finite, the returned iterate satisfies the prescribed accuracy requirement.
The result follows immediately from Definition 1.5. We therefore omit the proof and refer to [2, Theorem 3.1], where the same stopping-time argument is carried out. The aim of the current paper is to construct the upper confidence sequences and explicitly from the observed iterates, stochastic gradients, and stepsizes .
1.2 Contributions
Our main contributions can be summarized as follows:
(i) Confidence sequences under sub-Gaussian noise. Through a time-uniform Hoeffding argument, we construct fully observable, trajectory-adaptive confidence sequences for the two performance measures introduced above. These confidence sequences can be computed online from the observed stochastic gradients and stepsizes. In the worst case, they match the optimal 1/t rate for strongly convex stochastic optimization, up to the iterated-logarithmic cost of time-uniform validity, while remaining sensitive to the observed trajectory and therefore potentially smaller than the corresponding worst-case bounds.
- Squared distance to the optimizer. We construct an anytime-valid upper confidence sequence whose stochastic term depends explicitly on the conditional sub-Gaussian variance proxy . If almost surely and , then its worst-case decay satisfies
- Weighted average suboptimality. Building on the observable distance confidence sequence, we construct an anytime-valid upper confidence sequence for weighted average suboptimality. If almost surely and , then its worst-case decay satisfies
(ii) Refined confidence sequences under bounded stochastic gradients. Through a novel time-uniform empirical Bernstein argument (see item (iv)), we refine both confidence sequences under the assumption that almost surely. The resulting bounds replace the fixed worst-case variance proxy in the Hoeffding construction by the realized squared stochastic-gradient magnitudes , together with an additional correction that decays at the faster rate, up to iterated-logarithmic factors. The refined confidence sequences are fully observable and preserve the worst-case rates in equations (8) and (9). At the same time, they adapts more sharply to the observed trajectory: in our numerical experiments, the resulting confidence sequences are generally one order of magnitude smaller than their Hoeffding-based counterparts. This refinement constitutes the central contribution of the paper.
(iii) Minibatch extensions. We extend both constructions to minibatch SGD with conditionally independent stochastic gradients per iteration. For the Hoeffding confidence sequences, minibatching reduces the conditional sub-Gaussian variance proxy from to . For the empirical Bernstein confidence sequences, we develop a minibatch analogue that pools the observed quadratic variation of the individual stochastic gradients and adapts to the largest eigenvalue of the realized second-moment matrix of each minibatch. The minibatch empirical Bernstein boundary has a leading term that improves at the usual rate, together with a lower-order correction that improves at the faster rate. In our numerical experiments, the improvement relative to the corresponding worst-case bounds grows with the minibatch size, reaching between two and three orders of magnitude for the larger minibatch sizes considered. The gap relative to existing ex ante guarantees with explicit constants can be substantially larger still; see Figure 1.
(iv) A time-uniform empirical Bernstein inequality with growing predictable range. To support the refinement in item (ii), we establish a general time-uniform empirical Bernstein inequality for adapted processes with time-varying conditional means and predictable increment ranges that may grow without bound. This feature is essential for our SGD application: in both
The same approach can be adapted to other averaging schemes, such as uniform averaging. We use linearly increasing weights because they yield the optimal rate, whereas uniform averaging incurs an additional logarithmic factor and achieves an rate [26].
The bound of Rakhlin et al. [36] is simultaneous over all , but requires the horizon T to be fixed in advance. More recent fully time-uniform guarantees, such as Pham et al. [33], remove the need to prescribe T but are numerically more conservative in this comparison.

Figure 1: Trajectory-adaptive certification of SGD on an SVM problem with minibatch size and confidence level 99%. H and EB denote our Hoeffding- and empirical-Bernstein-based confidence sequences, respectively; worst-case is the trajectory-independent version of our Hoeffding construction obtained by replacing the realized squared stochastic-gradient norms by their uniform upper bound , while RSS12 denotes the finite-horizon high-probability bound of Rakhlin et al. [36]. Left: squared distance to the optimizer. Right: suboptimality of the weighted average. The gray curves show the corresponding ground truth. In the right panel, crosses and vertical lines mark the first iteration at which each bound falls below the target , and hence the time at which that bound first certifies the prescribed accuracy. Further details are provided in Section 5.
the squared-distance and weighted-average suboptimality analyses, the relevant predictable ranges can scale as under the worst-case convergence rate. Existing empirical Bernstein confidence-sequence constructions, such as Howard et al. [24, Theorem 4], allow the conditional means to vary but assume a fixed range scale, and therefore do not directly cover this setting. When the predictable range evolves over time, the admissible exponential parameter evolves with it. Starting from the pointwise exponential inequality of Fan et al. [15, Lemma 4.1], we overcome this difficulty through predictable truncation and simultaneous stitching over dyadic scales of the observed quadratic process and the running predictable range. The resulting explicit boundary adapts jointly to both quantities and is nondecreasing in each of them.
1.3 Related work
We first discuss the statistical foundations of our approach and their historical connection to stochastic approximation, before turning to the relevant background in strongly convex stochastic optimization.
Anytime-valid inference and stochastic approximation. The statistical framework underlying our analysis is anytime-valid sequential inference, which develops measures of evidence and uncertainty that remain valid under continuous monitoring and data-dependent stopping. Its motivating pathology is classical: a procedure may be statistically valid at every predetermined sample size and yet lose validity when observations are repeatedly inspected and sampling stops after a favorable fluctuation. An early illustration appears in Feller's 1940 discussion of extra-sensory perception, where repeated sampling could turn chance fluctuations into apparently significant evidence [16]. Anscombe later famously described this practice as “sampling to a foregone conclusion” [1], while Robbins placed the same phenomenon within the broader theory of sequential experimentation [39]. The martingale foundations go back to Ville [47], while Wald developed the classical theory of sequential hypothesis testing [49]. Subsequent work by Darling, Robbins, Siegmund, Lai, and others developed confidence sequences that are valid at any and all times, boundary-crossing methods, and tests of power one [7, 9, 40, 42, 27]. After remaining a comparatively small niche for decades, these ideas reemerged rapidly around 2017 under the modern framework of safe anytime-valid inference [38]. During 2018–2020, several independent lines of work with closely aligned motivations and techniques developed the modern theory of e-values, and the term itself was jointly adopted in its present measure-theoretic sense in 2020; see [48, 44, 19, 37] and the references therein. The terminology is recent, but the underlying objects trace back to likelihood ratios, nonnegative martingales, and Ville's betting interpretation.
A central technical ingredient in this framework is the construction of time-uniform boundaries that control a stochastic process uniformly over time. Such boundaries are commonly obtained from exponential supermartingales through mixtures or stitching. The method of mixtures integrates over the exponential tuning parameter; in the literature on self-normalized processes, this technique is also known as pseudo-maximization and provides a way to adapt to a random intrinsic time [10, 11, 12]. Stitching instead allocates tuning parameters and error probabilities across successive intrinsic-time epochs and combines the resulting bounds through a union bound. Epoch-based arguments of this kind go back at least to Darling and Robbins [8], while the approach was developed systematically for modern confidence sequences by Howard et al. [24]. Our empirical Bernstein analysis follows the stitching route, but must also accommodate a predictable range that evolves with the SGD trajectory; we therefore stitch simultaneously over the observed quadratic process and the running range scale.
This history also includes a close connection to stochastic approximation. Robbins and Monro introduced stochastic approximation [41], while the Robbins–Siegmund almost-supermartingale theorem later became a standard tool for establishing the convergence of stochastic approximation algorithms [43]. Lai likewise contributed to adaptive stochastic approximation jointly with Robbins [28]. The two traditions therefore share important intellectual origins, but their modern theories developed largely separately. Aolaritei and Jordan [2] brought these perspectives together by constructing trajectory-adaptive confidence sequences and certified stopping rules for convex and smooth nonconvex SGD. The present paper continues this line of work in the strongly convex setting, where contractivity permits substantially sharper certificates but also requires new recursive and self-normalized sequential arguments.
Strongly convex stochastic optimization. Classical work by Polyak and Juditsky established the asymptotic optimality of trajectory averaging under suitable regularity conditions [34]. Building on this asymptotic theory, Bach and Moulines [4] gave nonasymptotic analyses of standard and averaged SGD for smooth convex objectives, showing that inverse-time stepsizes attain the optimal rate under strong convexity, while slower decay combined with averaging is more robust to stepsize calibration and remains effective in the absence of strong convexity. Subsequent work obtained optimal rates through specialized algorithms and averaging schemes. Hazan and Kale [22] proposed an epoch-based method for strongly convex stochastic optimization without smoothness assumptions, while Ghadimi and Lan [17, 18] developed accelerated and multistage schemes for strongly convex composite problems, together with optimal or nearly optimal complexity bounds and large-deviation guarantees. For standard SGD, Rakhlin et al. [36] showed that smoothness yields the optimal rate, while suffix averaging recovers the same rate without smoothness. They also obtained a finite-horizon high-probability squared-distance bound valid simultaneously for all , with an additional iterated-logarithmic factor. Further weighted-averaging schemes attaining the optimal rate were developed by Lacoste-Julien et al. [26], using linearly increasing weights for projected stochastic subgradient descent, and by Nedic and Lee [31] for stochastic mirror descent. Extensions include adaptation to unknown local strong convexity in logistic regression [3] and trajectory averaging on Riemannian manifolds for geodesically strongly convex objectives [46].
The gap between averaged and last-iterate performance motivated a complementary line of work. For nonsmooth strongly convex objectives, Shamir and Zhang [45] established an last-iterate rate in expectation and proposed an online averaging scheme attaining the optimal rate. Harvey et al. [20] proved the corresponding high-probability last-iterate bound, established its tightness through a matching deterministic example, and obtained an optimal high-probability guarantee for suffix averaging. For the linearly weighted average of Lacoste-Julien et al. [26], Harvey et al. [21] established the optimal high-probability rate. Jain et al. [25] instead designed horizon-dependent stepsize sequences that transfer optimal guarantees for averaged SGD to the last iterate. More recently, Liu and Zhou [29] developed a unified last-iterate analysis in expectation and with high probability across general domains, composite objectives, non-Euclidean geometries, and both convex and strongly convex settings.
Recent work has derived high-probability convergence rates for strongly convex SGD that hold uniformly over time. Pham et al. [33] obtained such a rate for the last-iterate squared distance, matching the order in (8), while Chen et al. [6] established the corresponding order in (9) for the last-iterate objective gap under smoothness. Although time-uniform, these guarantees remain ex ante and worst-case: their envelopes depend only on the iteration count and global problem parameters, rather than adapting to the realized trajectory. For the accuracy-based stopping problem considered here, time uniformity alone therefore offers no advantage over a finite-horizon guarantee: thresholding either bound yields a deterministic worst-case iteration budget, while the time-uniform bound may be more conservative because of its additional iterated-logarithmic or constant-factor cost, as illustrated by the comparison between Pham et al. [33] and Rakhlin et al. [36]. The confidence sequences developed here instead adapt to the stochastic fluctuations observed along the realized trajectory, while providing fully observable certificates that can be evaluated throughout the run and used for online stopping, with the same decay orders in the worst case. This distinction is quantitatively substantial in our experiments: in Figure 1, our trajectory-adaptive distance certificate is roughly five orders of magnitude smaller than the finite-horizon bound of Rakhlin et al. [36], with an even larger gap relative to the time-uniform bound of Pham et al. [33].
1.4 Organization and notation
Organization. Section 2 develops our confidence sequences under conditional sub-Gaussian noise using a time-uniform Hoeffding argument. Section 3 refines these constructions under bounded stochastic gradients through a time-uniform empirical Bernstein approach. Section 4 extends both approaches to minibatch SGD. Finally, Section 5 numerically evaluates the resulting confidence sequences and their certified stopping rules. All proofs are deferred to Appendix A.
Notation. For , denotes the Euclidean norm and the standard inner product. For a closed convex set , denotes the Euclidean projection of onto . For a symmetric matrix , denotes its largest eigenvalue. Given a filtration , a process is adapted if is -measurable and predictable if is -measurable. Conditional expectations are written , and we adopt the convention . Unless a base is indicated explicitly, all logarithms are natural. For two nonnegative sequences and , we write if there exists a constant such that throughout the stated range; we write synonymously with , and if and . Unless stated otherwise, implicit constants may depend on fixed problem parameters but are independent of , , and the minibatch size whenever these quantities vary in the corresponding statement. All probabilities and expectations are taken with respect to the underlying algorithmic randomness.
2 Confidence Sequences under Sub-Gaussian Noise
We construct anytime-valid upper confidence sequences for the two performance measures of interest: the last-iterate squared distance and the suboptimality of the weighted-average iterate, . Although the two guarantees arise from different SGD recursions, both reduce to controlling partial sums of directional gradient noise terms. We first isolate the common time-uniform concentration argument, then construct the observable distance confidence sequence, which will in turn be used to make the suboptimality confidence sequence fully observable.
The common probabilistic ingredient underlying both constructions is a conditional exponential moment bound of sub-Gaussian form. Consider an adapted sequence of real-valued random variables and a nonnegative predictable sequence . Suppose that, for some ,
for every and every . The predictable quantity serves as a conditional variance proxy for , using only information available before is observed, while records the constant arising in the particular application. For each fixed , the conditional exponential bound implies that
is a nonnegative supermartingale. The cumulative variance proxy records the conditional fluctuation scale accumulated over the process. In sequential inference, such a cumulative process is often called an intrinsic time: the scale of the concentration boundary for the partial sum adapts to the accumulated variance proxy, rather than being indexed solely by the iteration count.
This exponential supermartingale is the starting point for a time-uniform concentration bound. Ville's inequality controls its running maximum and, after rearranging, yields for each fixed a linear upper boundary for the partial sums that holds simultaneously over time [47]. No single choice of , however, is well calibrated across all possible scales of the intrinsic time: different values of yield sharper boundaries in different ranges of the cumulative variance proxy. Dyadic stitching combines these fixed- boundaries over successive dyadic scales, while allocating the error probability across the scales. The result is a curved boundary that adapts to the realized intrinsic time and remains valid uniformly over the infinite horizon.
The following lemma formalizes this construction in the precise form used throughout the section. It is a dyadic specialization of the stitching framework developed by Howard et al. [24].
Lemma 2.1 (Anytime-valid stitched sub-Gaussian bound). Let be a filtration. Let be adapted, and let be nonnegative and predictable. Define
Fix . Suppose that, for every and every ,
For , let
Then, for every ,
Lemma 2.1 provides the generic concentration step, but applying it to SGD requires a problem-specific analysis of the algorithmic dynamics. For each performance measure, we derive a recursion that isolates the contribution of the gradient noise as a partial sum of directional terms, and then establish the required conditional exponential moment bound using a predictable variance proxy.
2.1 Last-iterate squared distance to the optimizer
We begin by constructing an upper confidence sequence for the last-iterate squared distance to the optimizer. Recall from (3) that . To account for the time-varying contraction induced by strong convexity, define
By Assumption 1.4, almost surely for every , so is well defined. Following the notation of Lemma 2.1, for define the adapted term
With these definitions, Lemma C.2 yields the following decomposed upper bound on the last-iterate distance: for every ,
This decomposition follows from the standard squared-distance Lyapunov argument for projected stochastic approximation; see, e.g., Nemirovski et al. [32, Section 2.1]. A closely related unrolling of the contractive SGD recursion for the classical stepsize appears in Rakhlin et al. [36, Appendix B.7, Lemma 6]; the decomposition (11) records the same telescoping mechanism for general predictable stepsizes.
Thus, following (11), the last-iterate distance to the optimizer is controlled by an initialization term, an observable accumulation of squared stochastic gradients, and a partial sum of directional gradient noise terms. A time-uniform bound on therefore translates directly into an upper confidence sequence for . To control this partial sum, define
The sequence is predictable because , , and are -measurable. Applying the conditional sub-Gaussian bound in Assumption 1.3(ii) with the predictable direction gives
for every and every . Thus, is the predictable intrinsic-time increment in the generic construction, and Lemma 2.1 applies with .
To express the resulting confidence sequences compactly, for define
and, for , let
The function collects the common dependence of the stitched boundaries on the intrinsic time and its dyadic scale, and is nondecreasing in v. For the distance process, define
This is the cumulative intrinsic time associated with the directional gradient noise terms. Since the conditional exponential bound corresponds to , Lemma 2.1 guarantees that
simultaneously for every with probability at least . Combining this bound with (11) gives the following proposition.
Proposition 2.2 (Confidence sequence for ). Suppose Assumptions 1.1–1.4 hold. Then, for every , the process
is an upper confidence sequence for the last-iterate squared distance to the optimizer, in the sense that
Although the squared-gradient accumulation in (14) is observable from the SGD trajectory, the confidence sequence is not yet fully observable: the initial distance is unknown, and the boundary term depends, through , on the unknown distances . If is compact, an immediate remedy is to replace every by the uniform bound . This produces a fully observable confidence sequence, but discards the contraction of the iterates toward the optimizer. As shown in Remark 2.5, the resulting bound exhibits polynomial decay, rather than the near-1/t decay achieved by the recursive construction below.
To obtain a sharper observable bound, we exploit the simultaneous-coverage guarantee of Proposition 2.2. Define the event
On , which has probability at least , every subsequent unknown distance is bounded by the corresponding upper confidence bound, that is, for all . The bounds are themselves not observable, so they cannot be inserted directly into . Instead, starting from an observable upper bound on , we construct observable envelopes recursively. Suppose that, up to the current time, these envelopes satisfy on . Then
so the observable envelopes can be used to upper bound the unknown distances in the intrinsic-time process. The resulting observable intrinsic time dominates and, since is nondecreasing, produces a boundary term that dominates . Substituting this larger boundary term into (14) yields the next observable envelope and preserves the required domination, thereby closing the construction recursively.
We now formalize this construction. Fix , and let be any -measurable quantity satisfying almost surely. Define recursively
For every , define the observable intrinsic time
and, using the notation in (12) and the stitched boundary function in (13), define the observable upper envelope
The recursion is well defined. When the recursion is evaluated at time , the proxies are already available: , while, for , was computed at time . They determine the observable intrinsic time , and hence the boundary term and the next envelope . The following theorem establishes that the resulting process is fully observable and retains the simultaneous-coverage guarantee.
Theorem 2.3 (Observable confidence sequence for ). Suppose Assumptions 1.1–1.4 hold, and let be an -measurable quantity satisfying almost surely. Then, for every , the recursively defined process is well defined and fully observable from and the SGD trajectory. Moreover,
A key feature of Theorem 2.3 is that it accommodates any predictable stepsize sequence satisfying the standing conditions, including stepsizes chosen adaptively from the observed trajectory. The confidence sequence is therefore not tied to a particular schedule or to an a priori convergence-rate calculation. To verify that the construction nevertheless recovers the expected behavior under a standard choice, we next specialize to and, for simplicity, assume that the stochastic gradients are uniformly bounded by . This condition also provides a deterministic observable initialization: unbiasedness and conditional Jensen's inequality imply , while strong convexity and first-order optimality yield . Consequently,
The following proposition shows that, under this classical specialization, the observable envelope decays at the 1/t rate in the worst case, up to an iterated-logarithmic factor typical of anytime-valid analysis.
Proposition 2.4 (Decay rate of the observable confidence sequence for ). Fix and suppose Assumptions 1.1–1.4 hold. Let and for every , and suppose that almost surely for every . Initialize the recursive construction using from (18). Define
Then there exists a universal constant such that, almost surely,
Proposition 2.4 reveals why the recursive construction preserves the strongly convex rate. The recursion does more than replace the latent distances by observable upper bounds: each newly computed envelope is fed back into the subsequent intrinsic-time increments. In this sense, the construction is self-localizing, since a shrinking certified radius leads to a corresponding reduction in the variance scale governing future deviations. Under , this feedback reduces the intrinsic-time growth from order under a fixed global radius to order , up to slowly varying factors. Because the stitched boundary scales with the square root of the intrinsic time, it is therefore of order , again up to slowly varying factors. After normalization by , this yields the decay established above. The following remark makes this improvement explicit by comparing the recursive construction with the simpler diameter-based substitution.
Remark 2.5 (Decay rate under the diameter-based observable bound). Suppose the conditions of Proposition 2.4 hold and that is compact with diameter , so that . Then, under with and ,
Consequently, using the monotonicity of ,
Thus, directly replacing the distances by the diameter bound yields only a -type decay, up to stitched-logarithmic factors, whereas the recursive observable envelope preserves the near-1/t rate.
The preceding proposition was stated for the stepsize . In the sequel, it is also useful to have the analogous rate statement for the common alternative schedule . We record this variant here.
Remark 2.6 (Alternative polynomial stepsize). The same rate conclusion holds for the stepsize
In this case, , so the natural analysis start time is . Following similar steps to those in the proof of Proposition 2.4, there exists a universal constant such that, for every ,
The proof is similar to the proof of Proposition 2.4 and is omitted.
In this proof, we track an explicit, though unoptimized, value of C to illustrate that the constants can be made fully explicit. In subsequent rate proofs, C denotes a universal constant whose value may change from line to line.
2.2 Suboptimality of the weighted-average iterate
We next consider the suboptimality of the weighted-average iterate and construct an upper confidence sequence for . Recalling the definitions in (5) and (6), the analysis follows the same basic structure as for the last-iterate distance to the optimizer: the objective gap is bounded by an initialization term, an observable accumulation of squared stochastic gradients, and a partial sum of directional gradient noise terms that can again be controlled using Lemma 2.1.
For this construction, we take and specialize to the stepsize considered in Remark 2.6. This choice is naturally aligned with the linear weights defining : after the one-step suboptimality inequality is weighted by , the resulting distance terms telescope across consecutive times. Define
The resulting weighted decomposition is recorded in Lemma C.3 and gives
This decomposition follows from the standard weighted telescoping argument for strongly convex SGD; see Lacoste-Julien et al. [26, Section 3.2]. We retain the directional gradient-noise term explicitly, rather than taking expectations, for the anytime-valid analysis.
The first term on the right-hand side of (19) is observable from the SGD trajectory, the second is an initialization term, and the final term accumulates the gradient noise in the directions . Thus, as in the distance analysis, a time-uniform upper bound on translates directly into an upper confidence sequence for the weighted-average suboptimality.
To control this final term, define the predictable intrinsic-time increment
The sequence is adapted, while is predictable because is -measurable. Applying the conditional sub-Gaussian bound in Assumption 1.3(ii) with the predictable direction yields
for every and every . Since the coefficient in the conditional exponent is , this is precisely the setting of Lemma 2.1 with .
Using the notation in (12) and the stitched-boundary function in (13), define, for every ,
In this application, is the cumulative intrinsic time associated with the weighted directional-noise terms. Since the conditional exponential bound corresponds to , Lemma 2.1 guarantees that
simultaneously for every with probability at least . Combining this bound with (19) gives the following proposition.
Proposition 2.7 (Confidence sequence for ). Suppose Assumptions 1.1–1.4 hold. Let and for every . Then, for every , the process
is an upper confidence sequence for the weighted-average suboptimality, in the sense that
Proposition 2.7 is not yet fully observable, because both the initialization term and the intrinsic time depend on the unknown distances to the optimizer. The key difference from the preceding subsection is that no second recursive construction is needed. Theorem 2.3 already provides observable upper bounds on the entire distance sequence, which can be substituted directly into the suboptimality bound. We allocate error probability to the distance confidence sequence and to the stitched bound for the weighted directional-noise process. On the intersection of the two corresponding events, every unknown distance is dominated by its observable envelope, and the resulting suboptimality bound holds simultaneously over time. A union bound then gives overall coverage at least . This coupling has only a mild cost: replacing by adds to the confidence logarithms appearing inside the square-root boundaries.
Recall the observable distance proxies defined in (15). To make their dependence on the confidence level explicit, for write
On the simultaneous-coverage event of Theorem 2.3 at level , these proxies satisfy
For , define the observable intrinsic time
On the distance-coverage event at level , the observable intrinsic time dominates its latent counterpart for every . Since is nondecreasing,
The same distance proxies also control the initialization term, since . Thus, the distance confidence sequence supplies both ingredients needed to make the suboptimality certificate observable. Given , define the observable suboptimality envelope
The construction is observable: for , the proxy is -measurable and is therefore available before is observed. At the end of iteration , all distance proxies in (22) with index at most and all gradients with are available, so (23) and (24) define an -measurable quantity.
Theorem 2.8 (Observable confidence sequence for ). Suppose Assumptions 1.1–1.4 hold. Let and for every , and let be an -measurable quantity satisfying almost surely. Then, for every , the process is fully observable and satisfies
We now turn to the decay of the observable suboptimality confidence sequence under the same bounded-gradient specialization used in Proposition 2.4. In particular, the deterministic initialization from (18) remains available, although any sharper observable upper bound on may be used instead. Since the present construction uses the stepsize , the rate analysis combines Proposition 2.4 with its extension in Remark 2.6. The following proposition shows that the resulting observable suboptimality envelope recovers the optimal rate in the worst case, up to iterated-logarithmic factors.
Proposition 2.9 (Decay rate of the observable confidence sequence for ). Fix and suppose Assumptions 1.1–1.4 hold. Let , , and for every , and suppose that almost surely for every . Define
and, for , let
Then there exists a universal constant C > 0 such that, almost surely,
Proposition 2.9 shows that passing from observable distance bounds to an observable suboptimality certificate does not degrade the optimal worst-case rate. Indeed, the near-1/s distance envelopes make the suboptimality intrinsic time grow as , up to slowly varying factors; the corresponding stitched boundary therefore grows as , and division by yields the near-1/t decay. Directly bounding objective suboptimality also improves the dependence on the strong-convexity parameter by one power: the terms and in the distance certificate become and . Consequently, when is small, the suboptimality certificate can become informative at a substantially earlier stage of the optimization trajectory.
3 Refined Confidence Sequences under Bounded Gradients
The preceding section constructed anytime-valid upper confidence sequences for the last-iterate squared distance and the suboptimality of the weighted-average iterate, , under a conditional sub-Gaussian assumption on the gradient noise. Under bounded stochastic gradients, conditional Hoeffding's lemma verifies this assumption with , so those confidence sequences remain valid. With this choice, however, the intrinsic times entering the observable distance and suboptimality confidence sequences are driven by the worst-case proxy and therefore do not adapt to the realized magnitudes of the stochastic gradients. Because is a uniform bound, it can be substantially larger than the gradient magnitudes observed along a typical trajectory, making the stochastic contribution to the resulting certificates unnecessarily large.
The natural refinement is to let the stochastic boundaries respond to the gradients actually observed along the trajectory. Under the bounded-gradient assumption, an empirical Bernstein construction makes this possible by replacing the fixed proxy with quadratic processes involving the realized values of . The relevant directional terms, however, have ranges that evolve with the SGD trajectory, so a fixed-range empirical Bernstein bound is not sufficient for our purposes. We therefore develop a time-uniform empirical Bernstein inequality for a growing predictable range, which will provide the common concentration argument for both the last-iterate distance and weighted-average suboptimality. This development builds on the empirical Bernstein supermartingale construction of Howard et al. [24] and the exponential inequality of Fan et al. [15] underlying it. As emphasized in [24], this approach is technically closer to the literature on self-normalized bounds [10] than to classical empirical Bernstein arguments such as Maurer and Pontil [30]. The latter combine a concentration bound for the sample mean involving the true variance with a separate concentration bound for the sample variance. By contrast, Howard et al. [24] construct an exponential supermartingale that directly relates the centered process to an online empirical variance.
We impose the following assumption throughout this section.
Assumption 3.1 (Bounded stochastic gradients). There exists such that
As shown in (18), Assumption 3.1 always yields the observable initialization . This universal choice will be used below, although sharper observable bounds on may be available in specific applications and can be substituted directly into the construction.
The concentration mechanism remains the same as in the preceding section: a one-step conditional exponential bound is lifted to a time-uniform boundary through a supermartingale argument and stitching. What changes is the compensating term. Rather than using a predictable variance proxy, the empirical Bernstein inequality below uses the realized square of the increment itself. This is the key mechanism that will allow the resulting confidence sequences to adapt to the stochastic gradients observed along the trajectory.
The following lemma isolates this one-step ingredient in the precise form needed below. Starting from a pointwise exponential inequality, it yields after conditional centering a bound in which the quadratic compensation depends on the realized square , while the admissible tuning parameter is restricted by the increment range . These two features will drive the time-uniform construction that follows. To state the lemma, for define
We are now ready to state the lemma.
Lemma 3.2 (Conditional exponential moment bound). For every and every ,
Moreover,
Consequently, let be a sigma-field, let be an integrable real-valued random variable satisfying almost surely for some deterministic , and let . Then
The pointwise inequality (26) was first established in the proof of Fan et al. [15, Lemma 4.1]. In Howard et al. [24, Theorem 4], this inequality is applied conditionally to deviations from a predictable reference sequence, and the corresponding squared deviations are accumulated to construct a time-uniform empirical Bernstein confidence sequence. Equation (28) records the one-step conditional form needed here, with the predictable reference specialized to zero and the quadratic coefficient simplified using (27). A self-contained proof is provided in the appendix.
We now lift the one-step inequality in Lemma 3.2 to a time-uniform bound. Two evolving scales enter the construction. First, the quadratic compensation in (28) accumulates the realized squared increments. Second, the admissible tuning parameter depends on the range of the increment. In our applications this range is predictable and may grow with the trajectory, without admitting any finite uniform bound over the infinite horizon. A time-uniform boundary must therefore adapt simultaneously to the accumulated quadratic process and to the largest predictable range encountered so far. We achieve this by stitching over dyadic scales of both quantities.
For , define the effective quadratic-process and range scales
and the corresponding dyadic indices
Both indices take values in . As in Lemma 2.1, the unit floor prevents negative dyadic indices and keeps the boundary well defined when either argument is zero. For , define
and let
The two logarithmic scale terms in account for the simultaneous stitching over the quadratic process and the predictable range. The resulting boundary is the empirical Bernstein counterpart of the stitched sub-Gaussian boundary from the preceding section, with the additional range scale allowing the predictable increment bound to evolve without any uniform upper bound over time. To the best of our knowledge, this is the first time-uniform empirical Bernstein bound that allows the predictable range to vary with the history and grow without any finite uniform bound over the infinite horizon.
Theorem 3.3 (Empirical Bernstein bound with a growing predictable range). Fix a deterministic integer . Let be a filtration. Let be a real-valued integrable adapted process, and let be an almost surely finite, nonnegative predictable process such that
No uniform upper bound on the process is assumed.
Define
and
Then, for every ,
Moreover, the map is nondecreasing in each argument.
Theorem 3.3 will now be used to refine the distance and weighted-suboptimality confidence sequences developed in the preceding section. We treat the two cases separately, beginning with the last-iterate distance to the optimizer.
3.1 Last-iterate squared distance to the optimizer
We begin with the last-iterate distance to the optimizer. Recall from Lemma C.2 that the distance analysis reduces to controlling the partial sum of the directional gradient noise terms . To bring this term within the scope of Theorem 3.3, define the corresponding uncentered directional stochastic-gradient term
By conditional unbiasedness, . Thus, the centered process appearing in Theorem 3.3 is exactly the stochastic term already isolated by the distance decomposition. Under Assumption 3.1,
For the canonical stepsize , we have , while the distance confidence sequence of the preceding section gives . Hence the predictable range can grow as , and in particular need not remain bounded over the infinite horizon. This is precisely the setting covered by Theorem 3.3. Accordingly, define the latent quadratic and range processes
These are the distance-specific counterparts of the quadratic process and the running predictable range in Theorem 3.3. The generic theorem also requires to be integrable. Since almost surely, it is enough to assume
This mild technical condition is automatic for the deterministic stepsize schedules considered below.
Combining Lemma C.2 with Theorem 3.3 gives the latent empirical Bernstein confidence sequence
(38) which satisfies
This is the empirical Bernstein counterpart of Proposition 2.2 from the preceding section. The argument follows the same overall logic, with Theorem 3.3 providing the corresponding concentration step. We defer the formal proof of this confidence-sequence guarantee to Proposition B.1 in the appendix.
Remark 3.4 (Comparison with the sub-Gaussian construction). This empirical Bernstein refinement admits a direct comparison with the sub-Gaussian confidence sequence from Proposition 2.2. The leading square-root term in is the analogue of . Under the bounded-gradient choice , the latter uses the fixed worst-case scale , whereas the former is driven by the realized directional quantities . In the worst case, when and the directional bound is attained, , so the leading factor 2 in exactly recovers the outer factor 4 in , up to the additional iterated-logarithmic factor required to stitch over the predictable range. Away from this worst case, the leading term in adapts to the realized stochastic-gradient magnitudes and directions, as desired. Beyond this additional logarithmic factor, the only new additive contribution is the linear range term in . For the observable construction below, Proposition 3.6 shows that the corresponding range contribution is lower order, scaling as rather than .
The bound is not yet observable, however, because , the directions , and the distances entering all depend on the unknown optimizer. We remove this dependence using the same recursive domination principle as in the preceding section, now applied simultaneously to the two arguments of . We formalize this construction. Fix , and let be any -measurable quantity satisfying almost surely. Define recursively the observable distance envelopes
For , set
and define
The recursion is sequentially well defined: when the envelope at time is computed, all with are already available. As in the sub-Gaussian construction, simultaneous domination of the unknown distances by these observable distance envelopes yields observable upper bounds on both the latent quadratic process and the predictable range; monotonicity of then propagates the domination through the recursion.
Theorem 3.5 (Refined observable confidence sequence for ). Suppose Assumptions 1.1–1.4 and 3.1 hold, and suppose (37) is satisfied. Let be an -measurable quantity satisfying almost surely. Then, for every , the recursively defined process is well defined and fully observable from and the SGD trajectory. Moreover,
The observable construction preserves the trajectory adaptation highlighted in Remark 3.4: the quadratic process (40) depends on the realized values , while the recursive observable distance envelopes remove the remaining dependence on the unknown optimizer. The global bound remains only in the predictable-range process (41) and, when used, in the canonical initialization . It remains to understand the cost of accommodating the growing predictable range. The empirical Bernstein boundary introduces the additional linear range term in (32), which has no counterpart in the sub-Gaussian construction. The next proposition shows that this term is of lower order and that the full observable confidence sequence retains the near-1/t decay established in the preceding section. Define
and, for ,
To isolate the contribution of the linear range term in (32), define
With these quantities in place, we are ready to state the proposition.
Proposition 3.6 (Decay rate of the refined observable confidence sequence for ). Fix and suppose the conditions of Theorem 3.5 hold. Let , , and . Then there exist universal constants such that, almost surely,
and, whenever and ,
Proposition 3.6 yields two useful conclusions. First, once , the observable confidence sequence satisfies
thereby recovering the same near-1/t worst-case decay rate as the sub-Gaussian construction. For fixed and fixed problem parameters, this condition holds for all sufficiently large . Second, (47) shows that the additional contribution induced by the growing predictable range is of lower order than the leading term.
Remark 3.7 (Alternative polynomial stepsize). The same conclusion holds for the stepsize
In this case, , so the natural analysis start time is . Following similar steps to those in the proof of Proposition 3.6, there exists a universal constant such that, almost surely, for every ,
The analogue of (47) holds as well, with a different universal constant. The proof is similar and is omitted.
3.2 Suboptimality of the weighted-average iterate
We now turn to the weighted-average suboptimality. Recall from Lemma C.3 that the suboptimality analysis reduces to controlling the partial sum of the directional gradient noise terms . To bring this term within the scope of Theorem 3.3, define the corresponding uncentered directional stochastic-gradient term
By conditional unbiasedness, . Thus, the centered process appearing in Theorem 3.3 is exactly the stochastic term already isolated by the suboptimality decomposition. Under Assumption 3.1,
As in the distance construction, the bound implies that the predictable range can grow as and need not remain bounded over the infinite horizon. Accordingly, define the latent quadratic and range processes
These are the corresponding quadratic and predictable-range processes for the suboptimality analysis. Moreover, since almost surely, is integrable for every deterministic .
Combining Lemma C.3 with Theorem 3.3 gives the latent empirical Bernstein confidence sequence
which satisfies
This is the empirical Bernstein counterpart of Proposition 2.7 from the preceding section. The argument follows the same overall logic, with Theorem 3.3 providing the corresponding concentration step. We defer the formal proof of this confidence-sequence guarantee to Proposition B.2 in the appendix.
As in the distance construction, the latent bound is not observable because , the directions , and the distances entering depend on the unknown optimizer. Here this dependence can be removed directly using the observable distance confidence sequence constructed above. Let be any -measurable quantity satisfying almost surely. For , define the observable distance envelopes
For , set
Given , define
As in the distance construction, the observable distance envelopes dominate the unknown distances simultaneously and therefore yield observable upper bounds on both latent arguments of . The use of confidence level accounts for the simultaneous validity of the distance and suboptimality confidence sequences.
Theorem 3.8 (Refined observable confidence sequence for ). Suppose Assumptions 1.1–1.4 and 3.1 hold. Let and for every , and let be an -measurable quantity satisfying almost surely. Then, for every , the process is well defined and fully observable from and the SGD trajectory. Moreover,
The observable construction preserves the same trajectory adaptation: the quadratic process (53) depends on the realized values , while the observable distance envelopes remove the remaining dependence on the unknown optimizer. As in the distance analysis, it remains to quantify the cost of the growing predictable range. Recall from (43), and define
and, for ,
To isolate the contribution of the linear range term in (32), define
With these quantities in place, we are ready to state the proposition.
Proposition 3.9 (Decay rate of the refined observable confidence sequence for ). Fix and suppose Assumptions 1.1–1.4 and 3.1 hold. Let , , and for every . Then there exist universal constants such that, almost surely,
and, whenever ,
Proposition 3.9 yields the same two conclusions as in the distance analysis. First, once , the observable confidence sequence satisfies
thereby recovering the same near-1/t worst-case decay rate as the sub-Gaussian construction. For fixed and fixed problem parameters, this condition holds for all sufficiently large . Second, (60) shows that the additional contribution induced by the growing predictable range is of lower order than the leading term.
4 Minibatch Extensions
The confidence sequences developed in the preceding two sections admit natural extensions to minibatch SGD. Fix an integer . At every iteration , conditionally on , suppose that we observe independent and identically distributed stochastic gradients satisfying
Let denote the filtration generated by the history through iteration . Define the minibatch gradient and its noise by
and let the SGD update use in place of .
For the sub-Gaussian confidence sequences of Section 2, the effect of minibatching is immediate. Suppose, in addition, that the individual noises satisfy the conditional sub-Gaussian condition in Assumption 1.3 with the same variance proxy . Conditional independence then implies that their average satisfies the same conditional sub-Gaussian bound with variance proxy . Consequently, the confidence sequences of Section 2 extend directly to minibatch SGD by replacing with in the corresponding variance processes and replacing with in the SGD recursions.
The empirical Bernstein construction of Section 3 allows the information contained in the minibatch to be used more finely. The sub-Gaussian construction summarizes the stochastic fluctuations through the fixed conditional variance proxy . By contrast, the empirical Bernstein argument can be applied to the individual observations before they are averaged. Conditional independence allows the corresponding one-step exponential bounds to be combined while retaining the sum of the individual realized quadratic contributions. Thus, the leading square-root term enjoys the usual minibatch reduction while continuing to adapt to the realized directional second moments within each minibatch, whereas the linear range term carries an explicit factor .
This observation yields a general minibatch extension of Theorem 3.3, in which the centered process is formed from the minibatch averages while the realized quadratic process retains the individual observations within each minibatch. The resulting form will apply directly to both the distance and suboptimality confidence sequences.
Proposition 4.1 (Minibatch empirical Bernstein bound with a growing predictable range). Fix deterministic integers and , and let be a filtration. For every , let be integrable, -measurable random variables that are conditionally independent given and have a common conditional mean , for . Let be an almost surely finite, nonnegative predictable process such that almost surely for every and . Define
and
As in Theorem 3.3, no uniform upper bound on the process is assumed.
Then, for every ,
For , Proposition 4.1 reduces exactly to Theorem 3.3. We next specialize Proposition 4.1 to the SGD setting. For this purpose, we impose the minibatch analogue of Assumption 3.1.
Assumption 4.2 (Bounded minibatch stochastic gradients). There exists such that
We now specialize Proposition 4.1 to the SGD confidence sequences, beginning with the last-iterate distance. For every , define the observable within-minibatch second-moment matrix
As in the single-gradient construction of Section 3, set
Their averaged centered increment is exactly the stochastic term arising from the distance decomposition with in place of . Moreover,
while Assumption 4.2 gives
Thus, the minibatch quadratic process retains the realized directional second moment encoded by , rather than reducing the stochastic fluctuations to a fixed variance proxy.
To make the resulting bound fully observable, we use the same recursive domination argument as in the distance construction of Section 3. Since
the unknown distance can again be replaced by a previously constructed distance envelope. Fix , and let be any -measurable quantity satisfying almost surely. Define recursively
For every , set
and define
As in the single-gradient case, the construction is recursive: is available before the minibatch at iteration s is observed, and the quantities above determine the distance envelope for the next iterate. The following corollary is the minibatch analogue of Theorem 3.5.
Corollary 4.3 (Refined observable minibatch confidence sequence for ). Suppose Assumptions 1.1–1.4 and 4.2 hold, and suppose (37) is satisfied. Let be an -measurable quantity satisfying almost surely. Then, for every , the recursively defined process is well defined and fully observable from and the minibatch SGD trajectory. Moreover,
The spectral relaxation (65) makes the directional quadratic process observable while retaining information about the geometry of the realized minibatch. Indeed, the latent quantity depends on the unknown direction , whereas provides a direction-free upper bound determined entirely by the observed stochastic gradients. Moreover,
so the resulting bound can be substantially sharper than replacing the quadratic process by the uniform worst-case factor , particularly when the realized gradients are small or their energy is spread across several directions. This refinement also remains computationally tractable: since has rank at most , its largest eigenvalue can be computed from a Gram matrix, without forming or diagonalizing a full matrix.
We next turn to weighted-average suboptimality. As in the single-gradient construction of Section 3, the stochastic term in the weighted suboptimality decomposition is controlled through the directional observations
Their averaged centered increment is , and
while Assumption 4.2 gives
Thus, as in the distance construction, the latent quadratic and range processes can be made observable using the same spectral relaxation together with the previously constructed minibatch distance envelopes. For a confidence level , define
For every , set
Given , define
(73)
The following corollary is the minibatch analogue of Theorem 3.8.
Corollary 4.4 (Refined observable minibatch confidence sequence for ). Suppose Assumptions 1.1–1.4 and 4.2 hold. Let and for every , and let be an -measurable quantity satisfying almost surely. Then, for every , the process is well defined and fully observable from and the minibatch SGD trajectory. Moreover,
When , we have and , so the minibatch distance and suboptimality constructions reduce exactly to their single-gradient empirical Bernstein counterparts in Section 3. For general , the factor in the observable quadratic processes combines with the prefactor outside the empirical Bernstein boundary to yield the usual reduction in the leading square-root term, up to the iterated-logarithmic factors from stitching, while the linear range term carries the explicit factor .
5 Experiments
To study the empirical performance of our confidence sequences, we run a series of experiments on a primal support vector machine (SVM) problem, using both real-world and synthetic data. Section 5.1 details the optimization problem, the experimental protocol, and the bounds we compare against. Section 5.2 then discusses the introductory figure (Figure 1), which illustrates the improvement in certified stopping on a single instance. Section 5.3 (Figure 2) varies the minibatch size b, exhibiting its effect on the relative behavior of the bounds. Section 5.4 (Figure 3) compares three synthetic datasets of increasing difficulty while keeping all constants entering the bounds fixed, thereby isolating trajectory adaptivity. We conclude with two verifications. Section 5.5 (Figures 4 and 5) checks the sensitivity of our bounds to conservatively chosen constants, and Section 5.6 (Figure 6) examines whether the same behavior persists in a single-pass regime beyond the finite-dataset formulation used in the preceding experiments.
5.1 Experimental setup
We consider the SVM primal optimization problem
where follows a probability distribution on and satisfies almost surely. This problem is -strongly convex and nonsmooth. For a minibatch size , at each time we sample independently from , conditionally on , and define
where is used in the SGD update. For , this reduces to the single-gradient setting; in that case, we simply write . Since (74) is not differentiable in general, each is an unbiased stochastic subgradient rather than a stochastic gradient. Although we assume differentiability throughout the paper for notational convenience, the same arguments apply with unbiased stochastic subgradients.
For the explicit constants, first notice that
We therefore take , which contains and hence has the same minimizer as the unconstrained problem (74). On ,
Thus the bounded-gradient conditions required by the empirical-Bernstein-based confidence sequences hold. In particular, the conditional Hoeffding lemma gives the valid minibatch sub-Gaussian proxy for . Finally, we use , the squared diameter of , as a deterministic bound on .
Data and protocol. We run experiments on the covertype.binary dataset, obtained from the LIBSVM data websitem and on synthetic datasets generated with scikit-learn's make_classification. A bias term is appended to every dataset, and dense features are standardized to zero mean and unit variance.
To account for the fact that we work with finite datasets, we take Q to be the uniform distribution over the dataset, rather than the unknown data-generating distribution. Sampling independently from Q, i.e., with replacement, makes the empirical risk problem a special case of our general setting. To confirm that the performance of our confidence sequences is not an artifact of this special case, we also conduct a true single-pass experiment in which SGD uses each data point exactly once, directly targeting the expected risk under the data-generating distribution. The full details and results of this experiment are discussed in Section 5.6.
In all experiments we set , choose the confidence level , use , and take the stepsize schedule . For the finite-dataset experiments, the ground-truth quantities and are computed beforehand with LIBLINEAR [14]. The resulting numerical error is several orders of magnitude below the smallest values appearing in our plots, so these quantities can be treated as exact.
Each figure reports a single trajectory of SGD. This is deliberate: our goal is to illustrate how the confidence sequences and the resulting stopping certificates evolve along an individual realized trajectory, rather than to average away their trajectory dependence across runs. Repeating the experiments with several seeds yields essentially identical qualitative behavior, and we therefore report a single run. Similarly, the horizon at which our plots stop is arbitrary: all the confidence sequences we display remain valid beyond it and do not depend on it.
Compared bounds. For both the squared distance to the optimum and the suboptimality of the weighted average, we compare the quantities listed in Table 1. The two worst-case baselines are obtained from our Hoeffding-based confidence sequences by replacing the realized squared-gradient terms by their a priori upper bound and propagating this replacement through the recursive distance envelopes. With denoting the individual-gradient sub-Gaussian proxy, so that is the corresponding minibatch proxy, this yields
https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/
https://scikit-learn.org/stable/modules/generated/sklearn.datasets.make_classification.html
In the minibatch experiments, we use the direct minibatch extension described at the beginning of Section 4, replacing with in the corresponding variance processes and with in the SGD recursions.
| Label | Quantity | Anytime-valid | Trajectory-adaptive | Reference |
|---|---|---|---|---|
| Ground truth | — | — | — | |
| H | yes | yes | Theorem 2.3 10 | |
| EB | yes | yes | Corollary 4.3 | |
| worst-case | yes | no | (75) | |
| RSS12 | no | no | [36] | |
| Ground truth | — | — | — | |
| H | yes | yes | Theorem 2.8 | |
| EB | yes | yes | Corollary 4.4 | |
| worst-case | yes | no | (76) |
Table 1: Quantities compared in the experiments. All bounds are plotted at confidence level and use the same trajectory.
for squared distance, and
for suboptimality. Under the deterministic stepsize schedule used in our experiments, these sequences are deterministic and trajectory-independent. They are also well defined recursively: the distance sequence is initialized at , and the suboptimality sequence uses the already defined distance sequence at level . Moreover, since almost surely and is nondecreasing, the same recursive domination argument used for the Hoeffding-based confidence sequences shows that the worst-case baselines remain valid confidence sequences. Comparing with the corresponding worst-case baseline therefore isolates the effect of adapting the Hoeffding-based construction to the realized trajectory.
For the distance to the optimum, we additionally compare against the high-probability bound of Rakhlin et al. [36, Proposition 1], which states that, for any fixed horizon , with probability at least , simultaneously for all ,
This bound stems from the same standard one-step recursion underlying our distance analysis, but differs from in several respects. First, (77) is stated in closed form, at the price of a multiplicative constant that is not necessarily optimized, whereas is defined recursively. Second, (77) does not account for the variance reduction due to minibatching, whereas uses the minibatch variance proxy . The effect of this difference will be illustrated in Section 5.3 by varying . Third, (77) is a finite-horizon simultaneous guarantee rather than a confidence sequence in our sense, since the horizon must be fixed in advance. We take , the most favorable valid choice for covering the entire plotted horizon. More recently, Pham et al. [33] obtained an infinite-horizon time-uniform analogue that removes the need to specify , but with a larger leading constant (1008 instead of 624). Since our goal is to compare against a favorable explicit literature benchmark, we therefore use (77) in the experiments.
The bound (77) is stated for the stepsize schedule , while our experiments use . Both belong to the standard stepsize regime for strongly convex stochastic optimization, and we use (77) as the corresponding explicit literature benchmark. Overall, the two baselines serve different purposes: RSS12 provides an explicit finite-horizon literature benchmark, while is the natural non-adaptive counterpart of our Hoeffding-based confidence sequence under the same stepsize schedule and minibatch variance proxy.
For the suboptimality of the weighted average, we are not aware of a high-probability bound in the literature stated with explicit constants. Harvey et al. [21] establish such a bound for the same linearly weighted averaging scheme and stepsize schedule, but only up to unspecified absolute constants, which makes a direct quantitative comparison impossible without further analysis. We therefore compare only against the worst-case baseline above.
5.2 Introductory plot
We begin with an experiment illustrating our main findings. We run SGD on covertype.binary with minibatch size . Figure 1 reports, on log-log axes, the squared distance to the optimum (left) and the suboptimality of the weighted average (right), with the bounds of Table 1 evaluated along the same trajectory. On the right panel, we mark for each bound the first time it drops below the threshold . Stopping SGD at this time certifies, with probability , that the returned weighted average satisfies .
Note first that lies several orders of magnitude below RSS12. As explained in Section 5.1, this reflects the larger explicit constants in RSS12 together with the fact that it does not account for the variance reduction due to minibatching. The role of minibatching is examined separately in Section 5.3.
Turning to the confidence sequences, the Hoeffding-based bound certifies the threshold 6.1 times earlier than the worst-case baseline, while the empirical Bernstein minibatch bound does so 312 times earlier. In terms of gradient lookups, this corresponds to lookups for , for , and for the worst-case baseline, all for the same confidence level and target accuracy.
These improvements illustrate the adaptivity of our confidence sequences, which make use of observed quantities along the trajectory rather than their a priori upper bounds. The further improvement of the empirical Bernstein sequence over the Hoeffding-based one reflects its ability to exploit the realized second-moment structure within each minibatch, rather than relying only on the fixed sub-Gaussian variance proxy. Overall, the experiment shows that trajectory adaptation can substantially tighten the resulting certificates while preserving their anytime-valid guarantees.
5.3 Effect of the minibatch size
We now repeat the previous experiment on covertype.binary with , all other parameters being unchanged. All three runs are given the same budget of gradient lookups. Although the performance of SGD may differ, the goal of this experiment is not to isolate how fast the algorithm converges, but how tightly its progress can be certified. The question of choosing the minibatch size is beyond the scope of this paper; here we only study its effect on the confidence sequences.
Figure 2 reports the results. The ordering of the curves remains the same across all three experiments, and the overall picture of Section 5.2 is unchanged. We make the following additional observations:

Figure 2: SGD on the covertype.binary dataset for minibatch sizes (left), 32 (middle), and 1024 (right). Top row: squared distance to the optimum. Bottom row: suboptimality of the weighted average. All panels use the conventions of Figure 1: ground truth (solid gray line), worst-case bound (dash-dotted blue line), H (solid orange line with squares), and EB (solid red line with triangles); RSS12 (dotted blue line) is shown in the distance panels only.
-
The bound of Rakhlin et al. [36] is about one order of magnitude above our worst-case baseline at . As grows, the gap widens to three orders of magnitude at . At , the difference is primarily due to the explicit constants, while for larger values of the gap widens because captures the variance reduction due to minibatching through the proxy , whereas RSS12 does not.
-
Hoeffding-based H is indistinguishable from worst-case at . The adaptive contribution in H comes from retaining the realized squared minibatch-gradient norms in the deterministic accumulation, whereas the recursive deviation term uses the fixed variance proxy . At , the latter dominates, so replacing by changes little. As increases, the deviation term shrinks and the trajectory-dependent accumulation becomes relatively more important, making the effect of adaptivity increasingly visible.
• Empirical-Bernstein-based EB improves on H by about one order of magnitude already at , and this gap widens with . Unlike H, whose deviation term is controlled by the fixed variance proxy , EB exploits the realized second-moment structure within each minibatch through . The contribution of each minibatch to the leading square-root term therefore carries the usual scaling while adapting to . In addition, the lower-order range term carries an explicit factor and hence decreases faster with the minibatch size.
- The gap between the ground truth and the worst-case baseline also widens with b. The EB confidence sequence nevertheless recovers a growing share of this gap. Define

Figure 3: SGD on three datasets generated with make_classification, with increasing class separability from A to C. Left: squared distance to the optimum. Right: suboptimality of the weighted average. Each panel shows the ground truth (solid gray lines) and EB (solid red lines) for each dataset, with increasing shade darkness from A to C and each curve labelled accordingly, together with the worst-case bound (dash-dotted blue line); RSS12 (dotted blue line) is shown in the distance panel only.
| class_sep | flip_y | |
|---|---|---|
| A (low separability) | 0.2 | 0.1 |
| B (medium separability) | 1.0 | 0.02 |
| C (high separability) | 5.0 | 0.0 |
Table 2: Parameters of each generated dataset.
the fraction of the gap between the worst-case bound and the ground truth recovered by EB on a logarithmic scale. At the end of the budget, we obtain , , and for , respectively.
5.4 Adaptivity across problem instances
In this experiment, we aim to isolate the trajectory adaptivity of the empirical Bernstein confidence sequence. We generate three datasets with make_classification, of increasing class separability, and report the evolution of the ground-truth quantities and , together with EB (Figure 3).
The dataset parameters are given in Table 2. For all three, we set n_samples = , n_features = 20, and n_clusters_per_class = 1. Each dataset is then rescaled so that G has the same value across all three. Since , , b = 256, and are also fixed, the worst-case bound is identical across the three instances.
On these instances, SGD makes faster progress on the more highly separated datasets, and the confidence sequences follow the same ordering. The relationship between the geometry of the data and the performance of SGD on the SVM primal problem is outside the scope of this paper; what matters here is that this variation in performance is invisible to the worst-case analysis but reflected by the trajectory-adaptive confidence sequences. The same deterministic bound applies to all three runs, whereas EB separates them and, after SGD iterations, is roughly 17 times tighter for than for in suboptimality: for , compared with for .

Figure 4: SGD on dataset B from Table 2, with b = 256, comparing the bounds obtained with the correct gradient bound G and with G overestimated by a factor of 10. Solid and dash-dotted lines correspond to the correct value, while dashed lines in lighter shades correspond to the overestimated one. Each panel shows the ground truth (solid gray line), the worst-case bound (blue line), H (orange line with squares), and EB (red line with triangles).
This behavior is consistent with the empirical Bernstein construction, which adapts to the realized second-moment structure within each minibatch through . Better separated datasets have fewer samples with an active hinge loss, and in our experiments this is accompanied by substantially smaller realized values of . The average value of over the last 1% of the run decreases by approximately 73% from A to B, and by approximately 98% from A to C. A deterministic bound depending on G alone cannot distinguish these trajectories.
5.5 Robustness to parameter misspecification
The bounds considered above depend on deterministic problem constants such as , , and , whose roles differ across the different constructions. These quantities are rarely available exactly in practice. The situation is not symmetric: choosing a value that is too small can invalidate the corresponding guarantee, whereas a conservative upper bound preserves validity at the price of tightness. The practical question is therefore what is lost when these constants are chosen too conservatively. We do not vary , since it enters the stepsize schedule and changing it would therefore also change the SGD trajectory itself.
Misspecification of the gradient bound G. We first compare the bounds computed with the correct value of G to the same bounds computed with G overestimated by a factor of 10. For H and the worst-case baseline, we use the valid individual-gradient proxy , so overestimating G by a factor of 10 also overestimates by a factor of 100. The experiment is run on dataset B from the previous subsection, with the SGD trajectory itself unchanged. Figure 4 reports both families of curves.
The worst-case bounds degrade as expected for both squared distance and suboptimality. Their leading asymptotic terms scale with , and the misspecified curves lie approximately a factor of 100 above their well-specified counterparts. A similarly strong effect is observed for Hoeffding-based H, reflecting the dependence of its deviation term on the fixed variance proxy rather than on the realized second-moment structure of the stochastic gradients.
Empirical-Bernstein-based EB behaves differently. Its leading deviation term adapts to the realized

Figure 5: SGD on make_classification dataset, b = 256, comparing EB computed with the correct value of and with over-estimated by factors 10, 100 and 1000. Each panel shows the ground truth (solid gray line) and the four confidence sequences (red lines, in increasingly light shades and increasingly sparse dotting as the over-estimation factor grows, as indicated in the legend).
second-moment structure within each minibatch through , while enters only through the lower-order range term of the empirical Bernstein boundary. The misspecified and well-specified EB curves are consequently asymptotically equivalent. They differ noticeably only at first and agree within a factor of 1.06 after iterations, for both and .
Misspecification of the initial distance bound . We repeat the experiment with overestimated by factors 10, 100, and 1000, while keeping all other quantities fixed, and report EB in each case in Figure 5. Unlike G, enters through the initialization of the recursive distance envelope, and its influence therefore diminishes as the trajectory-dependent terms accumulate. For the squared-distance confidence sequence, the effect is pronounced initially but vanishes rapidly: with overestimated by a factor of 1000, the confidence sequence initially differs from the correctly specified one by the same factor, but their relative difference is only 4% after 100 iterations and 0.01% after iterations.
Taken together, these two experiments show that, along the trajectories considered here, the effect of conservative choices of G and on EB is largely transient. This reflects the trajectory adaptivity of the empirical Bernstein construction: its leading deviation term is driven by realized second-moment quantities, while G enters through the lower-order range term and the influence of is rapidly attenuated by the recursive construction. In practice, this suggests that safe upper bounds on G and need not be specified very precisely for the resulting EB certificates to become largely insensitive to them later in the run.
5.6 True single-pass
All experiments above sample with replacement from the empirical distribution of a finite dataset, which makes (74) the empirical risk and allows to be computed beforehand. We now turn to the population setting, where the observations are modeled as i.i.d. samples from an unknown data-generating distribution P. Under this standard model, processing the dataset once in an order chosen independently of the observations has the same distribution as sequential i.i.d. sampling from P. Two consequences follow: the minimizer of the expected risk cannot be computed beforehand, so no ground truth is available, and the run is necessarily limited by the available sample size.
We run this experiment on covertype.binary, which contains N = 581012 observations, with mini-

Figure 6: SGD on the covertype.binary dataset in a true single-pass regime, with b = 256. Each panel shows the worst-case bound (dash-dotted blue line), H (solid orange line with squares), and EB (solid red line with triangles).
batch size , and report the evolution of worst-case, H, and EB in Figure 6. Using complete minibatches, the run stops after SGD iterations, with no observation reused. The picture is essentially the same as the one observed throughout this section. For suboptimality, is 6.4 times tighter than , while is times tighter. For comparison, in the experiment of Section 5.2, the corresponding factors are also 6.4 and after the same number of iterations. The improvements reported above are therefore not an artifact of repeatedly sampling from a finite empirical distribution and persist in this single-pass expected-risk setting.
5.7 Summary of the empirical findings
As shown in these experiments, on real-world data our confidence sequences can certify a target accuracy several orders of magnitude earlier than the trajectory-independent bounds against which they are compared. This improvement reflects their ability to adapt to the realized SGD trajectory. When all problem constants are fixed and only the problem instance varies, the worst-case bounds remain unchanged while our confidence sequences adapt to the instance. Minibatching further amplifies these differences, and our bounds recover a growing share of the gap between the worst-case bounds and the ground truth as b increases.
The two constructions nevertheless behave differently. The empirical-Bernstein-based sequences are consistently tighter than their Hoeffding-based counterparts in our experiments and appear particularly attractive when the stochastic gradients can be uniformly bounded. Their leading deviation terms adapt to realized second-moment quantities, while the effects of conservative choices of G and become negligible later in the runs considered above. By contrast, the Hoeffding-based sequences retain an asymptotic dependence on the fixed sub-Gaussian variance proxy .
Even with these improvements, a considerable gap remains between the confidence sequences and the ground truth in the experiments where the latter is available. Whether this residual gap can be reduced through a sharper analysis of the SGD dynamics is an interesting question that we leave open.
Acknowledgements
Liviu Aolaritei acknowledges support from the Swiss National Science Foundation through the Post-doc.Mobility Fellowship (grant agreement P500PT_222215). Funded in part by the European Union
(ERC-2022-SYG-OCEAN-101071601). Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Research Council Executive Agency. Neither the European Union nor the granting authority can be held responsible for them.
References
[1] F. J. Anscombe. Fixed-sample-size analysis of sequential observations. Biometrics, 10(1):89–100, 1954.
[2] L. Aolaritei and M. I. Jordan. Stopping rules for stochastic gradient descent via anytime-valid confidence sequences. arXiv preprint arXiv:2512.13123, 2025.
[3] F. Bach. Adaptivity of averaged stochastic gradient descent to local strong convexity for logistic regression. The Journal of Machine Learning Research, 15(1):595–627, 2014.
[4] F. Bach and E. Moulines. Non-asymptotic analysis of stochastic approximation algorithms for machine learning. Advances in Neural Information Processing Systems, 24, 2011.
[5] L. Bottou, F. E. Curtis, and J. Nocedal. Optimization methods for large-scale machine learning. SIAM review, 60(2):223–311, 2018.
[6] K. Chen, Y. Feng, and T. Wang. Revisiting stochastic gradient descent for strongly convex objectives: Tight uniform-in-time bounds. Systems & Control Letters, 212:106419, 2026.
[7] D. A. Darling and H. Robbins. Confidence sequences for mean, variance, and median. Proceedings of the National Academy of Sciences, 58(1):66–68, 1967.
[8] D. A. Darling and H. Robbins. Iterated logarithm inequalities. Proceedings of the National Academy of Sciences, 57(5):1188–1192, 1967.
[9] D. A. Darling and H. Robbins. Some nonparametric sequential tests with power one. Proceedings of the National Academy of Sciences, 61(3):804–809, 1968.
[10] V. H. de la Peña, M. J. Klass, and T. L. Lai. Self-normalized processes: Exponential inequalities, moment bounds and iterated logarithm laws. The Annals of Probability, 32(3):1902–1933, 2004.
[11] V. H. de la Peña, M. J. Klass, and T. L. Lai. Pseudo-maximization and self-normalized processes. Probability Surveys, 4:172–192, 2007.
[12] V. H. de la Peña, T. L. Lai, and Q.-M. Shao. Self-normalized Processes: Limit Theory and Statistical Applications. Springer, 2009.
[13] J. Duchi, E. Hazan, and Y. Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of machine learning research, 12(7), 2011.
[14] R.-E. Fan, K.-W. Chang, C.-J. Hsieh, X.-R. Wang, and C.-J. Lin. Liblinear: A library for large linear classification. the Journal of machine Learning research, 9:1871–1874, 2008.
[15] X. Fan, I. Grama, and Q. Liu. Exponential inequalities for martingales with applications. Electronic Journal of Probability, 20:1–22, 2015.
[16] W. K. Feller. Statistical aspects of ESP. The Journal of Parapsychology, 4(2):271, 1940.
[17] S. Ghadimi and G. Lan. Optimal stochastic approximation algorithms for strongly convex stochastic composite optimization i: A generic algorithmic framework. SIAM Journal on Optimization, 22(4):1469–1492, 2012.
[18] S. Ghadimi and G. Lan. Optimal stochastic approximation algorithms for strongly convex stochastic composite optimization, ii: shrinking procedures and optimal algorithms. SIAM Journal on Optimization, 23(4):2061–2089, 2013.
[19] P. Grünwald, R. de Heide, and W. Koolen. Safe testing. Journal of the Royal Statistical Society Series B: Statistical Methodology, 86(5):1091–1128, 2024.
[20] N. J. Harvey, C. Liaw, Y. Plan, and S. Randhawa. Tight analyses for non-smooth stochastic gradient descent. In Conference on Learning Theory, pages 1579–1613. PMLR, 2019.
[21] N. J. Harvey, C. Liaw, and S. Randhawa. Simple and optimal high-probability bounds for strongly-convex stochastic gradient descent. arXiv preprint arXiv:1909.00843, 2019.
[22] E. Hazan and S. Kale. Beyond the regret minimization barrier: an optimal algorithm for stochastic strongly-convex optimization. In Proceedings of the 24th Annual Conference on Learning Theory, pages 421–436. JMLR Workshop and Conference Proceedings, 2011.
[23] W. Hoeffding. Probability inequalities for sums of bounded random variables. Journal of the American statistical association, 58(301):13–30, 1963.
[24] S. R. Howard, A. Ramdas, J. McAuliffe, and J. Sekhon. Time-uniform, nonparametric, nonasymptotic confidence sequences. The Annals of Statistics, 49(2):1055–1080, 2021.
[25] P. Jain, D. M. Nagaraj, and P. Netrapalli. Making the last iterate of SGD information theoretically optimal. SIAM Journal on Optimization, 31(2):1108–1130, 2021.
[26] S. Lacoste-Julien, M. Schmidt, and F. Bach. A simpler approach to obtaining an O(1/t) convergence rate for the projected stochastic subgradient method. arXiv preprint arXiv:1212.2002, 2012.
[27] T. L. Lai. On confidence sequences. The Annals of Statistics, pages 265–280, 1976.
[28] T. L. Lai and H. Robbins. Adaptive design and stochastic approximation. The Annals of Statistics, 7(6):1196–1221, 1979.
[29] Z. Liu and Z. Zhou. Revisiting the last-iterate convergence of stochastic gradient methods. In International Conference on Learning Representations, volume 2024, pages 40394–40428, 2024.
[30] A. Maurer and M. Pontil. Empirical bernstein bounds and sample variance penalization. In Proceedings of the 22nd Annual Conference on Learning Theory, 2009.
[31] A. Nedic and S. Lee. On stochastic subgradient mirror-descent algorithm with weighted averaging. SIAM Journal on Optimization, 24(1):84–107, 2014.
[32] A. Nemirovski, A. Juditsky, G. Lan, and A. Shapiro. Robust stochastic approximation approach to stochastic programming. SIAM Journal on Optimization, 19(4):1574–1609, 2009.
[33] T. Pham, A. Rinaldo, and P. Sarkar. Time-uniform concentration bounds for iterative algorithms. arXiv preprint arXiv:2511.18273, 2025.
[34] B. T. Polyak and A. B. Juditsky. Acceleration of stochastic approximation by averaging. SIAM Journal on Control and Optimization, 30(4):838–855, 1992.
[35] L. Prechelt. Early stopping-but when? In Neural Networks: Tricks of the trade, pages 55–69. Springer, 1998.
[36] A. Rakhlin, O. Shamir, and K. Sridharan. Making gradient descent optimal for strongly convex stochastic optimization. In International Conference on Machine Learning, pages 1571–1578, 2012.
[37] A. Ramdas and R. Wang. Hypothesis testing with e-values. Foundations and Trends® in Statistics, 1(1–2):1–390, 2025.
[38] A. Ramdas, P. Grünwald, V. Vovk, and G. Shafer. Game-theoretic statistics and safe anytime-valid inference. Statistical Science, 38(4):576–601, 2023.
[39] H. Robbins. Some aspects of the sequential design of experiments. Bulletin of the American Mathematical Society, 58(5):527–535, 1952.
[40] H. Robbins. Statistical methods related to the law of the iterated logarithm. The Annals of Mathematical Statistics, 41(5):1397–1409, 1970.
[41] H. Robbins and S. Monro. A stochastic approximation method. The Annals of Mathematical Statistics, pages 400–407, 1951.
[42] H. Robbins and D. Siegmund. Boundary crossing probabilities for the Wiener process and sample sums. The Annals of Mathematical Statistics, pages 1410–1429, 1970.
[43] H. Robbins and D. Siegmund. A convergence theorem for non-negative almost supermartingales and some applications. In Optimizing methods in statistics, pages 233–257. Elsevier, 1971.
[44] G. Shafer. Testing by betting: A strategy for statistical and scientific communication. Journal of the Royal Statistical Society: Series A (Statistics in Society), 184(2):407–431, 2021.
[45] O. Shamir and T. Zhang. Stochastic gradient descent for non-smooth optimization: Convergence results and optimal averaging schemes. In International Conference on Machine Learning, pages 71–79. PMLR, 2013.
[46] N. Tripuraneni, N. Flammarion, F. Bach, and M. I. Jordan. Averaging stochastic gradient descent on Riemannian manifolds. In Conference On Learning Theory, pages 650–687. PMLR, 2018.
[47] J. Ville. Étude Critique de la Notion de Collectif. Gauthier-Villars, Paris, 1939.
[48] V. Vovk and R. Wang. E-values: Calibration, combination and applications. The Annals of Statistics, 49(3):1736–1754, 2021.
[49] A. Wald. Sequential tests of statistical hypotheses. The Annals of Mathematical Statistics, 16(2): 117–186, 1945.
[50] R. Ward, X. Wu, and L. Bottou. Adagrad stepsizes: Sharp convergence over nonconvex landscapes. Journal of Machine Learning Research, 21(219):1–30, 2020.
A Proofs
A.1 Proofs of Section 2
A.1.1 Proof of Lemma 2.1
For each , define
with . By the conditional exponential bound,
Thus is a nonnegative supermartingale. By Ville's inequality, for every ,
Equivalently,
We now stitch these fixed- bounds over dyadic ranges of the variance process. Define
For , set
Then . For each , choose
Applying (78) with gives
Suppose now that . Then , so on the complement of the above event,
By the choice of ,
Hence
If , then , and so . Therefore
If m = 0, then , and
Thus, for every , outside an event of probability at most ,
Taking a union bound over , with probability at least , the preceding implication holds simultaneously for all and all . On this event, fix any and let
Then , and therefore
Since was arbitrary, the result follows.
A.1.2 Proof of Proposition 2.2
By Lemma C.2, for every ,
It remains to control uniformly over time. Recall that
Since , , and are -measurable, applying Assumption 1.3(ii) with the predictable direction gives
for every . Thus, the sequences and satisfy the hypotheses of Lemma 2.1 with
Applying Lemma 2.1 therefore yields
Substituting this bound into the preceding decomposition and using the definition of in (14) proves the result.
A.1.3 Proof of Theorem 2.3
We first check that the recursion is well-defined. The quantity is defined explicitly from and the data at time . Inductively, if
have been defined, then is also defined, which in turn defines . Thus the sequence is recursively well-defined. Moreover, each depends only on and the observed trajectory up to time , so the construction is fully observable. Now let
be the adaptive confidence sequence from Proposition 2.2, where
Set
By Proposition 2.2, . We will show that on ,
This will imply
on , and therefore establish the claim. By (12) and (13), the map is nondecreasing on . We now prove by induction on that on ,
For the base case , since , we have
By monotonicity,
Using also , we obtain
Now fix , and suppose that for every ,
Since we are on , for each ,
Therefore,
By monotonicity again,
Using also , we conclude that
This closes the induction. Hence, on ,
Therefore,
This completes the proof.
A.1.4 Proof of Proposition 2.4
Fix and write . Since , the sequence is nondecreasing and satisfies for all . For convenience, throughout the proof define
For and , we have
Therefore
In particular,
We first bound the deterministic part of the recursive envelope. Define
Since
The almost-sure bound gives
Using , we obtain
Thus, for every ,
where we used , , and . Hence,
Now set . We prove by induction that
For the base case , note that and , so . Therefore,
Since , this implies . Consequently,
Using for , we get . Hence,
Since and , the preceding display gives
Therefore, by ,
where we used and . Now,
Using , , , and , we obtain
Because and , this yields
since . This proves the base case.
Now fix and assume that
We prove the same bound for . By the recursive definition of the observable intrinsic time,
As shown above, the initial term satisfies . For the summation term, we have
Using the induction hypothesis,
where we used the monotonicity of and the fact that . Since , , , and , we also have
Therefore the initial term and the effective truncation by 1 are both absorbed into the same scale, and
We next control the stitched logarithmic factor. From (80) and ,
Therefore, . Since for ,
The right-hand side is bounded by . Thus,
Each term on the right is controlled by . Indeed,
and, since , we have . Also . Hence
Since , we have
Combining this with (80), we obtain
Dividing by gives
For , we have , and therefore
where we also used .
Finally, by definition,
Using (79) and (81), we get
Since , , and , we conclude that
This closes the induction. Substituting gives the claimed bound.
A.1.5 Proof of Proposition 2.7
Proof. By Lemma C.3, for every ,
It remains to control uniformly over time. Recall that
Since is -measurable, applying Assumption 1.3(ii) with the predictable direction gives
for every . Thus, the increments satisfy the hypotheses of Lemma 2.1 with
Applying Lemma 2.1 with in place of and in place of yields
Substituting this bound into the preceding decomposition and using the definition of in (21) proves the result.
A.1.6 Proof of Theorem 2.8
We first note that, for each , the quantity depends only on , the observed trajectory up to time , and the recursive observable bounds
Hence is fully observable. Now let be the adaptive confidence sequence from Proposition 2.7. Set
By Proposition 2.7, . Also set
By Theorem 2.3, . We now show that on , for all . Indeed, on , we have for every , and also . Therefore,
Since is nondecreasing, it follows that
Using also , we obtain
Therefore, on ,
Hence
where the last step follows from the union bound. This completes the proof.
A.1.7 Proof of Proposition 2.9
Throughout the proof, denotes a universal constant whose value may change from line to line. Write . The sequence is nondecreasing and satisfies . For convenience, throughout the proof define
For every ,
By definition of the observable weighted-average suboptimality bound,
where we used .
We first bound the deterministic terms. Since and, by the standing initialization, , we have
and
Since and , it follows that
It remains to control the observable boundary term. By Remark 2.6, applied with confidence level , there exists a universal constant such that, for every ,
where is the logarithmic factor from Proposition 2.4. Since
we obtain
Using the definition of the observable intrinsic time, we get
The first term is bounded by , because
The second term is bounded by , since
Therefore, using and ,
Since , we have and . Hence
Thus the effective intrinsic time satisfies
Therefore,
The same elementary logarithmic bound used in the proof of Proposition 2.4 then gives
The logarithmic factor on the left is bounded in this way because the preceding display introduces only iterated logarithms of , , and , all of which are absorbed by the definition of ; the same definition also gives . Using the definition of and (83), we obtain
Dividing by gives
Combining (82) and (84), we conclude that
almost surely. This proves the proposition.
A.2 Proofs of Section 3
A.2.1 Proof of Lemma 3.2
The claim is immediate for , so fix . For , define
The logarithm is well defined because , and (26) is equivalent to . Differentiating gives
The power-series representation
implies
The upper bound is (27).
For , the term in parentheses in (85) is at least . Thus is nondecreasing on , and there. For , set
The function is nondecreasing, since
By (86), and . Hence changes sign at most once, from nonpositive to nonnegative. Since , equation (85) shows that first increases and then decreases on . Its minimum is therefore attained at an endpoint. Finally,
This proves (26).
For the conditional statement, let . Apply (26) with and to obtain
Taking conditional expectations and multiplying by the -measurable factor gives
Here , and the last inequality follows from for . By (27),
Replacing the quadratic coefficient by the larger quantity on the right decreases the exponential integrand and proves (28).
A.2.2 Proof of Theorem 3.3
For , define
We stitch over the dyadic intervals
and
For every , set
and
Since
we have
For each pair , define
Then
Fix . Since is -measurable for every , the running maximum is also -measurable. Consequently,
is predictable. Define
and
For , let
If , then
whereas if . Hence
Moreover, predictability gives
Applying Lemma 3.2 conditionally with , , and yields
Thus is a nonnegative supermartingale with . By Ville's inequality,
We now stitch these fixed- bounds over the dyadic ranges of and . Because is nondecreasing, implies
Therefore,
at every time satisfying . Taking a union bound in (88) over all , with probability at least
we have
simultaneously for every and every such that .
Work on this event and fix . Let
and let
Then
and therefore
Moreover,
Applying (89) with gives
By the choice of in (87),
Consequently,
Since was arbitrary, this proves (33). Monotonicity follows because all terms in (29)–(32) are nondecreasing in the corresponding argument.
A.2.3 Proof of Theorem 3.5
The recursion is well defined: at time , all with have already been computed, and therefore (40)–(42) define nonnegative -measurable quantities. Hence the resulting process is fully observable. Let
By Proposition B.1, . We prove by induction that, on this event, for every ,
For , Cauchy–Schwarz and give
and . Monotonicity of then implies the final inequality in (90).
Now fix and suppose the claim holds through time . On , for every ,
Together with , this yields
Monotonicity of and then give
This closes the induction. Hence, on ,
The theorem follows because .
A.2.4 Proof of Proposition 3.6
Throughout the proof, denotes a universal constant whose value may change from line to line. For convenience, throughout the proof define
For the specified stepsize,
Consequently,
In particular, (37) is automatic.
Write
As in the proof of Proposition 2.4, we use an induction argument. We claim that, for a sufficiently large universal constant K,
We first verify the claim at s = 4. Since , the definitions (40)–(41) give
Consequently,
and hence
Using these bounds in (42), together with , yields
Since and , this proves (92) at for some constant .
Now fix and suppose (92) holds through time . The deterministic part of (42) satisfies
(93)
We next control the two arguments of the empirical Bernstein boundary. We claim that
For (94), the contribution of is at most . For , the induction hypothesis, (91), and give
Since is nondecreasing,
The initial contribution and the unit floor are absorbed by the right-hand side of (94).
For (95), the contribution of is at most . For , the induction hypothesis and (91) give
where we used . By the monotonicity of and the inequality
we obtain
The initial contribution and the unit floor are again absorbed, proving (95).
We now bound the logarithmic factor. By (94)–(95) and the definitions in (30),
Since for , these bounds yield
The definition of and the elementary bounds
therefore imply
Combining (91), (94), and (96), the square-root contribution satisfies
(97)
Similarly, the linear range contribution satisfies
For every , the right-hand side of (98) is bounded by a constant multiple of ; whenever , it is bounded by a constant multiple of .
Combining (93), (97), and (98), and using
which implies , gives
Since , a sufficiently large universal makes the bracketed coefficient at most . This closes the induction, and proves (46). Moreover, whenever , we have and therefore .
Finally, whenever and , the sharper form of (98) gives (47) after fixing the universal induction constant . For fixed and fixed problem parameters,
so and . This also confirms the lower-order interpretation stated after the proposition.
A.2.5 Proof of Theorem 3.8
Fix and set . For the prescribed deterministic stepsize, condition (37) is automatic, so Theorem 3.5 applies at confidence level . Define
and
By Proposition B.2 and Theorem 3.5, each event has probability at least .
On , equation (52) and the initialization imply
Consequently, Cauchy–Schwarz gives, for every ,
By the monotonicity of in both arguments and , it follows that
Therefore, on ,
The union bound gives
which proves the theorem.
A.2.6 Proof of Proposition 3.9
Throughout the proof, denotes a universal constant whose value may change from line to line. For convenience, throughout the proof define
Set
The sequence is nondecreasing and satisfies .
Following Remark 3.7, we have:
By (57), , and hence
At the initial index,
We next control the two arguments of the empirical Bernstein boundary. We claim that, for every ,
For (101), the contribution of s = 4 is bounded by
For , Assumption 3.1 and (100) give
Moreover,
because . Since is nondecreasing,
The initial contribution and the unit floor are therefore absorbed by the right-hand side of (101).
For (102), the contribution of s = 4 is at most
For , equation (100) yields
Since
and
we obtain (102), after absorbing the initial contribution and the unit floor.
We now control the logarithmic factor. The definitions in (30), together with (101)–(102), imply
Using for , we conclude that
The definition of controls the first four terms. Furthermore, since ,
and, because for every ,
Hence
Since
combining (101) and (103) gives
Similarly, (102) and (103) yield
For every , the right-hand side is bounded by a constant multiple of ; whenever , it is bounded by a constant multiple of .
It remains to control the deterministic terms in (55). Assumption 3.1, , and give
where we used . Combining this bound with (104) and (105) gives the stronger estimate
This proves (59). Moreover, whenever , we have , and therefore . Under the same condition, the sharper form of (105) gives (60).
Finally, for fixed and fixed problem parameters,
so and . This also confirms the lower-order interpretation stated after the proposition.
A.3 Proofs of Section 4
A.3.1 Proof of Proposition 4.1
For brevity, write
We follow the predictable-truncation and stitching proof of Theorem 3.3. Fix a dyadic range level , let , and define the predictable truncation
For every , Lemma 3.2 applied conditionally to gives
Because is -measurable and are conditionally independent given , the corresponding exponential factors are conditionally independent. Multiplying their conditional expectations therefore gives
Thus, for every fixed intrinsic-time and range scale, the exponential process used in the proof of Theorem 3.3 remains a nonnegative supermartingale after replacing its centered increment by and its observed quadratic increment by . Repeating the same dyadic stitching over the intrinsic-time and range scales gives, with probability at least , simultaneously for every ,
Since , division by proves (63).
B Additional Results
Proposition B.1 (Refined confidence sequence for ). Suppose Assumptions 1.1–1.4 and 3.1 hold, and suppose (37) is satisfied. Let and be defined as in (35)–(36). Then, for every , the process defined in (38) satisfies
Proof. By Lemma C.2, for every ,
By (34) and conditional unbiasedness,
Moreover, Assumption 3.1 gives
By construction, is adapted. Since , , and are -measurable, the process
is predictable and almost surely finite. Moreover, the quadratic process and running predictable range associated with in Theorem 3.3 are precisely and , respectively. Finally, since almost surely, condition (37) ensures that is integrable for every deterministic . Applying Theorem 3.3 therefore gives, with probability at least , simultaneously for every ,
Substituting this inequality into the distance decomposition and dividing by yields
simultaneously for every , which proves the result.
Proposition B.2 (Refined confidence sequence for ). Suppose Assumptions 1.1–1.4 and 3.1 hold. Let and for every . Let and be defined as in (49)–(50). Then, for every , the process defined in (51) satisfies
Proof. Lemma C.3 gives, for every ,
By (48) and conditional unbiasedness,
Moreover, the predictable range associated with has running maximum , while the corresponding quadratic process is
Theorem 3.3 therefore implies that, with probability at least , simultaneously for every ,
Substituting this inequality into (106) proves the proposition.
C Supporting Lemmas
Lemma C.1 (One-step contractive recursion). Under Assumptions 1.1 and 1.4, the iterates satisfy
Proof. The proof follows the standard one-step analysis of projected stochastic approximation; see, e.g., Nemirovski et al. [32, Section 2.1]. We retain the directional gradient noise term explicitly for the anytime-valid analysis. Since , the nonexpansiveness of the projection gives
Expanding the square,
Now, writing ,
It remains to lower-bound the deterministic gradient term. By the gradient strong monotonicity property,
Hence
By the first-order optimality condition at , we have . Therefore,
Substituting back proves (107).
Lemma C.2 (Last-iterate distance to the optimizer decomposition). Suppose Assumptions 1.1 and 1.4 hold, and let be defined as in (10). For , define
Then, for every ,
Proof. A closely related unrolling of the contractive SGD recursion for the classical stepsize appears in Rakhlin et al. [36, Appendix B.7, Lemma 6]; the decomposition below records the same telescoping mechanism for general predictable stepsizes. By Lemma C.1, for every ,
Multiplying by and using , we obtain
Summing over gives
Since , we obtain
Finally, Assumption 1.4 implies , so dividing by proves (108).
Lemma C.3 (Weighted-average suboptimality decomposition). Suppose Assumption 1.1 holds. Let and for every . Define
Then, for every ,
Proof. The proof builds on the weighted telescoping argument of Lacoste-Julien et al. [26, Section 3.2], adapted here to retain the directional gradient noise term pathwise rather than taking expectations. Let
Since , the nonexpansiveness of the projection gives
Expanding the square,
Writing and using strong convexity,
we obtain
Now substitute . Since
it follows that
Multiplying by t and using , we obtain
Summing from to t, and using
we obtain
Dropping the negative terminal term yields
Dividing by and using the convexity of f we obtain