Edge of Stochastic Stability: Revisiting the Edge of Stability for SGD

Arseniy Andreyev, Pierfrancesco Beneventano

TL;DR

We’ve known for a few years that full-batch Gradient Descent doesn't smoothly slide down a bowl; it climbs up the walls until it teeters right on the brink of chaos—at a sharpness of $2/\eta$—and surfs that "Edge of Stability" all the way down. The catch? Nobody actually uses full-batch GD in practice, and mini-batch SGD mysteriously breaks this rule. This paper solves the puzzle by discovering the Edge of Stochastic Stability (EoSS), revealing the exact geometric quantity that governs real-world neural network training—and explaining why smaller batches naturally find flatter, better-generalizing solutions.

What Problem Does This Paper Address?

Classical optimization textbooks tell us that to minimize a loss function with step size (learning rate) $\eta$, the landscape's sharpest curve—measured by $\lambda_{\max}$, the largest eigenvalue of the Hessian—must stay below $2/\eta$. Otherwise, your steps overshoot the valley walls and your loss explodes.

Recently, researchers discovered that full-batch Gradient Descent (GD) ignores the textbooks: during neural network training, $\lambda_{\max}$ actively grows (progressive sharpening) until it hits $2/\eta$ and hovers right there, oscillating wildly while the average loss still drops. This is the Edge of Stability (EoS).

However, real-world deep learning runs on mini-batch Stochastic Gradient Descent (SGD), where EoS breaks down completely. In SGD, the full-batch $\lambda_{\max}$ plateaus well below $2/\eta$, especially for smaller batch sizes. Furthermore, in GD, loss oscillations tell you you've hit the edge of instability; in SGD, random batch sampling causes constant, harmless oscillations even in totally stable valleys. So, is SGD actually training at an unstable edge? And if so, what is hitting the ceiling?

Figure 2: SGD on CIFAR-10: η = 1/400. The full- batch Hessian’s λmax plateaus below 2/η. Smaller batch sizes lead to lower plateau values.

Methods

Because noise makes SGD oscillate all the time, the authors needed a new theoretical and empirical toolkit to hunt for the stochastic edge:

  • A Formal Instability Framework: Instead of trying to map the exact, intractable boundaries of stability in million-dimensional spaces, they define "edge behavior" as the saturation of a sufficient local instability criterion—a computable scalar threshold that, if crossed, guarantees local divergence.
  • Batch Sharpness: Rather than looking at the full-batch landscape, they introduce a new metric: the expected directional curvature of a mini-batch’s Hessian measured specifically along that same mini-batch’s gradient: $$\text{Batch Sharpness}(\theta) := \mathbb{E}_{B}\left[\frac{\nabla L_B(\theta)^\top \mathcal{H}(L_B) \nabla L_B(\theta)}{\|\nabla L_B(\theta)\|^2}\right]$$
  • Checkpoint Perturbation Test: To empirically prove a network is surfing an instability boundary without relying on oscillations, they pause training at a checkpoint and nudge hyperparameters in a slightly more aggressive direction (increasing $\eta$ or shrinking batch size $b$). If the model immediately suffers a massive loss spike (a "catapult"), it was genuinely living on the edge.

Datasets

The authors evaluate their findings on standard image-classification benchmarks—specifically CIFAR-10 (including an 8,000-example subset to make exact full-batch Hessian tracking computationally feasible) and SVHN—across standard MLP, 5-layer CNN, and ResNet-14 architectures. No new datasets or benchmarks are introduced.

Key Insights and Ideas

  • Stability is measured on mini-batch landscapes, not the average landscape: SGD doesn't step on the global loss surface; at every step, it experiences a sampled mini-batch landscape. Therefore, SGD is stable if its steps are stable on average across individual mini-batch surfaces.
  • Why smaller batches find flatter minima: Because gradients from different mini-batches point in poorly aligned directions, Batch Sharpness ends up being strictly larger than the full-batch $\lambda_{\max}$—and the gap widens as batch size shrinks. Because Batch Sharpness hits the $2/\eta$ ceiling and halts sharpening, $\lambda_{\max}$ gets artificially held down below it! Smaller batches and larger step sizes literally force the global landscape to stay flatter.
  • Oscillations $\neq$ Instability: The authors isolate a metric called Gradient–Noise Interaction (GNI) and prove it settles at $2/\eta$ even in completely stable, strongly convex bowls. That means watching the loss bounce up and down tells you about sampling noise ("Type-1 oscillations"), not curvature instability ("Type-2 oscillations").
  • "GD + Noise" and SDE models miss the point: Many theorists model SGD as full-batch GD plus isotropic or diagonal Gaussian noise, or as a continuous-time Stochastic Differential Equation (SDE). Because these approximations average out the batch-specific curvature geometry, they completely fail to reproduce EoSS and the suppression of $\lambda_{\max}$.
  • Natural Catapults: Because Batch Sharpness only stabilizes in expectation at $2/\eta$, an unlucky streak of unusually sharp mini-batches during normal training can organically launch the optimizer out of its valley, explaining the mysterious mid-training loss spikes practitioners often see.

Key Results

Across MLPs, CNNs, and ResNet-14, the authors demonstrate that Batch Sharpness consistently undergoes progressive sharpening and stabilizes squarely at $2/\eta$, completely independent of batch size (tested across $b \in \{4, 16, 32, 64, 256\}$ and step sizes like $\eta \in \{2/500, 2/375, 2/250, 2/125\}$).

Figure 1: SGD at EOSS under different step sizes and batch sizes. MLP on an 8k subset of CIFAR-10 with step size η > 0. Batch Sharpness stabilizes at the 2/η threshold across varying batch sizes and step sizes.

Meanwhile, full-batch $\lambda_{\max}$ settles at progressively lower plateaus as batch size drops (e.g., for $\eta = 1/400$ where $2/\eta = 800$, $\lambda_{\max}$ hovers near $400$ at $b=256$, drops below $300$ at $b=16$, and stays under $50$ at $b=2$).

Theoretically, in a linearized squared-loss model with orthogonal per-example gradients, they prove that $\text{Batch Sharpness} > 2/\eta$ causes exponential loss explosion almost surely. Finally, when testing mathematical surrogates of SGD, only Gaussian resampling (which preserves mini-batch Hessian structure) reproduces the EoSS $\lambda_{\max}$ suppression, whereas standard SDE integration and isotropic/diagonal noise injections overshoot right up to the full-batch $2/\eta$ ceiling.

Limitations and Future Work

The authors are candid about what remains open:

  • Scope of Experiments: Empirical evidence is limited to image classification, standard architectures, fixed learning rates, and squared loss (MSE). Extending EoSS to cross-entropy loss, NLP/LLMs, RL, and adaptive optimizers like Adam is wide open (though they note follow-up work already extends EoSS to SGD with momentum).
  • Theoretical Assumptions: Their proof that Batch Sharpness certifies instability relies on a linearized model with pairwise orthogonal sample gradients; relaxing orthogonality is left for future work.
  • The "Why" of Self-Stabilization: While they show where Batch Sharpness stabilizes ($2/\eta$), deriving a mathematical self-stabilization mechanism—explaining how third-order derivatives push SGD back down when it crosses the line, without a single shared unstable direction—remains a major open challenge.

Summary updated

BibTeX
@inproceedings{andreyev2026edge,
  author = {Arseniy Andreyev and Pierfrancesco Beneventano},
  title = {{Edge of Stochastic Stability: Revisiting the Edge of Stability for SGD}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=lUoXQdMVoe},
}

Loading related content...

Figure