The Implicit Bias of Gradient Descent
Which of many zero-loss solutions the optimizer picks.
When a model can fit its training data in infinitely many ways, the optimizer decides which fit you get. Gradient descent turns out to have strong, sometimes exactly computable preferences: the closest interpolant for least squares, the maximum margin for separable classification, sparsity or low rank for factorized models. This lesson proves the clean cases and maps where the theory stops.
What you’ll learn
- Prove that mirror descent, and gradient descent as a special case, converges on underdetermined regression to the interpolant closest to its initialization in its own geometry.
- State the theorem of Soudry et al. on separable logistic regression, explain the maximum-margin limit through the KKT conditions, and quantify how slow the convergence is.
- State what is known for homogeneous networks: monotone normalized margins, KKT points of a margin problem, and directional convergence.
- Explain the implicit bias of diagonal networks and deep matrix factorization, and the evidence that it is about rank rather than any norm.
Least squares in any geometry
For underdetermined least squares, gradient descent from converges to the interpolant nearest to in Euclidean distance, by the row-space argument of Generalization in Modern ML. Mirror descent replaces the Euclidean geometry by a strongly convex potential : it takes gradient steps in the dual variable, (Mirror Descent & Natural Gradient). Its implicit bias is the matching notion of distance, the Bregman divergence .
Every gradient is a combination of the training inputs, . So the dual iterates move only within an affine subspace, and by continuity of so does the limit:
Now write the optimality (KKT) conditions of the Bregman projection subject to . The gradient of the objective in is , so the conditions are feasibility plus stationarity:
satisfies both: it interpolates because it is a global minimizer and the loss vanishes only at the labels, and the first step gives stationarity. The problem is convex with a strictly convex objective, so the KKT conditions are sufficient and the solution is unique: is the Bregman projection of . Step sizes, and even dual momentum from (their Theorem 1b), do not change it.
With the entropy potential on the simplex (exponentiated gradient) from the uniform start, the limit is the maximum-entropy interpolant (Theorem 1a). The characterization is special to potentials: steepest descent with respect to a general norm, which is not mirror descent, can converge on the squared loss to a solution that depends on the step size and is not the nearest one in that norm, even as the step size goes to zero (Gunasekar et al., 2018, Example 4 with the norm).
Mirror descent with for a positive definite is run from on an underdetermined least-squares problem and converges to an interpolant. Which one?
- The interpolant of minimum Euclidean norm
- The interpolant minimizing
- The interpolant minimizing
- It depends on the step sizes
Show the answer
B. The interpolant minimizing
For a quadratic potential, , so the limit is the nearest interpolant in the -norm, independent of step sizes. This is preconditioned gradient descent: the preconditioner reshapes the implicit bias, which is why changing the optimizer can change which solution, and which generalization, you get.
Separable classification: the maximum-margin direction
No finite minimizer. For a separator , at every finite , so there is no critical point. Gradient descent drives the loss to zero, the norm to infinity and every margin to (their Lemma 1).
Only the closest points matter. Suppose with , scaled so that . In the negative gradient each point carries weight , so the points with dominate and all others are exponentially suppressed:
Self-consistency. For gradient flow to keep moving along , the direction must be a nonnegative combination of the points on its margin, and forces . Those are exactly the KKT conditions of the hard-margin SVM: stationarity with nonnegative multipliers, and complementary slackness (zero multipliers off the margin):
The rigorous proof controls the residual . The conclusion depends on the tail: Nacson et al. (2019) show that gradient descent on linear networks of any depth converges in direction to the maximum margin for a large family of super-polynomially tailed losses but not for heavier tails, and that for the exponential loss aggressive step sizes improve the rate to .
Suppose the direction error behaves like . After steps it is . After how many steps will it be half that? Give the exponent of .
Show the answer
6
Halving requires doubling , that is, squaring : . Each further halving squares the step count again (, then ). The loss, by contrast, falls like : by the time it looks converged, the direction may still be far from the maximum-margin one, so predictions on new points can keep shifting long after every training point is classified correctly.
Two extensions. Without separability, the logistic-regression iterates follow a ray: its direction is the maximum-margin predictor of a maximal linearly separable subset of the data, reached at rate , and its offset is the bounded minimizer of the risk on the remaining data (Ji & Telgarsky, 2019). And for the exponential loss, steepest descent with respect to any norm converges to the maximum margin in that norm (Gunasekar et al., 2018, Theorem 5); the case is coordinate descent, the margin-maximizing behavior studied for boosting (Why Boosting Resists Overfitting).
Homogeneous networks
A KKT point is a first-order stationary point of margin maximization, not necessarily a maximizer: the constraints are nonconvex for deep networks, and Lyu & Li note that examples where gradient descent misses the globally maximal normalized margin are easy to construct. Vardi, Shamir & Srebro (2022) went further: for several architectures with linear and ReLU activations, the KKT point reached need not even be a local optimum of the margin problem. Ji & Telgarsky (2020) showed that the direction does converge (a limit exists, not just limit points) for gradient flow on networks built from ReLU, max-pooling, linear and convolutional layers, needing only perfect classification at some time, and, for networks with locally Lipschitz gradients, that the gradients asymptotically align with the parameters.
In the infinite-width limit of two-layer homogeneous networks, Chizat & Bach (2020) characterized the limit of gradient flow on exponentially tailed losses as a max-margin classifier in a non-Hilbertian space of functions, with margins independent of the ambient dimension when the data have hidden low-dimensional structure; training only the output layer instead solves a kernel SVM, which lacks that adaptivity. For the squared loss the picture is murkier: even for a single ReLU neuron, the implicit regularization cannot be written as any explicit function of the parameters (Vardi & Shamir, 2021).
What does the Lyu–Li theorem not guarantee for a homogeneous ReLU network trained to separate its data?
- That the normalized margin (in smoothed form) never decreases after the data are separated
- That the parameters grow without bound while the loss tends to zero
- That the limit direction attains the largest normalized margin achievable by the architecture
- That limit directions satisfy first-order optimality conditions of a margin-maximization problem
Show the answer
C. That the limit direction attains the largest normalized margin achievable by the architecture
KKT conditions are necessary but not sufficient for global optimality of a nonconvex problem. Gradient flow ends at a stationary point of margin maximization, possibly a poor one; only for linear models, where the problem is convex, does this pin down the maximum margin.
Factorized models: sparsity and rank
The initialization scale is a regularization knob: large initializations keep the model near its linearization (a kernel method), small ones let it select features. The transition is lopsided. A polynomially large already gives a squared norm within a factor of the minimum, but the behavior emerges only with corrections of order , and their Theorem 2 guarantees an norm within of the minimum only for exponentially small in the dimension. That condition is only sufficient; they prove that a polynomially small is necessary for to approximate a multiple of the norm in every direction at once.
Take the simplest deep model, a scalar product trained by gradient flow on a loss , starting balanced (). Each factor follows , so is the same for every : balance is preserved, and .
By the chain rule, , and balance turns each product into :
For this is plain gradient flow. For the factor vanishes at : components that start small grow slowly, large ones fast, so learning proceeds roughly one component at a time and weak components stay near zero. Arora, Cohen, Hu & Luo (2019, Theorem 3) proved the matrix version for deep linear networks with balanced initialization: each singular value of the product obeys the same law, with replaced by the projection of the gradient onto its singular vectors.
For matrix sensing with a full-dimensional factorization and infinitesimal initialization, Gunasekar, Woodworth, Bhojanapalli, Neyshabur & Srebro (2017) conjectured that gradient flow finds the minimum nuclear-norm solution, and proved it when the measurement matrices commute. The evidence since points to rank rather than any norm. Arora et al. (2019) found that depth strengthens the pull toward low rank and questioned norm-based descriptions; Razin & Cohen (2020) proved that on certain matrix-completion problems the implicit regularization drives every norm and quasi-norm to infinity while the rank goes down; and Li, Luo & Lyu (2021) showed that, under assumptions, depth-2 gradient flow from infinitesimal initialization is equivalent to a greedy low-rank learning algorithm, which yields counterexamples to the nuclear-norm conjecture (Matrix Completion Theory covers the explicit nuclear-norm approach).
Noise, step sizes and stopping
| Algorithm and model | Implicit bias |
|---|---|
| Gradient descent, least squares, from | nearest interpolant to in Euclidean norm |
| Mirror descent with potential | Bregman projection: over interpolants |
| Gradient descent, exponentially tailed loss, separable data | maximum-margin direction, at rate about |
| Steepest descent in a norm, exponential loss | maximum margin in that norm |
| Homogeneous networks, gradient flow | KKT points of margin maximization in parameter space |
| Diagonal networks, initialization scale | (large ) to (small ) |
| Deep matrix factorization, small initialization | low rank, not captured by any norm in some problems |
| Gradient flow stopped at time , least squares | close to ridge with : risk at most 1.6862 times ridge's (Ali, Kolter & Tibshirani, 2019, Theorem 1) |
| SGD with label noise | stationary points of the loss plus a penalty on sharpness (Damian, Ma & Lee, 2021) |
The last row deserves a word. Blanc, Gupta, Valiant & Valiant (2020) showed that label-noise SGD near zero training error behaves as if penalized by the sum of squared gradient norms of the model at the data points, and Damian, Ma & Lee (2021) proved that SGD with label noise converges to a stationary point of a regularized loss , where penalizes sharp minimizers and the effective depends on the step size, the noise level and the batch size. Large step sizes add another effect, training at the edge of stability (Training Dynamics & the Edge of Stability), and flat minima are discussed in Why Big Networks Generalize.
Key takeaways
- Mirror descent on underdetermined regression converges, when it interpolates, to the Bregman projection of its starting point onto the interpolants, whatever the step sizes; gradient descent is the Euclidean case.
- On separable data, gradient descent on exponentially tailed losses converges in direction to the hard-margin SVM, , but only at rate about , while the loss falls like .
- For homogeneous networks, normalized margins (smoothed) increase after separation and limit directions are KKT points of margin maximization, not necessarily global maximizers; the direction converges.
- Initialization scale moves diagonal networks from minimum (kernel regime) to minimum (rich regime); depth makes large components grow first, and in matrix factorization the bias looks like low rank, not like any norm.
- Stopping time, step size and label noise are regularizers too: early stopping tracks ridge with , and label-noise SGD penalizes sharpness.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
On separable data, the logistic loss of gradient descent decays like while the margin approaches its maximum like . What follows?
- Stopping as soon as the training loss is tiny can leave a classifier far from the maximum-margin one; its margin keeps improving if training continues
- Once the training loss is tiny, the classifier has converged
- The weights converge to a finite vector
- The direction converges faster than the loss
Show the answer
A. Stopping as soon as the training loss is tiny can leave a classifier far from the maximum-margin one; its margin keeps improving if training continues
Loss and direction converge on very different time scales: the loss can be exponentially small in before the direction is close. Training past zero training error keeps enlarging the normalized margin, which can still change predictions on test points.
Gradient descent on the logistic loss is run on linearly separable data. Which training points determine the direction it converges to?
- All points equally
- The points farthest from the decision boundary
- Only the support vectors of the hard-margin SVM; moving another point, while keeping it strictly outside the margin, leaves the limit unchanged
- The points that were misclassified at initialization
Show the answer
C. Only the support vectors of the hard-margin SVM; moving another point, while keeping it strictly outside the margin, leaves the limit unchanged
The limit direction is the hard-margin SVM solution, a nonnegative combination of the points on its margin. Points beyond the margin receive exponentially vanishing weight in the gradient, so they do not affect the limit, though they do affect the early iterates.
Under balanced gradient flow, a depth- scalar factorization obeys . What does depth do to a component that starts near zero?
- It grows at the same rate as in plain gradient descent
- It grows slowly at first, because vanishes at zero, so large components are learned first and weak ones tend to stay near zero
- It grows fastest, because small components have the largest gradients
- It is set exactly to zero, like the lasso
Show the answer
B. It grows slowly at first, because vanishes at zero, so large components are learned first and weak ones tend to stay near zero
The depth factor multiplies the gradient by a power of the component's own size. Components near zero barely move until the large ones have been fit: an incremental, rich-get-richer dynamic that biases toward sparse or low-rank solutions. For the factor is 1 and there is no such effect.
Razin & Cohen (2020) found matrix-completion problems on which gradient flow over a matrix factorization drives every norm and quasi-norm of the solution to infinity. What does this show?
- That gradient flow diverges and fails to fit the observed entries
- That the nuclear-norm conjecture holds for deep factorizations
- That explicit regularization is always needed for matrix completion
- That the implicit regularization in these problems cannot be described as minimizing any norm; minimizing rank is a better description
Show the answer
D. That the implicit regularization in these problems cannot be described as minimizing any norm; minimizing rank is a better description
If the solutions found have unbounded norms while fitting the data, no norm can be what is being minimized. The rank, by contrast, decreases, which supports rank-based descriptions of the implicit bias, in line with Li, Luo & Lyu's greedy low-rank characterization.
Further reading
- D. Soudry, E. Hoffer, M. S. Nacson, S. Gunasekar & N. Srebro, "The implicit bias of gradient descent on separable data," Journal of Machine Learning Research 19, 1–57 (2018).
- S. Gunasekar, J. Lee, D. Soudry & N. Srebro, "Characterizing implicit bias in terms of optimization geometry," Proceedings of the 35th International Conference on Machine Learning, PMLR 80, 1832–1841 (2018).
- K. Lyu & J. Li, "Gradient descent maximizes the margin of homogeneous neural networks," International Conference on Learning Representations (2020).
- S. Arora, N. Cohen, W. Hu & Y. Luo, "Implicit regularization in deep matrix factorization," Advances in Neural Information Processing Systems 32 (2019).
- B. Woodworth, S. Gunasekar, J. D. Lee, E. Moroshko, P. Savarese, I. Golan, D. Soudry & N. Srebro, "Kernel and rich regimes in overparametrized models," Proceedings of the 33rd Conference on Learning Theory, PMLR 125, 3635–3673 (2020).