Foundations to Frontier
Tests
B. Statistical Learning Theory › B4 Theory of deep learning

Implicit Regularization of (S)GD

Overparameterized models have infinitely many zero-training-loss solutions, so which one you get depends on the optimizer, the parameterization and the initialization, not just the loss. This topic proves that gradient descent on least squares from zero finds the minimum-norm interpolant, that logistic regression on separable data converges in direction to the max-margin classifier (Soudry et al.), and that diagonal linear networks interpolate between minimum-ℓ1 (sparse, 'rich' regime) and minimum-ℓ2 ('kernel' regime) solutions depending on the initialization scale. It also covers SGD-specific effects: flatness, label noise and the learning rate to batch size ratio. In the research exercise a two-layer diagonal network recovers a sparse signal that the minimum-norm solution misses.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Many right answers, one chosen

Ask a hundred people to draw a line through two dots and they all agree. Ask them to draw a curve through two dots and you get a hundred different curves, all “correct”. Big neural networks are in the second situation: countless settings of their weights fit the training data perfectly. Training never says which to pick, yet it reliably picks ones that generalize. The choice comes from how we train: where we start, how we take steps, and how the model is built. That hidden preference is implicit regularization.

Many solutions; which one does gradient descent pick?
min ℓ2min ℓ1 (sparse)w₁w₂
diagonal net (α = 1e-2) ends at w = (0.995, 0.010) · min-ℓ2 point (0.800, 0.400) · min-ℓ1 point (1.000, 0.000)
Grey line: every w with zero training loss. Blue dashed: plain GD on a linear model from 0 walks straight to the closest solution (minimum ℓ2 norm), because its updates stay in the row space. Orange: a diagonal network w = u² − v² from scale α; faint: other α values. Small α gives "rich" dynamics: coordinates grow exponentially at different rates and the winner takes all, giving a sparse solution. Large α gives "kernel" (lazy) dynamics, close to the ℓ2 answer. Nothing in the loss asks for sparsity; the parameterization and initialization do.
Why engineers care

Implicit bias explains why huge networks trained without explicit regularization still generalize, why initialization scale and learning rate matter so much, and why changing the parameterization (for example, low-rank adapters) changes what a model learns. It matters when fine-tuning perception models on small robotics datasets.

📝 Quick check (Level 0)
0/3 answered
  1. 1. With more parameters than data points, the number of perfect-fit solutions is usually…
  2. 2. Implicit regularization comes from…
  3. 3. Can two networks with zero training loss generalize differently?

Level 1: Beginner

★★☆☆☆ Basic⏱ 25 minSecondary-school mathematics: arithmetic and elementary algebra.

Least squares: GD finds the minimum-norm solution

For X∈Rm×dX\in\mathbb R^{m\times d} with d greater than m and full row rank, the solutions of Xw = y form an affine subspace. GD on 12m∥Xw−y∥2\tfrac1{2m}\|Xw - y\|^2 updates w←w−ηX⊤(Xw−y)/mw\leftarrow w - \eta X^\top(Xw - y)/m. Every update lies in the row space of X. Starting from w0=0w_0 = 0, GD stays in the row space, and the only solution there is

w⋆=X⊤(XX⊤)−1y=X+y=arg⁡min⁡{∥w∥:Xw=y}.w^\star = X^\top(XX^\top)^{-1}y = X^+y = \arg\min\{\|w\| : Xw = y\}.

From a general w0w_0, GD converges to X+y+(I−X+X)w0X^+y + (I - X^+X)w_0: the null-space part of the initialization never changes.

Classification: GD maximizes the margin

On linearly separable data, unregularized logistic regression has no minimizer: ∥wt∥→∞\|w_t\|\to\infty like log t. But the direction converges:

wt∥wt∥→w^∥w^∥,w^=arg⁡min⁡{∥w∥:yiw⋅xi≥1 ∀i}\frac{w_t}{\|w_t\|}\to\frac{\hat w}{\|\hat w\|},\quad\hat w = \arg\min\{\|w\| : y_iw\cdot x_i\ge1\ \forall i\}

(the hard-margin SVM), at the painfully slow rate O(1/log⁡t)O(1/\log t) (Soudry, Hoffer, Nacson, Gunasekar, Srebro, 2018).

📝 Quick check (Level 1)
0/3 answered
  1. 1. GD from 0 on underdetermined least squares converges to…
  2. 2. On separable data, logistic GD's weight norm…
  3. 3. The limiting direction is…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.

Parameterization changes the bias

Write the same linear predictor differently: w=u⊙u−v⊙vw = u\odot u - v\odot v (a diagonal linear network). With GD from u=v=α1u = v = \alpha\mathbf 1 on squared loss, Woodworth et al. (2020) show that the limit minimizes a potential Qα(w)Q_\alpha(w) over the solution set:

  • α → 0 (rich regime): Qα→∥w∥1Q_\alpha\to\|w\|_1, giving sparse solutions.
  • α → ∞ (kernel / lazy regime): Qα→∥w∥22Q_\alpha\to\|w\|_2^2, the minimum-norm solution.

Small initialization makes coordinates grow multiplicatively: u˙i=−2uigi\dot u_i = -2u_ig_i, so uiu_i evolves like an exponential of the accumulated gradient, and the best-correlated coordinates win.

Matrix factorization W=UV⊤W = UV^\top from small init similarly tends toward low rank (Gunasekar et al., 2017; Arora et al., 2019).

SGD-specific effects

  • Noise scale η/B: larger learning rate to batch size ratios favour flatter minima; the steady-state noise is anisotropic, aligned with the Hessian.
  • Label-noise SGD implicitly minimizes the trace of the Hessian (sharpness) among interpolants (Blanc et al., 2020; Damian et al., 2021).
  • Edge of stability: full-batch GD drives the top Hessian eigenvalue to about 2/η (Cohen et al., 2021).
🐍 Exercise 1: min-norm and max-margin implicit bias
Verify that GD on underdetermined least squares converges to the pseudo-inverse solution (plus the untouched null-space part of w0). Then track the direction of unregularized logistic GD on separable 2-D data toward the brute-force max-margin direction, with plain and normalized step sizes.
📝 Quick check (Level 2)
0/3 answered
  1. 1. A diagonal linear network from very small init tends to find…
  2. 2. From large init it behaves like…
  3. 3. Label-noise SGD implicitly prefers interpolants with…

Level 3: Advanced

★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.

Proof sketch: the max-margin limit

For separable data and the exponential-tailed logistic loss, the gradient −∑iℓ′(yiw⋅xi)yixi-\sum_i\ell'(y_iw\cdot x_i)y_ix_i is dominated, as ‖w‖ grows, by the points with the smallest margins (their weights are about e−yiw⋅xie^{-y_iw\cdot x_i}). Writing wt=w^log⁡t+ρtw_t = \hat w\log t + \rho_t, one shows ρt\rho_t stays bounded. The gradient then lies in the cone of the support vectors, which is exactly the KKT condition of the hard-margin SVM. The direction error is ∥ρt∥/(∥w^∥log⁡t)=O(1/log⁡t)\|\rho_t\|/(\|\hat w\|\log t) = O(1/\log t). ∎

Faster: normalized GD

Taking steps η/L(w)\eta/L(w) compensates for the vanishing gradient. The margin then converges polynomially fast, roughly O(1/t) in direction under conditions (Nacson et al., 2019). Same limit, different speed.

Mirror-descent view of the diagonal network

The diagonal-network GD flow is mirror descent on w with potential QαQ_\alpha, so it converges to arg⁡min⁡Qα(w)\arg\min Q_\alpha(w) subject to Xw = y. Here Qα(w)=α2∑iq(wi/α2)Q_\alpha(w) = \alpha^2\sum_iq(w_i/\alpha^2) with q(z)=2−4+z2+z arcsinh(z/2)q(z) = 2 - \sqrt{4 + z^2} + z\,\mathrm{arcsinh}(z/2), which behaves like |z| log|z| for large |z| (giving ℓ1) and like z²/4 for small |z| (giving ℓ2).

📝 Quick check (Level 3)
0/3 answered
  1. 1. The max-margin direction is approached at rate…
  2. 2. Normalized GD steps η/L(w) mainly…
  3. 3. The diagonal network's GD flow is equivalent to…

Level 4: Expert

★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.

Implicit bias, measured

Exercise 1. GD on a 20 × 50 least-squares problem matches X+yX^+y to 3 × 10⁻¹⁶. From a random w₀ it matches X+y+(I−X+X)w0X^+y + (I - X^+X)w_0 to 3 × 10⁻¹⁵. On separable 2-D data the max-margin angle is 1.9163 rad. Plain logistic GD’s angle error is 0.010, 0.027, 0.040 and 0.046 at t = 10, 100, 1000 and 10 000. Early on, the direction is set by the bulk of the data and drifts away before the slow 1/log t convergence can take over, while ‖w‖ crawls to 13. Normalized GD gives errors of 0.020, 0.049, 0.007 and 0.002 at t = 10, 100, 1000 and 3000.

Exercise 2: sparse recovery (d = 100, m = 40, 4-sparse truth with ‖w*‖₁ = 5.057). The minimum-ℓ2 interpolant misses badly (error 1.87, ‖·‖₁ = 11.59). The diagonal network gives:

init α error ‖w‖₁
10⁻³ 0.010 5.067
10⁻² 0.042 5.151
0.1 0.56 6.70
1 1.87 11.56

The rich regime recovers the sparse signal like lasso, with no penalty at all. The large-init regime reproduces the ℓ2 answer.

🐍 Exercise 2 (research): rich vs kernel regime in a diagonal network
Train w = u⊙u − v⊙v by GD from u = v = α on an underdetermined sparse-recovery problem. For several α, measure the recovery error and ℓ1 norm, and compare with the minimum-ℓ2 interpolant.

Implicit bias in AI, robotics and aerospace

  • Initialization and learning-rate schedules are regularizers: tune them like hyperparameters of the solution, not only of the optimizer.
  • Low-rank fine-tuning (LoRA) and small-init adapters bias toward low-rank or sparse updates.
  • Sparse system identification: overparameterized models from small init can recover sparse dynamics without explicit L1 penalties.
  • Flat minima correlate with robustness to weight quantization on embedded hardware.

References

  1. D. Soudry, E. Hoffer, M. S. Nacson, S. Gunasekar, N. Srebro (2018). “The implicit bias of gradient descent on separable data.” JMLR, 19.
  2. S. Gunasekar, B. Woodworth, S. Bhojanapalli, B. Neyshabur, N. Srebro (2017). “Implicit regularization in matrix factorization.” NeurIPS.
  3. B. Woodworth, S. Gunasekar, J. D. Lee, E. Moroshko, P. Savarese, I. Golan, D. Soudry, N. Srebro (2020). “Kernel and rich regimes in overparametrized models.” COLT.
  4. M. S. Nacson, J. Lee, S. Gunasekar, P. Savarese, N. Srebro, D. Soudry (2019). “Convergence of gradient descent on separable data.” AISTATS.
  5. J. Cohen, S. Kaur, Y. Li, J. Z. Kolter, A. Talwalkar (2021). “Gradient descent on neural networks typically occurs at the edge of stability.” ICLR.
  6. A. Damian, T. Ma, J. D. Lee (2021). “Label noise SGD provably prefers flat global minimizers.” NeurIPS.