Search

Search papers and lessons

Double Descent

Level 4 · 11 min read

Double descent is the pattern where test error rises to a peak as a model gets big enough to fit its training data exactly, then falls again as the model keeps growing.

On this page

  • Colour = topic mix
  • Discrete math
  • Probability
  • Learning basics
  • Calculus
  • Linear algebra
  • Losses & regularization
  • ReadReady to readNot yet

TL;DR

Classical learning theory says test error is U-shaped in model size: it falls while the model is too rigid, then rises as the model starts to fit noise. Modern experiments show a second descent. Once the model is big enough to fit the training data exactly, the test error peaks, and then falls again as the model keeps growing. This means the peak is not the end of the story, and that very large models can generalise well when they are trained carefully.

Builds on: Bias-Variance Tradeoff, Overfitting, Linear Regression · Leads to: the 2018 Belkin et al. paper

Where it's used

Choosing how big a network should be. Practitioners who train large neural networks on image and language data often use models with more parameters than training examples. The double-descent picture says the test error at that size can be low, not catastrophic, so the rule "keep the model smaller than the data" is not always right.

Deciding when to stop growing a model. Because the test error has a peak near the point of exact fit, a team that sweeps model sizes must check the whole curve, not just the small and very large ends. A peak at a particular size is a warning to avoid that size, or to add regularisation, rather than a sign that bigger is always worse.

Reading scaling studies. Papers that measure test error against parameter count, such as the Neural Scaling Laws work on language models, assume the error keeps falling over many orders of magnitude. Double descent is one reason those curves can keep going down after a point where the old theory would predict a rise.

How it works

Take two training points, (1,1)(1, 1) and (2,3)(2, 3). We fit models that predict yy from xx and we will test them at x=3x = 3. The data are noisy; suppose the true underlying value at x=3x = 3 is 33.

  1. One parameter: a model that cannot fit both points. Use y^=ax\hat y = a x. Least squares chooses aa to minimise the squared residuals. Here a=1⋅1+2⋅312+22=75=1.4a = \dfrac{1 \cdot 1 + 2 \cdot 3}{1^2 + 2^2} = \dfrac{7}{5} = 1.4. Check: the fitted values are 1.41.4 and 2.82.8, not exact, so the residuals are −0.4-0.4 and +0.2+0.2.
  2. Test the one-parameter model. At x=3x = 3 it predicts 1.4×3=4.21.4 \times 3 = 4.2. Its error against the truth 33 is 1.21.2.
  3. Two parameters: a model that can fit both points exactly. Use y^=b+ax\hat y = b + a x. The two points give two equations, b+a=1b + a = 1 and b+2a=3b + 2a = 3. So a=2a = 2 and b=−1b = -1. Check: −1+2⋅1=1-1 + 2 \cdot 1 = 1 and −1+2⋅2=3-1 + 2 \cdot 2 = 3. The training error is now zero.
  4. Test the interpolating model. At x=3x = 3 it predicts −1+2⋅3=5-1 + 2 \cdot 3 = 5. Its error against the truth is 2.02.0, larger than the one-parameter model's 1.21.2. Check: the exact fit has become worse on the new point.
  5. Where the peak sits. The model that just fits the training points, with as many parameters as data points, is the point where the test error peaks in this kind of experiment. Going further, to three or more parameters, lets many fits reproduce the data. Which one the training method picks then matters a great deal, and that is where the second descent comes from. The math section shows how.
0.511.522.5301234model size relative to the number of training pointstest error
  • schematic test error
A schematic double-descent curve, not measured data. It falls at small sizes, peaks at the point where the model can just fit the training data, then falls again as the model grows.

The math

Setting

Let there be nn training pairs (xi,yi)(x_i, y_i). Stack the inputs into a design matrix XX with nn rows and pp columns, one column per feature, and stack the labels into a vector yy. A linear model has coefficients β∈Rp\beta \in \mathbb{R}^p and predicts XβX \beta for the training set. The fit minimises the sum of squared residuals ∥y−Xβ∥2\lVert y - X\beta \rVert^2.

Step 1 in symbols: the fit when there are fewer parameters than points

When p≤np \le n and the columns of XX are independent, the minimiser is the ordinary least squares solution

β^=(X⊤X)−1X⊤y,\hat\beta = (X^\top X)^{-1} X^\top y,

which uses the Matrix Transpose and the Matrix Inverse. In the walkthrough, X=(1,2)⊤X = (1, 2)^\top with one column, so X⊤X=1+4=5X^\top X = 1 + 4 = 5, and X⊤y=1+6=7X^\top y = 1 + 6 = 7. Then β^=7/5=1.4\hat\beta = 7/5 = 1.4, as step 1 found.

Step 2 in symbols: the test error splits into bias and variance

For a test point x0x_0 with noise-free target f(x0)f(x_0), the expected squared error of the fit splits into a bias term and a variance term, plus the irreducible noise. This is the Bias-Variance Tradeoff:

E[(y0−f^(x0))2]=(E[f^(x0)]−f(x0))2⏟bias2+E[(f^(x0)−E[f^(x0)])2]⏟variance+σ2.\mathbb{E}\big[(y_0 - \hat f(x_0))^2\big] = \underbrace{\big(\mathbb{E}[\hat f(x_0)] - f(x_0)\big)^2}_{\text{bias}^2} + \underbrace{\mathbb{E}\big[(\hat f(x_0) - \mathbb{E}[\hat f(x_0)])^2\big]}_{\text{variance}} + \sigma^2.

The classical picture is a U-shape: bias falls and variance rises as the model grows. Double descent says that the variance term can fall again beyond the point of exact fit.

Step 3 in symbols: the fit when there are more parameters than points

When p>np \gt n, the matrix X⊤XX^\top X is singular, so the formula in step 1 breaks down. There are then infinitely many β\beta that fit the training data exactly, since Xβ=yX \beta = y has many solutions. A standard choice is the one with the smallest norm:

β^min⁡=X⊤(XX⊤)−1y.\hat\beta_{\min} = X^\top (X X^\top)^{-1} y.

This is the minimum-norm interpolating solution. Here (XX⊤)−1(X X^\top)^{-1} is the inverse of an n×nn \times n matrix, and it is well defined whenever the rows of XX are independent. The norm of β^\hat\beta is what governs the variance. Near p=np = n the matrix XX⊤X X^\top becomes nearly singular, its inverse becomes very large, and the coefficients blow up, which is the peak. Far beyond p=np = n, the coefficients spread out across many features and the norm falls again.

Step 4 in symbols: a worked matrix to see the norm fall

For n=2n = 2 points with x=1x = 1 and x=2x = 2, and labels y=(1,3)y = (1, 3), take features ϕ(x)=(1,x,x2)\phi(x) = (1, x, x^2), so p=3p = 3. The design matrix has rows (1,1,1)(1, 1, 1) and (1,2,4)(1, 2, 4). Then XX⊤=(37721)X X^\top = \begin{pmatrix} 3 & 7 \\ 7 & 21 \end{pmatrix}, with determinant 63−49=1463 - 49 = 14. Its inverse times yy is 114(21−21,−7+9)=(0,17)\tfrac{1}{14}(21 - 21, -7 + 9) = (0, \tfrac{1}{7}). So β^min⁡=(1,2,4)/7\hat\beta_{\min} = (1, 2, 4)/7. The squared norm is 1+4+1649=37≈0.43\tfrac{1 + 4 + 16}{49} = \tfrac{3}{7} \approx 0.43, far below the squared norm 55 of the linear interpolant (−1,2)(-1, 2) on the same two points. That model uses different features, so the comparison only illustrates the trend.

Worked examples

Example
Example 1: one parameter, one fit
  1. Model: y^=ax\hat y = a x, with training points (1,1)(1, 1) and (2,3)(2, 3).
  2. Compute ∑xiyi=1⋅1+2⋅3=7\sum x_i y_i = 1 \cdot 1 + 2 \cdot 3 = 7.
  3. Compute ∑xi2=1+4=5\sum x_i^2 = 1 + 4 = 5.
  4. Fit: a=7/5=1.4a = 7/5 = 1.4.
  5. Training predictions: 1.41.4 and 2.82.8. Training residuals: −0.4-0.4 and +0.2+0.2.
  6. Training mean squared error: (0.16+0.04)/2=0.1(0.16 + 0.04)/2 = 0.1.
  7. Test prediction at x=3x = 3: 1.4×3=4.21.4 \times 3 = 4.2, error ∣4.2−3∣=1.2|4.2 - 3| = 1.2.

Interpretation: the simple model misses both training points a little, and its error on the new point is moderate. This is the under-parameterised side of the curve.

Example
Example 2: the interpolating fit and the peak
  1. Model: y^=b+ax\hat y = b + a x, with the same two points.
  2. Solve b+a=1b + a = 1 and b+2a=3b + 2a = 3. Subtracting gives a=2a = 2, so b=−1b = -1.
  3. Training predictions: 11 and 33, so training error is 00.
  4. Test prediction at x=3x = 3: −1+2×3=5-1 + 2 \times 3 = 5, error ∣5−3∣=2.0|5 - 3| = 2.0.
  5. Compare: the exact fit has training error 00 but test error 2.02.0, worse than the simpler model's 1.21.2.

Interpretation: the interpolating model has used up its parameters on the noise. This matches the peak in the schematic curve: test error is highest where the model can just fit the training data.

Example
Example 3: a realistic count of parameters against data

A classifier for handwritten digits takes 784 input pixels, has one hidden layer of 1000 units, and 10 outputs. The training set has 60,000 images.

  1. Weights from inputs to hidden: 784×1000=784,000784 \times 1000 = 784{,}000.
  2. Hidden biases: 1,0001{,}000.
  3. Weights from hidden to outputs: 1000×10=10,0001000 \times 10 = 10{,}000.
  4. Output biases: 1010.
  5. Total parameters: 784,000+1,000+10,000+10=795,010784{,}000 + 1{,}000 + 10{,}000 + 10 = 795{,}010.
  6. Ratio to training images: 795,010/60,000≈13.25795{,}010 / 60{,}000 \approx 13.25.
  7. Try it: a smaller hidden layer of 100 units has 784×100+100+100×10+10=79,510784 \times 100 + 100 + 100 \times 10 + 10 = 79{,}510 parameters. What is its ratio to the training images? Answer: 79,510/60,000≈1.3379{,}510 / 60{,}000 \approx 1.33, so it is just past the point where it could in principle fit the training data.

Interpretation: the larger network has more than thirteen parameters per training image. In this regime the classical theory would warn of overfitting. Whether the test error is worse depends on the training method and any regularisation, which is exactly the question the double-descent experiments study.

Common mistakes and tradeoffs

It is tempting to think that a model with more parameters than training points must overfit badly. In fact the test error can fall again past the interpolation point, especially when the training method picks a smooth interpolant, such as the minimum-norm one, rather than a wild one. Parameter count alone does not decide generalisation.

It is tempting to think that the peak appears at every model size. In fact it appears near the point where the model can just fit the training data, where the number of parameters is close to the number of examples, and it is most visible when the labels are noisy. Away from that point the classical U-shape still holds.

It is tempting to think that double descent overturns the bias-variance tradeoff. In fact the decomposition still holds. What changes is that the variance term does not keep rising with model size; it can come back down once the fit is interpolating and the norm of the solution is controlled.

When it matters. It matters when models are large relative to data, and when the choice of model size is being made by measuring test error. It also matters when comparing models with different parameter counts, because the ranking can flip across the peak.

When it does not. For small models relative to data, the classical U-shape is the right picture, and standard tools work: pick the size by validation, as in Train, Validation and Test Sets.

Alternatives. L2 Regularization reduces the size of the solution directly, which lowers the peak. Early stopping during training also limits how far the fit goes. Both reduce the risk near the peak without changing the model's size.

History

Classical statistics had long described test error as a U-shaped curve in model complexity, with the bias-variance tradeoff as its explanation. Neural networks trained in the 2010s did not follow it: very large networks often generalised well, even when they could memorise the training labels. In 2017 Zhang and colleagues showed that such networks can fit random labels perfectly, which made the puzzle sharper. In 2018 Belkin, Hsu, Ma and Mandal reported, in simple models, that test error can fall again past the interpolation threshold; the paper was published in PNAS in 2019, and it used the name double descent for the pattern. Later experiments by other groups found the same shape across model size, training time and data size, which made the pattern hard to dismiss.

Recap

  • Classical theory: test error is U-shaped in model size, the bias-variance tradeoff.
  • The interpolation threshold, where the model can just fit the training data, is where test error peaks.
  • Beyond the threshold, the minimum-norm solution keeps the coefficients from blowing up, so the error can fall again.
  • The matrix in step 3 is the key: its inverse blows up near the threshold and the norm falls beyond it.
  • Regularisation and early stopping lower the peak without changing the model size.
  • Read next: Neural Scaling Laws for how error falls with model size over many orders of magnitude, and the 2018 paper by Belkin and colleagues for the experiments.

Check yourself

QuestionRecall: where does the test error peak in the double-descent curve?Show answer
At the interpolation threshold, where the model has just enough parameters to fit the training data exactly, so the number of parameters is close to the number of training examples.
QuestionCompute: training points are (1,1)(1, 1) and (2,3)(2, 3). Using the model y^=ax\hat y = a x, the least-squares fit is a=7/5a = 7/5. What is the test prediction at x=4x = 4?Show answer
The prediction is 1.4×4=5.61.4 \times 4 = 5.6.
QuestionWhy: why does the minimum-norm solution help beyond the threshold, when a model with more parameters than data has infinitely many exact fits?Show answer
Among all exact fits, the minimum-norm one has the smallest coefficients, so it does not use large, unstable weights to chase noise. Near the threshold the matrix to invert is nearly singular, and the coefficients blow up. Far beyond it, the minimum-norm fit spreads weight over many features, so its norm falls and its variance drops.
QuestionApplied: a team has 5,000 training examples and a model with 5,100 parameters, and its test error is worse than a smaller model's. What should it do before concluding that bigger models are worse?Show answer
It should check whether it is sitting near the interpolation threshold, which here it is, since the parameter count is close to the example count. It should then test larger models, measure the whole curve, and try regularisation or early stopping at this size, since the peak is the most fragile point.

Sources