Tutorials › Statistical Learning (Graduate) › Surrogate-to-Task Excess-Risk Transfer

Multiclass and Structured Losses · Tutorial 585 of 989

Surrogate-to-Task Excess-Risk Transfer

Learn when a surrogate-risk guarantee implies a task-risk guarantee, and how calibration and bounded task regret determine the transfer bound.

Advanced 11 min read

What You'll Learn

  • Define conditional task regret and conditional surrogate excess risk for structured prediction.
  • State the measurability, boundedness, integrability, and calibration assumptions needed for transfer.
  • Prove a population excess-risk bound using conditional calibration and Jensen’s inequality.
  • Derive an explicit calibration function for binary squared loss.
  • Apply a finite-output Brier-loss bound to structured decisions and handle the inverse-function domain correctly.

Why Excess Risk Needs a Transfer Argument

A predictor can have small risk under a surrogate loss without that statement, by itself, saying how well it performs under the task loss. The bridge is a calibration condition: it quantifies how much surrogate excess risk is required whenever the prediction incurs nonzero task regret. A population transfer bound then converts that pointwise relationship into a guarantee about expected task performance.

The distinction between a conditional and a population guarantee matters. Calibration is most naturally stated separately at each input value. To obtain a population statement, we average over inputs and use the convexity of the calibration function. We also need to respect the range of that function: its inverse is defined only on that range. Since task regret is bounded, the final bound can be written so its inverse is always evaluated in its domain.

Conditional Risks and the Calibration Condition

Let \(X\) be an input, \(Y\) a structured output taking values in a finite set \(\mathcal Y\), and \(\mathcal A\) a finite set of actions or predicted outputs. Let \(\Delta:\mathcal A\times\mathcal Y\to[0,M]\) be the task loss, where \(0<M<\infty\). Assume a regular conditional distribution \(P(Y\mid X=x)\) is available; for example, it is enough to take the input space to be standard Borel. A score predictor \(g\) takes values in a measurable score space \(\mathcal U\), and a measurable decoder \(d:\mathcal U\to\mathcal A\) turns scores into actions.

For a fixed input \(x\), define the conditional task risk of action \(a\) and its Bayes value by

$$ r_\Delta(a\mid x)=E[\Delta(a,Y)\mid X=x], \qquad r_\Delta^*(x)=\min_{a\in\mathcal A}r_\Delta(a\mid x). $$

The conditional task regret of a score \(u\) is \(t(u,x)=r_\Delta(d(u)\mid x)-r_\Delta^*(x)\). It lies in \([0,M]\): each conditional task risk lies in \([0,M]\), and the Bayes risk is the minimum of those risks.

Let \(\ell:\mathcal U\times\mathcal Y\to[0,\infty]\) be a measurable surrogate loss. Its conditional risk and conditional optimum are

$$ r_s(u\mid x)=E[\ell(u,Y)\mid X=x], \qquad r_s^*(x)=\inf_{v\in\mathcal U}r_s(v\mid x). $$

Assume \(r_s^*(X)\) is measurable, the expectations below are well-defined, and the predictor \(g\) has finite surrogate risk. If the infimum over \(v\) is not attained, we still use the pointwise infimum. To identify the population surrogate benchmark with \(E[r_s^*(X)]\), assume measurable predictors can approximate these conditional infima arbitrarily closely in expectation. In particular, this holds when there are measurable conditional minimizers, or under the usual measurable-selection conditions that provide measurable approximate minimizers.

Definition: A calibration condition with function \(\psi\) holds if, for every relevant \(x\) and \(u\in\mathcal U\), \(\psi(t(u,x))\le r_s(u\mid x)-r_s^*(x)\). Here \(\psi:[0,M]\to[0,\infty)\) will be continuous, convex, and strictly increasing, with \(\psi(0)=0\). The condition says that a prediction with task regret \(t\) must pay at least \(\psi(t)\) in conditional surrogate excess risk.

The condition is a lower bound on surrogate excess in terms of task regret. It does not say surrogate excess is at most \(\psi(M)\). That distinction is essential when applying the inverse calibration function.

The Population Transfer Bound

Write \(R_\Delta(d\circ g)=E[\Delta(d(g(X)),Y)]\), and let \(R_\Delta^*=E[r_\Delta^*(X)]\). Define \(R_s(g)=E[\ell(g(X),Y)]\) and \(R_s^*=E[r_s^*(X)]\), under the benchmark assumption just stated. The excesses are \(T=R_\Delta(d\circ g)-R_\Delta^*\) and \(S=R_s(g)-R_s^*\).

Theorem: Suppose the conditional calibration condition holds, \(\psi\) is continuous, convex, and strictly increasing on \([0,M]\), and the risks and benchmarks above are well-defined with \(S<\infty\). Then \[ 0\le T\le M \quad\text{and}\quad T\le \psi^{-1}\!\left(\min\{S,\psi(M)\}\right). \] The inverse \(\psi^{-1}\) is the inverse of \(\psi\) from \([0,M]\) onto \([0,\psi(M)]\).

Proof. Put \(t(X)=t(g(X),X)\) and \(s(X)=r_s(g(X)\mid X)-r_s^*(X)\). By definition, both are measurable under the stated assumptions, \(0\le t(X)\le M\), and \(s(X)\ge0\). The calibration condition gives \(\psi(t(X))\le s(X)\) almost surely. Taking expectations yields \(E[\psi(t(X))]\le E[s(X)]=S\). Also \(T=E[t(X)]\), by conditioning the task loss on \(X\) and subtracting \(E[r_\Delta^*(X)]\). Since \(\psi\) is convex and \(t(X)\in[0,M]\), Jensen’s inequality gives

$$ \psi(T)=\psi(E[t(X)]) \le E[\psi(t(X))] \le S. $$

The bound \(0\le T\le M\) follows from \(t(X)\in[0,M]\). Because \(\psi\) is increasing, this also gives \(\psi(T)\le\psi(M)\). Thus \(\psi(T)\le\min\{S,\psi(M)\}\). The minimum belongs to \([0,\psi(M)]\), the domain of \(\psi^{-1}\); applying the increasing inverse proves the claimed result. \(\square\)

The cap by \(\psi(M)\) is not optional if \(S\) can exceed \(\psi(M)\). It both preserves the bound and ensures that the inverse is applied only within its range.

Worked Example: Binary Classification with Squared Loss

Worked Example: Binary Classification with Squared Loss

Let \(Y\in\{0,1\}\), let the task loss be \(0\)-\(1\) loss, and let a score \(q\in[0,1]\) be decoded as class \(1\) when \(q\ge1/2\), and class \(0\) otherwise. Write \(p=P(Y=1\mid X=x)\). Use the squared surrogate \(\ell(q,y)=(q-y)^2\). We derive a calibration function rather than assume one.

The conditional surrogate risk is \(p(q-1)^2+(1-p)q^2\). Expanding and completing the square gives

$$ p(q-1)^2+(1-p)q^2 =q^2-2pq+p =(q-p)^2+p(1-p). $$

Its infimum over \(q\in[0,1]\) is \(p(1-p)\), attained at \(q=p\). Therefore the conditional surrogate excess is exactly \((q-p)^2\).

If the decoded class is Bayes optimal, task regret is zero. Otherwise the prediction and \(p\) lie on opposite sides of the decision threshold, with the threshold case also satisfying the inequality below. The regret is \(t=|2p-1|\), while \(|q-p|\ge |p-1/2|=t/2\). Hence the surrogate excess is at least \(t^2/4\). Thus the calibration function \(\psi(t)=t^2/4\), for \(0\le t\le1\), is valid. It is continuous, convex, strictly increasing on this interval, and \(\psi(0)=0\).

For instance, take \(p=0.8\) and \(q=0.4\). The decoder predicts class \(0\), although class \(1\) is Bayes optimal, so \(t=0.8-0.2=0.6\). The surrogate excess is \((0.4-0.8)^2=0.16\), and \(\psi(t)=0.6^2/4=0.09\le0.16\), as required.

Worked Example: A Finite Structured Output Space

Worked Example: A Brier Surrogate for Structured Decisions

Suppose \(\mathcal Y=\mathcal A\) has \(K\) possible structured outputs, and use the \(0\)-\(1\) task loss \(\Delta(a,y)=\mathbf{1}\{a\ne y\}\), so \(M=1\). A score is a probability vector \(q\) on \(\mathcal Y\), and the decoder selects an output maximizing \(q\). Use the multiclass Brier loss \(\ell(q,y)=\sum_{j=1}^K(q_j-\mathbf{1}\{y=j\})^2\).

Let \(p_j=P(Y=j\mid X=x)\). Expanding the conditional Brier risk gives \(\sum_j(q_j-p_j)^2+1-\sum_jp_j^2\), so its minimum is attained at \(q=p\) and its conditional excess is \(\|q-p\|_2^2\). For any fixed output \(a\), the difference between its expected task loss under \(p\) and under \(q\) has absolute value at most \(\frac12\|p-q\|_1\): the loss values are in \([0,1]\), and the total variation distance between the two distributions is \(\frac12\|p-q\|_1\).

Let \(a_q\) minimize task risk under \(q\), and let \(a_p\) minimize it under \(p\). Since \(a_q\) is optimal under \(q\), \(r_q(a_q)\le r_q(a_p)\), where \(r_p(a)=\sum_y p_y\Delta(a,y)\). Insert and subtract these two \(q\)-risks:

$$ r_p(a_q)-r_p(a_p) \le |r_p(a_q)-r_q(a_q)|+|r_q(a_p)-r_p(a_p)| \le \|p-q\|_1 \le \sqrt K\,\|p-q\|_2. $$

The last inequality is Cauchy–Schwarz. Consequently \(t\le\sqrt K\,\|p-q\|_2\), so the calibration function \(\psi(t)=t^2/K\), on \([0,1]\), is valid. For \(K=4\), take \(p=(0.4,0.3,0.2,0.1)\) and \(q=(0.2,0.25,0.3,0.25)\). The Bayes output is the first; the decoder selects the third, giving task regret \(0.4-0.2=0.2\). The Brier excess is \((0.2)^2+(0.05)^2+(-0.1)^2+(-0.15)^2=0.075\). The calibration lower bound is \(\psi(0.2)=0.2^2/4=0.01\), which is indeed no larger than \(0.075\).

Worked Example: Using the Transfer Bound and Its Cap

Worked Example: Averaging Conditional Guarantees

Consider binary squared loss from the first example, with two equally likely input strata. In stratum A, let \(p=0.9\) and \(q=0.4\); in stratum B, let \(p=q=0.5\). In A the decoder chooses class \(0\), so conditional task regret is \(0.9-0.1=0.8\), and conditional surrogate excess is \((0.4-0.9)^2=0.25\). In B the task regret and surrogate excess are both zero. Therefore the population excesses are \(T=(0.8+0)/2=0.4\) and \(S=(0.25+0)/2=0.125\).

Here \(M=1\) and \(\psi(t)=t^2/4\), so \(\psi(M)=0.25\). The theorem gives \(T\le\psi^{-1}(\min\{0.125,0.25\})=2\sqrt{0.125}=\sqrt{0.5}\approx0.707\), which is a valid upper bound on the actual regret \(0.4\).

Now consider a possible score with \(S=1\) under the same task and calibration function. The argument \(1\) cannot be supplied to \(\psi^{-1}\), whose domain is \([0,0.25]\). The capped expression instead gives \(\psi^{-1}(\min\{1,0.25\})=\psi^{-1}(0.25)=1\), the universal task-regret bound. The cap is therefore necessary for a formula that remains defined for every allowed surrogate excess.

Assumptions, Interpretation, and a Common Pitfall

The transfer theorem separates three ingredients. First, the task loss is bounded, so task regret lies in a known interval. Second, the surrogate excess is measured relative to the pointwise conditional optimum, with the population benchmark matching its expectation. Third, calibration holds for the chosen score-to-action decoder. Changing the decoder can invalidate the calibration condition even when the surrogate loss is unchanged.

The convexity assumption is used specifically to pass from conditional regrets to their average: Jensen’s inequality gives \(\psi(E[t])\le E[\psi(t)]\). Without convexity, that step is not justified in general. Strict increase and continuity make the ordinary inverse on the stated range available. For functions that are not strictly increasing, a generalized inverse can be used, but it must be defined explicitly.

  • Wrong reasoning: “Calibration gives \(\psi(T)\le S\), so the bound is \(T\le\psi^{-1}(S)\) for every \(S\).” This overlooks that \(\psi^{-1}\) is defined here only up to \(\psi(M)\).
  • Correction: Since \(T\le M\), the proof also gives \(\psi(T)\le\psi(M)\). Combine the two inequalities to obtain \(\psi(T)\le\min\{S,\psi(M)\}\), then invert.
  • Another common mistake: Treating a small surrogate risk as automatically sufficient. The theorem uses surrogate excess over its benchmark, and the calibration inequality must connect it to the task regret for the decoder actually used.
Key takeaway: Under conditional calibration and convexity, population task excess is controlled by the inverse calibration function applied to surrogate excess. The domain-safe bound is \(\psi^{-1}(\min\{S,\psi(M)\})\), because task regret cannot exceed \(M\).

Check Your Understanding

Answer these questions by identifying which assumptions or steps in the transfer argument are being used.

  1. Why is conditional task regret bounded by \(M\) when the task loss takes values in \([0,M]\)?
  2. In the theorem’s proof, where is convexity of \(\psi\) required?
  3. For binary squared loss, calculate the conditional surrogate excess when \(p=0.7\) and \(q=0.3\), and compare it with \(\psi(t)\).
  4. Why can \(\psi^{-1}(S)\) be undefined even when the calibration condition holds?
  5. In the finite-output Brier example, what inequality converts the Euclidean distance between \(p\) and \(q\) into a bound involving task regret?
Clinical Biostats