Simple Algorithm
Machine Learning · Convergence · 30 min

Benign Overfitting

When perfectly fitting noise does no harm.

A predictor that fits every noisy label exactly can still predict almost optimally. Bartlett, Long, Lugosi and Tsigler pinned down when this happens for linear regression: the noise needs somewhere harmless to go. This lesson computes the mechanism in a model you can check by hand, states the theorem with its effective ranks, and follows the idea to kernels, nearest neighbors, classification and neural networks.

What you’ll learn

  • Split the excess risk of the minimum-norm interpolant into bias and variance, and write the variance through the covariance spectrum.
  • Derive the "implicit ridge plus noise sponge" mechanism in a two-scale covariance model.
  • Define the effective ranks rkr_k and RkR_k, state the Bartlett–Long–Lugosi–Tsigler theorem with its conditions, and decide which spectra are benign.
  • Classify interpolating methods as benign, tempered or catastrophic, and compare regression with classification and with neural networks.

Where the noise goes

Let x\mathbf x live in Rp\R^p or a separable Hilbert space, with covariance Σ=Exx⊤\Sigma=\E\mathbf x\mathbf x^\top and eigenvalues λ1≥λ2≥⋯\lambda_1\ge\lambda_2\ge\cdots, and let y=x⊤θ⋆+εy=\mathbf x^\top\boldsymbol\theta^\star+\varepsilon with noise variance σ2\sigma^2. With nn samples and more directions than samples, the minimum-norm interpolant is θ^=X⊤(XX⊤)−1y\hat{\boldsymbol\theta}=X^\top(XX^\top)^{-1}\mathbf y, which fits every noisy label exactly. Its excess risk is R(θ^)=(θ^−θ⋆)⊤Σ(θ^−θ⋆)R(\hat{\boldsymbol\theta})=(\hat{\boldsymbol\theta}-\boldsymbol\theta^\star)^\top\Sigma(\hat{\boldsymbol\theta}-\boldsymbol\theta^\star). When is it small?

DerivationBias, variance and the spectrum
  1. θ^−θ⋆=−(I−Π)θ⋆+X⊤(XX⊤)−1ε\hat{\boldsymbol\theta}-\boldsymbol\theta^\star=-(I-\Pi)\boldsymbol\theta^\star+X^\top(XX^\top)^{-1}\boldsymbol\varepsilon

    Substitute y=Xθ⋆+ε\mathbf y=X\boldsymbol\theta^\star+\boldsymbol\varepsilon and let Π=X⊤(XX⊤)−1X\Pi=X^\top(XX^\top)^{-1}X, the projection onto the span of the training inputs. The interpolant keeps the part of θ⋆\boldsymbol\theta^\star the inputs can see, and adds fitted noise:

  2. EεR(θ^)=θ⋆⊤(I−Π)Σ(I−Π)θ⋆⏟bias+σ2tr⁡[(XX⊤)−1XΣX⊤(XX⊤)−1]⏟variance\E_{\boldsymbol\varepsilon}R(\hat{\boldsymbol\theta})=\underbrace{\boldsymbol\theta^{\star\top}(I-\Pi)\Sigma(I-\Pi)\boldsymbol\theta^\star}_{\text{bias}}+\sigma^2\underbrace{\operatorname{tr}\big[(XX^\top)^{-1}X\Sigma X^\top(XX^\top)^{-1}\big]}_{\text{variance}}

    Averaging over the noise (independent of XX, mean zero, variance σ2\sigma^2) removes the cross term:

  3. XX⊤=∑iλizizi⊤,variance=∑iλi2 zi⊤(XX⊤)−2ziXX^\top=\sum_i\lambda_i\mathbf z_i\mathbf z_i^\top,\qquad\text{variance}=\sum_i\lambda_i^2\,\mathbf z_i^\top(XX^\top)^{-2}\mathbf z_i

    In the eigenbasis vi\mathbf v_i of Σ\Sigma, write the ii-th column of the data as Xvi=λi ziX\mathbf v_i=\sqrt{\lambda_i}\,\mathbf z_i, with zi∈Rn\mathbf z_i\in\R^n having standardized independent entries. Then XX⊤XX^\top and XΣX⊤X\Sigma X^\top are both sums over directions:

  4. Each direction contributes according to its own variance λi\lambda_i, but through a Gram matrix to which all directions contribute. A direction with tiny λi\lambda_i adds little to prediction error (λi2\lambda_i^2 is tiny), yet many such directions together can add a lot to XX⊤XX^\top, which is exactly what can make (XX⊤)−1(XX^\top)^{-1} small.

A two-scale model you can compute

Take kk strong directions with variance 1, where all the signal lives, and a flat tail of pp weak directions with variance ϵ\epsilon each, so the tail's total variance is pϵp\epsilon. Think k≪n≪pk\ll n\ll p.

DerivationImplicit ridge plus a noise sponge
  1. XX⊤=XhXh⊤+ϵ∑j=1pzjzj⊤≈XhXh⊤+pϵ InXX^\top=X_{\mathrm h}X_{\mathrm h}^\top+\epsilon\sum_{j=1}^p\mathbf z_j\mathbf z_j^\top\approx X_{\mathrm h}X_{\mathrm h}^\top+p\epsilon\,I_n

    The tail acts like a ridge penalty. The tail's Gram matrix is ϵ∑j=1pzjzj⊤\epsilon\sum_{j=1}^p\mathbf z_j\mathbf z_j^\top, an average of p≫np\gg n independent rank-one matrices with mean InI_n; by the law of large numbers it is close to a multiple of the identity:

  2. θ^h≈Xh⊤(XhXh⊤+pϵIn)−1y,bias≈(pϵn+pϵ)2∥θ⋆∥2\hat{\boldsymbol\theta}_{\mathrm h}\approx X_{\mathrm h}^\top\big(X_{\mathrm h}X_{\mathrm h}^\top+p\epsilon I_n\big)^{-1}\mathbf y,\qquad\text{bias}\approx\Big(\frac{p\epsilon}{n+p\epsilon}\Big)^2\norm{\boldsymbol\theta^\star}^2

    So the interpolant's strong-direction part is ridge regression on the strong features alone, with penalty pϵp\epsilon (use the identity Xh⊤(XhXh⊤+λI)−1=(Xh⊤Xh+λI)−1Xh⊤X_{\mathrm h}^\top(X_{\mathrm h}X_{\mathrm h}^\top+\lambda I)^{-1}=(X_{\mathrm h}^\top X_{\mathrm h}+\lambda I)^{-1}X_{\mathrm h}^\top). With Xh⊤Xh≈nIkX_{\mathrm h}^\top X_{\mathrm h}\approx nI_k, each strong coefficient is shrunk by the factor n/(n+pϵ)n/(n+p\epsilon):

  3. ∑i≤kzi⊤(XX⊤)−2zi≈kn(n+pϵ)2≈kn\sum_{i\le k}\mathbf z_i^\top(XX^\top)^{-2}\mathbf z_i\approx\frac{kn}{(n+p\epsilon)^2}\approx\frac kn

    Strong directions pay ordinary estimation variance. Each zi\mathbf z_i of a strong direction sits in an eigendirection of XX⊤XX^\top with eigenvalue about n+pϵn+p\epsilon, so it contributes about n/(n+pϵ)2≈1/nn/(n+p\epsilon)^2\approx1/n, as if kk parameters had been estimated:

  4. ∑j=1pϵ2 zj⊤(XX⊤)−2zj≈p ϵ2n(pϵ)2=np\sum_{j=1}^p\epsilon^2\,\mathbf z_j^\top(XX^\top)^{-2}\mathbf z_j\approx p\,\epsilon^2\frac n{(p\epsilon)^2}=\frac np

    The tail is a sponge. A tail direction sees eigenvalues near pϵp\epsilon, so it contributes ϵ2⋅n/(pϵ)2\epsilon^2\cdot n/(p\epsilon)^2; summed over the pp directions:

  5. Altogether the excess risk is about (pϵn+pϵ)2∥θ⋆∥2+σ2(kn+np)\big(\frac{p\epsilon}{n+p\epsilon}\big)^2\norm{\boldsymbol\theta^\star}^2+\sigma^2\big(\frac kn+\frac np\big), which vanishes when k≪nk\ll n, pϵ≪np\epsilon\ll n and p≫np\gg n: few strong directions, a tail with far more directions than samples, and a tail whose total variance is small next to nn. The noise is fitted exactly but spread so thinly over the tail that new predictions barely notice it.

Predict before you look

In the two-scale model take n=500n=500 samples and a tail of p=50,000p=50{,}000 directions of variance ϵ=10−3\epsilon=10^{-3}. By what factor does the implicit ridge shrink the strong-direction coefficients?

Show the answer

0.909

The implicit penalty is pϵ=50p\epsilon=50, so the factor is n/(n+pϵ)=500/550≈0.909n/(n+p\epsilon)=500/550\approx0.909; the squared bias factor is (50/550)2≈0.008(50/550)^2\approx0.008. With k=5k=5 strong directions the noise factor is k/n+n/p=0.01+0.01=0.02k/n+n/p=0.01+0.01=0.02. In simulations of this kind of model these approximations are accurate once pp is much larger than nn.

The theorem

Three ratios do all the work. r0/nr_0/n controls the bias: a tail whose total variance is large next to nn acts as too strong a ridge and flattens the signal (a matching lower bound shows this condition is needed up to a logarithm). k⋆/nk^\star/n is the price of estimating the strong directions. n/Rk⋆n/R_{k^\star} measures the noise parked in the tail, and it is negligible only when the tail's effective dimension dwarfs the sample size. The authors call a sequence of covariances benign when all three tend to zero; the two-scale model of the previous step is the simplest example.

Which spectra are benign?

DerivationWhy only α = 1, β > 1 works in infinite dimension
  1. Summability. For α<1\alpha<1, or α=1\alpha=1 with β≤1\beta\le1, ∑kλk=∞\sum_k\lambda_k=\infty: infinite total variance, so r0=∞r_0=\infty and the bias condition fails.

  2. rk≈kα−1⟹k⋆≈(α−1)bn,k⋆n↛0r_k\approx\frac k{\alpha-1}\quad\Longrightarrow\quad k^\star\approx(\alpha-1)bn,\qquad\frac{k^\star}n\not\to0

    Too fast. For α>1\alpha>1, ∑i>ki−α≈k1−α/(α−1)\sum_{i>k}i^{-\alpha}\approx k^{1-\alpha}/(\alpha-1), so rk≈k/(α−1)r_k\approx k/(\alpha-1). Reaching rk≥bnr_k\ge bn needs k⋆k^\star of order nn, and the variance term k⋆/nk^\star/n stays bounded away from zero: the tail is too thin to hide the noise.

  3. rk≈kln⁡kβ−1,Rk≈kln⁡2k(β−1)2r_k\approx\frac{k\ln k}{\beta-1},\qquad R_k\approx\frac{k\ln^2k}{(\beta-1)^2}

    Just right. For α=1\alpha=1, β>1\beta>1, comparing sums with integrals gives ∑i>kλi≈ln⁡1−βk/(β−1)\sum_{i>k}\lambda_i\approx\ln^{1-\beta}k/(\beta-1) and ∑i>kλi2≈1/(kln⁡2βk)\sum_{i>k}\lambda_i^2\approx1/(k\ln^{2\beta}k), hence

  4. k⋆n≈(β−1)bln⁡n→0,nRk⋆≈β−1bln⁡n→0\frac{k^\star}n\approx\frac{(\beta-1)b}{\ln n}\to0,\qquad\frac n{R_{k^\star}}\approx\frac{\beta-1}{b\ln n}\to0

    So k⋆≈(β−1)bn/ln⁡nk^\star\approx(\beta-1)bn/\ln n, and both variance terms vanish, though only like 1/ln⁡n1/\ln n: benign, but barely. Benign overfitting in a fixed infinite-dimensional space needs a very particular spectrum, which is why the finite-dimensional case (2), a decaying signal part plus a small isotropic floor in dimension much larger than nn, is the more generic route.

Check your understanding

In example (2) (a few strong directions plus an isotropic floor ϵn\epsilon_n on pnp_n coordinates), which scaling is benign?

  1. pn=2np_n=2n and ϵn=1/n\epsilon_n=1/n
  2. pn=n2p_n=n^2 and ϵn=1\epsilon_n=1
  3. pn=n2p_n=n^2 and ϵn=n−3/2\epsilon_n=n^{-3/2}
  4. pn=n3p_n=n^3 and ϵn=e−n\epsilon_n=e^{-n}
Show the answer

C. pn=n2p_n=n^2 and ϵn=n−3/2\epsilon_n=n^{-3/2}

Here pn=n2=ω(n)p_n=n^2=\omega(n) and ϵnpn=n\epsilon_np_n=\sqrt n, which is o(n)o(n) and not exponentially small: a tail with many more directions than samples and small total variance, exactly the two-scale picture.

Beyond linear regression

Kernels. A kernel interpolant of minimal RKHS norm is a minimum-norm linear interpolant in the kernel's feature space, so the same quantities govern it, with the kernel's eigenvalues playing the role of Σ\Sigma's spectrum. The theorem above assumes independent coordinates, which kernel features lack; Tsigler & Bartlett's (2020) version without that assumption covers kernel regression. Liang & Rakhlin (2020) showed it can generalize when the input dimension grows with nn, through an implicit regularization from high dimensionality, the curvature of the kernel and eigenvalue decay of the data. In constant dimension the picture flips: minimum-norm interpolation with the Laplace kernel is not consistent, for any bandwidth, even one chosen from the data (Rakhlin & Zhai, 2019).

Local interpolation. Benign overfitting does not need high dimension if the interpolation is local enough. Belkin, Hsu & Mitra (2018) proved consistency or near-consistency for simplicial interpolation and for nearest-neighbor schemes with weights singular at the data points, with optimal rates for the latter; Belkin, Rakhlin & Tsybakov (2019) showed that interpolating rules, Nadaraya–Watson smoothing with a singular kernel among them, can achieve optimal rates in nonparametric regression.

SettingResult
Classification vs regression (Muthukumar, Narang, Subramanian, Belkin, Hsu & Sahai, 2021)with enough overparameterization every training point becomes a support vector, so the hard-margin SVM equals the minimum-norm interpolant of the ±1\pm1 labels; there are regimes where this interpolant generalizes for the 0–1 loss but approaches the null risk for the squared loss
Two-layer networks (Frei, Chatterji & Bartlett, 2022)networks trained to interpolation by gradient descent on the logistic loss, on well-separated log-concave class conditionals with a constant fraction of adversarially corrupted labels, reach minimax-optimal test error: benign overfitting with nonlinear model and dynamics
Uniform convergence (Koehler, Zhou, Sutherland & Srebro, 2021)a uniform bound over interpolators in terms of Gaussian width recovers the consistency of minimum-norm interpolation for Gaussian data and gives consistency of minimum-ℓ1\ell_1-norm interpolation (basis pursuit)
Taxonomy (Mallinar, Simon, Abedsoltan, Pandit, Belkin & Nakkiran, 2022)kernels with power-law spectra, including Laplace and ReLU neural tangent kernels, overfit in a tempered way; deep networks trained to interpolate noisy labels were tempered, early-stopped ones benign
Benign is the exception, tempered perhaps the rule: many interpolating methods in fixed or moderate dimension pay a bounded but nonzero price for the noise they fit.

Key takeaways

  • For the minimum-norm interpolant, the noise term is σ2∑iλi2 zi⊤(XX⊤)−2zi\sigma^2\sum_i\lambda_i^2\,\mathbf z_i^\top(XX^\top)^{-2}\mathbf z_i: weak directions add little to prediction error but much to the Gram matrix.
  • In a two-scale model the interpolant is ridge regression on the strong directions with implicit penalty pϵp\epsilon, and the excess risk is about (pϵ/(n+pϵ))2∥θ⋆∥2+σ2(k/n+n/p)(p\epsilon/(n+p\epsilon))^2\norm{\boldsymbol\theta^\star}^2+\sigma^2(k/n+n/p).
  • Bartlett, Long, Lugosi and Tsigler: up to constants and a log⁡(1/δ)\log(1/\delta) factor, the noise costs σ2(k⋆/n+n/Rk⋆)\sigma^2(k^\star/n+n/R_{k^\star}) and the bias is controlled by r0/nr_0/n; covariances are benign when all three ratios vanish.
  • In infinite dimension only spectra like k−1ln⁡−β(k+1)k^{-1}\ln^{-\beta}(k+1) with β>1\beta>1 are benign, and only at rate about 1/ln⁡n1/\ln n; a decaying signal plus a small isotropic floor in dimension ≫n\gg n is the generic benign case.
  • Kernels can overfit benignly in high dimension but not in fixed dimension (Laplace kernel); local interpolating rules can be consistent; deep networks trained to interpolation look tempered.

Check yourself

In the interactive lesson these are scored with your confidence, and what you miss comes back for review.

Question 1

A covariance has eigenvalues (4,1,1,1,1)(4,1,1,1,1). What are r0=∑iλi/λ1r_0=\sum_i\lambda_i/\lambda_1 and R0=(∑iλi)2/∑iλi2R_0=\big(\sum_i\lambda_i\big)^2/\sum_i\lambda_i^2?

  1. r0=8r_0=8, R0=8R_0=8
  2. r0=5r_0=5, R0=5R_0=5
  3. r0=3.2r_0=3.2, R0=2R_0=2
  4. r0=2r_0=2, R0=3.2R_0=3.2
Show the answer

D. r0=2r_0=2, R0=3.2R_0=3.2

∑λi=8\sum\lambda_i=8, so r0=8/4=2r_0=8/4=2 and R0=64/(16+4)=3.2R_0=64/(16+4)=3.2. Both count "effectively equal directions", and both sit between 1 and the rank 5; a flat spectrum would give exactly 5 for both, and in general r0≤R0≤r02r_0\le R_0\le r_0^2.

Question 2

In the bound σ2(k⋆/n+n/Rk⋆)\sigma^2\big(k^\star/n+n/R_{k^\star}\big), which term measures the noise absorbed by the weak tail directions, and when is it small?

  1. n/Rk⋆n/R_{k^\star}, which shrinks as the tail's effective rank grows far beyond nn
  2. k⋆/nk^\star/n; it is small when there are few strong directions
  3. n/Rk⋆n/R_{k^\star}; it is small when the tail has few directions
  4. Neither: the noise is not absorbed, it is removed
Show the answer

A. n/Rk⋆n/R_{k^\star}, which shrinks as the tail's effective rank grows far beyond nn

The tail contributes ∑i>k⋆λi2 zi⊤(XX⊤)−2zi≈n/Rk⋆\sum_{i>k^\star}\lambda_i^2\,\mathbf z_i^\top(XX^\top)^{-2}\mathbf z_i\approx n/R_{k^\star}: the noise is spread over the tail, and a tail of effective rank Rk⋆≫nR_{k^\star}\gg n dilutes it. The term k⋆/nk^\star/n is the ordinary price of estimating the strong directions.

Question 3

Muthukumar et al. (2021) compared classification and regression in overparameterized linear models with Gaussian features. Which of their findings is correct?

  1. The hard-margin SVM never interpolates
  2. With enough overparameterization, every training point is a support vector, so the SVM coincides with the minimum-norm interpolant of the ±1\pm1 labels, and the same solution can generalize well for 0–1 loss while failing for squared loss
  3. Classification and regression always generalize equally well
  4. The minimum-norm interpolant is always worse than the SVM for classification
Show the answer

B. With enough overparameterization, every training point is a support vector, so the SVM coincides with the minimum-norm interpolant of the ±1\pm1 labels, and the same solution can generalize well for 0–1 loss while failing for squared loss

When all points end up on the margin, the SVM's constraints yiw⊤xi≥1y_i\mathbf w^\top\mathbf x_i\ge1 hold with equality, which is exactly interpolation of the labels. Evaluated by sign agreement, such solutions can be good while their squared error approaches that of predicting zero: the loss used to evaluate matters.

Question 4

In the experiments of Mallinar et al. (2022), what did deep networks trained to zero training error on noisy labels look like as the sample size grew?

  1. Benign: test error approached the Bayes error
  2. Catastrophic: test error approached chance
  3. Tempered: test error converged to a value above the Bayes error that grew with the noise level, while early-stopped networks behaved benignly
  4. Their test error kept falling to zero regardless of noise
Show the answer

C. Tempered: test error converged to a value above the Bayes error that grew with the noise level, while early-stopped networks behaved benignly

Their networks neither diverged nor became optimal: noisy training labels left a lasting, bounded excess error, the tempered regime. Benign overfitting may therefore be the wrong idealization for interpolating deep networks, though it does describe linear and some kernel and two-layer models.

Further reading

  • P. L. Bartlett, P. M. Long, G. Lugosi & A. Tsigler, "Benign overfitting in linear regression," Proceedings of the National Academy of Sciences 117(48), 30063–30070 (2020).
  • T. Liang & A. Rakhlin, "Just interpolate: kernel 'ridgeless' regression can generalize," Annals of Statistics 48(3), 1329–1347 (2020).
  • V. Muthukumar, A. Narang, V. Subramanian, M. Belkin, D. Hsu & A. Sahai, "Classification vs regression in overparameterized regimes: does the loss function matter?," Journal of Machine Learning Research 22(222), 1–69 (2021).
  • N. Mallinar, J. B. Simon, A. Abedsoltan, P. Pandit, M. Belkin & P. Nakkiran, "Benign, tempered, or catastrophic: toward a refined taxonomy of overfitting," Advances in Neural Information Processing Systems 35 (2022).
  • M. Belkin, D. Hsu & P. Mitra, "Overfitting or perfect fitting? Risk bounds for classification and regression rules that interpolate," Advances in Neural Information Processing Systems 31 (2018).