What Actually Makes Training Converge
A two per cent change in the learning rate separates a converged run from one five orders of magnitude away, a condition number predicts the convergence rate to six decimal places, and stochastic gradient descent with a fixed step never converges at all - it settles into a ball whose radius grows as the square root of the step. Every figure here was computed on a problem whose exact optimum is known.
Prerequisites: Backpropagation and Gradient Descent
A learning rate of 1.1246 trains a model. A learning rate of 1.1473 sends the same model, on the same data, from the same starting point, to a loss five orders of magnitude worse.
Nothing about the model changed. The gap between those two numbers is two per cent, and there is no gradual degradation in between - the run either settles or is flung away. That cliff has an exact location, it can be computed before training starts, and the same small piece of theory that locates it also predicts how many steps a successful run will take.
Everything below is measured on one deliberately small problem: least squares with 400 points and two parameters, whose exact optimum is known in closed form. Knowing the answer in advance is the whole point. It turns every claim into a measurement rather than an impression.
A. The cliff
Near a minimum the loss is a quadratic bowl, and the bowl's shape is the Hessian . Write the error as and one gradient step is just
Decompose the error along the eigenvectors of . Each component is multiplied by , where is that direction's curvature, and the directions never interact. A single step is therefore not one motion - it is as many independent contractions as the problem has curvature directions, each running at its own rate.
A component shrinks only when , which is exactly . Since every direction has to shrink, the binding constraint is the sharpest curvature :
On this problem , so the threshold is . The two step sizes at the top of this article are 0.99 and 1.01 times that number, and after 200 steps they leave the loss at 0.236592 and at 23585.65.
That is the cliff. It is not a region of instability with a grey zone; it is a
sign change in , after which the sharpest direction is multiplied by
the same factor greater than one every single step. Anyone who has watched a
loss curve go to NaN within thirty steps of a "small" learning-rate increase
has seen this exact arithmetic.
Interactive: the step, and the edge of stability
η = 0.6816, and the cliff is at 2/L = 1.1360.
- Contraction per step
- 0.949667
- Steps for six digits
- > 260
- Cliff at 2/L
- 1.1360
Six digits are out of reach in 260 steps at this setting. The condition number is 23.8410 - a mild elongation, on a problem with two parameters - and it alone sets the rate. Raise β and the zig-zag across the valley cancels while the crawl along it accumulates: the dependence drops from κ to √κ.
B. Stable is not fast
Knowing does not mean setting , because stability and speed are different questions with different answers.
The error contracts by per step, where is the flattest curvature. Raising helps the flat direction and hurts the sharp one, so the best step is where the two costs meet, at . Every step size between that and the threshold is both slower and closer to the cliff.
It is worth checking such a derivation rather than trusting it. Running the same 200 steps at each of 2000 step sizes and keeping the one that ends closest to gives 1.088582 against the derived 1.090230 - agreement to . The small gap is not the grid: over a finite 200 steps the best step sits just below the asymptotic optimum, and closes on it as the run lengthens. A formula with a sign slip in it still looks like a formula; a grid search costs three lines and does not.
C. One number predicts the whole run
Put back in and the contraction becomes a function of a single quantity - the condition number , the elongation of the bowl:
Here , so . Measuring the real run - taking at steps 20 and 100 and extracting the per-step ratio - gives . Six decimal places, with nothing fitted: the prediction uses two eigenvalues of a matrix and reproduces a run that knows nothing about them.
Note how little the rate depends on. Not the data beyond its Hessian, not the starting point, not the dimension. And note the scale: is a mild condition number, and it already costs 165 steps to shrink the error a millionfold on a two-parameter problem. Real networks run in the thousands.
This is also the reason rescaling a single input column can transform a training time. is a property of the parameterisation, not of what is being learned. Standardising features, batch normalisation and layer normalisation all move the Hessian's eigenvalues, and moving them is moving the rate. They are not statistical politeness; they are conditioning.
D. What momentum is actually doing
Gradient descent throws away the history of the run at every step - including the fact that the gradient along the flat direction has pointed the same way for a hundred steps, while the gradient along the sharp direction has been alternating in sign.
Momentum keeps a running velocity, , and the two directions get opposite treatment from it for free. Down the valley, where successive gradients agree, the decaying average builds to roughly times a single gradient. Across the valley, where they alternate, they largely cancel. One blind mechanism amplifies exactly the slow direction and damps exactly the oscillating one, and the rate improves to
The dependence on the condition number went from to . Momentum reaches millionfold accuracy in 42 steps against 165 - a factor of 3.9, where the asymptotic rates predict .
The shortfall is worth keeping rather than rounding away. Polyak's rate is asymptotic. With his tuning both curvature directions sit exactly at the extremes, so each gets a repeated root, at and , and a repeated root decays like rather than . Measured over steps 20 to 60 the real contraction is 0.677786, close to the that the extra factor of predicts. On this problem the asymptotics never arrive, because the run hits machine precision first. So the honest claim is not that momentum converges at 0.660022, but that it turns a problem into a problem and you should expect most of that on a real run.
Both runs are below, each at its own optimal settings, with the error on a log axis. At the condition number this problem actually has, the counts are the ones just quoted: 165 steps against 42. The slider is the point, though. A change of exponent is the one thing a pair of numbers cannot show, so drag the condition number and watch the two curves separate - the plain count growing with kappa and the momentum count with its square root. The two rate read-outs are also kept apart deliberately: the asymptotic one is a limit, and the measured one is what this run actually does.
Interactive: what the square root is worth
Both runs at their own optimal settings. Error on a log axis.
- Plain, steps to 1e-6
- 165
- Momentum, steps
- 42
- Momentum rate, asymptotic
- 0.660021
- Momentum rate, measured
- 0.677785
The lesson’s own problem: 165 steps for six digits against 42, a factor of 3.9 where the asymptotic rates predict 4.9. The gap is worth keeping rather than smoothing over. Polyak’s 0.660021 is a limit; measured over steps 20 to 60 the run actually contracts at 0.677785, because Polyak’s tuning gives each curvature direction a repeated root, and a repeated root decays like t times the rate to the power t, not the rate to the power t. That extra factor fades slowly, and on this problem it never does - machine precision arrives first. The honest claim is that momentum turns a kappa problem into a sqrt(kappa) one and that a real run gets most of that, not all.
E. And then the gradient is not exact
Everything so far assumed the true gradient. Real training has a minibatch estimate, and that single substitution breaks the guarantee that any of this converges.
The estimate is unbiased - a uniform sample of per-example gradients has the full gradient as its expectation - so a small batch does not point somewhere systematically different. What changes is spread: at the origin , where the full gradient is , the typical noise is 1.4382 at and 0.3027 at . Sixteen times the compute for 4.75 times the precision, close to the that averaging predicts and a little above it because these batches are drawn without replacement from only points, which predicts . Linear cost, square-root benefit: that exchange rate is the entire argument for small batches and many steps.
The consequence is that a fixed-step run never converges. Each step contracts toward and each step injects fresh sampling noise, and at some radius the two balance. Running to 120,000 steps and measuring the root-mean-square distance over the tail:
| step size | rms distance from |
|---|---|
| 0.2000 | 0.109343 |
| 0.1000 | 0.075358 |
| 0.0500 | 0.053134 |
| 0.0250 | 0.037673 |
| 0.0125 | 0.026497 |
None of these is heading to zero. And the exchange rate is worse than it looks: halving from 0.20 to 0.10 shrinks the floor by 31%, not 50%. Fitting across the whole sixteenfold range gives an exponent of 0.5090 - the radius scales as , because the stationary variance is and distance is its square root.
Sixteen times the patience for four times the accuracy is a bad enough bargain that the constant step is not tuned down but abandoned. Replacing it with - same initial rate, same data, same seed - brings the run to 0.009909, eleven times closer over the same horizon and still improving when stopped.
What makes a schedule work is a pair of conditions that pull against each other: , so the run keeps enough total travel to arrive from anywhere, and , so the injected noise is summable and the ball can close. A constant step meets the first and fails the second. A step decaying like fails the first and can run out of travel before arriving.
None of that has to be simulated. On a quadratic the second moment of the error obeys an exact recursion, so the figure below runs the whole experiment as arithmetic: no seed, no 120,000 steps, and the floor available in closed form as eta sigma^2 / (lambda (2 - eta lambda)). Its noise scale is calibrated on the 0.2 row above and the other four are then predictions, landing within 2.5%. The closed form also explains the exponent: it is above a half because the contraction per step is 2 - eta lambda rather than 2.
Interactive: the floor a constant step cannot leave
The second moment exactly, by recursion. No sampling and no seed.
- Radius of the cloud
- 0.109343
- Gained by halving the step
- 30%
- Fitted exponent
- 0.5025
At a step of 0.2000 the iterate settles into a cloud of radius 0.109343 and stays there. It is not heading anywhere: each step contracts the error and each step injects fresh noise from whichever examples were drawn, and at this radius the two balance exactly. Halving the step buys 30%, not fifty, because the balance leaves a second moment of order eta and the distance is its square root. The fit across the whole range is 0.5025 - above a half, and the reason is visible in the closed form: the contraction per step is 2 - eta lambda rather than 2.
F. The comparison that reverses
Which leaves the practical question: which optimizer? Same problem, same batches, same seed, each at a sensible fixed step - SGD at , momentum at with , Adam at - with :
| steps | SGD | momentum | Adam |
|---|---|---|---|
| 200 | 0.770159 | 0.351537 | 0.387005 |
| 1000 | 0.236251 | 0.236032 | 0.234713 |
| 5000 | 0.235990 | 0.249702 | 0.261468 |
| 20000 | 0.237333 | 0.240899 | 0.247613 |
At 200 steps the ranking is the expected one, and the gap is large. By 5000 steps it has reversed: plain SGD is closest to the optimum and the two faster methods have settled further out. One step of one run is noisy - with other batch seeds SGD leads at step 5000 only about half the time - but averaged over steps 3000 to 8000 the order SGD, momentum, Adam held in every one of 40 other seeds.
Nothing failed. Momentum and Adam each move further per step, which is the same thing as a larger effective - and by the result, a larger effective step means a wider ball. The early leader finishes last precisely because of what made it fast.
Adam still earns its place on the coordinate it was designed for. Dividing by a running estimate of each coordinate's gradient scale is conditioning applied one coordinate at a time, and on the flat direction of this problem Adam is 0.018492 from the optimum after 1000 steps where SGD is still 0.178858 away.
The short version
Three results, one recipe. The step size has an exact ceiling set by the sharpest curvature, and a different, lower optimum set by the ratio of the extreme curvatures. Momentum and adaptive methods buy the early progress by attacking that ratio. A decaying schedule buys the final digits by closing the noise ball. Neither substitutes for the other, which is why every serious training recipe specifies both.
And when a run is stuck at a loss that will not move, the first question is not which optimizer to switch to. It is whether the run is at a minimum at all, or merely at the edge of a noise ball whose radius you can compute.
References & further reading
- Ian Goodfellow, Yoshua Bengio, Aaron Courville, Deep Learning, MIT Press (Adaptive Computation and Machine Learning), 2016source ↗
- Stephen Boyd, Lieven Vandenberghe, Convex Optimization, Cambridge University Press, 2004source ↗
Copyrighted works are cited for reference only and are not hosted here; please consult the publisher for access.