Walkthrough on the edge of stochastic stability of neural networks.
At every iteration, SGD updates the iterate with an unbiased estimate of the gradient. The type of SGD is only the batch-sampling rule: online SGD uses one example; minibatch SGD uses \(B\) examples, drawn with or without replacement. For simplicity, let's just consider the sample batches are drawn i.i.d.
The dynamics of SGD are classical under Lipschitz assumptions, yet that theory does not predict what we see in deep networks. This tutorial recaps the quadratic picture, lists the observations it cannot explain, and then turns to scalar and high-dimensional models that do match the practical behaviour.
Start with one coordinate and a quadratic loss whose curvature \(a_t\) is redrawn i.i.d. each step:
Writing the SGD update step with additive Gaussian noise:
If the curvature is a fixed number \(a\), this is ordinary gradient descent: the iterate is a geometric sequence, so it converges when \(h<2/a\) and diverges when \(h>2/a\). There is only one threshold.
For SGD the sampled curvature \(a_t\) and multiplier \(A_t\) are random. The stationary distribution of \(x\) is then a property of the step size \(h\) and the distribution of \(A\). Convergence or divergence is a statement about moments of that distribution:
Between the two edges the iterate is heavy-tailed: almost every path returns to zero, while the variance blows up.
Kesten's theorem names the tail of this random walk. If the curvatures are i.i.d.\ and the Lyapunov exponent is negative,
then a unique stationary distribution exists, and it has a power tail whose index \(\alpha>0\) is the unique positive root of
The power matches the tail index of the stationary distribution. A positive root exists only while \(\Lambda<0\). So \(\alpha\) slides from large (nearly Gaussian) through \(\alpha=2\) at the mean-square edge down to \(\alpha=0\) at the Lyapunov edge, where the stationary distribution is gone.
This seems quite convincing and seems to give a full picture.
Training an MLP on CIFAR-10 with SGD at the edge of stochastic stability, we freeze a late checkpoint \(\theta_\star\), take the top Hessian eigenvector \(u_1\), and continue from there. The loss has already collapsed. In a late tracking window the occupancy of \(\langle\theta-\theta_\star,u_1\rangle\) is still two lobes with a gap at the checkpoint.
Measuring the Lyapunov exponent along that direction we get,
So the linear part really is expanding, and something outside the linear part is holding the iterate in. As you can already guess, the exact quadratic picture is flawed here: the natural next step is to ask whether a higher-order polynomial approximation of the loss can predict these dynamics.
We now turn to three labs that build that missing piece — first as a scalar nonlinearity, then as a matrix effect, then back on the network.
Keeping the same scalar update. Only the loss changes: replace the quadratic by a quartic, so the step picks up restoring terms.
Near zero this is still the Kesten map \(A_tx_t+\sigma\xi_t\). Once the iterate is pushed out, the higher terms pull it back, so an expanding linear multiplier no longer means escape. Raise \(h\) past the Lyapunov edge and the same path that used to diverge settles into two lobes.
The linear map has one more threshold after Lyapunov. Mean-square is \(\mathbb{E}[A^2]<1\). Lyapunov is \(\mathbb{E}\log|A|<0\). Harmonic stability is the inverse moment of the same multiplier:
The origin is harmonically unstable once \(H(h)<1\). The harmonic stability limit \(h_H\) is the first step size at that crossing, \(H(h_H)=1\). Past Lyapunov a typical path already expands near zero; past \(h_H\) the return becomes rare, so the restoring terms hold the iterate in two wells instead of a spike at the origin. (If the distribution of \(a\) can hit \(1/h\), the expectation diverges and one reads \(h_H\) from the histogram: the first \(h\) at which the cloud is bimodal.)
The histogram of the cloud then goes from a spike at \(0\), through a tent after Lyapunov, to two wells past \(h_H\). That is the strip below: only the step size changes.
Drag the step size across the edges, then turn the nonlinear terms on and off. Open this lab alone.
In this work, we first define a new edge to characterize this stability threshold, which we call the harmonic instability edge.
We extend the toy setup to 2-dimensional linear regression where the batch samples are drawn i.i.d from a Gaussian distribution. Each step picks a minibatch \(\mathcal B_t\) of size \(B\) and forms the batch Hessian from those covariates. We add an isotropic self-stabilization coefficient to observe the iterate dynamics in the post-Lyapunov regime. Note that since the Gaussian covariates are drawn i.i.d, the linear matrix product are non-commutative and hence a non-trivial extension of the scalar case above.
In the diagram below, we plot iterate histogram distribution of the cooridnates x1 and x2.
Pick a batch preset, hit Run, compare the two stability readouts. Open this lab alone.
Now let’s see the dynamics of SGD. We train several neural networks to completion. Then, using a different batch size and step size, we run SGD iterations from those trained checkpoints and plot the iterate histogram in the top two Hessian eigenvector directions.
Choose a checkpoint pack, sweep step size or batch, then run. Open this lab alone.
Full-batch GD on a quadratic has a single threshold where it converges or it diverges. SGD on the same quadratic has a tail spectrum that depends on the step-size and batch distribution. Self-stabilized SGD on a nonlinear loss does something new. After the Lyapunov edge the iterate stays bounded, and a new spectrum appears, organized by the negative-moment root \(\alpha\): a central peak while \(0<\alpha<1\), then central depletion once that root crosses \(\alpha=1\). That last crossing is the modal-split edge — the origin empties and, under the usual extra assumptions, the cloud becomes two lobes.