This is an example article. It shows what the article pipeline supports: inline and display math, aligned equations, code, tables, footnotes and quotes. Replace it with your own writing, or delete the file.

The model

Near a non-degenerate saddle point, any smooth loss looks like its second-order Taylor expansion. After a rotation into the Hessian’s eigenbasis, the simplest version in two dimensions is

L(x,y)=12(ax2−by2),a,b>0.\mathcal{L}(x, y) = \tfrac{1}{2}\left(a x^2 - b y^2\right), \qquad a, b > 0 .

The Hessian is diag⁡(a,−b)\operatorname{diag}(a, -b): the surface curves up along xx and down along yy, so its Gaussian curvature is negative. On the home page this is the white region around the saddle marker.

Gradient descent on the model

With step size η\eta, gradient descent updates each coordinate independently:

xt+1=(1−ηa) xt,yt+1=(1+ηb) yt.\begin{aligned} x_{t+1} &= (1 - \eta a)\, x_t, \\ y_{t+1} &= (1 + \eta b)\, y_t . \end{aligned}

So xtx_t shrinks geometrically and yty_t grows geometrically. Starting at distance ∣y0∣|y_0| from the stable direction, the iterate leaves a ball of radius rr after

Tescape=⌈log⁡(r/∣y0∣)log⁡(1+ηb)⌉≈1ηblog⁡r∣y0∣T_{\text{escape}} = \left\lceil \frac{\log (r / |y_0|)}{\log(1 + \eta b)} \right\rceil \approx \frac{1}{\eta b} \log \frac{r}{|y_0|}

steps. The dependence on ∣y0∣|y_0| is only logarithmic, which is good news. The bad news is the worst case: if y0=0y_0 = 0 exactly, the iterate converges to the saddle and never leaves.

How slow is slow?

For η=0.1\eta = 0.1, b=1b = 1, r=1r = 1:

∣y0∣\lvert y_0 \rvert steps to escape
10−210^{-2} 49
10−410^{-4} 97
10−810^{-8} 194

Each factor of 10410^{4} closer to the stable direction costs roughly another 48 steps.

def gd_escape_steps(y0, eta=0.1, b=1.0, r=1.0):
    """Steps until plain gradient descent leaves the ball of radius r."""
    y, t = y0, 0
    while abs(y) < r:
        y *= 1 + eta * b
        t += 1
    return t

print([gd_escape_steps(y0) for y0 in (1e-2, 1e-4, 1e-8)])  # [49, 97, 194]

Why noise fixes the worst case

Add isotropic Gaussian noise of temperature TT to each step:

θt+1=θt−η∇L(θt)+2ηT ξt,ξt∼N(0,I).\theta_{t+1} = \theta_t - \eta \nabla \mathcal{L}(\theta_t) + \sqrt{2 \eta T}\, \xi_t, \qquad \xi_t \sim \mathcal{N}(0, I).

Even from y0=0y_0 = 0, one step puts ∣y1∣|y_1| on the order of ηT\sqrt{\eta T}, and from there the deterministic growth above takes over. The escape time becomes roughly 1ηblog⁡rηT\frac{1}{\eta b}\log \frac{r}{\sqrt{\eta T}}, finite for every starting point. This is the idea behind perturbed gradient descent, which escapes strict saddles efficiently with high probability.1

The explorers on the home page run exactly this update, with the metric of the surface folded into the step. Hover near the saddle to watch them heat up and leave.

Takeaways

  1. Strict saddles slow gradient descent by a factor logarithmic in the distance to the stable direction.
  2. The only true trap is starting exactly on the stable manifold, a measure-zero set.2
  3. A small amount of noise removes that trap, at the cost of a slightly noisier final iterate.

Footnotes

  1. C. Jin, R. Ge, P. Netrapalli, S. M. Kakade, M. I. Jordan. How to Escape Saddle Points Efficiently. ICML 2017. ↩

  2. J. D. Lee, M. Simchowitz, M. I. Jordan, B. Recht. Gradient Descent Only Converges to Minimizers. COLT 2016. ↩