Tutorials › Statistical Learning (Graduate) › Excess-Risk Bounds for Neural Empirical Risk Minimizers

Neural Estimation and Generalization · Tutorial 916 of 989

Excess-Risk Bounds for Neural Empirical Risk Minimizers

Learn how uniform control of empirical risk yields an oracle bound for neural ERM, and how the bound changes when the neural class cannot attain the best possible risk.

Advanced 11 min read

What You'll Learn

  • Define population risk, empirical risk, and excess risk for a neural predictor class.
  • Prove the basic ERM inequality from a uniform deviation bound.
  • Derive a finite-class high-probability deviation bound using Hoeffding’s inequality.
  • Separate approximation error from the estimation error of empirical minimization.
  • Distinguish zero-risk realizability from correct specification when risk is positive.
  • Identify why empirical minimization alone does not guarantee low population risk.

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.

Definition: The population risk and empirical risk of \(f\in\mathcal F\) are $$ R(f)=E[\ell(f(X),Y)], \qquad R_n(f)=\frac{1}{n}\sum_{i=1}^n \ell(f(X_i),Y_i). $$ The uniform deviation over the class is $$ \Delta_n=\sup_{f\in\mathcal F}|R_n(f)-R(f)|. $$ An exact empirical risk minimizer \(\hat f\) satisfies \(R_n(\hat f)=\inf_{f\in\mathcal F}R_n(f)\). An \(\eta\)-approximate minimizer, for \(\eta\geq 0\), satisfies \(R_n(\hat f)\leq\inf_{f\in\mathcal F}R_n(f)+\eta\).

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

Theorem: Suppose \(\Delta_n\leq\varepsilon\). If \(\hat f\) is an \(\eta\)-approximate empirical risk minimizer over \(\mathcal F\), then $$ R(\hat f)-\inf_{f\in\mathcal F}R(f)\leq 2\varepsilon+\eta. $$ In particular, an exact ERM has excess risk over the best member of the class at most \(2\varepsilon\).

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)\).

Theorem: If \(\mathcal F\) is finite with cardinality \(M\), and the loss is in \([0,1]\), then for any \(0<\delta<1\), $$ P\left(\Delta_n\leq \sqrt{\frac{\log(2M/\delta)}{2n}}\right)\geq 1-\delta. $$ Consequently, with probability at least \(1-\delta\), every \(\eta\)-approximate ERM satisfies $$ R(\hat f)-\inf_{f\in\mathcal F}R(f) \leq 2\sqrt{\frac{\log(2M/\delta)}{2n}}+\eta. $$

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.

Definition: The prediction problem is zero-risk realizable by \(\mathcal F\) if some \(f_0\in\mathcal F\) satisfies \(R(f_0)=R_*=0\). More generally, the class is well-specified for risk minimization if \(\inf_{f\in\mathcal F}R(f)=R_*\), even when \(R_*>0\). It is misspecified relative to \(\mathcal G\) if \(A_{\mathcal F}>0\).

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.

Key takeaway: Uniform deviation control yields an excess-risk guarantee for ERM: the gap to the best network in the class is at most twice the deviation, plus any optimization tolerance. The gap to the unrestricted optimum also includes the class’s approximation error.

Check Your Understanding

Use the definitions and inequalities above to answer each question.

  1. Why does the proof of the basic ERM inequality use the uniform deviation twice?
  2. 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?
  3. Can a problem be well-specified for risk minimization while having positive minimum risk? Give the reason.
  4. For a misspecified class, which term in the risk bound remains even if the uniform deviation tends to zero and ERM is exact?
  5. What assumption about the loss is needed for the stated finite-class Hoeffding bound?
Clinical Biostats