Bias-Variance Tradeoff
Why can two models with similar training error behave very differently on new data?
One way to understand this is through the bias-variance decomposition. For squared-error regression, prediction error can be separated into three parts: noise, bias, and variance.
We first look at the error for a single input .
Write the response as:
where:
is the best possible prediction under squared error, and represents the remaining noise:
The noise does not need to be Gaussian.
Now imagine repeatedly drawing a new training set and fitting the same learning algorithm each time.
Let denote one such training set, and let be the model learned from it.
Because the training data changes, the learned prediction:
can also change.
We measure the expected squared error on a fresh test response at the same input :
If we average the prediction over all possible training sets, we get:
This tells us what the learning algorithm predicts on average.
The expected error can then be decomposed as:
The three terms have different meanings.
The noise term:
is unavoidable. Even the optimal predictor cannot predict the random noise in .
The squared bias:
measures how far the model's average prediction is from the optimal prediction.
Large bias means the model makes a systematic error and is often associated with underfitting.
The variance:
measures how much the model's prediction changes when we train it on a different dataset.

Each shot represents a model trained on a different dataset. Bias measures how far the average prediction is from the target, while variance measures how spread out the predictions are.
Averaging the pointwise decomposition over the distribution of gives the overall test mean squared error.
See derivation
Substitute:
into the expected squared error:
The cross term is zero because the fresh test noise has mean zero and is independent of the training set.
Since , we have .
Now add and subtract :
Expanding the square gives:
because .
Therefore:
This is the definition of variance around the mean prediction .
So:
Model Capacity and Double Descent
As model capacity increases, a classical pattern is:
- bias tends to decrease because the model can represent more complex relationships;
- variance can increase because the learned model becomes more sensitive to the training data.
This can produce a U-shaped test-error curve.

In the classical picture, squared bias decreases as model capacity grows while variance increases, producing an intermediate minimum in test error.
This is a useful heuristic, not a universal law.
Model capacity is also more subtle than simply counting parameters.
Some modern models exhibit double descent.
Instead of following a single U-shaped curve, test error can first decrease, then rise near the point where the model can perfectly fit the training data, and then decrease again as capacity increases further.
The point where the model first reaches zero training error is called the interpolation threshold.
For squared-error regression, interpolation means:
for every training example.
For classification, it often means zero training classification error.
Near the interpolation threshold, fitting the training data exactly can make the learned solution especially sensitive to small changes in the dataset.
The location of this threshold depends on the model, data, regularization, and optimization.
It is not generally the simple condition that the number of parameters equals the number of training examples.

In a schematic double-descent curve, test error rises near the interpolation threshold and then falls again as effective model capacity continues to increase.
Complexity Bounds
Training error tells us how well a model fits the examples we observed.
What we really care about, however, is how well it performs on new examples.
Complexity bounds give us a way to relate these two quantities.
Let:
be a training sample drawn IID from an unknown distribution .
For a classifier , the population error is the probability that it misclassifies a fresh example drawn from :
We do not know the true distribution , so we usually cannot compute this quantity directly.
Instead, we measure the fraction of mistakes on the training sample.
This is the empirical error:
A natural strategy is to choose the hypothesis with the smallest empirical error.
This is called empirical risk minimization, or ERM.
Let be a finite hypothesis class with:
Then ERM selects:
But a model with low training error does not necessarily have low population error.
We therefore want to understand the gap:
between population and empirical performance.
Hoeffding Inequality
Hoeffding's inequality tells us how quickly an empirical average concentrates around its true mean.
Imagine a coin that lands heads with probability .
Let:
be independent Bernoulli random variables representing the coin tosses, and let:
be the observed fraction of heads.
Hoeffding's inequality states that for any :
As grows, the probability of a large difference between the empirical frequency and the true probability decreases exponentially.
Uniform Convergence
For one fixed classifier , Hoeffding's inequality immediately gives a bound on the gap between training error and population error.
Define:
Then:
But this is not enough for ERM.
The classifier:
is chosen after looking at the training data.
To handle this data-dependent choice, we want the bound to hold for every hypothesis in at the same time.
For a finite class containing hypotheses, we can do this with the union bound.
The result is:
This is called a uniform convergence bound.
It shows two important effects.
More training examples make the guarantee tighter.
A larger hypothesis class makes the guarantee weaker.
The intuition is that with more possible hypotheses, there are more chances for at least one model to look unusually good on the training sample.
This does not mean that a larger hypothesis class has worse training error.
A larger class can only improve or preserve the best achievable empirical error.
The bound concerns the gap between training and population performance.
Because the guarantee holds for every hypothesis on the same event, it also applies to the data-dependent ERM solution .
See derivation
For events:
the union bound gives:
Enumerate:
and define the bad event:
Hoeffding's inequality gives:
Therefore:
Taking the complement changes “there exists a bad hypothesis” into “every hypothesis satisfies the bound.”
Sample Complexity
We can now ask:
How many training examples are sufficient to guarantee a generalization gap of at most with probability at least ?
We want the failure probability to be at most:
so we require:
Solving for gives:
This is a sample-complexity bound.
It shows that:
- requiring a smaller error tolerance needs substantially more data because of the dependence;
- allowing a larger hypothesis class increases the requirement through ;
- demanding higher confidence increases the requirement through .
Equivalently, if the sample size is fixed, the same result tells us how large the generalization gap can be.
With probability at least :
This is a high-probability statement.
It does not say that the gap is deterministically below this value for every possible training sample.
See derivation
Starting from:
Taking logarithms of both sides.
Multiplying by reverses the inequality:
Therefore:
and:
Choosing the right-hand side as the deviation threshold gives the uniform guarantee with probability at least .
ERM Generalization Guarantee
Uniform convergence lets us say something stronger about the model selected by ERM.
Let:
be the hypothesis in with the smallest population error.
Also define:
On the uniform-convergence event:
or:
So ERM performs nearly as well as the best hypothesis available in , provided empirical and population errors are uniformly close.
This guarantee holds with probability at least over the random draw of the training set.
It does not hold for every possible sample.
See derivation
On the event that:
for every :
is the empirical risk minimizer, so its training error cannot exceed that of any other hypothesis in .
Therefore:
Using uniform convergence again:
so:
This bound separates two sources of error.
The first term:
is the error of the best model available in the hypothesis class.
If is too restrictive, this error can be large.
This is related to approximation error.
The second term:
is an estimation or complexity term.
It reflects the difficulty of choosing a good hypothesis from a finite amount of data.
Enlarging can reduce approximation error because more models become available.
However, it can increase this particular complexity bound through .
This resembles the bias-variance tradeoff, but the two ideas are not mathematically identical.