arXiv:2608.25551cs.LGAug 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2608.25551

Beyond Optimal Rates in Stochastic Optimization: Trajectory-Adaptive Stopping Rules

Liviu Aolaritei, Lucas Lévy, Francis Bach, Michael I. Jordan

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 ε\varepsilon, one may solve for a time TεT_{\varepsilon} at which the bound falls below ε\varepsilon, and then run SGD for exactly that many iterations. This produces a valid certified stopping rule, but typically a very conservative one. Because TεT_{\varepsilon} 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.

References (36)