---
title: Edge of Stability in Optimization
url: https://www.emergentmind.com/topics/edge-of-stability-phenomenon
type: topic
---

# Edge of Stability in Optimization

Searching arXiv for recent and foundational papers on the edge of stability phenomenon.
The **edge of stability phenomenon** is a regime of iterative optimization in which training approaches the discrete-time stability boundary implied by a local quadratic model of the loss. In its canonical form for full-batch gradient descent (GD) with step size \(\eta\), the sharpness—typically the largest eigenvalue of the training-loss Hessian—rises during training until it is approximately \(2/\eta\), after which it hovers near that value; the loss becomes non-monotone on short timescales, yet continues to decrease over longer horizons. Subsequent work has generalized this picture to optimizer-dependent boundaries, including Sharpness-Aware Minimization (SAM), non-Euclidean descent, stochastic and momentum methods, and related NTK and bifurcation analyses, while also showing that the phenomenon is sensitive to loss geometry, data regime, and alignment structure [2103.00065][2309.12488][2603.05002].

## 1. Operational definition and canonical thresholds

In the standard formulation, sharpness is the **maximum eigenvalue of the training-loss Hessian**. For vanilla GD on a quadratic \(f(\mathbf{x})=\tfrac12 \mathbf{x}^\top A\mathbf{x}+b^\top\mathbf{x}+c\), the update along an eigen-direction with eigenvalue \(a\) is unstable if \(a>2/\eta\), since
\[
x_{t+1}-x^*=(1-\eta a)(x_t-x^*),
\]
and \((1-\eta a)<-1\) when \(a>2/\eta\). This motivates the operational definition of edge of stability: a regime where
\[
\lambda_{\max}(\nabla^2 f(\theta_t)) \approx \frac{2}{\eta},
\]
the loss is jagged or locally unstable, and yet long-horizon optimization continues [2103.00065].

A closely related formulation appears in work that treats the phenomenon as the interaction between curvature and the stability limit of the update rule under a quadratic-loss approximation. In that language, training typically has a **progressive sharpening** phase, where the leading Hessian eigenvalue rises while the loss decreases monotonically, followed by an **edge-of-stability** phase in which the leading eigenvalue oscillates near the optimizer’s divergence threshold and the loss becomes locally unstable while still decreasing over longer time frames [2307.04210].

| Setting | Curvature statistic | Threshold |
|---|---|---|
| GD | \(\lambda_{\max}(\nabla^2 L)\) | \(2/\eta\) |
| Polyak momentum | \(\mathrm{MSS}_{\text{Polyak}(\eta,\beta)}\) | \(\frac{1}{\eta}(2+2\beta)\) |
| Nesterov momentum | \(\mathrm{MSS}_{\text{Nesterov}(\eta,\beta)}\) | \(\frac{1}{\eta}\left(\frac{2+2\beta}{1+2\beta}\right)\) |
| SAM | \(\|H\|_{op}\) | \(\frac{\|g\|}{2\rho}\left(\sqrt{1+\frac{8\rho}{\eta\|g\|}}-1\right)\) |
| Non-Euclidean GD | \(D^{\cdot}(w_t,w_{t+1})\) or \(S^{\cdot}(w)\) | \(2/\eta\) |

The table emphasizes that the phrase does not denote a single invariant scalar across all optimizers. Rather, the stability boundary depends on the geometry of the update rule: Euclidean GD yields the classical \(2/\eta\), momentum changes the maximum stable sharpness, SAM introduces a gradient-dependent edge, and non-Euclidean descent replaces Euclidean sharpness with directional smoothness or generalized sharpness [2103.00065][2309.12488][2603.05002].

## 2. Quadratic local theory and optimizer-dependent edges

For GD, a local exact quadratic model around the current iterate \(w_t\),
\[
\ell(w)=\ell(w_t)+g^\top(w-w_t)+\frac{(w-w_t)^\top H(w-w_t)}{2},
\]
with \(g=\nabla\ell(w_t)\neq 0\) and \(H=\nabla^2\ell(w_t)\), gives
\[
\ell(w_{t+1})\le \ell(w_t)-\eta\left(1-\frac{\eta\|H\|_{op}}{2}\right)\|g\|^2.
\]
Hence \(\|H\|_{op}<2/\eta\) implies one-step decrease. Moreover, if \(g\) is aligned with a principal eigenvector of \(H\) with nonnegative eigenvalue, then the sign of \(\ell(w_{t+1})-\ell(w_t)\) is exactly the sign of \(\|H\|_{op}-2/\eta\). This is why \(2/\eta\) is interpreted as a local stability boundary rather than merely a heuristic scale [2309.12488].

For SAM, the update is
\[
w_{t+1}=w_t-\eta\nabla \ell\!\left(w_t+\rho\frac{g}{\|g\|}\right),
\]
and the same local quadratic analysis yields a different stability boundary. Assuming \(g=\nabla \ell(w_t)\neq 0\) and \(H=\nabla^2\ell(w_t)\succeq 0\), the paper derives the **SAM edge of stability**
\[
\frac{\|g\|}{2\rho}\left(\sqrt{1+\frac{8\rho}{\eta\|g\|}}-1\right).
\]
The main theoretical difference from GD is that this boundary depends on the gradient norm \(\|g\|\) as well as \(\eta\) and \(\rho\), and it becomes smaller as training progresses and \(\|g\|\) decreases. Empirically, on a depth-4 fully connected network on MNIST with quadratic loss, a CNN on CIFAR10 trained on the first 1000 examples with quadratic loss, and a Transformer language model on tiny_shakespeare with minibatch training, the Hessian norm under SAM tracks this predicted boundary rather than \(2/\eta\) [2309.12488].

A broader generalization replaces Euclidean smoothness by **directional smoothness**. For non-Euclidean GD,
\[
w_{t+1}=w_t-\eta \|\nabla L(w_t)\|_*(\nabla L(w_t))_*,
\]
the key identity is
\[
\Delta L_t=-\eta\Bigl(1-\tfrac{\eta}{2}D^{\cdot}(w_t,w_{t+1})\Bigr)\|\nabla L(w_t)\|_*^2.
\]
Thus the loss decreases if and only if
\[
D^{\cdot}(w_t,w_{t+1})\le \frac{2}{\eta}.
\]
Under a second-order approximation, this yields a generalized sharpness
\[
S^{\cdot}(w)=\max_{\|d\|\le 1} d^\top \nabla^2 L(w)\, d,
\]
which recovers vanilla GD, preconditioned GD, \(\ell_\infty\)-descent, Block CD, Spectral GD, and Muon without momentum as special cases. In experiments, the relevant generalized sharpness rises during progressive sharpening and then hovers at or slightly above \(2/\eta\) for these non-Euclidean methods [2603.05002].

## 3. Dynamical mechanisms: self-stabilization, bifurcation, and oscillatory structure

The empirical signatures of edge-of-stability training—alternating iterates, loss spikes, and sharpness stabilization—have motivated several mechanistic models. One line of work shows that, after a canonical reparameterization, different GD trajectories align on a bifurcation diagram independent of initialization. In a two-layer fully connected linear network and a single-neuron nonlinear network trained with a single data point, the reduced dynamics take the form
\[
f_q(p)=p\left(1-\frac{2r(p)}{q}\right),
\]
with a period-doubling bifurcation at \(q=1\), corresponding to the normalized sharpness threshold \(2/\eta\). In this view, progressive sharpening is a slow drift toward the bifurcation point, and the EoS phase is the regime where the fixed point loses stability and a stable period-2 orbit appears [2307.04204].

A more explicit continuous-time model is **Edge Flow**, which decomposes GD near EoS as
\[
w_t \approx \bar w_t + (-1)^t x_t u_t,
\]
with center \(\bar w_t\), oscillation direction \(u_t\), and oscillation magnitude \(x_t\). The coupled ODEs are
\[
\frac{d\bar w_t}{dt} = -\frac12\big(\nabla L(\bar w_t+x_tu_t)+\nabla L(\bar w_t-x_tu_t)\big),
\]
\[
\frac{du_t}{dt} = 2\Big(\nabla^2 L(\bar w_t) - (u_t^\top \nabla^2 L(\bar w_t)u_t)I\Big)u_t,
\]
\[
\frac{dx_t}{dt} = \Big(S(\bar w_t)-\frac{2}{\eta}\Big)x_t.
\]
The model attributes stabilization to a feedback loop: if sharpness rises above \(2/\eta\), \(x_t\) grows; the symmetrized center dynamics then introduce a third-derivative correction that pushes the center toward lower-curvature regions; if sharpness falls below \(2/\eta\), \(x_t\) decays and ordinary progressive sharpening resumes [2606.18080].

A discrete variational explanation appears in work introducing the **edge coupling**
\[
\mathcal A_\eta(x,y)=L(x)+L(y)-\frac{1}{2\eta}\|x-y\|_2^2.
\]
The condition \(\nabla_x\mathcal A_\eta(x,y)=0\) is exactly the GD update \(y=x-\eta\nabla L(x)\). Differencing this condition across consecutive steps yields
\[
d_{k+1}=(I-\eta \bar H_k)d_k,
\]
with \(d_k=w_{k+1}-w_k\) and \(\bar H_k\) the segment-averaged Hessian, making the boundary \(2/\eta\) explicit. A second-order expansion gives a telescoping loss identity that forces a weighted average curvature toward \(2/\eta\), and a mean value theorem argument localizes the averaged curvature to the true Hessian at interior points of each step segment [2604.20446].

Minimalist examples isolate the same structure in tractable nonconvex systems. A degree-4 scalar product objective yields a two-step map with a stabilizing cubic term and a parabolic slow manifold; under explicit local conditions, GD converges to a minimum whose sharpness lies in
\[
\left(\frac{2}{\eta}-\frac{20}{3}\eta,\ \frac{2}{\eta}\right),
\]
capturing both convergence above the naive threshold and endpoint sharpness slightly below \(2/\eta\) [2210.03294]. In deep linear networks, the regime beyond EoS follows a **period-doubling route to chaos**; oscillations occur in a small subspace whose dimension is determined by the learning rate, and the symmetry-induced balancing gap from gradient flow breaks at EoS and decays monotonically to zero [2502.20531].

## 4. Stochastic, momentum, and batch-sensitive formulations

Mini-batch training modifies the deterministic picture in several distinct ways. One approach extends full-batch self-stabilization to **stochastic self-stabilization** and derives a closed-form equilibrium sharpness gap
\[
\Delta S = \frac{\eta\beta\sigma_{\boldsymbol u}^2}{4\alpha},
\]
where \(\alpha\) is the progressive sharpening rate, \(\beta\) is the self-stabilization strength, and \(\sigma_{\boldsymbol u}^2\) is the gradient-noise variance projected onto the top Hessian eigenvector. This predicts that smaller batch sizes yield flatter solutions and recovers GD when the batch equals the full dataset [2604.21016].

A complementary high-dimensional analysis identifies **conservative sharpening** and a distinct **stochastic edge of stability**. In that theory, minibatch noise suppresses the later growth of already-large curvature modes, and the relevant instability criterion is often not the top Hessian eigenvalue but
\[
K \approx \frac{\eta}{B}\sum_{i=1}^D \frac{\lambda_i^2}{2-\lambda_i},
\]
with small-curvature approximation
\[
K \approx \frac{\eta}{2B}\operatorname{tr}(J J^\top).
\]
This yields a stochastic edge sensitive to the NTK spectrum and, at small batch size, often to its trace rather than to \(\lambda_{\max}\) alone [2404.19261].

Momentum introduces an explicitly batch-size-dependent edge. For SGDM, **Batch Sharpness**
\[
\mathrm{BS}(\theta)=\mathbb{E}_{B}\!\left[\frac{g_B(\theta)^\top H_B(\theta)\, g_B(\theta)}{\|g_B(\theta)\|_2^2}\right]
\]
stabilizes at
\[
\frac{2(1-\beta)}{\eta}
\]
in the small-batch regime and at
\[
\frac{2(1+\beta)}{\eta}
\]
in the large-batch regime; for SGDN, the large-batch plateau is
\[
\frac{2(1+\beta)}{\eta(1+2\beta)}.
\]
The paper’s central point is that momentum does not merely rescale the step size by a single deterministic factor; rather, the operative edge depends on whether the dynamics are noise-dominated or near-deterministic [2604.14108].

Another stochastic formulation, developed for multiclass cross-entropy in linear classifiers and two-layer neural networks, replaces pointwise monotonicity by **stochastic Lyapunov stability**. There the stable set is defined by a loss threshold \(L(W)\le 1/(\eta c)\), SGD alternates between edge-of-stability excursions and stable periods, and self-stabilization guarantees return to stability in a fixed number of iterations with high probability [2606.30930].

## 5. Manifestations across tasks, losses, and representation dynamics

The phenomenon is not uniform across domains. In off-policy deep reinforcement learning, it appears clearly for **DQN** with a Huber loss, especially in offline settings, where the leading Hessian eigenvalue rises to the quadratic threshold and then fluctuates around it. By contrast, **C51** with a cross-entropy loss does not show a consistent edge-of-stability effect: in offline learning \(\lambda_1\) often stays below the threshold or only briefly approaches it, while in online learning it can become much larger than the threshold and then decrease later. The paper therefore attributes a major role to **loss geometry**, not merely network architecture [2307.04210].

The phenomenon also has a representation-level formulation. In NTK analyses, edge-of-stability training is associated not only with oscillation of the largest eigenvalue near a threshold of order \(2/\eta\), but also with **eigenvector rotation**. In a two-layer linear theory with
\[
K_t=c_t^2 X^\top X + \boldsymbol{v}_t \boldsymbol{v}_t^\top,
\]
the ratio
\[
\alpha_t=\frac{\|\boldsymbol{v}_t\|^2}{c_t^2}
\]
governs an **alignment shift**: larger learning rates cause the target to align more strongly with the leading eigenvectors of the final NTK, and the sharpness-decreasing subphases of EoS coincide with sudden gains in alignment [2507.12837].

EoS can also act selectively across the data distribution. One study uses a branching intervention—continuing at the same learning rate versus halving the learning rate at the onset of EoS—to show that staying at EoS improves some groups while suppressing others. Two necessary conditions are identified for a group to benefit: its aggregate gradient must align with the top Hessian eigenvector, and its gradient magnitude must remain non-vanishing over time. Under cross-entropy loss, gradient saturation can decouple confidently classified groups, shifting the EoS advantage to output-outliers whose gradients persist [2606.04212].

A distinct feature-learning consequence appears in simplified two-layer ReLU models. There, a sharp learning-rate phase transition at
\[
\eta=\frac{8\pi}{d^2}
\]
separates a regime in which the bias remains near zero from one in which GD enters the EoS regime and learns a genuinely negative first-layer bias, yielding a **threshold neuron**. In that model, large learning rates and unstable convergence are not incidental; they are the mechanism by which threshold-like units emerge [2212.07469].

## 6. Scope, limitations, and adjacent meanings

Several caveats recur across the literature. The basic derivations are typically local and quadratic; stronger sign tests often assume favorable alignment between the gradient and a principal Hessian eigenvector, and in the SAM case the strongest proposition assumes \(H\succeq 0\). Minibatch results are noisier, and stochastic formulations do not always preserve the clean deterministic picture of sharpness hovering exactly at \(2/\eta\). These facts limit any claim that the phenomenon is universal in a strict mechanistic sense [2309.12488][2307.04210].

A common misconception is that crossing the quadratic threshold must imply immediate divergence. The empirical and theoretical literature instead describes a regime of **progress with oscillations**: short-horizon monotonicity fails, local quadratic descent guarantees break, and yet optimization can remain effective over long horizons [2103.00065][2606.18080]. Another misconception is that edge of stability is exclusively a Euclidean full-batch GD effect; later work shows optimizer-specific edges for SAM, non-Euclidean methods, SGD, and momentum, with different operative curvature statistics [2309.12488][2603.05002][2604.14108].

The term also appears in adjacent but non-identical settings. In **Edge of Stability Echo State Networks**, the phrase refers to reservoir dynamics organized near an edge-of-chaos regime by construction: the reservoir Jacobian spectrum is confined to an annular neighborhood of a circle of radius \(1-\beta\), the model has the ESP when \(\sigma<1\), and for small \(\beta\) the maximum local Lyapunov exponent satisfies \(\Lambda\approx -\beta\) [2308.02902]. In kernel associative memory, the **Ridge of Optimization** is identified with an information-geometric edge where the Fisher Information Matrix becomes highly concentrated and nearly singular, and natural-gradient geometry produces a self-braking effect along the dominant curvature direction [2511.23083]. This suggests that the label now spans several related boundary phenomena centered on criticality, curvature concentration, and marginal stability.

Across these formulations, the recurring theme is that practical training often does not remain in the classically “safe” small-step regime. Instead, it organizes near a boundary where the update rule, curvature geometry, loss structure, and sometimes data distribution jointly determine whether instability becomes divergence, oscillatory progress, selective learning, or a new implicit bias over representations and solutions.

Source: https://www.emergentmind.com/topics/edge-of-stability-phenomenon