datarekha
Patterns June 2, 2026

The bias-variance tradeoff, drawn from scratch

Model error is not one thing — it is the sum of two competing forces, and the art of machine learning is finding the narrow valley between them.

10 min read · by datarekha · machine-learningbias-variancemodel-selectiongeneralization

There is a moment every machine learning practitioner recognizes. You add more parameters — another layer, higher polynomial degree, deeper tree — and the training error keeps falling, ticking toward zero with the patient satisfaction of a debt being repaid. Then you look at the test set, the held-out data your model has never seen, and the error is going the wrong way. It is rising. You have left the valley and are climbing the far slope of something shaped like a U.

That shape has a name: the bias-variance tradeoff. It is the central organizing fact of statistical learning, and most explanations of it either stop too early (the dartboard metaphor, nothing more) or retreat immediately into algebra. This is neither. This is the mechanics of why that U exists, why it cannot be wished away, and what the two genuine levers are that let you move it.

Error is not one thing

When a model makes a prediction on a data point it has not seen before, the gap between that prediction and the truth is the test error. The standard instinct is to treat error as a single quantity to be minimized. That instinct is wrong in a productive way.

Expected test error — averaged over all the different training sets you could have drawn from the world, and all the test points you might be asked about — decomposes cleanly into three pieces. The first is irreducible noise: the inherent randomness in the data that no model can capture, because the world itself is not deterministic. You cannot engineer your way out of this. The second and third pieces are what you can control: bias and variance.

Bias is the systematic component of your error. It measures how wrong your model is on average, across all the training sets you could have drawn. A high-bias model has a flawed mental model of the world baked in — it consistently predicts too low, or misses a curve because it only knows straight lines. Bias comes from the model’s assumptions being a poor match for reality.

Variance is the sensitivity component. It measures how much your model’s predictions swing when you train it on a different sample of data drawn from the same distribution. A high-variance model is deeply shaped by the particular accidents of its training set — it memorizes noise, mistakes random fluctuations for signal, and produces very different predictions if you re-run the experiment with a slightly different batch of examples.

The total expected error is roughly: bias^2 + variance + noise. The noise is fixed. Everything else is a negotiation.

The dartboard, taken seriously

The dartboard analogy circulates because it earns its keep. Imagine throwing a hundred darts at a board, each throw representing a model trained on a different sample. Bias is the distance between the average landing spot and the bullseye — how systematically off-center you are. Variance is the spread of the cluster — how scattered your throws are around wherever their average happens to land.

You can be low-bias and low-variance: your darts cluster tightly around the bullseye. That is what everyone wants.

You can be high-bias and low-variance: your darts cluster tightly, but they are all stuck in the same wrong corner. A linear model trying to fit a quadratic relationship does this. It is consistently, confidently wrong.

You can be low-bias and high-variance: on average you are centered on the bullseye, but each individual throw is all over the board. A very deep decision tree trained on a small dataset does this — fit it on slightly different data and you get a completely different tree.

And you can be high-bias and high-variance: wrong on average, and all over the place about being wrong. This is usually where you end up when you use the wrong architecture for a problem and then fail to regularize it.

The insight the dartboard earns is this: these two failure modes feel identical from the outside when you only have one training set. A model that is consistently wrong and a model that is accidentally wrong look the same until you hold multiple experiments side by side.

The U-shaped curve and why it exists

As model capacity increases — more polynomial degree, more tree depth, more hidden units — something systematic happens.

Training error falls monotonically. Given enough parameters, any model can fit its training data perfectly. A degree-10 polynomial through 10 points hits every point exactly, residual zero. This is not learning; it is interpolation. The model is not discovering the signal; it is memorizing the noise.

Test error starts high (the model is too simple to capture the true relationship — high bias), falls as capacity increases (the model starts capturing the actual structure of the data), then bottoms out, and then rises again (the model is now memorizing training-set-specific noise, so its performance on any other sample degrades — high variance).

The bottom of the U is the only honest place to be.

Model Complexity →Error →irreducible noise floorUnderfit(high bias)Overfit(high variance)Sweet SpotTraining errorTest error
Training error falls monotonically with model complexity. Test error forms a U — the sweet spot is its minimum. The gap between the two curves in the overfit zone is the variance tax.

The key thing to see in that picture is the gap. At low complexity the two curves are close together — the model is not memorizing anything, but it is also not predicting anything useful. As complexity grows, training error plummets while test error lags. The widening gap between the two curves in the overfit zone is exactly the variance tax: the model has learned so much about its specific training data that it has less to say about the general case.

Why more capacity is not always better

There is a seductive engineering reflex that says “when in doubt, make the model bigger.” This is not irrational — in large language models and image classifiers at scale, it has often worked. But the conditions under which it works are specific and easy to mistake.

The reason bigger models can still generalize in modern deep learning is threefold: massive datasets drown out variance (more signal per parameter), regularization is applied aggressively (dropout, weight decay, early stopping all push the model away from memorization), and modern optimization routines tend to converge to flat minima that generalize better than the sharp minima smaller models find.

Take any of those three away and you get the test curve rising. A 10-million-parameter neural network trained on 500 rows of tabular data will overfit spectacularly. The law of large models does not repeal the bias-variance tradeoff; it operates under conditions designed to keep variance in check.

For most practitioners working with structured data at normal enterprise scale — thousands to hundreds of thousands of rows — the tradeoff is fully alive. Adding features, adding layers, or increasing tree depth past the sweet spot reliably raises test error. This is not a theoretical concern; it is something you can see in your cross-validation curves if you bother to plot them.

The two levers: more data and regularization

The practical question is not just “find the bottom of the U” but “how do I move the U?” Two interventions are well-understood.

More data primarily reduces variance. When your training set doubles, each individual data point has less leverage over the model’s learned parameters. The model cannot afford to memorize specific examples as readily because there are more of them to be consistent with. Technically, the variance of a learned estimator typically scales like 1/n — doubling your data roughly halves the variance component of your error. Bias is unaffected by dataset size, because bias reflects your model’s structural assumptions, not how much data you used to fit it. If you have a linear model trying to fit a quadratic truth, ten million points will still produce a biased prediction — it will be a very confidently wrong line.

Regularization — adding a penalty to the loss function that punishes model complexity — bends the test-error curve downward. Ridge regression (L2 penalty) shrinks coefficients toward zero without zeroing them, reducing the model’s sensitivity to any individual feature. Lasso (L1 penalty) can zero out features entirely, imposing a form of structural simplicity. Dropout in neural networks randomly disables neurons during training, forcing the network to learn redundant representations that do not depend on any single unit. Early stopping halts training before the model fully exploits the noise in its training data.

What regularization does geometrically is compress the set of models your fitting procedure will actually produce. A high-complexity model space contains both good models and overfit ones. Regularization adds friction that makes the overfit models harder to reach. The practical effect on your curves: test error at high complexity falls, and the bottom of the U shifts rightward — you can use more capacity before paying the variance tax.

Effect of More DataEffect of Regularizationsmall nlarge nComplexity →no reg.regularizedComplexity →
Left: more data shifts the sweet spot rightward and lowers the test curve by reducing variance. Right: regularization similarly shifts the minimum rightward, letting you use higher-capacity models before overfitting.

Where this actually shows up

The bias-variance lens is most valuable not as a theoretical framework but as a diagnostic. When a model performs well on training data and poorly on validation data, you are on the right slope of the U: high variance. The interventions are more data, stronger regularization, or a simpler model. When a model performs poorly on both training and validation data, you are on the left slope: high bias. The interventions are a more expressive model, better features, or removing an incorrect assumption (for example, using a quadratic rather than linear model).

Credit risk models at banks illustrate the real-world stakes. A logistic regression trained on payment history, income, and age will underfit the true nonlinear credit risk surface — high bias, acceptably low variance, stable across the year as data rolls in. A gradient-boosted tree trained on 200 features will capture more of that surface — lower bias — but in a low-data segment like thin-file applicants (people with limited credit history), the variance explodes: the model’s behavior on a new borrower is dominated by the specific accidents of the thin training set. Banks often use different model architectures for thick-file versus thin-file applicants for exactly this reason. Bias and variance are not just textbook concepts; they are the reason model choice is a business decision.

Demand forecasting in retail follows the same logic. A weekly-average baseline for each product is a low-capacity model with high bias but almost no variance — it will never be dramatically wrong in any direction. A store-and-product-level neural network trained on two years of data can learn holiday spikes, regional preferences, and interaction effects — but if you try to apply it to a product launched last quarter, variance dominates and the forecast is unreliable. Experienced forecasters fall back to simpler models for new products and let the high-capacity model earn trust as data accumulates.

The double descent footnote

There is a modern complication worth naming, especially if you work with deep learning. In overparameterized models — neural networks with far more parameters than training examples — researchers have observed that if you keep increasing capacity past the point where the model can perfectly interpolate the training data, test error sometimes falls again, producing a second descent in the error curve. The curve is not a simple U; it is closer to a U followed eventually by another downward slope.

This is real, and it has been reproduced across architectures. The explanations involve inductive biases of gradient descent, implicit regularization, and the geometry of high-dimensional parameter spaces. The practical takeaway for most practitioners is this: double descent is a phenomenon that shows up at model scales and dataset regimes that require serious infrastructure to reach. For tabular data at normal enterprise scale, for the medium-depth trees you run in Spark or scikit-learn, and for the regression problems you are diagnosing in a cross-validation grid, the classical U-shaped curve is the right mental model. Do not use double descent as an excuse to skip regularization or ignore a rising validation error.

The instinct to develop

The most expensive mistakes in ML engineering are not the algorithm choices. They are the failure to distinguish “my model is too simple” from “my model is memorizing noise.” Both produce bad predictions. Only one is fixable by adding complexity.

Training error is lying to you. It tells you how well your model fits the data you gave it, and it will always improve as you add parameters. The test error is the honest ledger. Keeping both curves in view — plotting them, watching the gap — is not a best practice from a textbook. It is the habit that separates practitioners who ship reliable models from practitioners who ship models that passed their own tests.

The U is always there. The skill is knowing which side of it you are on.

Skip to content