← Explainer Library

Interactive Explainer

Double Descent, Made Concrete

Classical statistics says: more parameters than data points should overfit catastrophically. Modern DL says: keep going and the test error often gets better. Watch the double-descent curve form live as you slide the model size across the interpolation threshold.

Step 1

What you should see

The mechanism (Belkin et al., 2018; Hastie et al., 2019): past the threshold, infinitely many weight vectors achieve zero training error, and the optimiser picks the minimum-$\ell_2$-norm one. Many of those are smooth, and the implicit bias of gradient descent (and ridge as $\lambda \to 0^+$) finds them.

Step 1½

Why classical bias-variance predicted the wrong shape

The U-curve from any ML textbook decomposes test error as

Up to the threshold, variance dominates the rise. The textbook stops here. What the textbook missed is that past $P = N$, both bias and variance can drop because the model now has slack capacity: many feature directions encode noise, and the minimum-norm solution spreads its weights across them so each individual direction carries less of the noise — the variance is averaged down. Belkin et al. coined this the "modern interpolating regime" in 2018.

Step 2

Live curve

Test error vs feature count P. Vertical line marks the interpolation threshold P=N.
Best-fit prediction at three model sizes (small / threshold / very large).
Step 2½

Why the spike happens, in three lines of algebra

With random feature matrix $\Phi \in \mathbb{R}^{N \times P}$ and tiny ridge $\lambda$, the prediction at a test point is $\hat y_* = \phi(x_*)^\top \hat w$. As $P \to N$, the smallest singular value $\sigma_{\min}(\Phi)$ approaches zero, and the ridge inverse blows up:

Small $\sigma_i$ correspond to feature directions that the training data barely identifies. Without ridge, those directions soak up huge weight to fit the noise — variance explodes. The spike happens exactly at $P = N$ because that's where $\Phi$ becomes square and least-squares is forced to interpolate. Beyond $P = N$, the system is underdetermined; min-norm collapses those weights again.

Stronger ridge ($\lambda \uparrow$) flattens the spike. Slide ridge log₁₀λ up and watch the peak shrink — that's the variance term being dampened. The cost: slightly higher error far from the threshold.

Step 2¾

Live: sample-wise double descent

Fix the model size $P$ above the original interpolation threshold. Now sweep the training set size $N$ from small to large. As $N$ approaches $P$ from below, the model is forced out of the over-parameterised regime back through the threshold. Test error can increase with more training data — exactly the opposite of what every intro ML class teaches.

Test RMSE vs training-set size $N$ for fixed $P$. Vertical line marks $N = P$ — adding a sample across that line can make the model worse.

Nakkiran et al. (2019, "Deep Double Descent") observed this same shape in CIFAR ResNets when sweeping the training set size with the model fixed. The remedy is more weight decay or much more training data.

Step 2⅞

Epoch-wise double descent

A third axis: hold $P$ and $N$ fixed, watch test error vs training epoch. Long-running ResNet runs show test error first drop, rise around the epoch where training loss hits zero, then drop again. The mechanism is the same — the network passes through an effective interpolation threshold as its function class "fills out" during training.

Three knobs, one phenomenon. Model size, dataset size, and training duration are each axes along which interpolation can be approached. Any of them can produce a non-monotone test-error curve. The uniting concept is "effective complexity vs effective data" — when those balance, things get bad.
Step 3

What it means in practice

Final takeaway. The U-curve is the wrong default mental model for modern DL. Once you've seen the second descent in your browser, you'll never expect "bigger model = more overfitting" the same way again.
Step 4

Connection to the NTK and infinite width

The Neural Tangent Kernel limit (Jacot et al., 2018) says that an infinitely-wide net trained with gradient descent and vanishing learning rate behaves as a fixed kernel regressor. The "$P = N$" spike is where that kernel's training-data Gram matrix becomes ill-conditioned; the second descent corresponds to the kernel ridgeless limit on an effectively over-determined system.

This gives a clean explanation:

Hastie, Montanari, Rosset & Tibshirani (2019) give the asymptotic risk formula for random-feature ridge regression in closed form: the test risk peaks at exactly $P/N = 1$ for $\lambda \to 0$ and decreases monotonically thereafter, with the rate of descent governed by the spectrum of the feature map.

Step 5

How to avoid getting trapped at the spike

Step 6

Reading list