Sam Babichenko

Reading notes / Benign overfitting

The implicit bias of gradient descent

Soudry, Hoffer, Nacson, Gunasekar and Srebro, 2018

Context. On underdetermined least squares, gradient descent from the origin picks the minimum-norm interpolant. Logistic and cross-entropy losses on separable data have no finite minimizer, so the loss reaches zero only as ∥w(t)∥→∞\|w(t)\|\to\infty, and the question is whether the direction w(t)/∥w(t)∥w(t)/\|w(t)\| converges and to what. It was known for coordinate descent with small enough steps (the max L1L_1 margin) and for the vanishing-ridge path (Rosset, Zhu and Hastie), not for plain gradient descent with a fixed step. With an exponentially tailed loss, a point with margin γ\gamma in the current direction gets gradient weight about e−γ∥w∥e^{-\gamma\|w\|}, so as the norm grows only the smallest-margin points contribute appreciably to the gradient, and the iterate becomes a nonnegative combination of them, which is the KKT system of the hard-margin SVM. The direction converges to the max-margin separator, but only at rate 1/log⁡t1/\log t, long after the loss is small.

Setting. Data xn∈Rdx_n\in\mathbb R^d with labels absorbed, loss L(w)=∑nℓ(w⊤xn)\mathcal L(w)=\sum_n\ell(w^\top x_n), and gradient descent w(t+1)=w(t)−η∇L(w(t))w(t+1)=w(t)-\eta\nabla\mathcal L(w(t)) from any w(0)w(0). Assumptions: the data are linearly separable; ℓ>0\ell>0, ℓ′<0\ell'<0, ℓ,ℓ′→0\ell,\ell'\to0 at +∞+\infty, ℓ′\ell' is β\beta-Lipschitz and lim sup⁡u→−∞ℓ′(u)<0\limsup_{u\to-\infty}\ell'(u)<0; and −ℓ′-\ell' has a tight exponential tail, (1−e−μ−u)e−u≤−ℓ′(u)≤(1+e−μ+u)e−u(1-e^{-\mu_-u})e^{-u}\le-\ell'(u)\le(1+e^{-\mu_+u})e^{-u} for large uu, with μ±>0\mu_\pm>0. Logistic and exponential losses qualify (the latter if η<1/L(w(0))\eta<1/\mathcal L(w(0))); convexity is never used. Lemma 1: if η<2β−1σmax⁡−2(X)\eta<2\beta^{-1}\sigma_{\max}^{-2}(X), then L(w(t))→0\mathcal L(w(t))\to0, ∥w(t)∥→∞\|w(t)\|\to\infty, and w(t)⊤xn→∞w(t)^\top x_n\to\infty for every nn.

Theorem 3 (main result). Under these assumptions, with η<2β−1σmax⁡−2(X)\eta<2\beta^{-1}\sigma_{\max}^{-2}(X) and any w(0)w(0), w(t)=w^log⁡t+ρ(t),w^=arg⁡min⁡w∈Rd∥w∥2  s.t.  w⊤xn≥1  ∀n,w(t)=\hat w\log t+\rho(t),\qquad \hat w=\arg\min_{w\in\mathbb R^d}\|w\|^2\ \ \text{s.t.}\ \ w^\top x_n\ge1\ \ \forall n, with ∥ρ(t)∥=O(log⁡log⁡t)\|\rho(t)\|=O(\log\log t), hence w(t)/∥w(t)∥→w^/∥w^∥w(t)/\|w(t)\|\to\hat w/\|\hat w\|; for almost every dataset ρ(t)\rho(t) is bounded. Here w^\hat w is the hard-margin SVM, with KKT conditions w^=∑nαnxn\hat w=\sum_n\alpha_nx_n, αn≥0\alpha_n\ge0, and αn>0⇒w^⊤xn=1\alpha_n>0\Rightarrow\hat w^\top x_n=1; SS is the set of support vectors and θ=min⁡n∉Sw^⊤xn>1\theta=\min_{n\notin S}\hat w^\top x_n>1. The limit does not depend on η\eta (below the threshold), on w(0)w(0), or on the loss away from its tail.

Theorems 9, 4 and 13 (the residual). For almost every dataset every support vector has αn>0\alpha_n>0 (non-degenerate), ∣S∣≤d|S|\le d, and the offset w~\tilde w with η exp⁡(−xn⊤w~)=αn\eta\,\exp(-x_n^\top\tilde w)=\alpha_n on SS exists. Then ρ(t)\rho(t) is bounded (Theorem 9), and if also rank⁡XS=rank⁡X\operatorname{rank}X_S=\operatorname{rank}X, ρ(t)→w~\rho(t)\to\tilde w, made unique by Pˉ1(w~−w(0))=0\bar P_1(\tilde w-w(0))=0, where Pˉ1\bar P_1 projects off span⁡XS\operatorname{span}X_S (Theorem 4): the initialization persists only in directions orthogonal to every support vector. For all datasets (Theorem 13), recursing on the zero-coefficient support vectors projected off the earlier levels gives w(t)=∑m=1Mw^mlog⁡∘m(t)+ρ(t),log⁡∘m=log⁡∘⋯∘log⁡⏟m,w(t)=\sum_{m=1}^M\hat w_m\log^{\circ m}(t)+\rho(t),\qquad \log^{\circ m}=\underbrace{\log\circ\cdots\circ\log}_{m}, with ρ\rho bounded; generic data have M=1M=1, and the O(log⁡log⁡t)O(\log\log t) residual of Theorem 3 comes from the m≥2m\ge2 terms, led by m=2m=2.

Theorem 5 (rates) and Corollary 6. For every separable dataset ∥w(t)∥w(t)∥−w^∥w^∥∥=O(log⁡log⁡tlog⁡t),1−w(t)⊤w^∥w(t)∥∥w^∥=O((log⁡log⁡tlog⁡t)2),\Big\|\frac{w(t)}{\|w(t)\|}-\frac{\hat w}{\|\hat w\|}\Big\|=O\Big(\frac{\log\log t}{\log t}\Big),\qquad 1-\frac{w(t)^\top\hat w}{\|w(t)\|\|\hat w\|}=O\Big(\Big(\frac{\log\log t}{\log t}\Big)^2\Big), improving to O(1/log⁡t)O(1/\log t) and O(1/log⁡2t)O(1/\log^2t) for almost every dataset, while the margin gap is O(1/log⁡t)O(1/\log t) and L(w(t))=O(1/t)\mathcal L(w(t))=O(1/t). The non-degenerate rates are tight. So to be close to w^\hat w in direction the loss must be exponentially small. Corollary 6: for the logistic loss and a validation point with w^⊤x<0\hat w^\top x<0, the validation loss is Ω(log⁡t)\Omega(\log t), rising while the margin, and typically the validation error, improve.

Extensions. Multiclass cross-entropy (Theorem 7) converges to the KK-class SVM, provided a multiclass offset equation has a solution, which is assumed, not proved generic. If only one layer of a ReLU network is trained, the loss tends to zero, and the activation patterns eventually stop switching (Corollary 8), that layer converges in direction to the max-margin solution in its effective features. An intercept added as a constant feature gives min⁡∥w∥2+b2\min\|w\|^2+b^2, which is not the SVM with a free intercept.

Step 1

The loss goes to zero and every margin diverges. Smoothness of L\mathcal L, with βL=βσmax⁡2(X)\beta_{\mathcal L}=\beta\sigma_{\max}^2(X), gives L(w(t+1))≤L(w(t))−η(1−βLη2)∥∇L(w(t))∥2\mathcal L(w(t+1))\le\mathcal L(w(t))-\eta(1-\tfrac{\beta_{\mathcal L}\eta}{2})\|\nabla\mathcal L(w(t))\|^2, so ∑t∥∇L(w(t))∥2\sum_t\|\nabla\mathcal L(w(t))\|^2 is finite. But for a separator w∗w_*, w∗⊤∇L(w)=∑nℓ′(w⊤xn) w∗⊤xnw_*^\top\nabla\mathcal L(w)=\sum_n\ell'(w^\top x_n)\,w_*^\top x_n is a sum of strictly negative terms, so each ℓ′(w(t)⊤xn)→0\ell'(w(t)^\top x_n)\to0, and since lim sup⁡−∞ℓ′<0\limsup_{-\infty}\ell'<0, this forces w(t)⊤xn→+∞w(t)^\top x_n\to+\infty. This justifies replacing −ℓ′-\ell' by its exponential tail in all later steps.

Step 2

Why the limit must be the SVM, and why the scale is log⁡t\log t (heuristic). Take ℓ(u)=e−u\ell(u)=e^{-u} in continuous time and suppose w(t)=g(t)w∞+ρ(t)w(t)=g(t)w_\infty+\rho(t) with g→∞g\to\infty, ρ/g→0\rho/g\to0. The negative gradient ∑ne−g w∞⊤xne−ρ⊤xnxn\sum_ne^{-g\,w_\infty^\top x_n}e^{-\rho^\top x_n}x_n is dominated by the points minimizing w∞⊤xnw_\infty^\top x_n, and since w(0)w(0) becomes negligible, w∞w_\infty lies in their cone. Normalized to w^\hat w, this says w^=∑αnxn\hat w=\sum\alpha_nx_n with αn≥0\alpha_n\ge0 and αn=0\alpha_n=0 unless w^⊤xn=1\hat w^\top x_n=1: the KKT conditions of the SVM, sufficient because that problem is convex. The remaining gradient is e−g∑Se−ρ⊤xnxne^{-g}\sum_Se^{-\rho^\top x_n}x_n, so matching g˙ w^\dot g\,\hat w needs g˙∝e−g\dot g\propto e^{-g}, i.e. g=log⁡t+constg=\log t+\text{const}. The proof plugs in g=log⁡tg=\log t, w∞=w^w_\infty=\hat w and bounds the residual.

Step 3

An offset w~\tilde w cancels the 1/t1/t term, and generic data admit one. The increment of w^log⁡t\hat w\log t is about w^/t\hat w/t, and at w=w^log⁡t+w~w=\hat w\log t+\tilde w the support vectors contribute t−1η∑Se−xn⊤w~xnt^{-1}\eta\sum_Se^{-x_n^\top\tilde w}x_n; choosing ηe−xn⊤w~=αn\eta e^{-x_n^\top\tilde w}=\alpha_n makes the two match, which needs αn>0\alpha_n>0 and a solvable linear system for the xn⊤w~x_n^\top\tilde w (the columns of XSX_S are generically independent). Genericity is a zero-set-of-polynomials argument: for almost every XX at most dd points lie on an affine hyperplane, so ∣S∣≤d|S|\le d, and αS=(XS⊤XS)−11\alpha_S=(X_S^\top X_S)^{-1}\mathbf 1 is a rational function of XSX_S that is not identically zero, so its zero set, over the finitely many candidate sets SS, is null.

Step 4

In continuous time the residual is bounded, because the support-vector terms can only decrease ∥r∥\|r\|. Let r=w−w^log⁡t−w~r=w-\hat w\log t-\tilde w, with ∑Se−xn⊤w~xn=w^\sum_Se^{-x_n^\top\tilde w}x_n=\hat w (no η\eta in continuous time). Substituting the decomposition into the flow, 12ddt∥r∥2=1t∑n∈Se−xn⊤w~(e−xn⊤r−1)xn⊤r+∑n∉St−w^⊤xne−xn⊤w~e−xn⊤rxn⊤r.\tfrac12\tfrac{d}{dt}\|r\|^2=\frac1t\sum_{n\in S}e^{-x_n^\top\tilde w}\big(e^{-x_n^\top r}-1\big)x_n^\top r+\sum_{n\notin S}t^{-\hat w^\top x_n}e^{-x_n^\top\tilde w}e^{-x_n^\top r}x_n^\top r. The first sum is ≤0\le0 because z(e−z−1)≤0z(e^{-z}-1)\le0, and the second is at most Ct−θCt^{-\theta} by ze−z≤1ze^{-z}\le1, integrable since θ>1\theta>1. So rr is bounded; the strict gap between support and non-support margins makes the error integrable.

Step 5

In discrete time the same energy argument goes through up to summable errors. Expand ∥r(t+1)∥2=∥r(t)∥2+2(r(t+1)−r(t))⊤r(t)+∥r(t+1)−r(t)∥2\|r(t+1)\|^2=\|r(t)\|^2+2(r(t+1)-r(t))^\top r(t)+\|r(t+1)-r(t)\|^2; the squared increment is summable by the descent lemma. The cross term splits into a discretization term O(t−2)O(t^{-2}), the non-support term O(t−θ)O(t^{-\theta}) of Step 4, and the sign-definite support-vector sum of Step 4 perturbed by the tail factors 1±O(t−μ±)1\pm O(t^{-\mu_\pm}). A case split on ∣z∣=∣xn⊤r∣|z|=|x_n^\top r| shows the perturbation adds O(t−1−1.5μ+)O(t^{-1-1.5\mu_+}) or O(t−1−0.5μ−)O(t^{-1-0.5\mu_-}) when zz is tiny and nothing once −z2-z^2 dominates, leaving the term ≤−C′t−1\le-C't^{-1} when ∣z∣≥ϵ2|z|\ge\epsilon_2. So the cross term is at most C1t−νC_1t^{-\nu}, ν=min⁡(θ,1+1.5μ+,1+0.5μ−)>1\nu=\min(\theta,1+1.5\mu_+,1+0.5\mu_-)>1, and ∥r∥2\|r\|^2 stays bounded.

Step 6

When the support vectors span the data, r(t)→0r(t)\to0. Spanning puts every gradient in span⁡XS\operatorname{span}X_S, so Pˉ1r\bar P_1r is frozen and can be absorbed into w~\tilde w, leaving r=P1rr=P_1r. If ∥P1r∥≥ϵ1\|P_1r\|\ge\epsilon_1, then σmin⁡(XS)>0\sigma_{\min}(X_S)>0 gives some support vector ∣xn⊤r∣≥ϵ2|x_n^\top r|\ge\epsilon_2, and the last case of Step 5 makes the cross term ≤−C2t−1\le-C_2t^{-1}, whose sum diverges, so rr re-enters the ϵ1\epsilon_1-ball infinitely often. During an excursion the cross terms are negative, so ∥r∥2\|r\|^2 can rise only by the tail of the summable squared increments, and letting ϵ1→0\epsilon_1\to0 gives r→0r\to0.

Step 7

A zero-coefficient support vector forces a log⁡log⁡t\log\log t term. Such a point has an uncancelled gradient of order t−1e−xn⊤ρt^{-1}e^{-x_n^\top\rho}, which the residual can damp only by growing slowly in a new direction: ρ\rho grows until e−xn⊤ρ∼1/log⁡te^{-x_n^\top\rho}\sim1/\log t, leaving a contribution ∼1/(tlog⁡t)=ddtlog⁡log⁡t\sim1/(t\log t)=\tfrac{d}{dt}\log\log t. That is the w^2log⁡log⁡t\hat w_2\log\log t term, and the recursion repeats at each level. The proof subtracts all levels with offsets and corrections, shows the cross term is at most κ1(t)∥r∥+κ2(t)\kappa_1(t)\|r\|+\kappa_2(t) with κi\kappa_i summable, and closes with a discrete Gronwall bound.

Step 8

The rates follow by expanding the direction. The residual is O(1)O(1), or O(log⁡log⁡t)O(\log\log t), against a norm of order log⁡t\log t, so w(t)∥w(t)∥=w^∥w^∥+(I−w^w^⊤∥w^∥2)ρ(t)∥w^∥log⁡t+O(1log⁡2t).\frac{w(t)}{\|w(t)\|}=\frac{\hat w}{\|\hat w\|}+\Big(I-\frac{\hat w\hat w^\top}{\|\hat w\|^2}\Big)\frac{\rho(t)}{\|\hat w\|\log t}+O\Big(\frac{1}{\log^2t}\Big). The direction error is O(1/log⁡t)O(1/\log t), and because its leading part is orthogonal to w^\hat w, 1−cos⁡1-\cos is quadratic in it. The margin gap picks up min⁡n∈Sxn⊤ρ\min_{n\in S}x_n^\top\rho at order 1/log⁡t1/\log t, and the loss is t−1∑Se−ρ⊤xnt^{-1}\sum_Se^{-\rho^\top x_n} plus a faster remainder. For degenerate data the log⁡log⁡t\log\log t part of ρ\rho slows the direction, but it eventually makes a nonnegative angle with the active support vectors, so the margin and loss keep their rates. One point x=(1,0)x=(1,0) with w2(0)≠0w_2(0)\ne0 attains the direction, angle and loss rates but not the margin rate (its gap is ≈w22/(2log⁡2t)\approx w_2^2/(2\log^2t)); two support vectors with different xn⊤ρx_n^\top\rho, e.g. x1=(1,2)x_1=(1,2), x2=(1,−1)x_2=(1,-1), attain the 1/log⁡t1/\log t margin rate. For Corollary 6, log⁡(1+e−u)≥−u\log(1+e^{-u})\ge-u gives validation loss ≥−(log⁡t)w^⊤xk−ρ⊤xk=Ω(log⁡t)\ge-(\log t)\hat w^\top x_k-\rho^\top x_k=\Omega(\log t).

Consequences and limits. Gradient descent on an exponentially tailed loss carries an exact implicit L2L_2 regularization: it reaches the max-margin separator with no norm penalty, no early stopping, and no dependence on step size or initialization. The tail of the loss sets the bias, so logistic and exponential losses agree on separable data; polynomial tails do not reach the max margin (Nacson et al.). The 1/log⁡t1/\log t rate helps explain why training past zero training error can keep improving the margin, and often the test error, while the validation loss rises, so the 0-1 validation error is the better stopping signal. The bias depends on the algorithm. Momentum and SGD keep it (mostly by experiment), while coordinate descent gives the L1L_1 margin and ADAM something step- and initialization-dependent. The link to benign overfitting comes from later work: the long-run linear classifier generalizes when the max-margin classifier does, and once the dimension is large enough relative to the sample size every point becomes a support vector, so the SVM equals the minimum-norm interpolant of the ±1\pm1 labels (Muthukumar et al. 2021; Hsu, Muthukumar and Xu 2021). Limits: linear predictors on separable data, a step below the smoothness threshold, and for networks a single trained layer with frozen activation patterns.

Terms

w^\hat w
Hard-margin SVM: arg⁡min⁡∥w∥2\arg\min\|w\|^2 s.t. w⊤xn≥1w^\top x_n\ge1; the limit direction of w(t)w(t).
Support vectors SS
Points on the margin, w^⊤xn=1\hat w^\top x_n=1; only they contribute to the gradient at late times.
Dual variables αn\alpha_n
KKT weights: w^=∑αnxn\hat w=\sum\alpha_nx_n, αn≥0\alpha_n\ge0, zero off SS; αS=(XS⊤XS)−11\alpha_S=(X_S^\top X_S)^{-1}\mathbf 1 generically.
θ\theta
min⁡n∉Sw^⊤xn>1\min_{n\notin S}\hat w^\top x_n>1; non-support vectors contribute O(t−θ)O(t^{-\theta}), summable.
Tight exponential tail
(1−e−μ−u)e−u≤−ℓ′(u)≤(1+e−μ+u)e−u(1-e^{-\mu_-u})e^{-u}\le-\ell'(u)\le(1+e^{-\mu_+u})e^{-u} for large uu.
w~\tilde w
Offset with ηe−xn⊤w~=αn\eta e^{-x_n^\top\tilde w}=\alpha_n on SS; cancels the 1/t1/t term; limit of ρ\rho when XSX_S spans.
P1, Pˉ1P_1,\ \bar P_1
Projections onto span⁡XS\operatorname{span}X_S and its complement; Pˉ1r\bar P_1r is frozen when XSX_S spans the data.
Non-degenerate dataset
Every support vector has αn>0\alpha_n>0; true for almost every XX, gives bounded ρ\rho.
log⁡∘mt\log^{\circ m}t
mm-fold iterated log; degenerate data add w^mlog⁡∘mt\hat w_m\log^{\circ m}t terms.
Rates
Generic data: direction O(1/log⁡t)O(1/\log t), angle O(1/log⁡2t)O(1/\log^2t); all data: margin gap O(1/log⁡t)O(1/\log t), loss O(1/t)O(1/t).

Quiz

  1. Why is the limit direction the hard-margin SVM, whatever exponentially tailed loss is used?
  2. What is the job of the offset w~\tilde w defined by ηe−xn⊤w~=αn\eta e^{-x_n^\top\tilde w}=\alpha_n on the support vectors?
  3. Suppose a support vector has dual coefficient αn=0\alpha_n=0 (a degenerate dataset). What changes in the behavior of w(t)w(t)?
  4. Why does the logistic validation loss grow while the margin improves?

Sources