Optimal Risk Bounds of Stochastic Gradient Descent for Shallow ReLU Networks

Yuqing Liu, Yunwen LeiNeurIPS 2026

TL;DR

Training neural networks in the real world almost always means running multi-pass Stochastic Gradient Descent (SGD) over a fixed dataset, yet our best theoretical guarantees for shallow ReLU networks previously relied on computationally expensive full-batch Gradient Descent (GD). This paper bridges that gap between practice and theory, proving that multi-pass SGD achieves the same near-optimal generalization error while slashing the total gradient computations from quadratic $O(n^2)$ down to linear $O(n)$. Even better, it accomplishes this with networks of merely logarithmic width—no absurdly massive overparameterization required.

What Problem Does This Paper Address?

Why do neural networks generalize so well instead of just memorizing noise? Answering this mathematically for even a single-hidden-layer ReLU network is notoriously tricky because the loss landscape is both nonconvex and nonsmooth (thanks to the sharp kink at zero in the ReLU activation).

Early breakthroughs using the Neural Tangent Kernel (NTK)—a framework that approximates a wide neural network as a linear model around its random initialization—proved that networks could converge and generalize, provided their hidden layers were polynomially wide relative to the dataset size $n$. Recently, theorists tightened this to a much more realistic logarithmic width and proved near-optimal risk bounds (guarantees on test error) for full-batch GD.

Here’s the catch: full-batch GD computes gradients across all $n$ data points at every single step. Reaching optimal test error takes $O(n)$ steps, resulting in $O(n^2)$ total gradient calculations—a non-starter for modern, large-scale datasets. Switching to SGD drops the per-step cost to $O(1)$ by sampling one data point at a time, but it injects random noise into every update. Theorists didn't know if these stochastic jitters would knock the weights out of the well-behaved region near initialization, or if reusing data across multiple passes would break generalization guarantees.

Methods

The authors analyze a two-layer ReLU network initialized symmetrically so its initial output is identically zero, fixing the output layer weights and training only the hidden layer via constant-step-size, multi-pass SGD. Their proof strategy relies on optimization-dependent localization:

  1. Taming the Stochastic Trajectory: Because SGD samples single data points, its path wobbles. By applying martingale concentration inequalities and exploiting a "self-bounding" property of smooth losses like logistic loss (where gradient magnitude is bounded by the loss itself), the authors build a mathematical fence around the weights. They prove that with high probability, the entire SGD trajectory stays close to initialization in both standard Euclidean distance and maximum per-neuron movement.
  2. Tighter Complexity Bounds: Classical generalization theory measures the capacity of all possible networks, which yields uselessly loose bounds for big models. Because the authors proved SGD stays inside a tiny Euclidean ball, they only need to measure the Rademacher complexity (a standard metric of a function class's ability to fit random noise) of that specific, localized neighborhood.

Datasets

Not discussed in the paper. (This is a purely theoretical work proving mathematical guarantees over arbitrary data distributions, assuming normalized inputs on the unit sphere.)

Key Insights and Ideas

  • Multi-pass beats one-pass realism: Previous linear-time SGD proofs assumed "one-pass" online learning, where every step sees a fresh sample from an infinite stream—conveniently dodging the generalization problem. This paper tackles the messy reality of a fixed training set sampled repeatedly, resolving the statistical dependencies between weights and reused data.
  • Correlations between neurons matter: Tracking individual neurons in isolation (via the $(2,\infty)$-norm) ignores how weights co-vary and bloats complexity bounds by a factor of $\sqrt{m}$ (where $m$ is network width). Controlling the global Euclidean norm captures inter-neuron correlations and yields a cleaner, tighter Rademacher complexity bound.
  • Stochastic noise doesn't require microscopic steps: You might expect SGD's noisy updates to require tiny learning rates—and thus way more iterations—to stay localized. Surprisingly, SGD tolerates step sizes large enough to hit optimal test error in just $O(n)$ steps.

Key Results

Under standard NTK separability with margin $\gamma$ (meaning the random features at initialization can cleanly separate the data classes with a buffer of $\gamma$):

  • Near-Optimal Test Error: Multi-pass SGD achieves a high-probability population risk bound of $\widetilde{O}\big(\frac{1}{n\gamma^2}\big)$ (where $\widetilde{O}$ hides logarithmic factors). This matches the minimax optimal rate and dramatically beats classic $\widetilde{O}\big(\frac{1}{\sqrt{n}\gamma^2}\big)$ bounds.
  • Linear Compute Complexity: Reaching this optimal bound takes $T \asymp n$ iterations, requiring only $O(n)$ total stochastic gradient computations—a massive theoretical speedup over the $O(n^2)$ gradients required by full-batch GD.
  • Mild Network Width: All guarantees hold as long as the network width $m$ scales polylogarithmically with the sample size $n$ and iteration count $T$ (e.g., $m \gtrsim \log^8 T$ under standard realizability).

Limitations and Future Work

The analysis relies on stylized theoretical scaffolding: input vectors must have a strict Euclidean norm of $1$, the network has only one hidden layer, and the outer-layer weights are frozen during training. Furthermore, the bounds are proved for the average risk across the optimization trajectory rather than the final iterate. In their conclusion, the authors note that extending this localization framework to deeper architectures and more complex optimization algorithms (like momentum or adaptive methods) is a key direction for future work, with preliminary discussions provided in their appendix.

Summary updated

Abstract

Recent work shows that gradient descent (GD) can achieve almost optimal risk bounds for shallow ReLU networks with a logarithmic width. However, these discussions require $O(n^2)$ gradient computations to achieve this optimality, which is not appealing for modern machine learning problems with large sample size $n$. In this paper, we significantly improve the existing gradient complexity by showing that stochastic gradient descent (SGD) can achieve similar risk bounds with $O(n)$ gradient computations for shallow ReLU networks with a logarithmic width. As compared to GD, the analysis with SGD is more challenging as there are additional fluctuations incurred by the stochastic gradient noise along the optimization process. With concentration inequalities to handle these fluctuations, we show that the entire SGD trajectory stays around its initialization point with high probability. Under an NTK separability condition with margin $\gamma$, we show SGD achieves near-optimal risk bounds $\widetilde{O}(1/(n\gamma^2))$ with a logarithmic width.
BibTeX
@inproceedings{liu2026optimal,
  author = {Yuqing Liu and Yunwen Lei},
  title = {{Optimal Risk Bounds of Stochastic Gradient Descent for Shallow ReLU Networks}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=dBGhQx4fCF},
}
Figure