Three regimes — calm, possessed, calm again
Twenty noisy data points, one model whose size you control (number of random features). Visit the three regimes: small (P=8) — smooth but too simple; the interpolation threshold (P=20, exactly as many knobs as data points) — the fit threads every point and thrashes violently between them; heavily overparameterized (P=80) — still hits every point, yet the curve between them goes… calm. Same data. Bigger model. Better behavior.
Model: linear regression on P random Fourier features, solved by (near-)minimum-norm least squares — the standard clean setting where double descent provably appears. Every curve you see is a fresh solve.
The full sweep — draw the curve that broke the textbook
Press the button: forty model sizes train back to back, and their measured train and test errors plot themselves. You'll watch the classical U form — then the spike at P=n — then the modern surprise: the second descent, often ending below the classical optimum. This is the chart from Belkin et al. and OpenAI's "Deep Double Descent," rebuilt from live fits.
Test error is measured on 200 held-out points per model size. Crank the noise and re-sweep: the peak grows — the spike feeds on noise.
Autopsy of the peak — measure the contortion
Why does error explode exactly at P=n? Because there the model has no choice: exactly one solution threads all twenty noisy points, and hitting noise exactly requires violent coefficients. The gold curve below is the measured size (norm) of the model's weights at each P — watch it spike precisely at the threshold and relax after, when the model regains freedom to choose among many perfect fits.
Set noise to zero and re-measure: the spike nearly vanishes. The peak is the price of taking noise literally with zero slack — no noise, no contortion.
Descent over time — when "train longer" beats "stop early"
Double descent also happens along the time axis. Watch this run: test error falls, rises (the memorization bump — our overfitting page would tell you to stop right there), then falls again to a deeper minimum as slower, genuine structure finishes learning. Early stopping at the first dip would have kept the worse model. Crank the label noise to make the bump — and the dilemma — bigger.
Conceptual simulation of epoch-wise double descent (fast memorization + slow structure learning), honest about being a model of the dynamics rather than a real transformer. The tension with the early-stopping advice on our overfitting page is real and regime-dependent — that's the point.
The cruelest twist — more data can make things worse
Hold the model fixed at P=25 features and grow the dataset. Common sense says error only falls. Watch the measured curve: as n climbs toward 25, test error rises — you're dragging the interpolation threshold onto yourself — then falls once data safely outnumbers knobs. There is a documented regime where hiring more data hurts.
Each point: fresh data of size n, same P=25 model, test error on 200 held-out points, averaged over 8 seeds — the bump survives the averaging.