From Empirical Fit to Population Risk
A neural network can achieve a small loss on its training sample without having small expected loss on new observations. The key question is not whether empirical risk minimization (ERM) selects the lowest training risk in the chosen class; it is how far the empirical risks of that class can be from their population risks. A uniform deviation bound answers this question by controlling the discrepancy for every network in the class at once. Once that discrepancy is controlled, a short comparison shows what ERM guarantees.
Let \((X_i,Y_i)_{i=1}^n\) be independent and identically distributed observations with the same distribution as \((X,Y)\). Let \(\mathcal F\) be a fixed class of neural-network predictors, and let \(\ell(f(X),Y)\) be a measurable loss taking values in \([0,1]\). The bounded-loss assumption is used for the concentration result below; it is not automatic for every regression loss.
For a potentially infinite class, assume the supremum defining \(\Delta_n\) is measurable and the selected minimizer is measurable. Alternatively, the statements below can be read on events where these quantities are well-defined. The central result is deterministic: whenever the uniform deviation is small, empirical minimization is close to optimal in population risk.
The Basic Excess-Risk Inequality
Proof. Write \(R_{\mathcal F}=\inf_{f\in\mathcal F}R(f)\). For any \(g\in\mathcal F\), the uniform deviation condition gives \(R(\hat f)\leq R_n(\hat f)+\varepsilon\) and \(R_n(g)\leq R(g)+\varepsilon\). The approximate minimization property then yields $$ R(\hat f) \leq R_n(\hat f)+\varepsilon \leq R_n(g)+\eta+\varepsilon \leq R(g)+\eta+2\varepsilon. $$ This inequality holds for every \(g\in\mathcal F\). Taking the infimum over \(g\) proves \(R(\hat f)\leq R_{\mathcal F}+\eta+2\varepsilon\), as required. \(\square\)
The two deviation terms arise from two separate comparisons: one compares the selected network’s population risk with its empirical risk, and the other compares a population competitor with its empirical risk. The middle comparison is exactly where ERM is used. Thus the factor of two does not assert that the training risk itself is twice as large; it reflects the two sides of the empirical comparison.
Worked Example: A Sample Chooses the Worse-Population-Risk Network
Consider two networks \(f_A\) and \(f_B\) with losses in \([0,1]\). Suppose their population risks are \(R(f_A)=0.30\) and \(R(f_B)=0.20\). In a sample of size \(10\), suppose the observed losses sum to \(2\) for \(f_A\) and \(3\) for \(f_B\). These observations are possible, for example, if the losses for each fixed network are Bernoulli with the stated population risks.
The empirical risks are $$ R_n(f_A)=\frac{2}{10}=0.20,\qquad R_n(f_B)=\frac{3}{10}=0.30. $$ ERM therefore selects \(f_A\), even though \(f_B\) has lower population risk. The selected network’s excess risk over this two-element class is \(0.30-0.20=0.10\). The uniform deviation for these two networks is $$ \Delta_n=\max\{|0.20-0.30|,\ |0.30-0.20|\}=0.10. $$ The theorem gives an upper bound of \(2\Delta_n=0.20\), and the actual excess risk \(0.10\) satisfies it. The example illustrates that ERM’s guarantee is a comparison with the best class member, not a promise that the empirical winner is itself the population winner.
A High-Probability Bound for a Finite Class
The preceding theorem reduces the learning question to controlling \(\Delta_n\). A simple explicit control is available when the predictor class has finitely many distinct predictors. For each fixed \(f\), the sample losses are independent, identically distributed, and lie in \([0,1]\). Hoeffding’s inequality states that for independent random variables in an interval of length one, the probability that their sample mean differs from its expectation by more than \(t>0\) is at most \(2\exp(-2nt^2)\).
Derivation. For each fixed \(f\), apply Hoeffding’s inequality to the \(n\) losses \(\ell(f(X_i),Y_i)\). This gives $$ P\bigl(|R_n(f)-R(f)|>t\bigr)\leq 2\exp(-2nt^2). $$ If \(\Delta_n>t\), at least one of the \(M\) predictors has deviation greater than \(t\). The union bound therefore gives $$ P(\Delta_n>t)\leq 2M\exp(-2nt^2). $$ Choose \(t=\sqrt{\log(2M/\delta)/(2n)}\). Then \(2M\exp(-2nt^2)=\delta\), so the asserted probability bound for \(\Delta_n\) follows. Applying the basic excess-risk inequality on that event proves the second claim. \(\square\)
This finite-class result is not, by itself, a bound for every neural-network class: a class with continuously varying parameters can contain infinitely many distinct predictors. The ERM inequality still applies to such classes whenever a suitable uniform deviation bound is available. The particular complexity measure or argument needed to obtain that bound is a separate question.
Worked Example: Turning a Deviation Bound Into an Excess-Risk Bound
Suppose a fixed neural class contains \(M=8\) predictors, the sample size is \(n=200\), the loss is in \([0,1]\), and the desired confidence level is \(1-\delta=0.95\). Then $$ \frac{2M}{\delta}=\frac{16}{0.05}=320,\qquad \log(320)\approx 5.768. $$ Thus the finite-class deviation threshold is $$ \sqrt{\frac{\log(320)}{400}} =\sqrt{0.01442} \approx 0.1201. $$ With probability at least \(0.95\), an exact ERM has excess risk over the best network in the class at most \(2(0.1201)=0.2402\). If the selected network is only an \(\eta=0.03\) approximate minimizer, the corresponding bound is \(0.2402+0.03=0.2702\). This is a guarantee, not a prediction of the realized excess risk; the actual gap can be much smaller.
Realizability and Misspecification
A bound relative to the best network in \(\mathcal F\) does not by itself say how good that network is for the prediction problem. To make this distinction precise, let \(\mathcal G\) be the larger set of admissible measurable predictors for the problem, and define the unrestricted optimal risk \(R_*=\inf_{g\in\mathcal G}R(g)\). Since \(\mathcal F\subseteq\mathcal G\), the approximation error $$ A_{\mathcal F}=\inf_{f\in\mathcal F}R(f)-R_* $$ is nonnegative. Adding and subtracting \(\inf_{f\in\mathcal F}R(f)\) gives the decomposition $$ R(\hat f)-R_* = \left(R(\hat f)-\inf_{f\in\mathcal F}R(f)\right)+A_{\mathcal F}. $$ Therefore, on the event \(\Delta_n\leq\varepsilon\), $$ R(\hat f)-R_*\leq A_{\mathcal F}+2\varepsilon+\eta. $$ The first term is a limitation of the chosen class; the other terms arise from empirical selection and, if applicable, inexact minimization.
These terms describe the approximation part of the problem, not the sample’s uniform deviation. Under either form of well-specification, \(A_{\mathcal F}=0\), so a deviation bound controls risk relative to the unrestricted optimum. Under misspecification, increasing the sample size can reduce the deviation term but cannot remove a positive approximation error for a fixed class.
Worked Example: A Noisy Target and a Misspecified Class
Let \(X\) be irrelevant, let \(Y\) be Bernoulli with \(P(Y=1)=0.2\), and use binary prediction with zero-one loss. The unrestricted optimal predictor always predicts \(0\), giving $$ R_*=P(Y=1)=0.2. $$ Consider first the class \(\mathcal F=\{f_0,f_1\}\), where \(f_0\) always predicts \(0\) and \(f_1\) always predicts \(1\). Their risks are \(R(f_0)=0.2\) and \(R(f_1)=0.8\). Hence \(\inf_{f\in\mathcal F}R(f)=0.2=R_*\), and \(A_{\mathcal F}=0\). The problem is well-specified for risk minimization, but it is not zero-risk realizable: even the best predictor has risk \(0.2\) because the labels are random.
Now restrict the class to \(\mathcal F'=\{f_1\}\). Its best risk is \(0.8\), so its approximation error is $$ A_{\mathcal F'}=0.8-0.2=0.6. $$ If a uniform deviation event holds with \(\Delta_n\leq 0.05\), exact ERM over \(\mathcal F'\) has risk \(0.8\), and the general bound relative to \(R_*\) is \(0.6+2(0.05)=0.7\). The actual excess risk is \(0.8-0.2=0.6\), within the bound. The positive approximation term records that this class cannot express the optimal prediction; more data alone does not fix that limitation.
What the Bound Does—and Does Not—Guarantee
The excess-risk inequality is useful because it isolates the job of a generalization argument: establish that empirical and population risks are uniformly close over the candidate class. But the inequality does not establish that closeness on its own, and a small training risk is not evidence of small population risk unless some control of the discrepancy is justified. In addition, the finite-class concentration result depends on bounded loss and a finite number of predictors; changing either assumption requires a corresponding concentration argument.
A common mistake is to reason that because \(\hat f\) minimizes empirical risk, it must minimize population risk. That replaces \(R_n\) by \(R\) without justification. The correct comparison inserts the uniform deviation on both sides of the ERM comparison, producing the \(2\Delta_n\) term. A second mistake is to call any small excess risk evidence that the network class is adequate. The bound relative to the class optimum can be small even when \(A_{\mathcal F}\) is large; assessing risk relative to the unrestricted optimum requires accounting for approximation error too.
Check Your Understanding
Use the definitions and inequalities above to answer each question.
- Why does the proof of the basic ERM inequality use the uniform deviation twice?
- If an \(\eta\)-approximate ERM has \(\eta=0.04\) and \(\Delta_n\leq 0.07\), what bound follows for its excess risk over the best member of the class?
- Can a problem be well-specified for risk minimization while having positive minimum risk? Give the reason.
- For a misspecified class, which term in the risk bound remains even if the uniform deviation tends to zero and ERM is exact?
- What assumption about the loss is needed for the stated finite-class Hoeffding bound?