§ 1.8Module I

Bias–Variance Trade-off

1.8 — Bias–Variance Trade-off

Recall first. Consider a very simple model and a very flexible model trained on different samples from the same population. Which one is more likely to give nearly the same prediction every time? Which one is more likely to chase quirks of the sample?

First, remove the ambiguity around “bias”

In this note, bias means systematic prediction error from a model family that cannot represent the underlying pattern well. It is not:

Variance means how much the fitted model’s prediction changes when the training sample changes. To discuss variance, imagine repeatedly drawing different training sets from the same population and fitting the same learning procedure to each one.12

The squared-error decomposition

For a fixed input x, suppose the target is:

Y = f(x) + ε

where f(x) is the underlying signal and ε is irreducible noise with mean zero. If f̂_D(x) is the model fitted on training set D, then under squared loss:

E[(Y − f̂_D(x))²]
  = noise variance + Bias[f̂_D(x)]² + Variance[f̂_D(x)]

with:

Bias = E_D[f̂_D(x)] − f(x)
Variance = E_D[(f̂_D(x) − E_D[f̂_D(x)])²]

The expectation over D asks what happens across possible training samples. The decomposition explains why lowering training error is not the whole goal: a model can trade lower bias for higher variance.23

What model complexity changes

Model familyBiasVarianceTypical symptom
Too simpleHighLowConsistently misses the pattern; underfits
Appropriate complexityModerateModerateGood transfer to new data
Too flexibleLow on the training sampleHighFits quirks; overfits

A simple model makes similar predictions across datasets, but they may all be wrong in the same direction. A flexible model can fit a wider range of patterns, but its fitted details may change greatly when the sample changes.

prediction error
  ^                 total test error
  |                    \__/
  |  bias²  \          /
  |          \        /
  |           \______/   variance rises →
  +----------------------------------------> complexity

The U-shaped total-error curve is a useful heuristic. Its exact shape depends on the data, model, loss, and training procedure.

Worked numerical intuition

Assume the true mean target at one input is 10. Fit a simple model on three different training samples:

predictions: 8, 8, 8

Its mean prediction is 8: squared bias is (8 − 10)² = 4, and variance is 0 in this toy set.

Now fit a flexible model on three different samples:

predictions: 6, 10, 14

Its mean prediction is 10: squared bias is 0, but its variance is:

((6−10)² + (10−10)² + (14−10)²) / 3 = 32/3 ≈ 10.67

The flexible model is centered correctly in this toy example but is unstable across training samples. More flexibility did not automatically create a better expected prediction.

How to respond to the trade-off

To reduce high variance:

To reduce high bias:

More data often helps variance more than bias. A more flexible model often lowers bias but can raise variance. These are tendencies, not promises; validation data decides what works for the actual problem.14

Bias–variance is not the same as training vs. test error

Training/test behavior helps diagnose the trade-off, but the concepts are different:

A validation curve can reveal the practical result of the trade-off, while the decomposition explains one reason the curve can exist.

Exercise

A model’s training and validation errors are both high and close. A second model has very low training error and much higher validation error. Which component is likely dominant in each case, and what is one remedy?

Answer

The first model is likely high-bias/underfitting; improve features or use a more expressive model, while checking the data and objective. The second is likely high-variance/overfitting; simplify or regularize it, collect representative data, or select complexity using validation.

Exam lens

Definition: bias is systematic error of the model family; variance is sensitivity of the fitted model to the training sample.

Formula to remember: under squared loss, expected prediction error = irreducible noise + bias² + variance.

Diagram to reproduce: as complexity rises, bias² tends to fall, variance tends to rise, and total validation/test error often forms a U-shape.

Common traps:

Rapid revision

Sources

Footnotes

  1. Mitchell, T. M. (1997). Machine Learning. McGraw-Hill — generalization, model complexity, and bias–variance foundations. 2

  2. Alpaydın, E. (2020). Introduction to Machine Learning, 4th Ed. MIT Press — expected prediction error and the bias–variance trade-off. 2

  3. Stanford University, CS229, “Course Materials.” https://cs229.stanford.edu/materials.html-withcomments — learning theory, regularization, and model-selection lecture materials.

  4. NPTEL, “Machine Learning” course preview. https://onlinecourses.nptel.ac.in/noc21_cs85/preview — overfitting, bias, variance, evaluation, and cross-validation topics.