---
title: Anytime Last-Iterate Guarantee
url: https://www.emergentmind.com/topics/anytime-last-iterate-guarantee
type: topic
---

# Anytime Last-Iterate Guarantee

An anytime last-iterate guarantee is a non-asymptotic guarantee on the quality of the current iterate, current policy, current action, or current released model at every time index, rather than on an ergodic average, a suffix average, or a horizon-specific output selected after the run. Across recent work, the object being controlled varies—objective suboptimality, residual norms, primal–dual gaps, policy suboptimality, action gaps, fairness deficits, or Rényi divergence—but the unifying requirement is prefix-wise validity: one may stop at the present time and retain an explicit guarantee on the present output [2507.11274], [2402.12711], [2605.11694], [2407.05237].

## 1. Conceptual scope and formalizations

In optimization, the canonical form is a bound such as
$$
f(x_K)-f(x_*)\le \Phi(K),
$$
holding for every iterate $K$, not only for an average $\bar x_K=\tfrac1K\sum_{k=1}^K x_k$ [2403.06873]. In smooth interpolation SGD, the guarantee is placed directly on the raw last iterate $x_t$, with no special averaging or output selection [2507.11274]. In monotone inclusion and saddle-point problems, the controlled quantity is often a residual, such as $\Res_{F,A}(z_T)$ or $\|F(z^T)\|$ [2604.12235], [2002.00057]. In bandits and reinforcement learning, the notion is formalized as Uniform Last-Iterate (ULI):
$$
\Pr\bigl[\forall t\ge1:\;\Delta_{A_t}\le f(\delta,t)\bigr]\ge 1-\delta,
$$
where $\Delta_{A_t}$ is the suboptimality gap of the action played at round $t$ [2402.12711].

A central distinction is between prefix-wise control and cumulative or ergodic control. Regret, PAC bounds, uniform-PAC, and averaged-iterate analyses may permit arbitrarily poor finite-time behavior of the currently deployed action or iterate, even when cumulative performance is near-optimal. Several papers therefore treat anytime last-iterate guarantees as strictly stronger than standard cumulative criteria, especially in settings where deployment must use the current policy or model rather than a mixture or an average [2402.12711], [2605.11694].

The usage of “anytime” is not fully uniform across the literature. Some papers reserve it for horizon-free procedures that do not require prior knowledge of $T$ and whose bounds are uniform over prefixes [2507.11274]. Others emphasize that a deterministic last-iterate bound is available for every finite horizon, even when the tuning contains the horizon explicitly [2604.10728]. This suggests that the invariant notion is prefix-wise validity, while horizon-freeness is an additional algorithmic property rather than the sole defining feature.

| Setting | Controlled quantity | Representative prefix-wise guarantee |
|---|---|---|
| Smooth convex SGD | $F(x_t)-F(x^*)$ | $\widetilde O(1/(\eta t^{1-\beta\eta/2})+\eta t^{\beta\eta/2}\sigma_*^2)$ [2507.11274] |
| Bandits / RL | $\Delta_{A_t}$ | $\Pr[\forall t\ge1:\Delta_{A_t}\le f(\delta,t)]\ge1-\delta$ [2402.12711] |
| Monotone inclusion | $\Res_{F,A}(z_T)$ | $O(1/\sqrt T)$ [2604.12235] |
| CMDPs | reward gap and constraint violation | $O(1/\sqrt t)$ on the current policy [2605.11694] |
| Cyclic DP-SGD | $D_\alpha(X_t\|X_t')$ | explicit RDP upper bound for any $t\le T$ [2407.05237] |
| Online fairness | maximum deficit | $c_t=O\!\bigl(\sigma\sqrt{t\ln m/n}\bigr)$ [2605.19844] |

## 2. Horizon-aware optimality and the horizon-free barrier in convex optimization

A decisive early result in convex Lipschitz optimization showed that the last iterate can match the information-theoretically optimal rate if the step-size schedule is redesigned specifically for the final time $T$. For general convex problems, Jain et al. use the standard suffix-averaged schedule $\gamma_t=C\,t^{-1/2}$ and replace it by the dyadically modified last-iterate schedule
$$
\alpha_t = C\,2^{-i}\,T^{-1/2}\qquad \text{for } T_i < t \le T_{i+1},
$$
while in the strongly convex case they replace $\gamma_t=(\lambda t)^{-1}$ by
$$
\alpha_t=\frac{2^{-i}}{\lambda t}\qquad \text{for } T_i < t \le T_{i+1}.
$$
Under Lipschitz $G$ and diameter $D$, this yields
$$
E[F(x_T)]-F(x^*) \le 15\,G\,D/\sqrt T,
$$
and with probability at least $1-\delta$,
$$
F(x_T)-F(x^*) = O\bigl(G\,D\,\sqrt{\log(1/\delta)/T}\bigr).
$$
Under $\lambda$-strong convexity, the corresponding bound is
$$
E[F(x_T)]-F(x^*) \le 130\,G^2/(\lambda T),
$$
with high-probability rate
$$
F(x_T)-F(x^*) = O\bigl(G^2\log(1/\delta)/(\lambda T)\bigr).
$$
These bounds remove the classical extra $\log T$ factor for the last iterate, but the construction is explicitly non-anytime because the dyadic breakpoints depend on the total horizon $T$ [1904.12443].

The proof mechanism is a modification scheme that transfers suffix-average guarantees under the original schedule to last-iterate guarantees under the modified schedule. Its key device is a one-shot “look-ahead” lemma,
$$
\sum_{t=t_0}^{t_1} 2\alpha_t\,E[F(x_t)-F(x_{t_0})] \le \sum_{t=t_0}^{t_1} G^2\alpha_t^2,
$$
which prevents significant post hoc deterioration in function value after a sufficiently good point has been reached. Intuitively, the dyadic halving “slows down” the method exactly where suffix averaging would have concentrated the mass [1904.12443].

A later impossibility result shows that this horizon dependence is not an artifact of the proof. For convex $G$-Lipschitz optimization over a domain of diameter $D$, if a deterministic step-size sequence is truly anytime, then its worst-case last-iterate error must obey
$$
E_T=\Omega\!\Bigl(\frac{DG\,(\log T)^{1/8}}{\sqrt T}\Bigr),
$$
and more precisely, if $E_T\le \phi(T)\,DG/\sqrt T$ for all $T$ and some non-decreasing $\phi$, then
$$
\phi(T)\ge \Omega\!\bigl((\log T)^{1/8}\bigr).
$$
This resolves the conjecture that no truly anytime schedule can attain the exact $1/\sqrt T$ last-iterate rate in this setting, and it does so even in the noiseless GD case [2604.13870].

The resulting picture is sharply bifurcated. Horizon-aware schedules can close the last-iterate gap to the lower bound, whereas horizon-free schedules must pay at least a polylogarithmic penalty. The classical textbook rule $\eta_t=D/(G\sqrt{t+1})$ remains anytime, but only with the familiar $O((\log T)/\sqrt T)$ last-iterate rate [2604.13870]. A plausible implication is that, in convex Lipschitz optimization, the exact optimal last-iterate rate is not compatible with genuine horizon-free operation.

## 3. Positive anytime guarantees for stochastic first-order methods

The smooth interpolation regime admits a qualitatively different phenomenon. For convex $\beta$-smooth $F$ and fixed constant step-size $\eta\le1/\beta$, SGD satisfies
$$
E[F(x_T)-F(x^*)]
=
\widetilde O\!\left(\frac{1}{\eta T^{1-\beta\eta/2}}+\eta T^{\beta\eta/2}\sigma_*^2\right),
$$
where $\sigma_*^2=E_z\|\nabla f(x^*;z)\|^2$. The bound is established directly for the raw last iterate, uses no step decay, requires no knowledge of $T$, and in fact holds uniformly for every prefix $t\le T$. Balancing the bias and variance terms yields a near-optimal $O(1/T+\sigma_*/\sqrt T)$ rate in the low-noise regime, while in pure interpolation $(\sigma_*=0)$ the greedy choice $\eta=1/\beta$ gives
$$
E[F(x_T)-F(x^*)]=O(1/\sqrt T).
$$
The analysis relies on a regret-style decomposition with non-uniform weights $v_t\downarrow0$, a smoothness lower bound converting inner products into function-value gaps and gradient-difference terms, and a step-dependent Young inequality that isolates the coefficient of the final iterate [2507.11274].

For smooth quadratics in the interpolation regime, including randomized Kaczmarz, a different anytime guarantee is available under the greedy step-size $\eta_t=1/\beta$. The analysis introduces stochastic contraction processes $v_{t+1}=(I-M_t)v_t$ with common mean $\overline M$, and proves
$$
\mathbb E[\|v_t\|_{\overline M}^2]
\le \frac{C\|v_0\|^2}{t^{3/4+\theta}}
\qquad\text{for some absolute }C>0,\;\theta\ge0.001.
$$
Consequently,
$$
\mathbb E[f(x_t)-f(x_\star)]
=
O\bigl(\beta\|x_0-x_\star\|^2\,t^{-3/4-\theta}\bigr),
$$
and for randomized Kaczmarz,
$$
\mathbb E[\|x_t-x_\star\|^2]
=
O\Bigl(\frac{\|A\|_F^2\|x_0-x_\star\|^2}{t^{3/4+\theta}}\Bigr).
$$
This improves the previously known $O(1/\sqrt t)$ guarantee in that regime [2604.09909].

Adaptive methods do not automatically inherit strong last-iterate guarantees. For scalar AdaGrad-Norm in convex non-smooth optimization, the deterministic final-iterate bound depends on an exponent parameter
$$
\delta=\frac12\log_N\!\Bigl(1+\frac1{G^2}\sum_{i=1}^{N-1}\|g^i\|^2\Bigr)\in[0,1/2],
$$
which captures the growth of the cumulative squared subgradients. Optimizing the base parameter $h=R/N^\gamma$ over the worst case leads to
$$
f(x^{N+1})-f(x^*) = O(N^{-1/4}),
$$
and matching lower bounds show that this rate is tight. The proof is built around a weighted last-iterate inequality of Zamani and Glineur and a backward choice of weights that annihilates all coefficients except the one attached to the final iterate [2604.10728].

These results show that positive anytime guarantees arise from different structural mechanisms: low noise at the optimum, interpolation, stochastic contraction, or finely tuned weighted inequalities. They also show that there is no universal last-iterate rate even within first-order convex optimization: rates from $O(1/\sqrt T)$ to $O(T^{-3/4-\theta})$ to $O(T^{-1/4})$ all occur, depending on geometry, noise, and algorithm class [2507.11274], [2604.09909], [2604.10728].

## 4. Variational inequalities, saddle-point problems, and games

In smooth convex–concave saddle-point problems, the last iterate can be provably slower than the averaged iterate. For Extragradient (EG) with constant step-size $\eta\le\min\{1/(30L),\,5/(\Lambda D)\}$, one has for every $T\ge1$
$$
\|F(z^T)\|\le \frac{2D}{\eta\sqrt T},
\qquad
\Gap_f^{\mathcal Z}(x^T,y^T)\le \frac{2\sqrt2\,D^2}{\eta\sqrt T}.
$$
Choosing $\eta=\Theta(1/L)$ gives $O(DL/\sqrt T)$ and $O(D^2L/\sqrt T)$, whereas the classical ergodic EG guarantee is $O(D^2L/T)$. A matching lower bound of $\Omega(1/\sqrt T)$ for the last iterate establishes a quadratic separation between ergodic and last-iterate convergence rates [2002.00057].

Monotone inclusion problems admit anytime last-iterate bounds for anchoring-only schemes. Proximal Anchored Gradient Descent (P-AGD),
$$
z_{t+1}
=
J_{\alpha_tA}\Bigl((1-\beta_t)z_t+\beta_t z_0-\alpha_tF(z_t)\Bigr),
$$
with
$$
\alpha_t=\frac1{L\sqrt{t+\gamma}},
\qquad
\beta_t=\frac{\gamma}{t+\gamma},
$$
satisfies
$$
\Res_{F,A}(z_T)\le \|F(z_T)+c_T\|
\le \frac{L(2E+\gamma D)}{\sqrt{T-1+\gamma}},
$$
hence $\Res_{F,A}(z_T)=O(1/\sqrt T)$ for every $T\ge1$. The proof combines a resolvent-based rewrite with a boundedness argument and a decay estimate for consecutive differences $\|d_t\|\le E/(t+\gamma)$ [2604.12235].

Other operator-splitting and game-theoretic settings exhibit linear anytime behavior. For min–max optimization, Hamiltonian Gradient Descent (HGD) minimizes $H(x)=\tfrac12\|\xi(x)\|^2$ and, under a PL inequality for $H$, yields
$$
\|\xi(x^{(k)})\|
\le
\Bigl(1-\frac{\alpha}{L_H}\Bigr)^{k/2}\|\xi(x^{(0)})\|.
$$
The same paper proves analogous linear last-iterate convergence for Consensus Optimization under a suitable parameter choice, and extends the theory beyond strongly convex–strongly concave problems to sufficiently bilinear regimes [1906.02027].

Under noisy feedback in $\lambda$-co-coercive games, vanilla stochastic gradient ascent with
$$
\beta_t=\frac1{(t+T_0)^b},\qquad 0.5<b<1,
$$
admits a piecewise anytime bound on the gradient residual:
$$
\mathbb E[\|v(x_t)\|^2]
\le
\begin{cases}
\dfrac{C_2}{(t+1)^{2b-1}}, & b\in(\tfrac12,\tfrac23),\\[4pt]
\dfrac{C_3\log(t+1)}{(t+1)^{1/3}}, & b=\tfrac23,\\[4pt]
\dfrac{C_4}{(t+1)^{1-b}}, & b\in(\tfrac23,1).
\end{cases}
$$
Choosing $b=2/3$ gives the first last-iterate bound under non-vanishing affine-growth noise in this class:
$$
\mathbb E[\|v(x_t)\|^2]=O\!\Bigl(\frac{\log t}{t^{1/3}}\Bigr).
$$
The same analysis also gives almost sure convergence of the iterates to the Nash equilibrium set and time-average bounds [2604.19065].

Monotone mean field games present a split picture. Exact proximal-point iterations converge in the last iterate asymptotically under Lasry–Lions monotonicity:
$$
\lim_{k\to\infty}\dist(\sigma^k,\Pi^*)=0.
$$
For the regularized mirror-descent subroutine used to approximate each proximal step, however, there is a genuine anytime exponential bound:
$$
D_{m[\varpi^*]}(\varpi^*,\pi^t)
\le
D_{m[\varpi^*]}(\varpi^*,\pi^0)\exp\!\Bigl(-\frac{\lambda\eta}{2}t\Bigr).
$$
Thus exact outer convergence is asymptotic, while the inner approximate solver is uniformly contractive at every finite time [2410.05127].

## 5. Finite-sum, continual, and policy-learning settings

Incremental and shuffled methods were long known mainly through ergodic guarantees, but recent analyses move them into the anytime last-iterate regime. For finite-sum optimization
$$
\min_{x\in\mathbb R^d}\;f(x):=\frac1T\sum_{t=1}^T f_t(x),
$$
Cai and Diakonikolas obtain the first last-iterate guarantees for incremental gradient and incremental proximal methods in general convex smooth settings, and for incremental proximal methods also in convex Lipschitz settings. Their bounds hold for every epoch $K$, and the resulting oracle complexities nearly match the best known average-iterate guarantees up to a square-root-log or log factor. In the continual-learning interpretation, they also argue that a large amount of regularization is crucial to preventing catastrophic forgetting [2403.06873].

For shuffling-based gradient methods—Random Reshuffle, Shuffle Once, and Incremental Gradient—objective-value last-iterate guarantees are available even without strong convexity. In the Lipschitz convex case, appropriate step-size schedules give the standard subgradient last-iterate rate
$$
F(x_{K+1})-F(x^*) = O\!\Bigl(\frac{G\,D}{\sqrt K}\Bigr),
$$
valid for any permutation sequence. In the smooth strongly convex regime, the last iterate attains a nearly sharp $\tilde O(L/(\mu_F^2 n K^2))$ bound for RR/SO, matching known lower bounds up to logarithms [2403.07723].

Bandits and reinforcement learning formulate the concept most explicitly. ULI requires a high-probability event on which every action played is near-optimal:
$$
\Pr\Bigl[\forall t\ge1:\;\Delta_{A_t}\le f(\delta,t)\Bigr]\ge1-\delta,
$$
with near-optimal ULI corresponding to $\kappa=\tfrac12$ in
$$
f(\delta,t)=(\log t)^{O(1)}\,t^{-\kappa}.
$$
The paper shows that ULI implies near-optimal uniform-PAC and regret guarantees, but not conversely. Elimination-based finite-arm algorithms and a meta-algorithm wrapping a high-probability adversarial learner achieve near-optimal ULI, and an oracle-efficient linear-bandit algorithm obtains
$$
\Delta_{A_t}=O\!\Bigl(\sqrt{\frac{d^3\log(d\,t/\delta)}{t}}\Bigr).
$$
By contrast, optimistic algorithms such as lil’UCB do not achieve near-optimal ULI [2402.12711].

In constrained MDPs, the motivation is explicitly deployment-oriented: mixture-policy guarantees are theoretically standard but practically mismatched when a single policy must be deployed. An inexact augmented Lagrangian method therefore targets last-policy convergence. If the augmented-Lagrangian subproblem at outer iteration $t$ is solved to accuracy $\varepsilon_t=O(1/t^2)$, then after $T=O(1/\varepsilon^2)$ outer iterations the final policy satisfies
$$
V_r^*-V_r(\pi_{T+1})\le O(1/\sqrt T),
\qquad
[d_i-V_{c_i}(\pi_{T+1})]_+\le O(1/\sqrt T),
$$
and, crucially, the same form holds for the current policy at every outer iteration $t$. With Projected Q-Ascent as the primal oracle, the total number of policy-gradient evaluations is $O(1/\varepsilon^6)$ [2605.11694].

Approximate last-iterate convergence also appears in overparameterized GANs. For the Implicit Update dynamics, one has
$$
\|x_t-x^*\|_2
\le
(1-\Delta)^t\|x_0-x^*\|_2+\varepsilon_{\rm IU}(m),
$$
and for the Predictive Method,
$$
\|x_t-x^*\|_2
\le
(1-\beta)^t\|x_0-x^*\|_2+\varepsilon_{\rm PM}(m).
$$
In both cases the neighborhood radius shrinks with width as
$$
\varepsilon(m)=O\!\bigl(m^{-1/6}H^{5/2}\log^{1/2}m\bigr)\to0,
$$
so the dynamics exhibit an anytime exponential-plus-bias guarantee rather than exact asymptotic convergence of the raw last iterate [2108.03491].

## 6. Privacy, fairness, and recurring limitations

The last-iterate viewpoint extends beyond optimization error. In cyclically sampled DP-SGD on nonconvex composite losses, the released object is only the final or current model, so privacy accounting for the last iterate is the relevant quantity. Under weak-convexity/upper-curvature assumptions and step-size $\eta\le1/[2(m+M)]$, the Rényi divergence between neighboring runs satisfies, for any stopping time $t\le T$,
$$
D_\alpha(X_t\|X_t')
\le
4\alpha\Bigl(\frac{C}{b\sigma}\Bigr)^2
\Bigl[
\theta_L(t-E_t\ell)+E_t\,\theta_L(\ell)
\Bigr],
$$
where $\ell=N/b$, $E_t=\lfloor t/\ell\rfloor$, and
$$
\theta_L(s)=L^{-2(s-1)}\sum_{i=0}^{s-1}L^{2i}.
$$
Thus the privacy cost of releasing the current iterate is controlled prefix-wise, without relying on subsampling amplification [2407.05237].

An analogous prefix-wise perspective appears in perpetual online fairness. In the deficit framework, each round produces deficits $z_q^t$ for tracked quality variables, and the goal is to keep all deficits below a slowly growing threshold at every prefix. The $p$-potential rule chooses the action minimizing the next-round potential
$$
\Phi^t=\sum_{q\in Q^t}( (z_q^t)^2+4p^2)^p,
\qquad
\Psi^t=(\Phi^t)^{1/p}.
$$
Under the moment conditions in the paper, with fixed $m=|Q^t|$ and
$$
p=\max\{1,\ln m\},
\qquad
c_t=m^{1/p}\sqrt{\,4p^2 + \frac{2\sqrt e\,p\,\sigma^2\,t}{n}\,},
$$
every round $t$ is $c_t$-fair. In particular,
$$
c_t=O\!\Bigl(\sigma\sqrt{\frac{t\ln m}{n}}\Bigr).
$$
A matching lower bound shows that any perpetual guarantee must satisfy
$$
c_t\in \Omega\!\Bigl(\frac{\sqrt t}{n}\Bigr)
\quad\text{in the worst case,}
$$
so $\sqrt t$ growth is unavoidable in general [2605.19844].

Several recurring misconceptions are therefore incorrect. First, a good averaged iterate does not imply a good current iterate; the smooth saddle-point case gives a sharp $O(1/T)$ versus $O(1/\sqrt T)$ separation [2002.00057]. Second, horizon-aware optimality does not imply horizon-free optimality; the convex Lipschitz lower bound rules out exact $1/\sqrt T$ last-iterate performance for deterministic anytime schedules [2604.13870]. Third, “anytime” does not fix a unique metric: different papers control function values, residuals, action gaps, privacy loss, fairness deficits, or neighborhood radii [2507.11274], [2402.12711], [2407.05237], [2605.19844].

This suggests that anytime last-iterate guarantees are best understood as a family of deployment-aligned finite-time guarantees rather than a single theorem schema. Their feasibility and rate depend sharply on structural conditions—interpolation, smoothness, co-coercivity, monotonicity, contraction, regularization, or low effective noise—and on the metric that defines “current performance.”

Source: https://www.emergentmind.com/topics/anytime-last-iterate-guarantee