---
title: 'SGDmax: Gradient Descent with Max-Oracle'
url: https://www.emergentmind.com/topics/stochastic-gradient-descent-with-max-oracle-sgdmax
type: topic
---

# SGDmax: Gradient Descent with Max-Oracle

Searching arXiv for the cited SGDmax-related papers to ground the article.
arXiv search query: 2111.13162
Stochastic Gradient-Descent with Max-Oracle (SGDmax) denotes a family of optimization methods for objectives in which the minimization variable is updated by gradient descent or stochastic gradient descent, while an associated maximization problem is handled by a “max-oracle.” In the cited arXiv literature, the label is used for several related but non-identical algorithms: a sample-average max-oracle for distributionally robust optimization (DSSG), a randomized stochastic gradient descent ascent scheme (RSGDA) for nonconvex–strongly-concave min–max problems, a zero-order policy-gradient method for risk-constrained structured LQR, and a stochastic-greedy-descent-with-max-oracle procedure for general nonconvex–nonconcave minimax optimization [1805.08728] [2111.13162] [2204.01779] [2006.12376].

## 1. Terminological scope and common structure

Across these works, SGDmax is organized around an outer descent variable and an inner maximization step, but the inner oracle is instantiated differently depending on the problem class. The common pattern is therefore methodological rather than notationally uniform.

| Variant | Problem class | Max-oracle form |
|---|---|---|
| DSSG / SGDmax | Distributionally robust optimization | Solve inner max-problem on a subset \(S_t\) |
| RSGDA | Nonconvex–strongly-concave min–max | A Geometric\((p)\) number of \(v\)-steps in expectation |
| SGDmax for LQR | Risk-constrained structured feedback | \(\lambda^j=\arg\max_{\lambda\in[0,\Lambda]^I}\mathcal{L}(K^j,\lambda)\) or sampled max-oracle under perturbation |
| SGD\(_{\max}\) | Nonconvex–nonconcave minimax | Repeated ascent until \(\|G_y\|\le\epsilon\) |

This variation in oracle design is matched by variation in convergence targets. In one line of work, the goal is an \(\epsilon\)-stationary point of \(\phi(\theta)=\max_v F(\theta,v)\); in another, it is vanishing gradient norm for a robust loss \(R(\theta)\); in the LQR setting, the target is an \(\epsilon\)-stationary point of a Moreau envelope; and in the general nonconvex–nonconcave setting, the output is an \((\epsilon,\delta,\omega,Q)\)-approximate local equilibrium. A plausible implication is that “SGDmax” is best understood as a max-oracle design pattern for minimax optimization rather than a single canonical recursion [2111.13162] [1805.08728] [2204.01779] [2006.12376].

## 2. RSGDA as randomized SGDmax for nonconvex–strongly-concave objectives

For the nonconvex–strongly-concave problem
\[
\phi(\theta)\;:=\;\max_{v\in V}F(\theta,v),\qquad
F(\theta,v)=\mathbb{E}_{z\sim\mathcal D}[f(\theta,v;z)],
\]
RSGDA is presented as a practical instantiation of SGDmax with a randomized inner loop. A stationary point of \(\phi\) is \(\theta\) with \(\|\nabla\phi(\theta)\|\le\epsilon\), and a \(\delta\)-approximate maximizer for fixed \(\theta\) is \(v\) satisfying \(\phi(\theta)-F(\theta,v)\le\delta\). The analysis assumes smoothness, \(\mu\)-strong concavity in \(v\), bounded variance in the \(\theta\)-gradient, and finite noise in the \(v\)-gradient at the maximizer. The algorithm uses the “coin-flip” update
\[
\theta_k^+ \leftarrow \theta_k-\alpha_k\nabla_\theta f(\theta_k,v_k;z_k),\qquad
v_k^+ \leftarrow \Pi_V\!\bigl(v_k+\eta_k\nabla_v f(\theta_k,v_k;z_k)\bigr),
\]
followed, with probability \(p\), by \((\theta_{k+1},v_{k+1})=(\theta_k^+,v_k)\), and otherwise by \((\theta_{k+1},v_{k+1})=(\theta_k,v_k^+)\). Equivalently, between two \(\theta\)-steps one performs a Geometric\((p)\) number of \(v\)-steps, so the expected inner-loop length is \((1-p)/p\) [2111.13162].

The parameterization is explicit. In the exact-gradient regime, with \(\kappa=L/\mu\), one sets
\[
\eta=\frac{1}{2L},\qquad
\alpha=\frac{1-p}{4\kappa^2L\sqrt{p(2p+(1-p)/(2\kappa))}},
\]
and for any \(p\in[1/\kappa,1/2]\) obtains
\[
\min_{t<k}\|\nabla\phi(\theta_t)\|^2=O(\kappa^2/k),
\]
hence \(O(\kappa^2\epsilon^{-2})\) iterations to reach \(\epsilon\)-stationarity. In the stochastic regime with decreasing steps, for any \(\zeta>0\),
\[
\eta_k=\frac{1}{2L(k+1)^{2/5+\zeta}},\qquad
\alpha_k=\frac{1-p}{2\sqrt{p(2p+(1-p)\eta_k\mu)}}\cdot\frac{\eta_k}{\kappa^2(k+1)^{1/5}},
\]
which yields
\[
\min_{t<k}\mathbb E[\|\nabla\phi(\theta_t)\|^2]=O(\log k\cdot k^{-2/5}).
\]
With fixed stepsizes and arbitrary batch sizes, choosing \(\eta,\alpha\) of order \(O(\epsilon^2/(\kappa L\sigma^2))\) gives \(k=\Theta(\kappa^3\epsilon^{-5})\) iterations to reach \(\min_{t<k}\mathbb E[\|\nabla\phi(\theta_t)\|^2]\le\epsilon^2\); a large-minibatch variant with batch size \(M\approx \epsilon^{-2}\) yields the optimal SGDA rate \(O(\kappa^3\epsilon^{-4})\); and the interpolation setting \((\tilde\sigma^2=0)\) improves to \(O(\kappa^2\epsilon^{-4})\) [2111.13162].

The theoretical core is a one-step inequality based on
\[
E_k\;:=\;\phi(\theta_k)-\min\phi+\kappa L\cdot\frac{p\alpha_k}{(1-p)\eta_k}\|v^*(\theta_k)-v_k\|^2.
\]
Under
\[
\eta_k\le\frac{1}{2L},\qquad
\alpha_k \le \frac{(1-p)\eta_k}{4\kappa^2\sqrt{p(2p+(1-p)\eta_k\mu)}},
\]
one obtains a “master” descent inequality from which almost-sure convergence follows by the Robbins–Siegmund supermartingale convergence theorem. If \(\sum\alpha_k=\infty\), \(\sum\alpha_k^2<\infty\), \(\sum\eta_k\alpha_k<\infty\), and \(\sum(\alpha_k^3/\eta_k^2)<\infty\), then almost surely
\[
\min_{t<k}\|\nabla\phi(\theta_t)\|=o(1/\textstyle\sum_{t<k}\alpha_t),
\]
and for the decreasing-step choices above,
\[
\min_{t<k}\|\nabla\phi(\theta_t)\|=o(k^{-2/5+\zeta}).
\]
The paper emphasizes that the geometric randomization removes the need to track a fixed inner-loop length \(m\) and simplifies the bookkeeping of cross-terms between \(\theta\) and \(v\) updates. Experimentally, on a distributionally robust MNIST classifier, \(p=0.25\) allowed a larger \(\alpha\) and gave the fastest decrease in \(\phi(\theta)\), while \(p=0.1\) made outer updates slow and \(p=0.9\) forced small \(\alpha\); on adversarial optimal transport for single-cell data integration, best performance was at \(p=0.9\), significantly speeding up convergence of \(W_\epsilon\) compared to a minibatch Sinkhorn-gradient procedure [2111.13162].

## 3. Distributionally robust optimization and the DSSG form of SGDmax

In the distributionally robust optimization setting, SGDmax is introduced as an efficient stochastic gradient method for
\[
\min_{\theta\in\Theta}R(\theta)
\equiv
\min_{\theta\in\Theta}\max_{P:\,D_\phi(P,U_N)\le\rho}
\sum_{n=1}^N p_n\,\ell(\theta,\xi_n),
\]
where \(U_N\) is the uniform empirical distribution and
\[
D_\phi(P,U_N)=\frac1N\sum_{n=1}^N\phi(Np_n).
\]
An equivalent dual representation is
\[
R(\theta)
=\min_{\substack{\alpha\ge0,\;\lambda\in\mathbb R}}
\left\{
\alpha\rho+\lambda+\frac{\alpha}{N}\sum_{n=1}^N
\phi^*\!\Bigl(\frac{\ell(\theta,\xi_n)-\lambda}{\alpha}\Bigr)
\right\}.
\]
The algorithmic idea is to approximate the inner maximization on a subset \(S_t\) of size \(M_t\), sampled uniformly without replacement, and to solve
\[
\hat R_t(\theta)=
\max_{\substack{p\in\mathbb R^{M_t},\,\sum p_i=1,\,p_i\ge0\\
\tfrac1{M_t}\sum_{i\in S_t}\phi(M_t p_i)\le\rho_t}}
\sum_{i\in S_t}p_i\,\ell(\theta,\xi_i),
\]
with an inflated radius
\[
\rho_t=\rho+\eta_t,\qquad
\eta_t=c\Bigl(\frac1{M_t}-\frac1N\Bigr)^{(1-\delta)/2},\quad c>0,\;0<\delta<1.
\]
Two canonical schedules for \(M_t\) are constant-factor growth \(M_t=M_0\nu^t,\;\nu>1\), up to \(N\), and diminishing-factor growth such as \(\nu_t=1+1/t\). In practice, the summary states \(M_0\approx1\), \(\nu\gtrsim1\) such as \(\nu=1.001\), and termination when \(M_t=N\) [1805.08728].

If \(\hat p_{t,i}^*\) denotes the subset-optimal pmf, the gradient estimator is
\[
G_t=\nabla_\theta\hat R_t(\theta_t)=
\sum_{i\in S_t}\hat p_{t,i}^*\,
\nabla_\theta\ell(\theta_t,\xi_i),
\]
and the outer update is
\[
\theta_{t+1}=\theta_t-\gamma G_t,\qquad \gamma>0\text{ fixed.}
\]
Although \(G_t\) is biased relative to \(\nabla R(\theta_t)\), the bias and variance are quantified:
\[
\|\mathbb E[G_t]-\nabla R(\theta_t)\|^2
=O(\eta_t^2)
=O\bigl((1/M_t-1/N)^{\,1-\delta}\bigr),
\]
and
\[
\operatorname{Var}(G_t)=O(1/M_t-1/N).
\]
As \(M_t\to N\), both vanish. The main convergence statements are correspondingly expressed in terms of vanishing stochastic approximation error. Under differentiability assumptions for \(R(\theta)\), the robust loss gradient has the form
\[
\nabla_\theta R(\theta)=\sum_{n=1}^N p_n^*(\theta)\,\nabla_\theta\ell(\theta,\xi_n).
\]
If \(\nabla R\) is \(L\)-Lipschitz and \(\gamma\le 1/(2L)\), then
\[
\sum_{t=0}^{T-1}\|\nabla R(\theta_t)\|^2
\le
\frac{2(R(\theta_0)-R_{\inf})}{\gamma(2-L\gamma)}
+C\frac{L\gamma+1}{2-L\gamma}\sum_{t=0}^{T-1}\eta_t^2,
\]
so \(\|\nabla R(\theta_t)\|\to0\) whenever \(\sum_t\eta_t^2<\infty\). In the strongly-convex case, the analysis uses total work \(W_t=\sum_{s=0}^{t-1}O(M_s\ln M_s)\) and characterizes the trade-off between deterministic linear convergence and stochastic error under different growth schedules [1805.08728].

Empirically, DSSG is reported to achieve the same final accuracy as the full-batch solver on RCV1, HIV-1 protease, Riccardo, and Adult income, but with 1–2 orders of magnitude less cumulative sample usage and hence CPU time. Standard SGD with a fixed small batch is described as suffering a bias in the DRO gradient and often failing to converge near the true robust solution unless one chooses a very large batch. The method is also reported as robust to \(\nu\) in \([1.000...,\;1.01]\) and to the step-size \(\gamma\) beyond a moderate range, and training with DRO via DSSG often yields models that generalize better, or at least as well, as classical ERM with \(\ell_2\)-regularization tuned by expensive \(k\)-fold cross-validation [1805.08728].

## 4. SGDmax for risk-constrained structured LQR

For infinite-horizon, average-cost, structured, risk-constrained LQR, SGDmax arises after reformulating the constrained control problem as a nonconvex–concave minimax. With state dynamics
\[
x_{t+1}=A\,x_t+B\,u_t+w_t,\qquad u_t=-Kx_t,
\]
and structured feedback
\[
K\in\mathcal K=\{\,K\in\mathbb R^{m\times n}\mid K_{ij}=0\text{ if }(i,j)\not\in\mathcal E\},
\]
the primary cost is \(R_0(K)\) and the additional quadratic constraints are \(R_i(K)\le c_i\). Introducing nonnegative Lagrange multipliers \(\lambda\in\mathcal Y=[0,\Lambda]^I\), the Lagrangian is
\[
\mathcal L(K,\lambda)=R_0(K)+\sum_{i=1}^I\lambda_i(R_i(K)-c_i),
\]
which is concave in \(\lambda\) but nonconvex in \(K\). The associated minimax is
\[
\min_{K\in\mathcal K}\Phi(K),\qquad \Phi(K):=\max_{\lambda\in\mathcal Y}\mathcal L(K,\lambda).
\]
Because \(\Phi(K)\) may fail to be everywhere differentiable, the analysis instead uses the Moreau envelope
\[
\Phi_\mu(K)=\min_{K'\in\mathcal K}\left\{\Phi(K')+\frac1{2\mu}\|K'-K\|_F^2\right\},
\]
and an \(\epsilon\)-stationary point is characterized by \(\|\nabla\Phi_\mu(K^*)\|\le\epsilon\) [2204.01779].

The deterministic GDmax alternates exact maximization in \(\lambda\) with gradient descent in \(K\):
\[
\lambda^j=\arg\max_{\lambda\in[0,\Lambda]^I}\mathcal L(K^j,\lambda),\qquad
K^{j+1}=K^j-\eta\,\nabla_K\mathcal L(K^j,\lambda^j).
\]
The summary states that the maximization in \(\lambda\) is done exactly, in closed form by projecting each multiplier to \(0\) or \(\Lambda\). On a compact sublevel set \(\mathcal G^0=\{K\in\mathcal K\mid \Phi_\mu(K)\le \Phi_\mu(K^0)\}\), the local constants \(L_0,\ell_0,\rho_0\) bound Lipschitzness, smoothness, and a stability radius. With \(\mu_0=1/(2\ell_0)\), the envelope satisfies
\[
\Phi_{\mu_0}(K^{j+1})
\le
\Phi_{\mu_0}(K^j)
-\frac\eta4\|\nabla\Phi_{\mu_0}(K^j)\|^2
+\eta^2\ell_0L_0^2
\]
whenever
\[
\eta\le\min\{\rho_0,\epsilon^2/(4\ell_0L_0^2)\}.
\]
Summing over \(J\) steps yields an iterate with \(\|\nabla\Phi_{\mu_0}(K)\|\le2\epsilon\) once
\[
J=O\!\Bigl(\frac{\ell_0L_0^2\Phi_{\mu_0}(K^0)}{\epsilon^4}\Bigr).
\]
The model-free version, denoted SGDmax, replaces exact policy gradients with a zero-order policy gradient estimator. For smoothing radius \(r\) and sample count \(M\), one draws perturbations \(U_s\) on the unit sphere of the nonzero pattern, evaluates
\[
\Phi(K+rU_s)=\max_{\lambda\in\mathcal Y}\mathcal L(K+rU_s,\lambda),
\]
and forms
\[
\hat G(K)=\frac{n_K}{rM}\sum_{s=1}^M \Phi(K+rU_s)\,U_s.
\]
The update is \(K^{j+1}=K^j-\eta\,\hat G^j\). The high-probability theorem states that, for any confidence parameter \(\alpha>0\), if
\[
r\le\min\Bigl\{\rho_0,\;\frac{L_0\sqrt M}{\ell_0\sqrt\alpha}\Bigr\},\qquad
\eta\le\frac{\epsilon^2}{\alpha\,\ell_0\bigl(L_0^2+\ell_0^2r^2/M\bigr)},
\]
and
\[
J=\frac{2\sqrt{10\alpha}\,\Phi_{\mu_0}(K^0)}{\eta\,\epsilon^2},
\]
then with probability at least
\[
1-\Bigl(\frac1{10}+\frac{4}{\alpha}+\frac{4}{\sqrt{10\alpha}}\Bigr)
\]
one iterate satisfies \(\|\nabla\Phi_{\mu_0}(K^j)\|\le2\epsilon\). The proof relies on bounded variance, an expected-decrease inequality, Doob’s maximal inequality, and a martingale argument for sublevel-set invariance [2204.01779].

The numerical testbed is a radial network of \(N=6\) identical microgrids, each with 4 states and one control input. Three cases are compared: structured \(K\) with risk constraint learned by SGDmax; full \(K\) with risk constraint learned by SGDmax; and full \(K\) without constraint learned by vanilla ZOPG. All three methods converge to a stationary policy. The full-feedback risk-constrained policy has slightly higher LQR cost than the unconstrained full-feedback policy but reduced frequency variance; the structured risk-constrained policy has the highest LQR cost of the three, yet remains close to full-feedback performance; and in step-load tests both risk-constrained policies exhibit markedly smaller frequency deviations and tie-line power swings compared to unconstrained LQR [2204.01779].

## 5. Stochastic-greedy-descent-with-max-oracle in nonconvex–nonconcave minimax optimization

Another use of the name appears in a variant of minimax optimization for a smooth, bounded objective
\[
f:\mathcal X\times\mathcal Y\to\mathbb R,\qquad
\min_{x\in\mathcal X}\max_{y\in\mathcal Y}f(x,y),
\]
with \(\mathcal X,\mathcal Y\subseteq\mathbb R^d\) convex. The method builds its equilibrium notion around a proposal distribution for the min-player and a greedy max-player path. For \(\epsilon\ge0\), an \(\epsilon\)-increasing path is a continuous, unit-speed path \(\gamma:[0,T]\to\mathcal Y\) with \(\gamma(0)=y\) such that for almost every \(t\),
\[
\frac{d}{dt}f(x,\gamma(t))\ge\epsilon,
\]
and \(P_\epsilon(x,y)\) denotes the set of endpoints of such paths. The max-oracle \(\mathrm{Oracle}_{\max-\epsilon}\) repeatedly samples a stochastic gradient \(G_y\approx\nabla_y f(x,y_j)\), takes
\[
y_{j+1}=y_j+\eta_y G_{y_j},
\]
and stops when \(\|G_{y_j}\|\le\epsilon\), returning a stationary point in \(P_\epsilon(x,y_0)\). The corresponding equilibrium notion is an \((\epsilon,\delta,\omega,Q)\)-approximate local equilibrium. It requires max-stationarity,
\[
y^*\in\arg\max_{y\in P_\epsilon(x^*,y^*)} f(x^*,y),
\]
and a randomized no-descent property:
\[
\Pr_{\Delta\sim Q_{x^*,y^*}}
\Bigl[
\max_{y\in P_\epsilon(x^*+\Delta,y^*)} f(x^*+\Delta,y)
<
\max_{y\in P_\epsilon(x^*,y^*)} f(x^*,y^*)-\delta
\Bigr]
\le\omega.
\]
This departs from standard stationarity and local Nash notions by tying the min-player’s admissible move to a proposal distribution \(Q_{x,y}\) [2006.12376].

The SGD\(_{\max}\) recursion samples \(\Delta_t\sim Q_{x_t,y_t}\), sets \(x'=x_t+\Delta_t\), applies the greedy max-oracle at \(x'\) starting from \(y_t\), and then accepts or rejects according to the “look-ahead” value:
- accept if \(f_{\text{new}}\le f_{\text{old}}-\delta/4\);
- otherwise accept with small probability \(\exp(-t/\tau)\);
- otherwise reject and keep \((x_t,y_t)\).
Termination occurs after \(r_{\max}\) consecutive rejections. A typical choice is \(Q_{x,y}\) equal to the distribution of the scaled stochastic gradient
\[
\Delta=-(1/(2L))\,G_x(x,y).
\]
Under boundedness \(|f(x,y)|\le b\), \(L\)-Lipschitz gradient, and bounded-variance stochastic oracles, the main theorem states that the algorithm finds an \((\epsilon^*,\delta,\omega,Q)\)-approximate local equilibrium with \(\epsilon^*\in[\epsilon/2,\epsilon]\) in
\[
T=\mathrm{poly}(b,L,1/\epsilon,1/\delta,1/\omega)
\]
stochastic-gradient and function-oracle calls, independent of dimension \(d\), with probability at least \(9/10\). The proof combines descent per accepted step, an inner-loop runtime bound for the max-oracle, and a termination argument based on repeated rejections [2006.12376].

The empirical study emphasizes GAN training. On synthetic minimax test functions \(F_1,F_2,F_3\), the method converges on \(F_1\) and \(F_3\), whereas \(F_2\) has no finite global max and the method diverges to \(-\infty\). On a 4-mode Gaussian mixture, out of 20 runs, SGD\(_{\max}\) recovered all 4 modes in 70% of runs, compared with at most 20% for GDA and 0% for OMD and Unrolled GAN. On 0-1 MNIST, GDA mode-collapses in about 77% of runs whereas SGD\(_{\max}\) never mode-collapses. On full MNIST, it learns all 10 digits reliably in 5/5 runs. On CIFAR-10, the reported Inception Score is approximately \(4.7\pm0.4\) for SGD\(_{\max}\), \(4.5\pm0.9\) for GDA, and approximately \(1.9\pm0.3\) for OMD [2006.12376].

## 6. Comparative interpretation, guarantees, and common misconceptions

The cited literature shows that SGDmax is not a single standardized update rule. In one setting, the max-oracle is an exact maximization in \(\lambda\); in another, it is a subset-based convex maximization over probability weights; in RSGDA it is encoded through a randomized alternation between descent and ascent; and in the nonconvex–nonconcave framework it is a greedy ascent process that terminates at first-order stationarity. A common misconception is therefore to equate “max-oracle” with exact global maximization. The papers collectively show that the oracle may be exact, sample-average, stochastic, geometric, or first-order stationary, depending on the problem model [2204.01779] [1805.08728] [2111.13162] [2006.12376].

The convergence statements are likewise heterogeneous. RSGDA provides the first almost sure convergence rates among SGDA algorithms in the nonconvex min/strongly-concave max setting and matches the best SGDA rates known to hold for SGDA. DSSG establishes that the bias and variance of the gradient estimator vanish as the support size reaches the full dataset, and proves \(\|\nabla R(\theta_t)\|\to0\) under summable \(\eta_t^2\). The risk-constrained LQR method guarantees, with high probability, an iterate satisfying \(\|\nabla\Phi_{\mu_0}(K^j)\|\le 2\epsilon\). The nonconvex–nonconcave algorithm proves convergence to an \((\epsilon,\delta,\omega,Q)\)-approximate local equilibrium in a number of calls that is independent of dimension. This suggests that direct comparison of rates across papers requires care because the target objects—stationary points of \(\phi\), gradients of \(R\), Moreau-envelope stationarity, and randomized local equilibrium—are not identical [2111.13162] [1805.08728] [2204.01779] [2006.12376].

The empirical tuning rules also depend strongly on the application. In RSGDA, \(p=0.25\) is fastest on the MNIST distributionally robust problem, but \(p=0.9\) is best for adversarial optimal transport in single-cell data integration. In DSSG, the growth of \(M_t\) is the central control knob, with slowly increasing support sizes balancing computational effort and stochastic error. In the LQR setting, the design revolves around local constants \(L_0,\ell_0,\rho_0\), smoothing radius \(r\), sample count \(M\), and step size \(\eta\). In the nonconvex–nonconcave framework, proposal distribution \(Q\), inner ascent tolerance, and acceptance or rejection dynamics define the practical behavior. The literature therefore supports a narrow but robust conclusion: SGDmax names a family of outer-descent/inner-maximization procedures whose precise oracle, stationarity notion, and complexity guarantee are task-dependent rather than universal [2111.13162] [1805.08728] [2204.01779] [2006.12376].

Source: https://www.emergentmind.com/topics/stochastic-gradient-descent-with-max-oracle-sgdmax