Tutorials › Statistical Learning (Graduate) › Early Stopping Near The Interpolation Limit

Interpolation and Implicit Regularization · Tutorial 957 of 989

Early Stopping Near The Interpolation Limit

Analyze the bias and noise contributions at each stopping time, and identify conditions under which a finite-time fit predicts better than its interpolating limit.

Advanced 10 min read

What You'll Learn

  • Define a finite-dimensional linear spectral model for gradient flow and prediction risk
  • Derive the estimator at finite time and at the interpolating limit
  • Decompose prediction risk into squared bias and variance by spectral mode
  • Determine exactly when finite-time stopping improves on interpolation
  • Calculate an optimal stopping time in a one-mode example
  • Explain why training-loss curvature and test-risk weights play different roles

Why Compare a Finite-Time Fit With Interpolation?

In an overparameterized linear model, gradient descent can reach zero training error while fitting noise as well as signal. But the prediction risk need not improve all the way to that limit. At a finite time, some directions have not yet been fully fitted; this can leave signal unexplained, while also limiting how much label noise is fitted. Early stopping is useful when the reduction in noise-related error outweighs the remaining signal-related error.

The comparison depends on how quickly each direction is learned and how strongly that direction contributes to prediction on new data. We make those roles explicit in a finite-dimensional spectral model. The model isolates the stopping-time effect; it is not a claim that every design or data-generating process has the same behavior.

A Linear Spectral Model

Let there be \(p\) orthogonal modes. In mode \(j\), let \(\lambda_j>0\) be the curvature of the training loss, \(\beta_j\) the true signal coefficient, and \(Z_j=\beta_j+\varepsilon_j\) the coefficient that exactly fits the observed training target. Assume the errors are independent, with \(E[\varepsilon_j]=0\) and \(\operatorname{Var}(\varepsilon_j)=\tau_j^2\). The squared training loss, up to an irrelevant positive scale, is

$$ \mathcal{L}(\theta)=\frac{1}{2}\sum_{j=1}^{p}\lambda_j(\theta_j-Z_j)^2. $$

We study gradient flow initialized at \(\theta_j(0)=0\). For prediction, let \(\mu_j\geq 0\) be the weight of mode \(j\) under the test distribution. For example, if test covariates have diagonal covariance with entries \(\mu_j\), the excess prediction risk of \(\theta\), relative to the true regression function, is \(\sum_j\mu_j(\theta_j-\beta_j)^2\). The \(\lambda_j\) and \(\mu_j\) need not be equal: training curvature controls the speed of fitting, while test weights control the prediction cost of an error.

Definition: In this model, the finite-time estimator \(\theta(t)\) is the gradient-flow solution at time \(t\geq 0\). Its prediction risk is \(R(t)=E[\sum_{j=1}^{p}\mu_j(\theta_j(t)-\beta_j)^2]\), where expectation is over the label errors. The interpolating limit is the coefficient vector approached as \(t\to\infty\), which fits each observed target \(Z_j\) exactly.

The coordinate-wise gradient-flow equation is \(\dot\theta_j(t)=-\lambda_j(\theta_j(t)-Z_j)\). Multiplying by the integrating factor \(e^{\lambda_jt}\), or directly solving this scalar differential equation with the stated initial value, gives

$$ \theta_j(t)=(1-e^{-\lambda_jt})Z_j. $$

Thus the weight applied to the observed coefficient is \(1-e^{-\lambda_jt}\). A large-curvature mode approaches its fitted value more quickly; as \(t\to\infty\), every mode with \(\lambda_j>0\) converges to \(Z_j\).

Worked Example: A Single Mode at a Chosen Stopping Time

Take one mode with \(\lambda=2\), \(\mu=1\), \(\beta=2\), and error variance \(\tau^2=1\). The interpolating estimator is \(Z=2+\varepsilon\), so its prediction risk is \(E[\varepsilon^2]=1\).

Choose \(t=(\log 5)/2\). Then \(e^{-\lambda t}=1/5\), and \(\theta(t)=(4/5)Z\). Its error is \(\theta(t)-\beta=(4/5)(2+\varepsilon)-2=-2/5+(4/5)\varepsilon\). Since the error has mean zero, the cross term has expectation zero, and

$$ R(t)=\left(\frac{2}{5}\right)^2+\left(\frac{4}{5}\right)^2 =\frac{4}{25}+\frac{16}{25} =\frac{4}{5}. $$

The finite-time risk, \(0.8\), is lower than the interpolating risk, \(1\). The improvement comes from reducing the noise contribution enough to compensate for the bias introduced by shrinking the signal.

Risk at Finite Time and at the Limit

Write \(q_j(t)=e^{-\lambda_jt}\), so that \(\theta_j(t)=(1-q_j(t))(\beta_j+\varepsilon_j)\). The estimation error in mode \(j\) is

$$ \theta_j(t)-\beta_j=-q_j(t)\beta_j+(1-q_j(t))\varepsilon_j. $$

The first term is the remaining signal error; the second is the fitted noise. The following result gives the exact risk, not just an asymptotic approximation.

Theorem: Under the model assumptions above,
$$ R(t)=\sum_{j=1}^{p}\mu_j\left\{\beta_j^2e^{-2\lambda_jt} +\tau_j^2(1-e^{-\lambda_jt})^2\right\}, \qquad R(\infty)=\sum_{j=1}^{p}\mu_j\tau_j^2. $$

Proof. Square the mode-wise error. Its expected squared value is

$$ E[(\theta_j(t)-\beta_j)^2] =q_j(t)^2\beta_j^2 -2q_j(t)(1-q_j(t))\beta_jE[\varepsilon_j] +(1-q_j(t))^2E[\varepsilon_j^2]. $$

Because \(E[\varepsilon_j]=0\) and \(E[\varepsilon_j^2]=\tau_j^2\), this equals \(q_j(t)^2\beta_j^2+(1-q_j(t))^2\tau_j^2\). Multiply by \(\mu_j\) and sum over the finite set of modes to obtain \(R(t)\). Since every \(\lambda_j>0\), \(q_j(t)\to0\) as \(t\to\infty\), so the formula gives \(R(\infty)=\sum_j\mu_j\tau_j^2\). \(\square\)

Worked Example: A Signal-Free Mode

Suppose there is one mode with \(\lambda=1\), \(\mu=3\), \(\beta=0\), and \(\tau^2=4\). The risk at time \(t\) is

$$ R(t)=12(1-e^{-t})^2, \qquad R(\infty)=12. $$

For every finite \(t\geq0\), \(0\leq1-e^{-t}<1\), so \(R(t)<12\). Moreover, differentiating gives \(R'(t)=24(1-e^{-t})e^{-t}\geq0\). Here there is no signal to learn, and fitting the noisy observed coefficient only increases prediction risk. The risk starts at zero and approaches the interpolating risk from below.

When Does Stopping Beat the Interpolating Limit?

Subtracting the limiting risk from the finite-time risk gives an exact comparison. In each mode, stopping leaves a squared signal error but avoids some of the noise error that full interpolation incurs.

Theorem: At a finite time \(t\), stopping has lower prediction risk than interpolation if and only if
$$ \sum_{j=1}^{p}\mu_j\beta_j^2e^{-2\lambda_jt} < \sum_{j=1}^{p}\mu_j\tau_j^2 \left(2e^{-\lambda_jt}-e^{-2\lambda_jt}\right). $$

Proof. For each mode, subtract its contribution to \(R(\infty)\) from its contribution to \(R(t)\). With \(q_j=e^{-\lambda_jt}\), the difference is

$$ \mu_j\{\beta_j^2q_j^2+\tau_j^2(1-q_j)^2-\tau_j^2\} =\mu_j\{\beta_j^2q_j^2-\tau_j^2(2q_j-q_j^2)\}. $$

Summing over \(j\) yields \(R(t)-R(\infty)\). The inequality \(R(t)<R(\infty)\) holds exactly when the sum of the signal-error terms is less than the sum of the avoided-noise terms, which is the displayed condition. \(\square\)

This condition is not a guarantee that early stopping helps. Signal strength, noise, test weights, and learning rates all matter. In particular, a mode with a large \(\mu_j\) can dominate prediction risk even if it has little influence on the training loss. Conversely, a mode with small \(\mu_j\) may be fitted quickly without materially changing test risk.

Worked Example: One Stopping Time for Two Modes

Consider two independent modes. For mode 1, let \((\lambda_1,\mu_1,\beta_1^2,\tau_1^2)=(1,1,4,1)\). For mode 2, let \((\lambda_2,\mu_2,\beta_2^2,\tau_2^2)=(4,0.2,0,1)\). The interpolating risk is \(R(\infty)=1+0.2=1.2\).

At \(t=1\), mode 1 has \(q_1=e^{-1}\), and its risk contribution is

$$ 4e^{-2}+(1-e^{-1})^2 \approx 4(0.13534)+(0.63212)^2 \approx 0.54134+0.39958 =0.94092. $$

Mode 2 has \(q_2=e^{-4}\). Because its signal is zero, its contribution is

$$ 0.2(1-e^{-4})^2 \approx 0.2(0.98168)^2 \approx 0.19275. $$

Therefore \(R(1)\approx0.94092+0.19275=1.13367\), below the interpolating risk \(1.2\). The fast second mode is already close to its noisy fitted value; the slower first mode retains enough signal bias to make its own contribution less than its limiting noise risk. The total comparison depends on both contributions, not on whether every individual mode benefits from the same stopping time.

Choosing a Stopping Time in One Mode

In one mode with \(\lambda>0\), \(\mu>0\), \(\beta^2>0\), and \(\tau^2>0\), the risk as a function of \(q=e^{-\lambda t}\in(0,1]\) is

$$ R(q)=\mu\{\beta^2q^2+\tau^2(1-q)^2\}. $$

Differentiating with respect to \(q\) gives \(R'(q)=2\mu\{(\beta^2+\tau^2)q-\tau^2\}\). Since \(R''(q)=2\mu(\beta^2+\tau^2)>0\), the unique minimum occurs at \(q=\tau^2/(\beta^2+\tau^2)\). This lies strictly between zero and one, and hence corresponds to the finite time

$$ t^*=\frac{1}{\lambda}\log\left(1+\frac{\beta^2}{\tau^2}\right). $$

Substitution gives \(R(t^*)=\mu\beta^2\tau^2/(\beta^2+\tau^2)\), while \(R(\infty)=\mu\tau^2\). Under the stated positive-signal, positive-noise assumptions, \(R(t^*)<R(\infty)\). The optimal time increases as the signal-to-noise ratio increases: when the signal is stronger relative to the noise, more fitting is worthwhile. This one-mode calculation does not supply a common optimal time for multiple modes, since their curvatures and signal-to-noise ratios may differ.

Discrete Gradient Descent and a Common Pitfall

The same calculation applies to ordinary gradient descent on the stated quadratic loss. With step size \(\eta\), the update in mode \(j\) is \(\theta_j^{(k+1)}=\theta_j^{(k)}-\eta\lambda_j(\theta_j^{(k)}-Z_j)\). If \(0<\eta<1/\max_j\lambda_j\), then iteration from zero gives \(\theta_j^{(k)}=[1-(1-\eta\lambda_j)^k]Z_j\). The continuous-time factor \(e^{-\lambda_jt}\) is replaced by \((1-\eta\lambda_j)^k\), and the risk formulas follow with that substitution. This step-size condition ensures the factors lie in \((0,1)\); larger stable step sizes can produce oscillating factors, so the simple monotone-shrinkage interpretation no longer applies directly.

Common mistake: “The interpolating solution has zero training error, so it must have the smallest prediction risk.” This confuses fitting the observed targets with predicting the true signal. In the model, the interpolator has risk \(\sum_j\mu_j\tau_j^2\), not necessarily zero: its prediction error includes the fitted label noise. At finite time, the estimator can have nonzero training error and lower prediction risk, as the exact comparison condition and worked examples show. The reverse mistake is also possible: early stopping is not automatically beneficial. If the remaining signal error is large relative to the noise avoided, stopping increases risk.

Key takeaway: In a linear spectral model, stopping time controls mode-wise shrinkage. Prediction risk balances residual signal error against fitted label noise, with learning rates determining how quickly that balance changes and test-risk weights determining which modes matter most.

Check Your Understanding

Use the spectral risk formula and the assumptions stated in the tutorial.

  1. For a single mode, explain why the interpolating risk is \(\mu\tau^2\), even though the training residual tends to zero.
  2. In the two-mode example, which mode approaches its fitted training coefficient more quickly, and which parameter determines its contribution to test risk?
  3. For a single mode with \(\beta=0\), \(\tau^2>0\), and \(\mu>0\), describe how risk changes as \(t\) increases.
  4. State the exact inequality that determines whether a given finite stopping time has lower risk than interpolation.
  5. Why does the one-mode optimal stopping time not generally minimize risk for all modes in a multi-mode model?
Clinical Biostats