Skip to content
nonconvexcard

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.

DL TheoryResearch⏱ 1 day17 min readntklazy trainingimplicit biasoverparameterisationloss landscape
7 problems →

The starting point: it should not work

TheoremTraining a neural network is NP-hard in general

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.

TheoremWhat gradient methods provably give on any smooth loss

For any LL-smooth loss bounded below, TT steps of gradient descent with η=1/L\eta = 1/L give min⁡t<T∥∇f(xt)∥2≤2LΔ0/T\min_{t<T}\norm{\nabla f(x_t)}_2 \le \sqrt{2L\Delta_0/T}, and TT steps of SGD with tuned constant step give 1T∑tE∥∇f(xt)∥22≲Lσ2Δ0/T\frac1T\sum_t\E\norm{\nabla f(x_t)}_2^2 \lesssim \sqrt{L\sigma^2\Delta_0/T}.

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 LL-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

DefinitionNeural tangent kernel

For a network f(x;θ)f(x;\theta), the tangent features are ∇θf(x;θ)\nabla_\theta f(x;\theta) and the neural tangent kernel is

Θ(x,x′)=⟨∇θf(x;θ),∇θf(x′;θ)⟩.\Theta(x,x') = \ip{\nabla_\theta f(x;\theta)}{\nabla_\theta f(x';\theta)} .
TheoremConvergence for sufficiently wide networks

Consider a two-layer ReLU network of width mm with standard initialisation, trained by gradient descent on the squared loss over nn data points with ∥xi∥2=1\norm{x_i}_2=1 and no two inputs parallel. Let λ0=λmin⁡(Θ∞)>0\lambda_0 = \lambda_{\min}(\Theta^\infty)>0 be the smallest eigenvalue of the infinite-width kernel matrix. If

m=Ω ⁣(n6λ04δ3)andη=O ⁣(λ0n2),m = \Omega\!\left(\frac{n^6}{\lambda_0^4\delta^3}\right) \quad\text{and}\quad \eta = O\!\left(\frac{\lambda_0}{n^2}\right),

then with probability at least 1−δ1-\delta over the initialisation,

L(θt)≤(1−ηλ02)tL(θ0),\mathcal{L}(\theta_t) \le \left(1-\frac{\eta\lambda_0}{2}\right)^t\mathcal{L}(\theta_0),

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.

PropositionWhy the NTK argument works — a PL inequality in disguise

Let ut∈Rnu_t \in\R^n be the vector of network outputs on the training set and Jt=∂ut/∂θJ_t = \partial u_t/\partial\theta. Gradient flow on L=12∥u−y∥22\mathcal{L} = \tfrac12\norm{u - y}_2^2 gives

u˙t=−JtJt⊤(ut−y)=−Θt (ut−y),\dot u_t = -J_tJ_t^\top(u_t-y) = -\Theta_t\,(u_t-y),

so

ddtL(θt)=−(ut−y)⊤Θt(ut−y)≤−λmin⁡(Θt) ∥ut−y∥22=−2λmin⁡(Θt) L(θt).\frac{d}{dt}\mathcal{L}(\theta_t) = -(u_t-y)^\top\Theta_t(u_t-y) \le -\lambda_{\min}(\Theta_t)\,\norm{u_t-y}_2^2 = -2\lambda_{\min}(\Theta_t)\,\mathcal{L}(\theta_t) .

If λmin⁡(Θt)≥λ0/2\lambda_{\min}(\Theta_t)\ge\lambda_0/2 for all tt along the trajectory, then L(θt)≤e−λ0tL(θ0)\mathcal{L}(\theta_t)\le e^{-\lambda_0t}\mathcal{L}(\theta_0).

Key idea

The condition L˙≤−2λmin⁡L\dot{\mathcal{L}}\le-2\lambda_{\min}\mathcal{L} is exactly a Polyak–Łojasiewicz inequality. So the entire NTK convergence result is: width makes the tangent kernel stay near its initialisation, which makes λmin⁡(Θt)\lambda_{\min}(\Theta_t) 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 ∥Θt−Θ0∥\norm{\Theta_t-\Theta_0} 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 problemThe NTK regime does not describe practical training

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:

  1. The width requirement is astronomical. m=Ω(n6/λ04)m = \Omega(n^6/\lambda_0^4) with n=106n = 10^6 is beyond any conceivable model. Sharper analyses have reduced the exponent, but not to the regime of real networks.
  2. 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.
  3. 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.
  4. The kernel demonstrably drifts. Measurements of Θt\Theta_t during real training show large changes, especially early. The hypothesis of the theorem is observably false in practice.

The mean-field / μ\muP 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".

TheoremImplicit bias — the cases that are proved
  • Linear regression, underdetermined. Gradient descent from β0=0\beta_0=0 on 12∥y−Xβ∥22\tfrac12\norm{y-X\beta}_2^2 converges to the minimum ℓ2\ell^2-norm interpolator.
  • Linear classification, separable data. Gradient descent on the logistic loss has θt/∥θt∥2\theta_t/\norm{\theta_t}_2 converging to the maximum-margin (ℓ2\ell^2) direction, at rate O(1/log⁡t)O(1/\log t).
  • Diagonal linear networks. Parameterising β=u⊙v\beta = u\odot v and running gradient descent from small initialisation converges towards the minimum ℓ1\ell^1-norm interpolator, so the parameterisation changes the induced norm.
  • Deep matrix factorisation. Gradient flow on ∥Y−WL⋯W1∥F2\norm{Y - W_L\cdots W_1}_F^2 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 problemImplicit bias of SGD on deep networks

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 η\eta 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

TheoremPerturbed gradient descent escapes strict saddles

Let ff be LL-smooth with ρ\rho-Lipschitz Hessian. Perturbed gradient descent — gradient descent with small isotropic noise added when the gradient is small — finds an ε\eps-second-order stationary point, i.e. a point with

∥∇f(x)∥2≤εandλmin⁡(∇2f(x))≥−ρε,\norm{\nabla f(x)}_2\le\eps \quad\text{and}\quad \lambda_{\min}\big(\nabla^2f(x)\big)\ge-\sqrt{\rho\eps},

in O~(1/ε2)\tilde O(1/\eps^2) 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 λmin⁡=0\lambda_{\min}=0, 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 observationFlat minima and generalisation

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 (W1,W2)↦(αW1,α−1W2)(W_1,W_2)\mapsto(\alpha W_1,\alpha^{-1}W_2) leaves the function — hence the test error — exactly unchanged while changing the Hessian spectrum by factors of α±2\alpha^{\pm2}. 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 observationEdge of stability

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 λmax⁡(∇2L)\lambda_{\max}(\nabla^2\mathcal{L}) rise during training until it reaches approximately 2/η2/\eta, and then hover just above it, with the loss decreasing non-monotonically.

What this does not say

The observation is striking because 2/η2/\eta is exactly the classical stability threshold of the quadratic analysis: gradient descent on a quadratic with curvature above 2/η2/\eta 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 η≤1/L\eta \le 1/L with LL the true smoothness constant do not describe what happens, because the effective LL adapts to η\eta 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 observationGrokking

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 100%100\% 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 100%100\% 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 observationScaling laws

Empirical observation — a regularity seen in experiments. No theorem on this page establishes it in general.

Test loss follows

L(N,D)≈L∞+ANα+BDβ\mathcal{L}(N,D) \approx \mathcal{L}_\infty + \frac{A}{N^\alpha} + \frac{B}{D^\beta}

in parameters NN and tokens DD, with fitted exponents, over several orders of magnitude. Hoffmann et al. (Chinchilla) fit this form and conclude that compute-optimal training scales NN and DD 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

QuestionStatus
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 problemThe central open problem

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 hours

References

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

Problems (7)

All problems

Papers that use this mathematics