Bias vs Variance in Machine Learning
Every prediction error splits into two parts — being too simple, and being too sensitive. You cannot zero both, the fixes are opposites, and telling them apart takes ten seconds.
Every prediction error a model makes breaks into two parts.
Bias is error from the model being too simple to represent the truth. Variance is error from the model being too sensitive to the particular data it happened to see. You cannot drive both to zero at once, and the trade between them is the single most useful idea in applied machine learning.
Three models, same nine points
The middle one is wrong about every single point. It is also the only one you would trust on data it has not seen.
Bias is being confidently wrong in a consistent way. Variance is being right about this data and wrong about the next batch. The flat line has high bias — it is wrong the same way forever. The wiggly curve has high variance — it is perfect here and will be nonsense an inch to the left.
Why you cannot have both
Bias comes from restricting your model. Variance comes from freeing it. They are the same dial turned in opposite directions.
- Make the model simpler → it can no longer chase noise → variance falls, bias rises.
- Make the model more flexible → it can fit finer structure, including the noise → bias falls, variance rises.
Total error is roughly the sum of the two, plus noise you can never remove:
That third term is the part of the world your features simply do not explain. No model, however clever, gets below it. Chasing it is how people end up overfitting.
The chart
Training error falls forever. That is why training accuracy is not evidence of anything — a model with enough freedom will drive it to zero by memorising, and a memoriser scores 100% on the exam it has already seen.
Test error is the one that matters, and it is U-shaped. It falls while the model is still learning real structure, bottoms out, then climbs as the model starts learning noise.
Diagnosing a model in ten seconds
Compare the two numbers. The answer is always one of three things:
Test error high
Test error high
Test error low
This matters because the fixes are opposites. More training data fixes variance and does nothing for bias. A bigger model fixes bias and makes variance worse. Getting the diagnosis backwards means every change you make moves the wrong direction, which is the single most common way a project stalls.
Why this explains so much else
Almost every technique you will meet is a move in this trade:
- L1 and L2 regularization — deliberately add bias by penalising large weights, to buy a larger reduction in variance.
- More training data — reduces variance without touching bias, which is why data usually beats cleverness.
- Bigger models — reduce bias, and need more data or more regularization to keep variance in check. This is the entire story of why modern models are both enormous and trained on enormous corpora.
- Ensembles — average many high-variance models so their errors cancel. Variance falls, bias stays put.
- A held-out test set — the only instrument that can measure variance at all. Without one you are flying blind, which is why it is non-negotiable.
The short version
- Bias = too simple, wrong in a consistent way, more data will not save you.
- Variance = too sensitive, perfect on what it has seen, unreliable on what it has not.
- Training error always falls; test error is U-shaped. Trust only the second.
- Diagnose with the two numbers before you change anything, because the fixes are opposites.
Related
- Overfitting vs underfitting — the same idea, diagnosed in practice.
- L1 vs L2 regularization — the most common way to buy variance down.
- Gradient descent, by hand — the process that does the fitting in the first place.
- How models learn — the plain-English version, no maths.