Overview
Curated: · Written: · Reviewed:
Bias-Variance Tradeoff
In one line
Model error splits into bias (the average fit's distance from the truth), variance (how much the fit moves across training samples) and irreducible noise. Reach for it when a train and validation result needs diagnosing, and to decide whether the next move is more data, more regularization, more capacity or better features.
Key definitions
- Bias: E[f_hat(x)] minus f(x); systematic error of the average fit, set by model family, features and objective.
- Variance: E[(f_hat(x) - E[f_hat(x)])^2]; how much the fit changes when the training sample changes.
- Irreducible noise (sigma^2): outcome variation the best predictor from these features cannot remove; the Bayes error for that representation.
- Underfitting: high error on training and validation, small gap; bias-dominated.
- Overfitting: low training error with a persistent train-validation gap; variance-dominated.
- Learning curve: performance against training size, refitting the whole pipeline at each size.
Formulas and complexity
The identity is exact for squared loss only. For AUC, log loss or 0-1 loss, treat it as a mental model: the terms move in the same directions but do not sum to the metric.
How it works
Training error falls as capacity rises, so it says nothing about generalization on its own. Compare train and validation at each training size. Curves that converge at high error are bias-limited; a persistent gap that narrows slowly is variance-limited. Curve shape picks the lever. Noisy labels inflate apparent variance, so check label consistency before calling a gap a variance problem.
When to use and when not to
| Lever | Term it moves | Cost |
|---|---|---|
| More representative rows | Variance down | Collection cost; no help if bias-limited |
| L1/L2, dropout, early stopping, pruning | Variance down | Bias up past the useful range |
| Shallower trees, fewer features | Variance down | Bias up |
| Better features or representation | Bias down | Engineering cost; can raise variance |
| Bagging / random forest | Variance down | Latency, memory; weak when bias dominates |
| Boosting | Bias down | Overfits noisy labels if rounds are unbounded |
| Stacking | Variance down (usually) | Needs out-of-fold base predictions |
Traps interviewers probe
- Quoting training accuracy as evidence. Fix: report validation performance on data the tuning never touched, alongside the gap.
- Adding rows to a bias-limited model. Curves converge at high error and extra rows change nothing. Fix: change features, representation or objective.
- Reading a plateau as a climb. A +0.009 gain against a +/- 0.015 fold spread is noise. Fix: compare each increment with the spread across folds before funding more data.
- Using a random subsample of time-ordered data for the learning curve. Later patterns leak into the smaller sets. Fix: subsample by event time and drop entities that cross the boundary.
- Treating label noise as overfitting. Fix: check whether near-duplicate inputs carry consistent labels; relabel or drop the corrupted slice before adding regularization.
Interview tips
Open with the decomposition: "Expected squared error splits into bias squared, variance and irreducible noise, and I diagnose which term dominates from learning curves." Say which bias you mean if fairness is in the room, because estimation bias and fairness bias are different quantities.
Expect these follow-ups: Would more data help? Is 99% training accuracy good? The gap is small, so are we fine? Which lever moves which term and what does it cost? Does the curve support a bigger model or a simpler one?
30-second outline: "Bias is the average fit's distance from the truth, variance is how much the fit moves across samples, and noise is the floor. I'd plot train and validation against training size on a split that respects time and entities. If both are high and flat, it's bias and I change features. If there's a persistent gap that narrows slowly, it's variance and I add representative data or regularize. I'd check the labels before concluding either, and I'd confirm any gain against the fold spread."
Feedback on this overview
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.