Why Does Deep Learning Optimization Work?
A careful ledger of what is proved about training deep networks, what each theorem excludes, and which questions are genuinely open.
The starting point: it should not work
Deciding whether a given dataset can be fit exactly by a network with two hidden threshold units and one output unit is NP-complete.
Quoted from Blum and Rivest. Related results establish hardness for ReLU networks and for approximate fitting. So there is no algorithm that trains all networks efficiently, and any explanation of why training works in practice must be an explanation about the instances that arise in practice, not about the problem class.
For any -smooth loss bounded below, steps of gradient descent with give , and steps of SGD with tuned constant step give .
These are the theorems on the gradient descent and SGD pages, and they are the strongest assumption-free guarantees available.
What this does not say
They deliver an approximate stationary point. They do not say that point is a local minimum, that it has low loss, or that it generalises. A neural network loss has exponentially many stationary points, most of them useless. So the assumption-free theory is compatible with training producing nothing of value — and the fact that it does not is precisely what needs explaining.
Note also that neural network losses are typically not -smooth globally (ReLU has unbounded curvature at the kink locus in a suitable sense; the loss surface has regions of very large curvature), so even these theorems apply only under a hypothesis that is not verified in practice.
What overparameterisation buys: the NTK regime
For a network , the tangent features are and the neural tangent kernel is
Consider a two-layer ReLU network of width with standard initialisation, trained by gradient descent on the squared loss over data points with and no two inputs parallel. Let be the smallest eigenvalue of the infinite-width kernel matrix. If
then with probability at least over the initialisation,
so the training loss converges to zero at a linear rate.
Quoted from Du et al.; Jacot, Gabriel and Hongler introduced the kernel and its infinite-width limit.
Let be the vector of network outputs on the training set and . Gradient flow on gives
so
If for all along the trajectory, then .
Key idea
The condition is exactly a Polyak–Łojasiewicz inequality. So the entire NTK convergence result is: width makes the tangent kernel stay near its initialisation, which makes stay bounded away from zero, which gives a PL inequality, which gives a linear rate. The non-convexity is not overcome — it is bypassed, by showing the trajectory stays in a region where the problem behaves like a strongly convex one.
The technical heart is the second step: bounding over the trajectory. That is what forces the enormous width requirement, since one needs the parameters to move so little that the Jacobian barely changes.
Open problem — no proof and no counterexample is known to the author of this page.
What this does not say
Four separate problems with reading the NTK theorem as an explanation of deep learning:
- The width requirement is astronomical. with is beyond any conceivable model. Sharper analyses have reduced the exponent, but not to the regime of real networks.
- In the NTK regime the network does not learn features. By construction the parameters barely move, so the tangent features are those at initialisation: the model is a linear model in random features, and the "deep" part is inert. Chizat, Oyallon and Bach call this lazy training and show it is a consequence of the scaling, not of depth.
- NTK-regime networks generalise worse than real ones. Empirically, the NTK-limit kernel machine underperforms the trained finite network on standard benchmarks, often substantially. So whatever the finite network is doing, it is not what the NTK describes.
- The kernel demonstrably drifts. Measurements of during real training show large changes, especially early. The hypothesis of the theorem is observably false in practice.
The mean-field / P line of work studies alternative scalings under which features do move in the infinite-width limit, and is the more promising direction. It has produced genuine results for two-layer networks and useful hyperparameter-transfer prescriptions; a comparable theory for deep networks is open.
Implicit bias
Overparameterised networks have infinitely many zero-loss parameter settings, most of which generalise badly. So the question is not "does training reach zero loss" but "which zero-loss solution does it reach".
- Linear regression, underdetermined. Gradient descent from on converges to the minimum -norm interpolator.
- Linear classification, separable data. Gradient descent on the logistic loss has converging to the maximum-margin () direction, at rate .
- Diagonal linear networks. Parameterising and running gradient descent from small initialisation converges towards the minimum -norm interpolator, so the parameterisation changes the induced norm.
- Deep matrix factorisation. Gradient flow on from small initialisation biases towards low nuclear norm, with depth sharpening the effect.
Key idea
The first proof is one paragraph and it identifies the mechanism precisely: the algorithm cannot leave the row space, so the component of the solution in the kernel is whatever the initialisation put there — namely zero. The implicit bias is a consequence of the update's algebraic form, not of anything subtle. That is encouraging, and it is also why the deep case is hard: for a nonlinear network the increments do not live in a fixed subspace.
Open problem — no proof and no counterexample is known to the author of this page.
There is no characterisation of the solution selected by SGD on a realistic deep network. Partial results exist for specific architectures, losses, initialisation scales and (usually) gradient flow rather than discrete stochastic steps, and they do not compose into a general statement.
What this does not say
This is arguably the central technical gap. If the implicit bias were characterised, the generalisation question would reduce to asking whether the induced complexity measure is small for the data — a question of the kind learning theory knows how to answer. Without it, we do not even know what function class the algorithm is effectively searching.
Note also that the discrete/continuous distinction is not cosmetic: gradient descent with a finite step has a different implicit bias from gradient flow (there are extra terms of order that penalise gradient norm), and the SGD noise adds further terms. Results proved for flow do not transfer automatically.
Saddle points and the loss landscape
Let be -smooth with -Lipschitz Hessian. Perturbed gradient descent — gradient descent with small isotropic noise added when the gradient is small — finds an -second-order stationary point, i.e. a point with
in iterations, with only polylogarithmic dependence on the dimension.
Quoted from Jin et al. The intuition is that a strict saddle has a descent direction, and isotropic noise has a component along it with high probability, so the iterate is pushed off the saddle's stable manifold. This is a genuine and satisfying result.
What this does not say
It gives an approximate second-order stationary point, which rules out strict saddles but not: degenerate saddles with , poor local minima, or plateaus. And deep network losses are known to have degenerate critical points in abundance — every permutation of hidden units gives a symmetry, and every dead ReLU gives a flat direction. The theorem is progress on one obstruction, not on all of them.
Flatness, sharpness and the edge of stability
Empirical observation — a regularity seen in experiments. No theorem on this page establishes it in general.
Across many experiments, solutions with smaller Hessian eigenvalues at the minimum generalise better, and algorithms that explicitly seek flat minima (SAM and relatives) improve test accuracy.
What this does not say
The correlation is real and reproducible. The causal claim is not established, and there is a sharp objection. Dinh et al. showed that for a ReLU network the map leaves the function — hence the test error — exactly unchanged while changing the Hessian spectrum by factors of . So "sharpness" is not a property of the learned function; it is a property of the parameterisation, and can be made arbitrarily large or small without touching generalisation.
Responses have been to define reparameterisation-invariant sharpness measures (adaptive sharpness, information-theoretic or PAC-Bayes flatness), and some of these correlate with generalisation more robustly. But no theorem currently shows that flatness in any such sense implies generalisation for realistic networks. Treat "flat minima generalise" as a well-supported empirical heuristic with a known counterexample to its naive form.
Empirical observation — a regularity seen in experiments. No theorem on this page establishes it in general.
Cohen et al. document that full-batch gradient descent on neural networks typically has the sharpness rise during training until it reaches approximately , and then hover just above it, with the loss decreasing non-monotonically.
What this does not say
The observation is striking because is exactly the classical stability threshold of the quadratic analysis: gradient descent on a quadratic with curvature above diverges. So training operates at the boundary of where the standard theory applies, and beyond the regime where descent-lemma arguments are valid.
This has a direct consequence: convergence proofs assuming with the true smoothness constant do not describe what happens, because the effective adapts to rather than the reverse. Theory for the edge-of-stability regime exists for specific simplified models and is an active area; there is no general account.
Generalisation, memorisation and grokking
The foundational empirical result here is Zhang et al.: standard architectures can fit random labels on standard datasets to zero training error. So the hypothesis class is rich enough to memorise, and any explanation of generalisation must be about the algorithm and the data, not the architecture's capacity. This is also why uniform convergence bounds over the architecture's function class are vacuous here.
Empirical observation — a regularity seen in experiments. No theorem on this page establishes it in general.
On small algorithmic tasks (modular arithmetic, group operations), networks reach training accuracy quickly while remaining at chance on held-out data, and then — after many thousands of further steps with no visible change in training loss — jump to test accuracy.
What this does not say
Several mechanisms have been proposed: a slow transition from a memorising to a generalising circuit driven by weight decay; a competition between a fast-to-find memorisation solution and a slower-to-find but lower-norm generalising one; a delayed alignment of representations. Each has supporting evidence on specific tasks, and mechanistic-interpretability work has reverse-engineered the learned circuit in the modular-addition case in convincing detail.
What is not established is a general theory: which tasks grok, how long the delay is, or whether the phenomenon occurs in large-scale training at all (the evidence is largely from small models on algorithmic data). It is an unusually clean experimental handle on the memorisation-to-generalisation transition, and that is its main value.
Empirical observation — a regularity seen in experiments. No theorem on this page establishes it in general.
Test loss follows
in parameters and tokens , with fitted exponents, over several orders of magnitude. Hoffmann et al. (Chinchilla) fit this form and conclude that compute-optimal training scales and roughly in proportion, revising the earlier Kaplan et al. prescription.
What this does not say
This is among the most useful empirical regularities in the field — it is what makes large training runs planable — and it is not derived. There are suggestive arguments connecting power-law loss curves to power-law data spectra, to intrinsic dimension of the data manifold, and to nonparametric-rate calculations of the kind on the nearest neighbours page. None of them predicts the observed exponents from properties of the data, and none explains the functional form's remarkable stability across modalities and architectures.
Two further cautions. The fitted form is an extrapolation and has been revised when refit with better methodology — the Kaplan-to-Chinchilla correction moved the recommended data-to-parameter ratio by more than an order of magnitude, from a fit to the same functional family. And the laws describe loss, not capability; the relationship between loss and downstream behaviour is itself not a smooth function and is much less well characterised.
The ledger
| Question | Status |
|---|---|
| Does gradient descent reach a stationary point? | Proved, with rates, under smoothness |
| Does it reach zero training loss for wide enough nets? | Proved in the NTK regime; width requirement unrealistic |
| Is the NTK regime what happens in practice? | No — kernel drifts, features are learned |
| Which interpolating solution does GD select? | Proved for linear models and a few simple architectures; open in general |
| Can first-order methods escape saddles? | Proved for strict saddles with noise |
| Do flat minima generalise better? | Correlated; naive sharpness is reparameterisation-dependent; causal claim open |
| Why does training operate at the edge of stability? | Open; documented empirically |
| Why do overparameterised nets generalise? | Open — the central question |
| Why do scaling laws hold, with those exponents? | Open; empirically very robust |
| Is there a non-vacuous generalisation bound for a state-of-the-art model? | No |
Open problem — no proof and no counterexample is known to the author of this page.
Given an architecture, a dataset and a training procedure, there is no theory that predicts in advance that training will find a solution which generalises — nor a non-vacuous bound on its test error. Every quantitative guarantee available today is either vacuous at realistic scale or holds under hypotheses that practical training violates.
Problems
NTK convergence is a PL inequalityProof · Graduate · 1 hour Implicit bias of gradient descent on underdetermined least squaresProof · Intermediate · 30 min Sharpness is not a property of the functionProof · Advanced · 30 min What fitting random labels rules outProof · Intermediate · 30 min Fit a scaling law and derive the compute-optimal allocationCoding · Advanced · 3 hoursReferences
- PaperAvrim L. Blum and Ronald L. Rivest (1992). Training a 3-node neural network is NP-complete
- PaperArthur Jacot, Franck Gabriel and Clément Hongler (2018). Neural Tangent Kernel: Convergence and Generalization in Neural Networks
- PaperSimon S. Du, Xiyu Zhai, Barnabás Póczos and Aarti Singh (2019). Gradient Descent Provably Optimizes Over-parameterized Neural Networks
- PaperLénaïc Chizat, Edouard Oyallon and Francis Bach (2019). On Lazy Training in Differentiable Programming
- PaperDaniel Soudry, Elad Hoffer, Mor Shpigel Nacson, Suriya Gunasekar and Nathan Srebro (2018). The Implicit Bias of Gradient Descent on Separable Data
- PaperChi Jin, Rong Ge, Praneeth Netrapalli, Sham M. Kakade and Michael I. Jordan (2017). How to Escape Saddle Points Efficiently
- PaperChiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht and Oriol Vinyals (2017). Understanding deep learning requires rethinking generalization
- PaperLaurent Dinh, Razvan Pascanu, Samy Bengio and Yoshua Bengio (2017). Sharp Minima Can Generalize For Deep Nets
- PaperJeremy M. Cohen, Simran Kaur, Yuanzhi Li, J. Zico Kolter and Ameet Talwalkar (2021). Gradient Descent on Neural Networks Typically Occurs at the Edge of Stability
- PaperAlethea Power, Yuri Burda, Harri Edwards, Igor Babuschkin and Vedant Misra (2022). Grokking: Generalization Beyond Overfitting on Small Algorithmic Datasets
- PaperJared Kaplan and collaborators (2020). Scaling Laws for Neural Language Models
- PaperJordan Hoffmann and collaborators (2022). Training Compute-Optimal Large Language Models
These works are cited as sources to read, not reproduced. All exposition, examples and problems on this site are written independently; where an argument is standard, the citation points to a canonical treatment.
Results stated on this page
- TheoremTraining a neural network is NP-hard in generalEven fitting a three-node network to data exactly is NP-complete, so no efficient algorithm can work for all instances.
- TheoremWhat gradient methods provably give on any smooth lossConvergence to an approximate stationary point at a known rate, and nothing more.
- TheoremConvergence for sufficiently wide networks (NTK regime)With width polynomial in the sample size and small enough step size, gradient descent on the squared loss converges to zero training error at a linear rate.
- PropositionWhy the NTK argument works — a PL inequality in disguiseproof includedWide networks have a near-constant tangent kernel, which makes the loss satisfy a Polyak-Lojasiewicz inequality along the trajectory.
- Open problemThe NTK regime does not describe practical trainingFeature learning, the widths used in practice and the observed kernel drift all contradict the regime's hypotheses.
- TheoremImplicit bias — the cases that are provedFor linear models and some simple networks the solution selected by gradient descent is characterised exactly.
- Open problemImplicit bias of SGD on deep networksNo characterisation of the solution selected by SGD on a realistic deep network is known.
- TheoremPerturbed gradient descent escapes strict saddlesWith noise, first-order methods reach approximate second-order stationary points in polynomial time.
- Empirical observationFlat minima and generalisationSharpness correlates with generalisation across many experiments, but the measure is reparameterisation-dependent and the causal claim is unproved.
- Empirical observationEdge of stabilityTraining typically settles at a sharpness just above the classical stability threshold two over the learning rate.
- Empirical observationGrokkingTest accuracy can jump from chance to perfect long after training accuracy saturates; several mechanisms are proposed and none is established in general.
- Empirical observationScaling lawsLoss follows a power law in parameters, data and compute over many orders of magnitude, an extremely robust empirical regularity without a derivation from first principles.
- Open problemThe central open problemThere is no theory that predicts, for a given architecture and dataset, that training will find a solution that generalises.
Problems (7)
All problems- Implicit bias of gradient descent on underdetermined least squaresProofIntermediate⏱ 30 min
- NTK convergence is a PL inequalityProofGraduate⏱ 1 hour
- What fitting random labels rules outProofIntermediate⏱ 30 min
- Fit a scaling law and derive the compute-optimal allocationCodingAdvanced⏱ 3 hours
- Sharpness is not a property of the functionProofAdvanced⏱ 30 min
- Open: the edge of stabilityProofResearch⏱ Research
- Open: does SGD find global minima of deep networks?ProofResearch⏱ Research
Papers that use this mathematics
Neural Tangent Kernel: Convergence and Generalization in Neural Networks
Arthur Jacot, Franck Gabriel, Clément Hongler · 2018
Deep Double Descent: Where Bigger Models and More Data Hurt
Preetum Nakkiran, Gal Kaplun, Yamini Bansal, Tristan Yang, Boaz Barak, Ilya Sutskever · 2020
The Lottery Ticket Hypothesis: Finding Sparse, Trainable Neural Networks
Jonathan Frankle, Michael Carbin · 2019
Grokking: Generalization Beyond Overfitting on Small Algorithmic Datasets
Alethea Power, Yuri Burda, Harri Edwards, Igor Babuschkin, Vedant Misra · 2022
Scaling Laws for Neural Language Models
Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B. Brown, Benjamin Chess, Rewon Child, Scott Gray, Alec Radford, Jeffrey Wu, Dario Amodei · 2020
Training Compute-Optimal Large Language Models
Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, Elena Buchatskaya, Trevor Cai, Eliza Rutherford, Diego de Las Casas, Lisa Anne Hendricks, Johannes Welbl, Aidan Clark and others · 2022