DL0261 Double Descent Reproduction

Reproduce double descent: as you add samples, the min-norm least-squares test error peaks twice. Where is the interpolation threshold, and what creates the second peak?

A three-panel question card. The first panel lists the setup: 40 strong features with variance 1.0, 160 weak unscaled features with variance 0.0025, label noise variance 1.0, a pseudo-inverse fit, and a sweep of n from 10 to 600. The second panel sketches a test-error curve against samples n with one spike near n of 40 and a taller spike near n of 200. The third panel asks which spike is the interpolation threshold, what creates the other spike, and what flattens both.

The Problem: A team reproducing double descent sweeps the training-set size from 10 to 600 for a min-norm least-squares fit on 200 features (40 standardized, 160 left unscaled at variance 0.0025, label noise standard deviation 1). The averaged test error spikes near n = 40 and again near n = 200, and before the plot goes into a report they must say which spike is the interpolation threshold, what creates the other one, and how to flatten both.

Answer

For min-norm least squares on d features, the interpolation threshold is n = d, the last sample size at which the pseudo-inverse can still fit every noisy label exactly. There the design matrix is square with a smallest singular value near zero, so the coefficient norm explodes and the variance term \sigma^2 n/(d-n-1) diverges. A second peak needs a second scale in the features. When k directions have large variance and the other d-k are tiny, the tiny block acts as an implicit ridge \lambda_{\mathrm{eff}} = (d-k)\varepsilon on the strong block. The strong block then hits its own threshold at n \approx k, the effective number of parameters, while training error is still zero, and that peak grows taller as \lambda_{\mathrm{eff}} shrinks. Both peaks are label noise being interpolated through near-singular directions, so ridge tuned per sample size flattens them.

(1) Threshold Equals Rank: For generic features the pseudo-inverse interpolates every label while n \leq d, so the threshold is n = d = 200, or more generally the rank of the feature covariance. It is the sample size where training error first leaves zero.
(2) Variance, Not Bias, Blows Up: Near n = d the noise projected onto the smallest singular direction is amplified by the inverse of a near-zero singular value. The expected excess risk is infinite for n within one of d.
(3) More Data Can Hurt: On the left flank every new row is one more constraint the interpolator must satisfy using ever-weaker directions, so adding samples raises error. This sample-wise non-monotonicity is model-wise double descent read along the other axis of the ratio n/d.
(4) The Second Peak Needs Two Scales: Isotropic features give exactly one peak. With 40 unit-variance and 160 tiny-variance columns, the tiny block adds roughly \lambda_{\mathrm{eff}} I_n to the Gram matrix, a weak implicit ridge on the strong block.
(5) Location Tracks Effective Parameters: The strong block reaches its own threshold at n \approx k = 40, the count of directions whose variance dominates the tail, even though training error is still zero there. Its height scales like 1/\sqrt{\lambda_{\mathrm{eff}}/k}, so a heavier tail smooths it away.
(6) Noise Is The Fuel: Both spikes scale with \sigma^2. With clean labels and a well-specified model they nearly vanish, while omitted features act as extra noise and revive them.
(7) Tuned Ridge Removes Both: Choosing \lambda per sample size gives a smooth, near-monotone curve. Standardizing all 200 features removes only the extra peak and leaves the one at n = d.

Mathematical Formulation:
\hat w = X^{\top}(XX^{\top})^{-1} y \quad (n \leq d)
\hat w = (X^{\top}X)^{-1}X^{\top} y \quad (n \geq d)
R(\hat w) = (\hat w - w^{*})^{\top}\Sigma\,(\hat w - w^{*})
R_{\mathrm{iso}}(n) = \|w^{*}\|^2 (1 - n/d) + \frac{\sigma^2 n}{d - n - 1}
R_{\mathrm{iso}}(n) = \frac{\sigma^2 d}{n - d - 1}
XX^{\top} = SS^{\top} + WW^{\top} \approx SS^{\top} + \lambda_{\mathrm{eff}} I_n
\lambda_{\mathrm{eff}} = (d - k)\,\varepsilon

Where:

  • \hat w is the fitted coefficient vector, X \in \mathbb{R}^{n \times d} the design matrix with n samples and d features, and y the noisy labels. Both lines equal the pseudo-inverse solution X^{+}y.
  • R is the excess test risk (test MSE minus the noise floor), w^{*} the true coefficients, \Sigma the feature covariance, and \sigma^2 the label-noise variance.
  • The two R_{\mathrm{iso}} lines are exact for isotropic Gaussian features, the first for n \leq d-2 and the second for n \geq d+2. The second holds for any \Sigma, because ordinary least squares is invariant to invertible reparameterizations of the features.
  • S \in \mathbb{R}^{n \times k} holds the strong columns (variance 1) and W \in \mathbb{R}^{n \times (d-k)} the weak columns (variance \varepsilon), and I_n is the n \times n identity.
  • \lambda_{\mathrm{eff}} is the implicit ridge contributed by the weak block, equal to its total variance. In the scenario k = 40, d - k = 160, and \varepsilon = 0.0025.

Worked Example (d = 200, k = 40, unit-norm signal, noise variance 1):
R(210) = 200/9 \approx 22.2
R(400) = 200/199 \approx 1.0
\lambda_{\mathrm{eff}} = 160 \times 0.0025 = 0.4
R(40) \approx \frac{\sigma^2}{2\sqrt{\lambda_{\mathrm{eff}}/k}} = \frac{1}{2 \times 0.1} = 5
R(100) \approx \frac{40}{59} + \frac{60}{99} \approx 1.3

The first two lines are exact for this anisotropic design, because above the threshold the risk only knows n and d. The last two are heuristics for the two-scale design. At n = k the smallest eigenvalues of S^{\top}S crowd toward zero along the Marchenko-Pastur edge, so a ridge of only 0.4 caps the variance near 5 instead of infinity. Between the peaks the risk splits into an OLS-like strong part k/(n-k-1) and a weak part (n-k)/(d-n-1), in which 160 tiny features interpolate the leftover n-k noise dimensions. That weak term grows from about 0.6 at n = 100 to about 7.4 at n = 180, which is more data hurting in its plainest form.

To reproduce the curve, draw Gaussian rows with column standard deviations 1 for 40 features and 0.05 for 160, and set w^{*} to a unit vector on the strong block. Fit np.linalg.pinv(X) @ y for each n and score the exact excess risk (\hat w - w^{*})^{\top}\Sigma(\hat w - w^{*}) rather than a finite test set, averaging 60 draws per n. Log training error as well, because it is the only measurement that locates the threshold unambiguously. It stays at zero through n = 200 and turns positive right after.

Two log-scale panels against training samples n from 10 to 600. Left: the min-norm excess test risk rises to a first spike at n of 40, falls to a valley near n of 100, climbs to a much taller spike at n of 200, then decays, while ridge with lambda tuned per n stays smooth and low throughout. Right: the same min-norm risk split by feature block, where the strong-block curve carries the n of 40 spike alone and both curves spike at n of 200 with the weak block on top.

Figure 1: Left, the min-norm excess risk averaged over 60 draws spikes at n = 40 and again at n = 200, while ridge with its penalty tuned per sample size stays smooth. Right, the n = 40 spike lives only in the strong block, while near n = 200 both blocks blow up and the weak block carries most of the variance.

The two spikes look alike on a test-error plot but differ in every diagnostic that matters. That is why the interpolation threshold has to be read from training error and parameter count, not from the tallest bump. Above n = d the variance splits between the blocks exactly in proportion to their sizes, 40 to 160. Below it, the extra spike is a hidden threshold of the strong subspace that the training curve never shows.

PropertySpike near n = 40 (extra peak)Spike at n = 200 (threshold)
Location rulen close to k, the count of high-variance directions (effective parameters)n equal to d, the full column rank of the design
What goes near-singularThe 40 strong columns aloneThe whole square 200 by 200 design
Training error on each sideZero on both sides, the model still interpolatesZero below, positive above
Height set byImplicit ridge of 0.4 from the weak block, finite at about 5Nothing, expected risk diverges at n = d
Present with isotropic featuresNoYes
Removed byStandardizing features, a heavier weak tail, or tuned ridgeTuned ridge, or keeping n well away from d

Login to view more content
Log in to track your progress

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *