Chapter I
Downhill
Real analysis says that at a smooth minimum the slope is zero. For constraints, Joseph-Louis Lagrange added a trick in 1788: attach each constraint to the function with an unknown multiplier, and look for points where everything balances. These conditions describe the answer but do not say how to find it. For that, one needs an algorithm.
The first came from astronomy. In 1847 Augustin-Louis Cauchy, facing large systems of equations for planetary orbits, proposed to minimise the sum of their squared errors by stepping repeatedly in the direction in which that sum decreases fastest, the direction opposite the gradient. This is gradient descent. It is simple, it needs only first derivatives, and it is slow on functions whose valleys are long and narrow. Newton's method, applied to the gradient, is much faster near a minimum but needs second derivatives, which for many variables form a large matrix that is costly to compute and to solve with.
Chapter II
Constraints
Real problems have limits: a budget that cannot be exceeded, a beam that cannot be thinner than a millimetre. In 1939 William Karush, a master's student at Chicago, worked out the conditions for a minimum with inequality constraints. His thesis was never published. The same conditions appeared in 1951 in a paper by Harold Kuhn and Albert Tucker, which launched nonlinear programming as a field, alongside the linear programming of combinatorial optimisation. Karush's work was rediscovered in the 1970s, and the conditions now carry all three names.
In 1959 William Davidon, a physicist at Argonne National Laboratory whose computer kept crashing before his long optimisations finished, found a way to learn the second-derivative matrix gradually from the gradients themselves. His report was rejected for publication. It was printed, as a historical document, only in 1991. Roger Fletcher and Michael Powell refined the method in 1963, and in 1970 four people independently found the BFGS formula. Quasi-Newton methods became the standard for smooth problems of moderate size.
Chapter III
A Closer Look: A Narrow Valley
Take the function
a bowl ten times steeper in one direction than the other. Its minimum is at and its gradient is . Gradient descent with step size updates
The two directions shrink at different rates. The best fixed step balances them, , and then both shrink by a factor of at every step. Start at , where :
| Step | |||
|---|---|---|---|
| 0 | 10 | 1 | 55 |
| 1 | 8.18 | −0.818 | 36.8 |
| 2 | 6.69 | 0.669 | 24.7 |
| 5 | 3.67 | −0.367 | 7.39 |
| 10 | 1.34 | 0.134 | 0.994 |
| 20 | 0.181 | 0.0181 | 0.0180 |
The steps zigzag across the valley, the sign of flipping each time, while creeping along it. A slightly larger step, , makes , and the coordinate grows by 10% per step: after 20 steps has risen from 55 to 226. Any step above diverges.
The ratio of the steepest to the shallowest curvature, here 10, is the condition number . With the best step, the error shrinks by per step. To cut it by a factor of a million:
| Condition number | Gradient descent steps | Best momentum method |
|---|---|---|
| 10 | 69 | 22 |
| 100 | 691 | 69 |
| 1,000 | 6,908 | 219 |
The cost grows in proportion to . Methods with momentum, which let each step carry on partly in the direction of the last, such as conjugate gradients and Nesterov's accelerated method, need a number of steps proportional to about instead. For badly conditioned problems, that difference decides whether an optimisation finishes at all.
Chapter IV
Convexity and Scale
For a convex function, one whose graph curves upwards everywhere, every local minimum is the global minimum, and there is hope of guarantees. In 1984 Narendra Karmarkar gave a fast method for linear programming that moves through the interior of the feasible region. Yurii Nesterov and Arkadi Nemirovski showed in 1994 that interior-point methods solve a very wide class of convex problems in polynomial time. Convex optimisation became a reliable technology, used in engineering design, signal processing, finance and control.
The largest problems went the other way. Herbert Robbins and Sutton Monro had shown in 1951 that steps based on noisy estimates still converge if the step sizes shrink correctly. Estimating a gradient from a small random batch of data, rather than all of it, is exactly such a step, and stochastic gradient descent, often with momentum, now trains neural networks with billions of parameters. Their training functions are not convex, and theory gives little reason to expect success. Yet training usually works, and explaining why is one of the central open questions where Monte Carlo methods, linear algebra and optimisation meet.