Tutorials › Statistical Learning (Graduate) › Separating Optimization Error in Neural Risk Bounds

Neural Estimation and Generalization · Tutorial 926 of 989

Separating Optimization Error in Neural Risk Bounds

Learn how an approximately optimized neural estimator’s population excess risk separates into optimization, generalization, and approximation terms.

Advanced 10 min read

What You'll Learn

  • Define empirical suboptimality relative to the best predictor in a neural class.
  • Decompose population excess risk into optimization, uniform generalization, and approximation terms.
  • Prove the deterministic bound for an approximate empirical minimizer.
  • Derive a finite-class uniform deviation bound using Hoeffding’s inequality.
  • Calculate how each error source contributes in explicit examples.
  • Recognize why an empirical optimizer alone does not guarantee small population risk.

Why Separate the Sources of Error?

A trained neural predictor can have poor population performance for several different reasons. The chosen architecture may not represent a good predictor; the sample may make empirical performance differ from population performance; or the training algorithm may not find a predictor with nearly minimal empirical risk. A useful risk bound distinguishes these mechanisms rather than combining them into an unexplained remainder.

This separation is especially important when optimization is approximate. A method may return a predictor that is not an empirical risk minimizer, yet is close to one. The resulting population guarantee should account explicitly for that gap, alongside the generalization and approximation terms.

Risks and the Three Error Terms

Let \(Z_1,\ldots,Z_n\) be independent and identically distributed observations from a distribution \(P\). A predictor \(f\) incurs loss \(\ell_f(Z)\), where the loss is measurable and has finite expectation. Its population risk and empirical risk are

$$ \mathcal R(f)=E[\ell_f(Z)], \qquad \widehat{\mathcal R}_n(f)=\frac{1}{n}\sum_{i=1}^{n}\ell_f(Z_i). $$

Let \(\mathcal F\) be a nonempty class of measurable predictors, such as neural networks with a specified architecture and parameter constraints. Define the best achievable population risk over all admissible predictors as \(\mathcal R^*=\inf_{f\in\mathcal G}\mathcal R(f)\), where \(\mathcal G\) is the larger benchmark class containing \(\mathcal F\). The class’s approximation error is the gap between its best population risk and this benchmark.

Definition: The approximation error of \(\mathcal F\), relative to \(\mathcal G\), is \(\mathcal A(\mathcal F)=\inf_{f\in\mathcal F}\mathcal R(f)-\mathcal R^*\). For a returned predictor \(\widehat f\in\mathcal F\), its empirical optimization error is \(\epsilon_{\mathrm{opt}}=\widehat{\mathcal R}_n(\widehat f)-\inf_{f\in\mathcal F}\widehat{\mathcal R}_n(f)\). The uniform generalization deviation is \(\Delta_n=\sup_{f\in\mathcal F}|\mathcal R(f)-\widehat{\mathcal R}_n(f)|\).

The approximation error is nonnegative because \(\mathcal F\subseteq\mathcal G\). The optimization error is also nonnegative by its definition. It measures how far the algorithm’s output is from the best empirical risk available within the chosen class, not how far that class is from the population benchmark. The deviation \(\Delta_n\) is uniform: it controls the population-to-empirical discrepancy for every member of \(\mathcal F\), including a predictor selected after seeing the sample.

Worked Example: Reading the Three Terms in a Bound

Suppose a neural class has approximation error \(0.03\). On a specified sample, suppose its uniform deviation is at most \(0.04\), and the returned network is within \(0.01\) empirical risk of the class’s empirical infimum. The population excess-risk bound derived below is

$$ \mathcal R(\widehat f)-\mathcal R^* \leq 0.03+2(0.04)+0.01=0.12. $$

The three contributions are \(0.03\) from approximation, \(0.08\) from generalization, and \(0.01\) from optimization. Thus, if the benchmark risk is \(0.18\), the bound gives \(\mathcal R(\widehat f)\leq 0.30\). This is a guarantee, not a claim that the realized risk equals \(0.30\).

The Basic Excess-Risk Bound

The central result is deterministic once a uniform deviation bound holds. No convexity, differentiability, or existence of an exact empirical minimizer is required. The output only needs to lie in the class and have a stated empirical suboptimality.

Theorem: Suppose \(\mathcal F\subseteq\mathcal G\), the risks in the definitions above are finite, and \(\widehat f\in\mathcal F\) satisfies \(\widehat{\mathcal R}_n(\widehat f)\leq\inf_{f\in\mathcal F}\widehat{\mathcal R}_n(f)+\epsilon\) for some \(\epsilon\geq0\). If \(\Delta_n\leq\delta\), then \[ \mathcal R(\widehat f)-\mathcal R^* \leq \mathcal A(\mathcal F)+2\delta+\epsilon. \]

Proof. For any \(f\in\mathcal F\), the definition of \(\Delta_n\) implies \(\mathcal R(f)\leq\widehat{\mathcal R}_n(f)+\delta\). Apply this first to \(\widehat f\), then use its empirical suboptimality:

$$ \mathcal R(\widehat f) \leq \widehat{\mathcal R}_n(\widehat f)+\delta \leq \inf_{f\in\mathcal F}\widehat{\mathcal R}_n(f)+\epsilon+\delta. $$

For each \(f\in\mathcal F\), the other direction of the same uniform bound gives \(\widehat{\mathcal R}_n(f)\leq\mathcal R(f)+\delta\). Taking infima preserves this inequality, so

$$ \inf_{f\in\mathcal F}\widehat{\mathcal R}_n(f) \leq \inf_{f\in\mathcal F}\mathcal R(f)+\delta. $$

Combining the last two displays yields \(\mathcal R(\widehat f)\leq\inf_{f\in\mathcal F}\mathcal R(f)+\epsilon+2\delta\). Subtract \(\mathcal R^*\) and use the definition of \(\mathcal A(\mathcal F)\). This proves the result. \(\square\)

The two deviation terms arise at two distinct comparisons: first, from the returned predictor’s empirical risk to its population risk; second, from the class’s best empirical risk to its best population risk. In applications, a sharper analysis may sometimes control these comparisons differently, but the displayed inequality requires only one uniform deviation bound.

Worked Example: A Finite-Class Generalization Calculation

Suppose \(\mathcal F\) contains \(M=8\) fixed predictors and every loss lies in \([0,1]\). The observations are independent and identically distributed. We seek a bound that holds with probability at least \(0.95\), so set \(\eta=0.05\), and take \(n=200\).

For one fixed predictor \(f\), its \(n\) losses are independent, bounded random variables with mean \(\mathcal R(f)\). Hoeffding’s inequality gives \(P(|\widehat{\mathcal R}_n(f)-\mathcal R(f)|>t)\leq2e^{-2nt^2}\). A union bound over the eight predictors therefore gives

$$ P(\Delta_n>t)\leq 2M e^{-2nt^2}. $$

Choose \(t\) so the right side is at most \(\eta\). Solving \(2M e^{-2nt^2}=\eta\) gives \(t=\sqrt{\log(2M/\eta)/(2n)}\). For these values, \(2M/\eta=16/0.05=320\), \(\log(320)\approx5.768\), and

$$ t=\sqrt{\frac{5.768}{400}}\approx 0.1201. $$

Thus \(\Delta_n\leq0.1201\) with probability at least \(0.95\). If the approximation error is \(0.02\) and the returned predictor’s empirical suboptimality is at most \(0.005\), the excess-risk bound on that event is \(0.02+2(0.1201)+0.005=0.2652\), approximately. The two deviation contributions are substantial here; even exact empirical optimization would reduce the bound by only \(0.005\).

Obtaining a Uniform Deviation Bound

The deterministic theorem separates the terms but does not itself guarantee that \(\Delta_n\) is small. That step requires assumptions on the loss and predictor class. For a finite class and bounded loss, the preceding calculation gives a simple high-probability result.

Theorem: Suppose \(\mathcal F\) is a fixed finite class of \(M\geq1\) measurable predictors, \(Z_1,\ldots,Z_n\) are independent and identically distributed, and \(0\leq\ell_f(Z)\leq1\) almost surely for every \(f\in\mathcal F\). For any \(0<\eta<1\), with probability at least \(1-\eta\), \[ \Delta_n\leq\sqrt{\frac{\log(2M/\eta)}{2n}}. \]

Proof. Fix \(f\in\mathcal F\). Its losses \(\ell_f(Z_i)\) are independent, identically distributed, and lie in \([0,1]\). Hoeffding’s inequality, applied to their sample mean, gives \(P(|\widehat{\mathcal R}_n(f)-\mathcal R(f)|>t)\leq2e^{-2nt^2}\). The event \(\{\Delta_n>t\}\) is the union, over all \(M\) predictors, of the events that the corresponding absolute deviation exceeds \(t\). The union bound therefore implies

$$ P(\Delta_n>t) \leq \sum_{f\in\mathcal F}2e^{-2nt^2} =2M e^{-2nt^2}. $$

Set \(t=\sqrt{\log(2M/\eta)/(2n)}\). Then \(e^{-2nt^2}=e^{-\log(2M/\eta)}=\eta/(2M)\), so \(P(\Delta_n>t)\leq\eta\). Equivalently, \(P(\Delta_n\leq t)\geq1-\eta\), as claimed. \(\square\)

Combining this theorem with the basic excess-risk bound gives, under its assumptions, a probability-\(1-\eta\) guarantee of \(\mathcal R(\widehat f)-\mathcal R^*\leq\mathcal A(\mathcal F)+2\sqrt{\log(2M/\eta)/(2n)}+\epsilon\). For large or infinite neural classes, a different valid uniform generalization bound may be used in place of this finite-class expression. The deterministic decomposition remains the same; only the way \(\delta\) is established changes.

Worked Example: A Nearly Optimized Constant Neural Classifier

Let \(X\) be constant and \(Y\) be Bernoulli with \(P(Y=1)=0.4875\). Use zero-one classification loss and a class \(\mathcal F\) with two constant neural classifiers: \(f_0\), which always predicts \(0\), and \(f_1\), which always predicts \(1\). Constant outputs can be represented by choosing output biases appropriately. The best possible classification risk is \(\mathcal R^*=0.4875\), attained by \(f_0\), so \(\mathcal A(\mathcal F)=0\).

Consider a sample of \(n=40\) observations containing 19 ones and 21 zeros. This sample event has positive probability under the stated Bernoulli distribution. The empirical risks are

$$ \widehat{\mathcal R}_{40}(f_0)=\frac{19}{40}=0.475, \qquad \widehat{\mathcal R}_{40}(f_1)=\frac{21}{40}=0.525. $$

Suppose the training procedure returns \(f_1\). Its empirical suboptimality is \(0.525-0.475=0.05\), so it satisfies the approximate-optimization condition with \(\epsilon=0.05\). The population risks are \(\mathcal R(f_0)=0.4875\) and \(\mathcal R(f_1)=0.5125\). For this two-element class, the deviations are \(0.0125\) for each predictor, hence \(\Delta_{40}=0.0125\). The returned predictor’s actual excess risk is \(0.5125-0.4875=0.025\), while the decomposition gives

$$ \mathcal A(\mathcal F)+2\Delta_{40}+\epsilon =0+2(0.0125)+0.05=0.075. $$

The bound is valid but conservative. It still makes the source of the guarantee transparent: there is no approximation gap, the sample deviation contributes \(0.025\), and the stated optimization tolerance contributes \(0.05\).

Interpreting the Bound and Avoiding a Common Pitfall

The decomposition is useful because the three terms suggest different questions about a trained neural estimator. Is the architecture expressive enough for the target, making \(\mathcal A(\mathcal F)\) small? Does the available sample and class complexity support a sufficiently small uniform deviation? Did the training procedure reduce empirical risk close enough to the class infimum? A small value for one term cannot compensate for an uncontrolled value in another.

Common mistake: treating empirical optimization as a population guarantee. It is incorrect to argue that a small empirical risk, or successful convergence of an optimizer, by itself implies small population excess risk. The empirical risk is calculated on the observed sample, and its difference from population risk must still be controlled; moreover, a class may have a nonzero approximation gap. The correction is to establish a population-to-empirical deviation bound and account for the benchmark approximation error, while recording any empirical suboptimality separately.

The bound also clarifies why optimization error should not be silently folded into a generalization term. A generalization statement concerns the relationship between empirical and population risk. Optimization error concerns the empirical objective’s minimization within the selected class. Keeping their roles distinct makes the assumptions, calculations, and possible remedies easier to assess.

Check Your Understanding

Use the definitions and results above to answer these questions.

  1. Why does the basic excess-risk bound contain two copies of the uniform deviation \(\delta\)? Identify the two comparisons that require it.
  2. If the returned network is an exact empirical risk minimizer, which term in the bound becomes zero, and which terms remain?
  3. For a fixed finite class of \(M\) predictors with losses in \([0,1]\), how does the stated deviation bound change as \(n\) increases?
  4. In the constant-classifier example, calculate the excess risk of \(f_0\) and explain why its empirical risk is lower than that of \(f_1\).
  5. Can a class with zero approximation error still yield a weak population guarantee? Explain using the other terms in the bound.
Clinical Biostats