The Bias-Variance Tradeoff
Volume I, Chapter 3 — Part VI. Rigorous derivation of the bias-variance decomposition, analysis for linear and k-NN estimators, model complexity, regularization, double descent in overparameterized models, and implications for deep learning generalization.
Prerequisites
Table of Contents
- Learning Objectives
- Prerequisites
- Notation
- Core Intuition
- Problem Setup and Expected Prediction Error
- The Bias-Variance Decomposition Theorem
- Bias, Variance, and Irreducible Error
- Examples: Linear Regression and Ridge
- k-Nearest Neighbors and Model Complexity
- The Classical U-Curve and Model Selection
- Regularization as Bias-Variance Control
- Double Descent in Overparameterized Models
- Beyond Squared Loss: Classification and Other Losses
- Connection to Machine Learning Practice
- Common Pitfalls and Misconceptions
- Research Perspective
- Summary of Takeaways
- Exercises
Learning Objectives
After reading this chapter, you should be able to:
- Define expected prediction error (EPE) and decompose it into irreducible noise, bias squared, and variance.
- Prove the bias-variance decomposition for squared loss with no gaps in the cross-term arguments.
- Compute bias and variance for linear regression (OLS and Ridge) and interpret their dependence on model complexity.
- Explain how in k-NN controls the bias-variance tradeoff.
- Describe the classical U-curve of test error vs model complexity and how regularization navigates it.
- State the double descent phenomenon and explain implicit regularization in overparameterized models.
- Connect the decomposition to Maximum Likelihood Estimation, overfitting, and generalization in deep learning.
Prerequisites
- Maximum Likelihood Estimation: MLE, Gaussian noise model leading to MSE, finite-sample behavior.
- Bayes' Theorem: posterior vs point estimates, irreducible Bayes error.
- The Multivariate Gaussian: linear regression noise models, conditional expectation.
- Positive Definite Matrices: Ridge regression, .
- Gradient Descent: SGD as implicit regularization.
Notation
- — True regression function
- — Estimator trained on dataset
- — Expectation over training data
- — Bias and variance of an estimator
- — Irreducible noise variance
Core Intuition
Why does a model that fits the training data perfectly often fail on new data? Why does a linear model underfit nonlinear patterns? The bias-variance tradeoff provides a precise answer: every prediction error has three sources, and simpler vs more complex models allocate error differently between them.
- Bias captures systematic error — the model family cannot represent the truth.
- Variance captures sensitivity to the particular training sample — the model overfits noise.
- Irreducible noise is inherent randomness no model can eliminate.
The classical story: as model complexity increases, bias decreases but variance increases. Test error follows a U-shape, minimized at intermediate complexity. Modern deep learning complicates this picture: massively overparameterized networks can generalize well despite interpolating training data — the double descent phenomenon.
This chapter derives the decomposition rigorously and applies it to linear models, k-NN, regularization, and contemporary overparameterized regimes.
Series context. This is Part VI of Chapter 3 (Probability & Statistical Learning) in Volume I. It synthesizes MLE, Bayes' Theorem, and prepares for regularization and generalization theory in Volume II.
Bias-Variance Tradeoff
BalancedProblem Setup and Expected Prediction Error
Data generating process. Observations are drawn i.i.d. from a joint distribution. We model:
where is the regression function (conditional mean). Noise has mean zero and variance .
Learning. Given training set , we learn a predictor — a function of both the data and the query point .
Goal. Minimize expected prediction error (EPE) at a new test point :
where expectation is over: (i) random training set , (ii) test noise given .
Definition 1 (Average EPE). The average expected prediction error is:
We derive the decomposition at fixed ; averaging over gives the global version.
The Bias-Variance Decomposition Theorem
Definition 2 (Average Predictor). The average predictor at is:
the mean prediction over all possible training sets of size .
Definition 3 (Bias). The bias of at is:
Definition 4 (Variance). The variance of at is:
Theorem 1 (Bias-Variance Decomposition). Under the model (1), for fixed :
Proof. Write where , , and is independent of and .
Step 1 — Add and subtract terms. Insert and :
Step 2 — Square and take expectation.
where is a constant (not random w.r.t. ).
Step 3 — Expand the square.
Step 4 — Show cross-terms vanish.
(Cross-term 1.) since is independent of everything and mean zero.
(Cross-term 2.) by independence of test noise from training data.
(Cross-term 3.) since implies .
Step 5 — Identify remaining terms.
Therefore (7) holds.
Remark. The decomposition is exact for squared loss and the additive noise model (1). It does not require linearity of or .
Bias, Variance, and Irreducible Error
Irreducible noise . The variance of given that cannot be reduced by any predictor. This is the Bayes error for squared loss — the error of the optimal predictor .
Bias². Measures systematic mis-specification. If the model family cannot represent , then even with infinite data. Example: fitting a line to quadratic data.
Variance. Measures instability across training sets. High variance: small changes in produce large changes in . Example: nearest neighbor (memorization).
The tradeoff (classical view). Increasing model complexity:
- Decreases bias — richer function class approximates better.
- Increases variance — more parameters fit noise in .
Total error may be minimized at intermediate complexity.
Proposition 1. For squared loss, the oracle predictor minimizing EPE at is , with error exactly .
Examples: Linear Regression and Ridge
Ordinary Least Squares (Fixed Design)
Model: with .
Assume the true relationship is linear: .
Bias. , so when .
If the true is nonlinear, OLS has nonzero bias — the best linear approximation.
Variance. With :
Proof sketch. . Since :
The second term has mean zero and variance .
Interpretation. Variance is large when lies in directions where has small eigenvalues — extrapolation beyond the training hull.
Ridge Regression
.
Bias increases: — shrinkage toward zero.
Variance decreases: Eigenvalues of are smaller than those of .
Theorem 2 (Ridge Bias-Variance Tradeoff). There exists that minimizes (averaged over ) when (OLS) has excessive variance.
See Positive Definite Matrices for the geometry of Ridge as perturbing the Gram matrix.
k-Nearest Neighbors and Model Complexity
Predictor. — average of nearest neighbors.
Complexity parameter. controls model flexibility:
- — Low (zero on training) — High — Interpolation, memorization
- — High (predicts ) — Zero — Constant prediction
- Intermediate — Moderate — Moderate — Smoothing
Proposition 2. As : and (under smoothness).
As : and .
Optimal . Typically for -dimensional features — curse of dimensionality increases optimal .
The Classical U-Curve and Model Selection
Model complexity can be measured by: number of parameters, VC dimension, in k-NN, degree of polynomial, tree depth, etc.
Classical U-curve. Plot test EPE vs complexity:
- Underfitting region (low complexity): High bias, low variance, high total error.
- Sweet spot: Bias and variance balanced, minimum test error.
- Overfitting region (high complexity): Low bias, high variance, high total error.
Model selection. Choose complexity (or regularization strength ) to minimize estimated test error — cross-validation, AIC, BIC. AIC/BIC connect to Maximum Likelihood Estimation via penalized log-likelihood.
Proposition 3. Training error decreases monotonically with complexity (for nested models), but test error is U-shaped (classically).
Regularization as Bias-Variance Control
Principle. Regularization increases bias (shrinks toward simpler models) to decrease variance, reducing total error when variance dominates.
Examples.
- Ridge () — Penalty — Shrinks coefficients, reduces variance
- Lasso () — Penalty — Sparsity, reduces effective complexity
- Early stopping — Stop gradient descent before convergence — Limits effective model capacity
- Dropout — Random neuron masking — Ensemble-like variance reduction
- Weight decay — on neural network weights — Ridge analog in deep learning
Theorem 3 (Explicit Bias-Variance for Ridge — Sketch). For linear model with :
where and increases with .
Connection to MAP. Ridge regression is MAP under Gaussian prior — see Bayes' Theorem. The prior introduces bias intentionally.
Double Descent in Overparameterized Models
Classical U-curve breaks down when model complexity exceeds sample size (interpolation threshold).
Three regimes.
- Underparameterized (): Classical U-curve — optimal complexity in the middle.
- Interpolation threshold (): Test error spikes — model can interpolate noise.
- Overparameterized (): Test error decreases again — "double descent."
Explanation (minimum-norm interpolation). Among all satisfying (exact fit), gradient descent converges to the minimum norm solution:
This implicit regularization reduces variance despite zero training error.
Neural networks. Massive overparameterization () with SGD, weight decay, and architectural biases (convolutions, skip connections) yields low test error — effective complexity is controlled by implicit rather than explicit parameter count.
Proposition 4. Double descent is not a violation of the bias-variance decomposition — it reflects that the decomposition still holds but variance can decrease in the overparameterized regime due to implicit regularization.
Remark. The bias-variance tradeoff remains valid at each fixed training procedure; what changes is how complexity maps to in modern architectures.
Beyond Squared Loss: Classification and Other Losses
Classification. For 0-1 loss, a similar decomposition exists but with different structure. For squared loss on probability estimates (Brier score), the decomposition applies to calibrated probabilities.
Connection to cross-entropy. From KL Divergence, minimizing cross-entropy relates to bias in probability estimates. Overconfident wrong predictions indicate high bias in the softmax outputs; instability across training runs indicates variance.
Bayes error for classification. Irreducible error is — the error of the Bayes classifier.
Connection to Machine Learning Practice
Diagnosing Underfitting and Overfitting
- High training error: High bias (underfitting) — increase capacity, reduce regularization.
- Low training error, high validation error: High variance (overfitting) — regularize, more data, reduce capacity.
- Both low: Good generalization (modulo ).
Ensembling and Variance Reduction
Bagging averages predictors trained on bootstrap samples — reduces variance without increasing bias much. Random forests extend this. Bias-variance analysis: ; averaging independent models divides variance by .
Data Size and the Tradeoff
As : variance for consistent estimators; bias remains (model mis-specification). More data helps variance-dominated problems most.
Deep Learning
Modern networks operate in the overparameterized, double-descent regime. Generalization depends on:
- Implicit bias of Gradient Descent (SGD noise, early stopping)
- Architecture (inductive bias reducing effective complexity)
- Regularization (weight decay, dropout, data augmentation)
The classical U-curve is insufficient alone — but bias, variance, and still decompose the error.
Common Pitfalls and Misconceptions
Pitfall 1: Applying the decomposition to training error. The theorem concerns expected test error, not training error. Training error has a different (optimistic) bias.
Pitfall 2: Assuming bias and variance always trade off monotonically in complexity. Double descent shows variance can decrease after the interpolation threshold.
Pitfall 3: Confusing high variance with high noise. is irreducible noise in ; variance of is reducible with more data or regularization.
Pitfall 4: Ignoring model mis-specification. Zero variance with wrong model class still yields high bias — ensembling wrong models does not fix systematic error.
Pitfall 5: Treating the decomposition as only for squared loss. Extensions exist for other losses; the squared-loss version is the cleanest and most used.
Pitfall 6: Equating parameter count with effective complexity. Overparameterized networks have many parameters but low effective complexity due to implicit regularization.
Research Perspective
The bias-variance decomposition for squared loss was formalized by Geman, Bienenstock, and Doursat (1992) in the neural network context, though components appeared earlier in statistics (Hoerl & Kennard, 1970 for Ridge). The classical U-curve guided model selection for decades.
Double descent was documented systematically by Belkin et al. (2019) and Spigler et al. (2019), reviving interest in interpolation and benign overfitting. Neural tangent kernel theory and implicit regularization of SGD aim to explain why deep networks generalize despite massive capacity.
Open questions: tight bias-variance estimates for deep networks, role of data augmentation, and whether scaling laws (Kaplan et al., 2020) reflect fundamental bias-variance tradeoffs or new phenomena.
Summary of Takeaways
-
Irreducible noise — — Inherent randomness
-
Bias² — — Model mis-specification
-
Variance — — Sensitivity to training data
-
EPE — — Total expected test error
-
Complexity ↑ — Bias ↓, Var ↑ (classically) — U-curve
-
Regularization — Bias ↑, Var ↓ — Navigate U-curve
-
Double descent — Var ↓ again when — Implicit regularization
-
Underfitting — High — Low — High
-
Classical optimum — Medium — Medium — Lowest
-
Overfitting (interpolating) — Low — High — High
-
Overparameterized (modern) — Low — Moderate* — Good
*With SGD, weight decay, architecture.
Next in Volume II: Linear Regression — applying these principles to the foundational supervised learning algorithm.
Exercises
Exercise 1 (Proof). Verify all three cross-terms in the proof of Theorem 1 vanish, stating independence assumptions explicitly.
Exercise 2 (OLS variance). Derive (12) completely for fixed design matrix .
Exercise 3 (Ridge). Express and in terms of .
Exercise 4 (k-NN). For and deterministic , show on training data and characterize variance at a training point.
Exercise 5 (Bias). Fit when true . Compute asymptotic bias of OLS at .
Exercise 6 (Double descent). Explain why has lower norm than a generic interpolating solution and why this reduces variance.
Exercise 7 (Conceptual). Why does bagging reduce variance but not bias?
Exercise 8 (Extension). State how the irreducible error term changes for classification with 0-1 loss.