🧮 Brain Teaser

The Double Descent Puzzle

You are training a linear regression model with pp parameters on nn training points, using ordinary least squares (OLS). Assume the features are in "general position" (no perfect multicollinearity).

(a) What happens to the training error as pp increases from 11 to n1n-1? What happens at p=np = n? What about p>np > n?

(b) Classical statistical wisdom says: "more parameters → more overfitting → worse test error." Yet modern deep learning routinely uses models with pnp \gg n and achieves excellent test performance. How can this be reconciled?

In particular: in the overparameterized regime p>np > n, there are infinitely many zero-training-error solutions. Which one does gradient descent (or the pseudoinverse) select, and why does that choice matter for generalization?

double descentoverparameterizationminimum normimplicit regularizationbias-variancepseudoinverse

Answer: The Double Descent Puzzle

Key Idea / Intuition

When p<np < n, OLS has a unique solution and training error decreases as pp grows (more flexibility). At p=np = n, the model interpolates the data perfectly — training error hits zero. For p>np > n there are infinitely many interpolating solutions; gradient descent initialized at zero (equivalently, the Moore–Penrose pseudoinverse) picks the minimum 2\ell_2-norm solution. This implicit bias toward small-norm solutions acts like an implicit regularizer, and for well-structured problems this can generalize surprisingly well — the heart of the double descent phenomenon.


Formal Proof / Solution

Part (a): Training Error as a Function of pp

Let XRn×pX \in \mathbb{R}^{n \times p} be the design matrix and yRny \in \mathbb{R}^n the response.

Under-parameterized regime p<np < n:
OLS minimizes yXβ2\|y - X\beta\|^2. The unique solution is β^=(XX)1Xy\hat\beta = (X^\top X)^{-1} X^\top y (assuming full column rank), and the fitted values are y^=Hy\hat y = H y where H=X(XX)1XH = X(X^\top X)^{-1}X^\top is the hat matrix projecting onto the column space of XX. Training error is: RSS=yy^2=(IH)y2>0generically.\text{RSS} = \|y - \hat y\|^2 = \|(I - H)y\|^2 > 0 \quad \text{generically}. As pp increases, the column space of XX grows, HH captures more of yy, and training error monotonically decreases.

Interpolation threshold p=np = n:
When p=np = n and XX is square and invertible, H=IH = I, so y^=y\hat y = y exactly. Training error = 0.

Over-parameterized regime p>np > n:
There are infinitely many β\beta satisfying Xβ=yX\beta = y (the system is underdetermined). Any such solution achieves training error = 0. The solution family is an affine subspace of dimension pnp - n.


Part (b): Which Solution Does Gradient Descent Pick?

Among all interpolating solutions, gradient descent initialized at β0=0\beta_0 = 0 converges to the one with minimum Euclidean norm: β^min-norm=X(XX)1y=X+y,\hat\beta_{\text{min-norm}} = X^\top (X X^\top)^{-1} y = X^+ y, where X+X^+ is the Moore–Penrose pseudoinverse. This is because gradient descent on the squared loss stays in the row space of XX (it only moves in directions spanned by the gradient, which lives in rowspace(X)\text{rowspace}(X)), and the minimum-norm interpolant is exactly the projection of 00 onto the solution affine subspace — which lies in rowspace(X)\text{rowspace}(X).

Why does minimum norm help generalization?

Suppose the true signal is y=Xβ+εy = X\beta^* + \varepsilon. The test error of any interpolating β^\hat\beta decomposes as:

E[test error]β^βsignal directions2+noise amplification.\mathbb{E}[\text{test error}] \propto \|\hat\beta - \beta^*\|^2_{\text{signal directions}} + \text{noise amplification}.

The minimum-norm solution distributes the fit across many small coefficients rather than placing it on a few large ones. In high-dimensional settings where β\beta^* is itself small or sparse in some sense, this implicit 2\ell_2 regularization behaves like ridge regression with a data-dependent effective regularization strength.

Concretely, the bias–variance tradeoff for the minimum-norm estimator in the p>np > n regime is: test MSE=bias20 as p+σ2tr(X+(X+))noise amplification.\text{test MSE} = \underbrace{\|\text{bias}\|^2}_{\to 0 \text{ as } p \to \infty} + \underbrace{\sigma^2 \cdot \text{tr}(X^+ (X^+)^\top)}_{\text{noise amplification}}.

Near pnp \approx n, the singular values of XX near zero get inverted by the pseudoinverse, causing noise amplification to blow up — this is the interpolation peak (the right hump of double descent). As pnp \gg n, the many small singular values each contribute little individually, and the total noise term can decrease again.


The Double Descent Picture

Test error=classical regime p<npeak near p=nmodern regime pn\boxed{\text{Test error} = \underbrace{\searrow}_{\text{classical regime } p < n} \nearrow_{\text{peak near } p = n} \searrow_{\text{modern regime } p \gg n}}

  • Classical regime (pnp \ll n): bias dominates, more parameters reduce bias faster than variance grows.
  • Interpolation peak (pp \approx n):themodeljustbarelyinterpolates;tinyperturbationscausewildswingsin): the model just barely interpolates; tiny perturbations cause wild swings in \hat\beta(nearsingular(near-singularX^\top X$).
  • Modern regime (pnp \gg n): minimum-norm interpolation re-emerges as a gentle implicit regularizer; test error descends again.

This explains why overparameterized neural networks — which also find low-norm (or otherwise "simple") solutions via gradient descent from near-zero initialization — can generalize well even with zero training error.


Reference: ESL Chapter 7 (Bias–Variance tradeoff) provides the classical picture; the double descent phenomenon is discussed in the context of modern ML (Hastie et al., Surprises in High-Dimensional Ridgeless Least Squares Interpolation, 2022).

Written to: questions/2025-07-18_AM_double_descent_puzzle.md

Source: The Elements of Statistical Learning, Ch. 7; Hastie et al. 2022

Type: ML/StatsSource: The Elements of Statistical Learning, Ch. 7; Hastie et al. 2022Edit on GitHub ↗