TL;DR
When you fit a model to data, its error on new data comes from three sources. Bias is the error from a model that is too rigid to capture the true pattern. Variance is the error from a model that is so flexible it fits the quirks of one particular training set, and would fit different quirks if the training set were different. Irreducible noise is the randomness no model can remove. Making a model more flexible usually lowers bias and raises variance, so the best model sits in the middle.
Where you'll see it: in choosing the degree of a polynomial, the depth of a decision tree, or the strength of a regularisation penalty, and in why ensembles such as Bagging and early stopping help.
Intuition
Imagine you are shown five noisy measurements of a smooth curve and asked to predict the value somewhere new. There are two easy ways to get it badly wrong.
The first is to draw a straight line no matter what the points look like. The line misses the curve's bend every time you draw a new set of points. Its mistakes are consistent, and that consistency is bias.
The second is to draw a wiggly curve that passes through every point. It is perfect on the points you have, but a different set of noisy points would produce a completely different wiggle. Its mistakes change from one training set to the next, and that instability is variance. Fitting the noise this way is Overfitting; fitting too little is underfitting.
A good model is flexible enough to follow the real curve but not so flexible that it follows the noise. Nothing removes the scatter of the measurements themselves; that part of the error is fixed.
Here is the picture in one sentence: a rigid model is wrong in the same direction every time, and a flexible model is right on average but wrong in a different direction each time.
The math
Setting up
Assume the world produces targets by a true function plus noise:
Here is the true signal at input , is random noise with mean zero and variance , and is the observed target. We train a learning algorithm on a random training set , which produces a predictor . Because the training set is random, the predictor is random too. Its expected value over training sets is written .
Define, for a fixed input :
- Bias: , the gap between the average prediction and the truth.
- Variance: , how much predictions spread around their own average.
The decomposition
Take a fresh test point with , independent of the training data. The expected squared error (the mean squared error averaged over training sets and noise) is
Derivation. Write the error as three pieces that add to :
Square the sum and take expectations. The two cross terms that contain vanish, because has mean zero and is independent of the training set. The cross term between the bias and variance pieces vanishes because . What remains is the squared bias (the first piece is a constant once is fixed), the variance, and .
The three terms have different owners. The noise belongs to the world and no model can lower it. The bias belongs to the model's assumptions. The variance belongs to how sensitive the fitted model is to the particular data it saw.
A tiny calculation
Suppose the true mean of a population is and each observation has variance . We estimate from observations, so the sample mean has variance . Consider two estimators:
- Plain sample mean, . It is unbiased, so its bias is , and its variance is . Its excess error (bias squared plus variance) is .
- Shrunken mean, for some . Its bias is , and its variance is . Its excess error is .
With the excess error is , which is slightly better than . Shrinking adds a little bias and removes more variance. Minimising over gives and an excess error of . The sweet spot is biased, which is the central message of the tradeoff. The optimum is not zero bias; it is the lowest total.
- bias squared
- variance
- total test error
- irreducible noise
Where the curves come from
The schematic above is not arbitrary. For a model family with free parameters fitted by least squares, the variance term tends to grow roughly in proportion to divided by the number of training points. The bias term tends to shrink as the family gets richer, because more shapes become reachable. The total is therefore U-shaped in complexity, with the minimum where the marginal drop in bias equals the marginal rise in variance.
Worked examples
The true signal is on with noise . We fit polynomials of degree 1, 3 and 9 to 20 random training points, many times over.
- Degree 1 (a straight line). The line cannot follow a hump, so the average prediction is far from in the middle. Bias is large; variance is small because a line barely changes from one training set to the next.
- Degree 3. The average prediction is close to across the interval. Bias is small. Variance is moderate.
- Degree 9. Each fitted curve passes almost exactly through its 20 points and swings wildly between them. The average prediction is close to , so bias is small, but the spread across training sets is large near the ends of the interval.
- Interpretation: degree 3 has the lowest total error here, not because it has the least bias, but because it has the best combination. Degree 9 is a textbook case of a model that is unbiased on average and terrible on any single draw.
Illustrative numbers: a decision tree is grown with no depth limit on 200 labelled examples and reaches zero training error. Its test error is 25%.
- Zero training error means the tree has memorised the training labels, including their noise.
- A new training sample would produce a different tree, with different splits, so its predictions vary: variance is high.
- Pruning the tree to depth 4 raises the training error to about 10% and drops the test error to about 14%.
- Interpretation: the drop in test error came from lowering variance more than the bias increased. Training error is a poor guide to test error once the model is flexible enough to memorise.
Tradeoffs and failure modes
Choosing a model is choosing a point on the bias-variance curve. The table lists how the tradeoff shows up in practice.
| Situation | Symptom | Likely cause | Better choice |
|---|---|---|---|
| Training and test error both high | Model misses obvious structure | High bias (underfitting) | More features, a richer model, or less regularisation |
| Training error low, test error much higher | Model fits noise | High variance (overfitting) | More data, stronger regularisation, early stopping, or simpler model |
| Small dataset, flexible model | Results change a lot with new samples | Variance dominated by sample size | Collect data, or average several models (bagging) |
| Very large dataset | Both errors close to the noise floor | Little left to reduce | Focus on the problem definition or measurement quality |
Some practical warnings:
- Do not read the tradeoff from training error. Training error falls monotonically with flexibility. Only held-out error, from a validation set or cross-validation, shows the U-shape.
- Noise sets a floor. If the irreducible is large, even a perfect model has high error, and tuning complexity further will look like it helps less than it does.
- Variance is not just about parameter count. Heavy regularisation, data augmentation and averaging all reduce variance without changing the model class, and that is why they are often the better fix.
- The classical picture is incomplete for very large models. Some over-parameterised neural networks keep improving past the point where classical theory predicts overfitting. Belkin and colleagues called the resulting curve "double descent". Treat the U-shape as the default mental model, and check the held-out curve for your own model.
History
The name is modern, but the idea is old. Statisticians had known since the 1950s and early 1960s that biased estimators can beat unbiased ones in mean squared error. Charles Stein showed in 1956 that the sample mean is inadmissible for estimating several normal means at once, and William James and Stein gave an explicit shrinkage estimator in 1961. Regularised methods such as ridge regression, which trade bias for lower variance, came from the same line of thought.
The tradeoff as a named dilemma was popularised by Stuart Geman, Elie Bienenstock and René Doursat in a 1992 paper on neural networks, "Neural Networks and the Bias/Variance Dilemma". They framed the question as the core obstacle to learning from finite data, and the phrase spread through machine learning textbooks over the following decade.
It caught on because it explained two things that looked contradictory at the time: why more complicated models sometimes generalise worse, and why averaging over many models can improve them. The decomposition gives both a single explanation. In 2018 and 2019 Belkin and coauthors showed that very large models can break the classical U-shape, which is why the tradeoff is now treated as a useful default rather than a law.
Check yourself
QuestionName the three parts of expected test error and say which one a model cannot reduce.Show answer
The three parts are squared bias, variance, and irreducible noise . The noise cannot be reduced by any model, because it comes from the randomness in the targets themselves. Bias comes from the model's assumptions about the shape of the function, and variance comes from sensitivity to the particular training sample.
QuestionA predictor has bias 0.3 and variance 0.5 at a point, and the noise variance is 0.2. What is its expected squared error there?Show answer
Add the three terms: .
QuestionWhy does an unbiased estimator not always give the lowest error?Show answer
Because expected error also includes variance. An unbiased estimator can have large spread across samples, and a slightly biased estimator with much smaller spread can have lower total error. The shrunken mean with in the worked calculation beats the plain sample mean for exactly this reason, even though it is biased.
QuestionA deep neural network has near-zero training error and much higher test error. You can either add more training data or make the network smaller. Which lever targets which term, and what would you check first?Show answer
More data mainly lowers variance, because the fitted model depends less on the particular sample. A smaller network lowers variance by restricting the model class, but it may raise bias if it becomes too rigid. Before changing anything, check the held-out curve as a function of model size and data size, since very large models may not follow the classical U-shape and the answer depends on where you sit on the curve.