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
The Hessian is : the surface curves up along and down along , 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 , gradient descent updates each coordinate independently:
So shrinks geometrically and grows geometrically. Starting at distance from the stable direction, the iterate leaves a ball of radius after
steps. The dependence on is only logarithmic, which is good news. The bad news is the worst case: if exactly, the iterate converges to the saddle and never leaves.
How slow is slow?
For , , :
| steps to escape | |
|---|---|
| 49 | |
| 97 | |
| 194 |
Each factor of 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 to each step:
Even from , one step puts on the order of , and from there the deterministic growth above takes over. The escape time becomes roughly , 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
- Strict saddles slow gradient descent by a factor logarithmic in the distance to the stable direction.
- The only true trap is starting exactly on the stable manifold, a measure-zero set.2
- A small amount of noise removes that trap, at the cost of a slightly noisier final iterate.