Skip to content
Field Atlas

Atlas / Mathematics / The Computation Thread

Field · Emerged 1847 – 1970

Continuous Optimisation

How do you find the lowest point of a function of thousands or billions of variables?

4 chapters5 min read6 turning points1 open problem

Branched from
Numerical Analysis + Real Analysis
Branched into
Not yet surveyed past here
Figures
Joseph-Louis Lagrange, Augustin-Louis Cauchy, William Karush, Harold Kuhn, Albert Tucker, Herbert Robbins, Sutton Monro, William Davidon, Roger Fletcher, Michael Powell, Yurii Nesterov, Arkadi Nemirovski

In brief

Optimisation looks for the best choice among infinitely many: the shape of a wing with the least drag, the portfolio with the least risk for a given return, the settings of a neural network that make the fewest mistakes. When the choices vary continuously, calculus gives the starting point. At a minimum the slope is zero, and constraints add terms called Lagrange multipliers. Continuous optimisation turns these conditions into algorithms that find the minimum, step by step, when the variables number in the millions.

Cauchy proposed the simplest algorithm, gradient descent, in 1847: repeatedly step downhill. The twentieth century added the conditions for optimisation under inequality constraints, first written down by William Karush in a forgotten thesis of 1939. It added quasi-Newton methods, which learn the curvature of the function as they go, and, from 1984, interior-point methods that solve convex problems in polynomial time. Stochastic gradient descent, going back to Robbins and Monro in 1951, now trains the neural networks of modern artificial intelligence, and why it works as well as it does is not fully understood.

Key ideas

Lagrange multipliersEnters 1788

To minimise a function subject to an equation constraint, look for points where the function's gradient is a multiple of the constraint's gradient. The multiple measures how much the optimum would improve if the constraint were relaxed slightly.

Gradient descentEnters 1847

The gradient points in the direction of steepest increase. Step a little in the opposite direction, recompute, and repeat. Progress is fast when the function is shaped like a round bowl and slow when it is a long, narrow valley.

KKT conditionsEnters 1939 – 1951

The conditions a minimum must satisfy when there are inequality constraints. Each constraint either holds with room to spare, in which case it can be ignored, or holds exactly and acts like a Lagrange constraint.

ConvexityEnters 1984 – 1994

A function is convex if the straight line between any two points on its graph lies above the graph. For convex problems every local minimum is a global minimum, and efficient algorithms with guarantees exist.

Stochastic gradientEnters 1951

When the function is an average over millions of data points, estimate its gradient from a small random sample at each step. The steps are noisy but cheap, and with shrinking step sizes they still converge.

Draws on other domains

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

f(x,y)=12(x2+10y2),f(x, y) = \tfrac12\left(x^2 + 10y^2\right),

a bowl ten times steeper in one direction than the other. Its minimum is at (0,0)(0, 0) and its gradient is (x,10y)(x, 10y). Gradient descent with step size hh updates

x←(1−h) x,y←(1−10h) y.x \leftarrow (1 - h)\,x, \qquad y \leftarrow (1 - 10h)\,y.

The two directions shrink at different rates. The best fixed step balances them, h=2/11h = 2/11, and then both shrink by a factor of 9/11≈0.8189/11 \approx 0.818 at every step. Start at (10,1)(10, 1), where f=55f = 55:

Stepxxyyf(x,y)f(x, y)
010155
18.18−0.81836.8
26.690.66924.7
53.67−0.3677.39
101.340.1340.994
200.1810.01810.0180

The steps zigzag across the valley, the sign of yy flipping each time, while creeping along it. A slightly larger step, h=0.21h = 0.21, makes 1−10h=−1.11 - 10h = -1.1, and the yy coordinate grows by 10% per step: after 20 steps ff has risen from 55 to 226. Any step above 2/10=0.22/10 = 0.2 diverges.

The ratio of the steepest to the shallowest curvature, here 10, is the condition number κ\kappa. With the best step, the error shrinks by (κ−1)/(κ+1)(\kappa - 1)/(\kappa + 1) per step. To cut it by a factor of a million:

Condition number κ\kappaGradient descent stepsBest momentum method
106922
10069169
1,0006,908219

The cost grows in proportion to κ\kappa. 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 κ\sqrt{\kappa} 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.

Applications

Where it is used

  • Structural biology↗ Biology · Protein Structure Prediction

    Predicting protein structures

    AlphaFold predicts the three-dimensional shape of a protein from its sequence. It is a neural network with millions of parameters, fitted to the known structures of the Protein Data Bank by stochastic gradient methods. In 2020 its predictions reached accuracy close to experiment for many proteins.

    › Sources (1)
    • Jumper, J. et al. (2021). Highly accurate protein structure prediction with AlphaFold. Nature 596: 583–589.
  • Finance

    Portfolio selection

    Harry Markowitz's portfolio theory chooses investments that minimise risk, measured by variance, for a required expected return. It is a quadratic optimisation problem with constraints, solved every day by fund managers.

    › Sources (1)
    • Markowitz, H. (1952). Portfolio selection. Journal of Finance 7(1): 77–91.
  • Medical imaging

    Compressed sensing

    A convex optimisation, minimising the sum of absolute values, can recover an image exactly from far fewer measurements than was thought necessary, when the image is simple in a suitable sense. It has shortened MRI scans, which matters most for children and the seriously ill.

    › Sources (1)
    • Candès, E. J., Romberg, J. & Tao, T. (2006). Robust uncertainty principles: exact signal reconstruction from highly incomplete frequency information. IEEE Transactions on Information Theory 52(2): 489–509.

Open problems

Where the map runs out

Open

Why gradient descent trains deep networks

Open as of 2026; understood for some simplified models, not for networks used in practice.

Training a neural network means minimising a function of millions or billions of variables that is far from convex, with countless local minima and saddle points. Classical theory gives no reason to expect that stochastic gradient descent will find a good minimum, or that the network found will work well on new data. In practice it usually does both.

Why it is hard

The functions involved are too complicated for the tools of convex analysis, and their structure depends on the data. In 2016 experiments showed that networks can fit even randomly labelled data perfectly, so the usual explanations of why they generalise cannot be the whole story. Results exist for very wide networks and other simplified cases, but they do not explain the networks actually used.

What resolving it unlocks

A theory would say when training will succeed, how to choose step sizes and network shapes without costly trial and error, and when a trained system can be trusted.

› Sources (1)
  • Zhang, C., Bengio, S., Hardt, M., Recht, B. & Vinyals, O. (2017). Understanding deep learning requires rethinking generalization. International Conference on Learning Representations (ICLR).

Further reading

  1. Nocedal, J. & Wright, S. J. (2006). Numerical Optimization, 2nd edition. Springer.

    The standard textbook on algorithms for continuous optimisation.

  2. Boyd, S. & Vandenberghe, L. (2004). Convex Optimization. Cambridge University Press.

    A widely used introduction to convex problems and interior-point methods.

  3. Bottou, L., Curtis, F. E. & Nocedal, J. (2018). Optimization methods for large-scale machine learning. SIAM Review 60(2): 223–311.

    A survey of stochastic gradient methods and the theory behind them.