Overparameterization & Generalization (Double Descent)

Test error can peak at the interpolation threshold, where a model first fits its training data exactly, and fall again as the model grows past it.

Intermediate · Undergraduate mathematics · about 16 minutes

Reading map and next steps

Intuition

The idea in plain words, before the symbols.

The classical picture says that test error is U-shaped in model capacity: too little capacity underfits, too much overfits. Yet very large networks, which can fit their training data exactly, often generalize well. Belkin et al. (2019) proposed the double-descent curve to reconcile the two, and Nakkiran et al. (2020) observed it in deep networks as model size, training time or the amount of data changes:

  1. As capacity increases, test error initially falls (bias decreases).
  2. Near the interpolation threshold (where training error hits ~0), test error can spike.
  3. Past that, as capacity keeps growing, test error often falls again.

The key idea is that in the overparameterized regime there are many solutions that fit the training data perfectly. Optimization and model choice can impose an implicit bias toward particular interpolating solutions. In some settings, especially linear or random-feature models, this bias is connected to low-norm or smoother solutions that can generalize well (Hastie et al., 2022).

Grokking is often discussed as a related training-time generalization pattern, but it is a separate phenomenon and is not needed to define double descent.

Study prompts for this section: Intuition
Study prompts

Each button copies a prompt about this section to your clipboard, for an AI assistant you already use. Nothing is sent by this site.

Mathematics

Definitions, assumptions and the derivation.

In a linear regression view, let X∈Rn×dX\in\mathbb R^{n\times d} be features and y∈Rny\in\mathbb R^n targets.

  • If d<nd < n and XX has full column rank, the least-squares solution is unique:
w^=arg⁡min⁡w∥Xw−y∥22.\hat w = \arg\min_w \|Xw - y\|_2^2.
  • If d>nd > n and XX has full row rank, there are infinitely many interpolating solutions with Xw=yXw=y.

Gradient descent on the squared loss, started from w=0w=0, never leaves the row space of XX, so with a sufficiently small positive step size and full row rank it converges to the minimum-norm interpolant:

w^min⁡ ∥w∥=X⊤(XX⊤)−1y.\hat w_{\min\,\|w\|} = X^\top (XX^\top)^{-1} y.

For the random Gaussian designs considered below, near d=nd=n the smallest singular value of XX is typically close to zero, so the fitted weights need a very large norm and amplify the noise in yy; that is the peak. For dd much larger than nn there are many interpolants, and the minimum-norm one can have a small norm again. Hastie et al. (2022) derive the limiting test-error curve, as nn and dd grow in proportion, for linear and random-feature models.

Study prompts for this section: Mathematics
Study prompts

Each button copies a prompt about this section to your clipboard, for an AI assistant you already use. Nothing is sent by this site.

Code

The same calculation as runnable code, in the notation of the derivation.

import numpy as np

n_train, n_test, max_d = 80, 2000, 300
noise = 0.2
dims = [10, 30, 60, 80, 100, 150, 300]

def fit_linear(X, y):
    n, d = X.shape
    if d < n:
        return np.linalg.lstsq(X, y, rcond=None)[0]
    return X.T @ np.linalg.solve(X @ X.T + 1e-8 * np.eye(n), y)

def trial(seed, d):
    rs = np.random.RandomState(seed)
    w_true = rs.randn(max_d) / np.sqrt(max_d)
    Xtr_full = rs.randn(n_train, max_d)
    Xte_full = rs.randn(n_test, max_d)
    ytr = Xtr_full @ w_true + noise * rs.randn(n_train)
    yte = Xte_full @ w_true + noise * rs.randn(n_test)

    Xtr, Xte = Xtr_full[:, :d], Xte_full[:, :d]
    w_hat = fit_linear(Xtr, ytr)
    train_mse = float(np.mean((Xtr @ w_hat - ytr) ** 2))
    test_mse = float(np.mean((Xte @ w_hat - yte) ** 2))
    return train_mse, test_mse

curve = []
for d in dims:
    runs = np.array([trial(seed, d) for seed in range(20)])
    train_mse, test_mse = runs.mean(axis=0)
    curve.append((d, train_mse, test_mse))
    print("d =", f"{d:>3}", "train_mse =", round(train_mse, 3), "test_mse =", round(test_mse, 3))

by_d = {d: (train, test) for d, train, test in curve}
assert by_d[80][0] < 1e-6
assert by_d[80][1] > by_d[60][1] and by_d[80][1] > by_d[100][1]
assert by_d[300][1] < by_d[80][1]

This is a fixed synthetic linear task, not a theorem about every large model. It makes the interpolation threshold visible: training error reaches zero near d=nd=n, test error spikes there, and a larger minimum-norm interpolant can recover lower test error.

Study prompts for this section: Code
Study prompts

Each button copies a prompt about this section to your clipboard, for an AI assistant you already use. Nothing is sent by this site.

Demo

Change an input, predict the result, and see which quantities respond.

ExploreChange one control at a time and name what responds.An optional observation guide follows the demo.

Explore Overparameterization & Generalization (Double Descent)

Loading the interactive demo…

Observation guide

Optional and ungraded. Opening a guide saves nothing.

Choose what to inspect in Overparameterization & Generalization (Double Descent), then open its guide.

Use the demo to see error curves against capacity, and compare double descent with grokking, a separate pattern in which validation accuracy rises long after training accuracy has reached 100% (Power et al., 2022).

Study prompts for this section: Demo
Study prompts

Each button copies a prompt about this section to your clipboard, for an AI assistant you already use. Nothing is sent by this site.

In focus

Concept: Overparameterization & Generalization (Double Descent)

What is the smallest example of Overparameterization & Generalization you can work through by hand, and what does it show?

BeforeLoss Landscapes, Sharpness & Flat MinimaNextScaling Laws & Emergent Abilities
DetailsScaling

After the first pass

Go deeper

Optional material for a second reading. Sources are always shown; the other panels open from their headings or from these links, and closing one keeps what you wrote or revealed.
What to look for in each sectionChoose a section and what you expect to see in it, then read short advice.

Section by section

Choose what to look for in each section

Test error can peak at the interpolation threshold, where a model first fits its training data exactly, and fall again as the model grows past it.

Choose what to look for (no demo yet)01 / Intuition
Illustration of a double-descent generalization curve with interpolation threshold and second descent.
What to look for

Start with the picture, metaphor, or geometric mechanism.

Choose first

Choose what you expect to see in this section of Overparameterization & Generalization (Double Descent).

Questions to ask of the pictureChoose a part of the picture and what you expect, then read short advice.

Looking at the picture

Questions to ask of the picture

Test error can peak at the interpolation threshold, where a model first fits its training data exactly, and fall again as the model grows past it.

4 of 4 sections writtenNo live demo yet
Question

Which part of the picture should you look at first?

Choose first

Pick the part of the picture you expect to explain Overparameterization & Generalization (Double Descent).

Sources

References for this page

A reference shows where an idea comes from; it does not vouch for every step on this page.
paper · 2019Reconciling modern machine-learning practice and the classical bias–variance trade-offBelkin, Hsu, Ma, and Mandal
Why it is cited

Proposes the double-descent risk curve, which extends the classical U-shape past the interpolation threshold, and shows it for random-feature models, decision trees and neural networks (PNAS 116(32), 2019).

Open source
paper · 2020Deep Double Descent: Where Bigger Models and More Data HurtNakkiran et al.
Why it is cited

Reports model-wise, epoch-wise and sample-wise double descent in deep networks, including regimes where more training data hurts (ICLR 2020).

Open source
paper · 2022Surprises in High-Dimensional Ridgeless Least Squares InterpolationHastie, Montanari, Rosset, and Tibshirani
Why it is cited

Derives the test error of minimum-norm least-squares interpolation as the number of features and samples grow together, reproducing double descent for linear and random-feature models (Annals of Statistics 50(2), 2022).

Open source
paper · 2022Grokking: Generalization Beyond Overfitting on Small Algorithmic DatasetsPower et al.
Why it is cited

Reports networks on small algorithmic datasets that generalize perfectly long after they have overfit the training set (arXiv preprint).

Open source
What each claim rests on1 claim, each with its sources, where it appears on this page, and its caveats.

Claims and sources

Test error can peak at the interpolation threshold, where a model first fits its training data exactly, and fall again as the model grows past it.

Checked against the cited passages

The checks were made by this site, not by an independent reviewer.

Double descent is an empirical test-error pattern: error may peak near the interpolation threshold, then decline again in larger overparameterized models; Nakkiran et al. show model-wise, epoch-wise, and sample-count variants.
What the sources support

Belkin et al. frame double descent as an empirical risk curve extending the classical U-shape beyond interpolation: near-threshold predictors can have high risk while more capacity beyond interpolation can l...

Caveat

Double descent is empirical and conditional: it is not guaranteed for every model, dataset, optimizer, training length, regularization or noise level. The synthetic code example shows the shape, not evidence...

StatusChecked against the cited passages.

Belkin supports the interpolation-threshold pattern: risk can peak near interpolation and fall again past it. Nakkiran supports model-wise, epoch-wise, and sample-count/non-monotonic deep double descent. The synthetic demo and the minimum-norm equations and code are illustrations, not part of the checked claim.

Explain it without the pageWrite your own explanation before asking for feedback. Your draft and any hints stay while this page is open.

Practice · Overparameterization & Generalization (Double Descent)

Try the idea in your own words

Test error can peak at the interpolation threshold, where a model first fits its training data exactly, and fall again as the model grows past it.

Concept · Selected for practice

Overparameterization & Generalization (Double Descent)

What it rests on: Sources: Reconciling modern machine-learning practice and the classical bias–variance trade-off; Deep Double Descent: Where Bigger Models and More...

Context and links
Choose a task

Explain the mechanism

For Overparameterization & Generalization (Double Descent): What is the smallest example of Overparameterization & Generalization you can work through by hand, and what does it show? Explain your answer, including what changes, why, and which assumption matters.

No answer yet

A rough first thought is enough. Your draft stays when you change tasks.

Your draft stays on this page and is cleared when you leave or reload.

A little help · Explain

Open one hint at a time. These are suggestions, not your answer or a grade.

0 of 3 hints shown for this question.

    Clearing your answer keeps this help record. Outside help is your own report; this page cannot check it.

    Where am I stuck? (optional)
    Your own description, not an automatic diagnosis

    Choose one, or leave this unspecified. Select it again to clear it.

    Take your draft to a feedback conversation

    No AI feedback runs here. You can copy a prompt to use elsewhere; nothing is sent automatically. Review the text before sharing, and leave out private information.

    Write an attempt before copying a feedback prompt.

    A draft, or an AI reply to it, is not a test of what you have learned. To check that, try a different case later without help.

    Ask about this pagePick one item on this page and copy a prompt about it into an AI assistant you already use. Notes you write here stay in this browser.
    Ask about this pageClose
    ConceptOverparameterization & Generalization (Double Descent)Sources: Reconciling modern machine-learning practice and the classical bias–variance trade-off; Deep Double Descent: Where Bigger Models and More...assert by_d[80][0] < 1e-6

    Your question

    Choose what your question is about

    Pick the idea, equation, source, code, claim, misconception or demo state you want to ask about. The prompt you copy includes it, so the answer can stay on that item.
    Next local actionNo local draft saved yet

    Open the draft below to save one note and next action in this browser.

    conceptScaling

    Overparameterization & Generalization (Double Descent)

    Starting question

    What is the smallest example of Overparameterization & Generalization you can work through by hand, and what does it show?

    SourcesCheck the 4 cited sources listed under Sources.Notes can be saved for this item
    Points of view on this item

    Fixed prompts generated from this item. They are not comments from people or independent reviews.

    Learner’s first stepAsk what would make "Overparameterization & Generalization (Double Descent)" feel predictable rather than familiar.
    Assumption

    The 4 cited sources must support this exact item, not just the surrounding topic.

    Source-checking summary

    Connect the definition to one equation, piece of code or demo before widening the discussion.

    Proposed experiment

    Change one input, then check that the same relationship holds in the mathematics, the code and the demo.

    Next action

    You can state the mechanism in your own words

    Evidence4 checks
    ObservationChecking for a saved observation
    ActionReady for one action
    PromptLearner prompt ready to copy
    Go to this item
    01ObservationChecking what this browser has saved
    02EvidenceChecking for a saved observation
    03SourcesCheck the 4 cited sources listed under Sources.
    04Next stepSave one next action
    Local action draftNo local draft saved yetOpen when you are ready to write one next action
    Local action draft

    This draft stays in this browser and is attached to this item only.

    No local draft saved.
    Evidence to inspect
    • What the 4 cited sources say about this exact item
    • The definition, its prerequisites, and a contrasting concept
    • The equation or code that makes the concept concrete
    • One demo state that shows what stays the same as the inputs change
    What would resolve this
    • You can state the mechanism in your own words
    • You can name the prerequisite that would clear up the confusion
    • You can predict how the result changes when one input changes
    Reference idconcept/concept-notebook/scaling/double-descent concept:scaling/double-descent