SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Theorem A.1 (Rademacher-based uniform convergence). Let  $D_{\mathcal{X}}$  be a distribution over  $\mathcal{X}$ , and  $\mathcal{F}$  a family of functions mapping  $\mathcal{X} \rightarrow [0,1]$ . Let  $S = \{x_1, \ldots, x_n\}$  be a set of samples drawn i.i.d. from  $D_{\mathcal{X}}$ , then with probability at least  $1 - \delta$  over our draw  $S$ ,
$$
\left| \mathbb {E} _ {\mathcal {D}} [ f (x) ] - \hat {\mathbb {E}} _ {S} [ f (x) ] \right| \leq 2 R _ {n} (\mathcal {F}) + \sqrt {\frac {\ln (2 / \delta)}{2 n}}.
$$
This holds for every function  $f \in \mathcal{F}$ , and  $\hat{\mathbb{E}}_S[f(x)]$  is expectation over a uniform distribution over  $S$ .
This bound on the empirical Rademacher complexity leads to the standard generalization bound for supervised learning.
Theorem A.2. For a binary classification setting when  $y \in \{\pm 1\}$  with a zero-one loss, for  $\mathcal{H} \subset \{h : \mathcal{X} \to \{-1, 1\}\}$  be a family of binary classifiers, let  $S = \{(x_1, y_1), \ldots, (x_n, y_n)\}$  is drawn i.i.d. from  $D$  then with probability at least  $1 - \delta$ , we have
$$
| \mathrm {e r r} _ {\mathcal {D}} (h) - \widehat {\mathrm {e r r} _ {S}} (h) | \leq R _ {n} (\mathcal {H}) + \sqrt {\frac {\ln (2 / \delta)}{2 n}},
$$
for every  $h\in \mathcal{H}$  when
$$
\operatorname {e r r} _ {\mathcal {D}} (h) = \Pr_ {(x, y) \sim \mathcal {D}} (h (x) \neq y)
$$
$$
\widehat {\operatorname {e r r}} _ {S} (h) = \frac {1}{n} \sum_ {i = 1} ^ {n} 1 [ h (x _ {i}) \neq y _ {i} ]
$$
is the empirical error on  $S$ .
For a linear model with a bounded weights in  $\ell_2$  norm, the Rademacher complexity is  $\mathcal{O}\left(\frac{1}{\sqrt{n}}\right)$ . We refer to the proof from Ma [24] for this result.
Theorem A.3 (Rademacher complexity of a linear model ([24])). Let  $\mathcal{X}$  be an instance space in  $\mathbb{R}^d$ , let  $\mathcal{D}_{\mathcal{X}}$  be a distribution on  $\mathcal{X}$ , let  $\mathcal{H} = \{h : x \to \langle w_h, x \rangle \mid w_h \in \mathbb{R}^d, \|w_h\|_2 \leq B\}$  be a class of linear model with weights bounded by some constant  $B > 0$  in  $\ell_2$  norm. Assume that there exists a constant  $C > 0$  such that  $\mathbb{E}_{x \sim \mathcal{D}_{\mathcal{X}}}[||x||_2^2] \leq C^2$ . For any  $S = \{x_1, \ldots, x_n\}$  is drawn i.i.d. from  $\mathcal{D}_{\mathcal{X}}$ , we have
$$
R _ {S} (\mathcal {H}) \leq \frac {B}{n} \sqrt {\sum_ {i = 1} ^ {n} | | x _ {i} | | _ {2} ^ {2}}
$$
$$
R _ {n} (\mathcal {H}) \leq \frac {B C}{\sqrt {n}}.
$$
Many of our proofs require the usage of Talgrand's lemma, which we now present.
Lemma A.4 (Talgrand's Lemma [21]). Let  $\phi : \mathbb{R} \to \mathbb{R}$  be a  $k$ -Lipschitz function. Then for a hypothesis class  $\mathcal{H} = \{h : \mathbb{R}^d \to \mathbb{R}\}$ , we have that
$$
R _ {S} (\phi \circ \mathcal {H}) \leq k R _ {s} (\mathcal {H})
$$
where  $\phi \circ \mathcal{H} = \{f: z \mapsto \phi(h(z)) | h \in \mathcal{H}\}$ .
B Generalizable Constraints
We know that constraints  $C(x)$  capture human knowledge about how explanations at a point  $x$  should behave. For any constraints  $C(x)$  that are known apriori for all  $x \in \mathcal{X}$ , we can evaluate whether a model satisfies the constraints at a point  $x \in \mathcal{X}$ . This motivates us to discuss the ability of models to generalize from any finite samples  $S_{E}$  to satisfy these constraints over  $\mathcal{X}$  with high probability. Having access to  $C(x)$  is equivalent to knowing how models should behave over all possible data points in terms of explanations, which may be too strong of an assumption. Nevertheless, many forms of human knowledge can be represented by a closed-form function  $C(x)$ . For example,
1. An explanation has to take value in a fixed range can be represented by  $C(x) = \Pi_{i=1}^{r}[a_i, b_i], \forall x \in \mathcal{X}$ .
2. An explanation has to stay in a ball around  $x$  can be represented by  $C(x) = \{u \in \mathbb{R}^d \mid \| u - x \|_2 \leq r\}$ .
3. An explanation has to stay in a rectangle around  $\frac{x}{3}$  can be represented by  $C(x) = \{u \in \mathbb{R}^d \mid \frac{x_i}{3} - a_i \leq u_i \leq \frac{x_i}{3} + b_i, i = 1, \dots, d\}$ .
Figure 6: Illustration of examples of explanation constraints, given from some learnable class  $C(x)$ .
In this case, there always exists a surrogate loss that represents the explanation constraints  $C(x)$ ; for example, we can set  $\phi(h,x) = 1\{g(h,x) \in C(x)\}$ . On the other hand, directly specifying explanation constraints through a surrogate loss would also imply that  $C(x)$  is known apriori for all  $x \in \mathcal{X}$ . The task of generalization to satisfy the constraint on unseen data is well-defined in this setting. Furthermore, if a surrogate loss  $\phi$  is specified, then we can evaluate  $\phi(h,x)$  on any unlabeled data point without the need for human annotators which is a desirable property.
On the other hand, we usually do not have knowledge over all data points  $x \in \mathcal{X}$ ; rather, we may only know these explanation constraints over a random sample of  $k$  data points  $S_{E} = \{x_{1}',\ldots ,x_{k}'\}$ . If we do not know the constraint set  $C(x)$ , it is unclear what satisfying the constraint at an unseen data point  $x$  means. Indeed, without additional assumptions, it may not make sense to think about generalization. For example, if there is no relationship between  $C(x)$  for different values of  $x$ , then it is not possible to infer about  $C(x)$  from  $C(x_i')$  for  $i = 1,\dots ,k$ . In this case, we could define
$$
\phi (h, x) = 1 \{g (h, x) \in C (x) \} 1 \{x \in S _ {E} \},
$$
where we are only interested in satisfying these explanation constraints over the finite sample  $S_{E}$ . For other data points, we have  $\phi(h,x) = 0$ . This guarantees that any model with low empirical explanation loss would also achieve loss expected explanation loss, although this does not have any particular implication on any notion of generalization to new constraints. Regardless, we note that our explanation constraints still reduce the size of the hypothesis class from  $\mathcal{H}$  to  $\mathcal{H}_{\phi,\tau}$ , leading to an improvement in sample complexity.
The more interesting setting, however, is when we make an additional assumption that the true (unknown) surrogate loss  $\phi$  exists and, during training, we only have access to instances of this surrogate loss evaluated on the sample  $\phi(\cdot, x_i')$ . We can apply a uniform convergence argument to achieve
$$
\phi (h, \mathcal {D} _ {\mathcal {X}}) \leq \phi (h, S _ {E}) + 2 R _ {k} (\mathcal {G}) + \sqrt {\frac {\ln (4 / \delta)}{2 k}}
$$
with probability at least  $1 - \delta$  over  $S_{E}$ , drawn i.i.d. from  $\mathcal{D}_{\mathcal{X}}$  and  $\mathcal{G} = \{\phi (h,\cdot)|h\in \mathcal{H}\}$ ,  $k = |S_{E}|$ . Although the complexity term  $R_{k}(\mathcal{G})$  is unknown (since  $\phi$  is unknown), we can upper bound this by the complexity of a class of functions  $\Phi$  (e.g., neural networks) that is large enough to well-approximate any  $\phi (h,\cdot)\in \mathcal{G}$ , meaning that  $R_{k}(\mathcal{G})\leq R_{k}(\Phi)$ . Comparing to the former case when  $C(x)$  is known for all  $x\in \mathcal{X}$  apriori, the generalization bound has a term that increases from  $R_{k}(\mathcal{G})$  to  $R_{k}(\Phi)$ , which may require more explanation-annotated data to guarantee generalization to new data points. We note that the simpler constraints lead to a simpler surrogate loss, which in turn implies a less complex upper bound  $\Phi$ . This means that simpler constraints are easier to learn.
Nonetheless, this is a more realistic setting when explanation constraints are hard to acquire and we do not have the constraints for all data points in  $\mathcal{X}$ . For example, Ross et al. [33] considers an image classification task on MNIST, and imposes an explanation constraint in terms of penalizing the input gradient of the background of images. In essence, the idea is that the background should be less important than the foreground for the classification task. In general, this constraint does not have a closed-form expression, and we do not even have access to the constraint for unseen data points. However, if we assume that a surrogate loss  $\phi(h, \cdot)$  can be well-approximated by two layer neural networks, then our generalization bound allows us to reason about the ability of model to generalize and ignore background features on new data.
C Goodness of an explanation constraint
Definition 7 (Goodness of an explanation constraint). For a hypothesis class  $\mathcal{H}$ , a distribution  $\mathcal{D}$  and an explanation loss  $\phi$ , the goodness of  $\phi$  with respect to a threshold  $\tau$  and  $n$  labeled examples is:
$$
G _ {n, \tau} (\phi , \mathcal {H}) = \left(R _ {n} (\mathcal {H}) - R _ {n} \left(\mathcal {H} _ {\phi , \tau}\right)\right) + \left(\operatorname {e r r} _ {\mathcal {D}} \left(h ^ {*}\right) - \operatorname {e r r} _ {\mathcal {D}} \left(h _ {t} ^ {*}\right)\right)
$$
$$
h ^ {*} = \arg \min _ {h \in \mathcal {H}} \operatorname {e r r} _ {\mathcal {D}} (h), \quad h _ {\tau} ^ {*} = \arg \min _ {h \in \mathcal {H} _ {\phi , \tau}} \operatorname {e r r} _ {\mathcal {D}} (h).
$$
Here, we assume access to infinite explanation data so that  $\varepsilon_{k}\rightarrow 0$ . The goodness depends on the number of labeled examples  $n$  and a threshold  $t$ . In our definition, a good explanation constraint leads to a reduction in the complexity of  $\mathcal{H}$  while still containing a classifier with low error. This suggests that the benefits from explanation constraints exhibit diminishing returns as  $n$  becomes large. In fact, as  $n\to \infty$ , we have  $R_{n}(\mathcal{H})\to 0$ ,  $R_{n}(\mathcal{H}_{\phi ,\tau})\to 0$  which implies  $G_{n}(\phi ,\mathcal{H})\to \mathrm{err}_{\mathcal{D}}(h^{*})-$ $\mathrm{err}_{\mathcal{D}}(h_{\tau}^{*})\leq 0$ . On the other hand, explanation constraints help when  $n$  is small. For  $t$  large enough, we expect  $\mathrm{err}_{\mathcal{D}}(h^{*}) - \mathrm{err}_{\mathcal{D}}(h_{\tau}^{*})$  to be small, so that our notion of goodness is dominated by the first term:  $R_{n}(\mathcal{H}) - R_{n}(\mathcal{H}_{\phi ,\tau})$ , which has the simple interpretation of reduction in model complexity.
D Examples for Generalizable constraints
In this section, we look at the Rademacher complexity of  $\mathcal{G}$  for different explanation constraints to characterize how many samples with explanation constraints are required in order to generalize to satisfying the explanation constraints on unseen data. We remark that this is a different notion of sample complexity; these unlabeled data require annotations of explanation constraints, not standard labels. In practice, this can be easier and less expertise might be necessary if define the surrogate loss  $\phi$  directly. First, we analyze the case where our explanation is given by the gradient of a linear model.
Proposition D.1 (Learning a gradient constraint for linear models). Let  $\mathcal{D}$  be a distribution over  $\mathbb{R}^d$ . Let  $\mathcal{H} = \{h : x \mapsto \langle w_h, x \rangle \mid w_h \in \mathbb{R}^d, \|w_h\|_2 \leq B\}$  be a class of linear models that pass through the origin. Let  $\phi(h, x) = \theta(w_h, w_{h'})$  be a surrogate explanation loss. Let  $\mathcal{G} = \{\phi(h, \cdot) \mid h \in \mathcal{H}\}$ , then we have
$$
R _ {n} (\mathcal {G}) \leq \frac {\pi}{2 \sqrt {m}}.
$$
Proof. For a linear separator,  $\phi(h, \cdot)$  is a constant function over  $\mathcal{X}$ . The Rademacher complexity is given by
$$
\begin{array}{l} R _ {n} (\mathcal {G}) = \underset {x \sim D} {\mathbb {E}} \left[ \underset {\sigma} {\mathbb {E}} \left[ \sup  _ {\phi (h, \cdot) \in \mathcal {G}} \left(\frac {1}{m} \sum_ {i = 1} ^ {m} \sigma_ {i} \phi (h, x _ {i})\right) \right] \right] \\ = \underset {x \sim D} {\mathbb {E}} \left[ \underset {\sigma} {\mathbb {E}} \left[ \sup  _ {h \in \mathcal {H}} \left(\frac {1}{m} \sum_ {i = 1} ^ {m} \sigma_ {i}\right) \theta \left(w _ {h}, w _ {h ^ {\prime}}\right) \right] \right] \\ = \underset {x \sim D} {\mathbb {E}} \left[ \mathbb {E} _ {\sigma} \left[ \left(\frac {1}{m} \sum_ {i = 1} ^ {m} \sigma_ {i}\right) \sup  _ {h \in \mathcal {H}} \theta \left(w _ {h}, w _ {h ^ {\prime}}\right) \right] \right] \\ = \frac {\pi}{2} \underset {\sigma} {\mathbb {E}} \left[ \left| \frac {1}{m} \sum_ {i = 1} ^ {m} \sigma_ {i} \right| \right] \\ \leq \frac {\pi}{2 \sqrt {m}}. \\ \end{array}
$$
We compare this with the Rademacher complexity of linear models which is given by  $R_{m}(\mathcal{H}) \leq \frac{B}{\sqrt{m}}$ . The upper bound does not depend on the upper bound on the weight  $B$ . In practice, we know that the gradient of a linear model is constant for any data point. This implies that knowing a gradient of a single point is enough to identify the gradient of the linear model.
We consider another type of explanation constraint that is given by a noisy model. Here, we could observe either a noisy classifier and noisy regressor, and the constraint could be given by having similar outputs to this noisy model. This is reminiscent of learning with noisy labels [27] or weak supervision [30, 29, 28]. In this case, our explanation  $g$  is simply the hypothesis element  $h$  itself, and our constraint is on the values that  $h(x)$  can take. We first analyze this in the classification setting.
Proposition D.2 (Learning a constraint given by a noisy classifier). Let  $\mathcal{D}$  be a distribution over  $\mathbb{R}^d$ . Consider a binary classification task with  $\mathcal{Y} = \{-1,1\}$ . Let  $\mathcal{H}$  be a hypothesis class. Let  $\phi(h,x) = 1[h(x)\neq h'(x)]$  be a surrogate explanation loss. Let  $\mathcal{G} = \{\phi(h,\cdot)\mid h\in \mathcal{H}\}$ , then we have
$$
R _ {n} (\mathcal {G}) = \frac {1}{2} R _ {n} (\mathcal {H}).
$$
$$
\begin{array}{l} R _ {n} (\mathcal {G}) = \underset {x \sim D} {\mathbb {E}} \left[ \mathbb {E} _ {\sigma} \left[ \sup  _ {\phi (h, \cdot) \in \mathcal {G}} \left(\frac {1}{m} \sum_ {i = 1} ^ {m} \sigma_ {i} \phi (h, x _ {i})\right) \right] \right] \\ = \underset {x \sim D} {\mathbb {E}} \left[ \underset {\sigma} {\mathbb {E}} \left[ \sup  _ {h \in \mathcal {H}} \left(\frac {1}{m} \sum_ {i = 1} ^ {m} \sigma_ {i} \left(\frac {1 - h (x) h ^ {\prime} (x)}{2}\right)\right) \right] \right] \\ = \underset {x \sim D} {\mathbb {E}} \left[ \underset {\sigma} {\mathbb {E}} \left[ \sup  _ {h \in \mathcal {H}} \left(\frac {1}{m} \sum_ {i = 1} ^ {m} \sigma_ {i} \left(\frac {h (x) h ^ {\prime} (x)}{2}\right)\right) \right] \right] \\ = \underset {x \sim D} {\mathbb {E}} \left[ \underset {\sigma} {\mathbb {E}} \left[ \sup  _ {h \in \mathcal {H}} \left(\frac {1}{m} \sum_ {i = 1} ^ {m} \sigma_ {i} \left(\frac {h (x)}{2}\right)\right) \right] \right] \\ = \frac {1}{2} R _ {n} (\mathcal {H}). \\ \end{array}
$$
Here, to learn the restriction of  $\mathcal{G}$  is on the same order of  $R_{n}(\mathcal{H})$ . For a given noisy regressor, we observe slightly different upper bound.
Proposition D.3 (Learning a constraint given by a noisy regressor). Let  $\mathcal{D}$  be a distribution over  $\mathbb{R}^d$ . Consider a regression task with  $\mathcal{V} = \mathbb{R}$ . Let  $\mathcal{H}$  be a hypothesis class that  $\forall h \in \mathcal{H}, -h \in \mathcal{H}$ . Let  $\phi(h, x) = |h(x) - h'(x)|$  be a surrogate explanation loss. Let  $\mathcal{G} = \{\phi(h, \cdot) \mid h \in \mathcal{H}\}$ , then we have
$$
R _ {n} (\mathcal {G}) \leq 2 R _ {n} (\mathcal {H}).
$$
$$
\begin{array}{l} R _ {n} (\mathcal {G}) = \underset {x \sim D} {\mathbb {E}} \left[ \mathbb {E} _ {\sigma} \left[ \sup  _ {\phi (h, \cdot) \in \mathcal {G}} \left(\frac {1}{m} \sum_ {i = 1} ^ {m} \sigma_ {i} \phi (h, x _ {i})\right) \right] \right] \\ = \underset {x \sim D} {\mathbb {E}} \left[ \underset {\sigma} {\mathbb {E}} \left[ \sup  _ {h \in \mathcal {H}} \left(\frac {1}{m} \sum_ {i = 1} ^ {m} \sigma_ {i} | h \left(x _ {i}\right) - h ^ {\prime} \left(x _ {i}\right) |\right) \right] \right] \\ = \underset {x \sim D} {\mathbb {E}} \left[ \mathbb {E} _ {\sigma} \left[ \sup  _ {h \in \mathcal {H}} \left(\frac {1}{m} \sum_ {i = 1} ^ {m} \sigma_ {i} \max  (0, h \left(x _ {i}\right) - h ^ {\prime} \left(x _ {i}\right)) + \frac {1}{m} \sum_ {i = 1} ^ {m} \sigma_ {i} \max  (0, h ^ {\prime} \left(x _ {i}\right) - h \left(x _ {i}\right))\right) \right] \right] \\ \leq \underset {x \sim D} {\mathbb {E}} \left[ \mathbb {E} _ {\sigma} \left[ \sup  _ {h \in \mathcal {H}} \left(\frac {1}{m} \sum_ {i = 1} ^ {m} \sigma_ {i} \max  (0, h (x _ {i}) - h ^ {\prime} (x _ {i}))\right) \right] \right] + \\ \underset {x \sim D} {\mathbb {E}} \left[ \underset {\sigma} {\mathbb {E}} \left[ \sup  _ {h \in \mathcal {H}} \left(\frac {1}{m} \sum_ {i = 1} ^ {m} \sigma_ {i} \max  (0, h ^ {\prime} (x _ {i}) - h (x _ {i}))\right) \right] \right] \\ \leq \underset {x \sim D} {\mathbb {E}} \left[ \mathbb {E} _ {\sigma} \left[ \sup _ {h \in \mathcal {H}} \left(\frac {1}{m} \sum_ {i = 1} ^ {m} \sigma_ {i} (h (x _ {i}) - h ^ {\prime} (x _ {i}))\right) \right] \right] + \underset {x \sim D} {\mathbb {E}} \left[ \mathbb {E} _ {\sigma} \left[ \sup _ {h \in \mathcal {H}} \left(\frac {1}{m} \sum_ {i = 1} ^ {m} \sigma_ {i} (h ^ {\prime} (x _ {i}) - h (x _ {i}))\right) \right] \right], \\ \end{array}
$$
where in the last line, we apply Talgrand's lemma A.4 and note that the max function  $\max (0,h(x))$  is 1-Lipschitz; in the third line, we note that we break up the supremum as both terms by definition of the max function are non-negative. Then, noting that we do not optimize over  $h^\prime (x)$ , we further simplify this as
$$
\begin{array}{l} R _ {n} (\mathcal {G}) \leq \underset {x \sim D} {\mathbb {E}} \left[ \underset {\sigma} {\mathbb {E}} \left[ \sup  _ {h \in \mathcal {H}} \left(\frac {1}{m} \sum_ {i = 1} ^ {m} \sigma_ {i} h (x _ {i})\right) \right] \right] + \underset {x \sim D} {\mathbb {E}} \left[ \underset {\sigma} {\mathbb {E}} \left[ \sup  _ {h \in \mathcal {H}} \left(\frac {1}{m} \sum_ {i = 1} ^ {m} \sigma_ {i} (- h (x _ {i}))\right) \right] \right] \\ \leq 2 R _ {n} (\mathcal {H}). \\ \end{array}
$$
As mentioned before, knowing apriori surrogate loss  $\phi$  might be too strong. In practice, we may only have access to the instances  $\phi(\cdot, x_i)$  on a set of samples  $S = \{x_1, \ldots, x_k\}$ . We also consider the case when  $\phi(h, x) = |h(x) - h'(x)|$  when  $h'$  is unknown and  $h'$  belongs to a learnable class  $\mathcal{C}$ .
Proposition D.4 (Learning a constraint given by a noisy regressor from some learnable class  $\mathcal{C}$ ). Assume  $\mathcal{D}$  is a distribution over  $\mathbb{R}^d$ . Let  $\mathcal{H}$  and  $\mathcal{D}$  be hypothesis classes. Let  $\phi_{h'}(h,x) = |h(x) - h'(x)|$  be a surrogate explanation loss of a constraint corresponding to  $h'$ . Let  $\mathcal{G}_{\mathcal{C}} = \{\phi_{h'}(h,\cdot) | h \in \mathcal{H}, h' \in \mathcal{C}\}$ , then we have
$$
R _ {n} (\mathcal {G} _ {\mathcal {C}}) \leq 2 R _ {n} (\mathcal {H}) + 2 R _ {n} (\mathcal {C}).
$$
$$
\begin{array}{l} R _ {n} (\mathcal {G} _ {\mathcal {C}}) = \underset {x \sim D} {\mathbb {E}} \left[ \mathbb {E} _ {\sigma} \left[ \sup  _ {\phi (h, \cdot) \in \mathcal {G} _ {\mathcal {C}}} \left(\frac {1}{m} \sum_ {i = 1} ^ {m} \sigma_ {i} \phi (h, x _ {i})\right) \right] \right] \\ = \underset {x \sim D} {\mathbb {E}} \left[ \mathbb {E} _ {\sigma} \left[ \sup  _ {h \in \mathcal {H}, h ^ {\prime} \in \mathcal {C}} \left(\frac {1}{m} \sum_ {i = 1} ^ {m} \sigma_ {i} | h (x _ {i}) - h ^ {\prime} (x _ {i}) |\right) \right] \right] \\ \leq \underset {x \sim D} {\mathbb {E}} \left[ \underset {\sigma} {\mathbb {E}} \left[ \sup  _ {h \in \mathcal {H}, h ^ {\prime} \in \mathcal {C}} \left(\frac {1}{m} \sum_ {i = 1} ^ {m} \sigma_ {i} \max  (0, h (x _ {i}) - h ^ {\prime} (x _ {i}))\right) \right] \right] + \\ \underset {x \sim D} {\mathbb {E}} \left[ \underset {\sigma} {\mathbb {E}} \left[ \sup  _ {h \in \mathcal {H}, h ^ {\prime} \in \mathcal {C}} \left(\frac {1}{m} \sum_ {i = 1} ^ {m} \sigma_ {i} \max  (0, h ^ {\prime} (x _ {i}) - h (x _ {i}))\right) \right] \right] \\ \leq \underset {x \sim D} {\mathbb {E}} \left[ \underset {\sigma} {\mathbb {E}} \left[ \sup  _ {h \in \mathcal {H}, h ^ {\prime} \in \mathcal {C}} \left(\frac {1}{m} \sum_ {i = 1} ^ {m} \sigma_ {i} (h (x _ {i}) - h ^ {\prime} (x _ {i}))\right) \right] \right] + \\ \underset {x \sim D} {\mathbb {E}} \left[ \underset {\sigma} {\mathbb {E}} \left[ \sup  _ {h \in \mathcal {H}, h ^ {\prime} \in \mathcal {C}} \left(\frac {1}{m} \sum_ {i = 1} ^ {m} \sigma_ {i} (h ^ {\prime} (x _ {i}) - h (x _ {i}))\right) \right] \right] \\ \end{array}
$$
where the lasts line again holds by an application of Talgrand's lemma. In this case, we indeed are optimizing over  $h'$ , so we get that
$$
\begin{array}{l} R _ {n} \left(\mathcal {G} _ {\mathcal {C}}\right) \leq 2 \cdot \underset {x \sim D} {\mathbb {E}} \left[ \underset {\sigma} {\mathbb {E}} \left[ \sup  _ {h \in \mathcal {H}} \left(\frac {1}{m} \sum_ {i = 1} ^ {m} \sigma_ {i} \left(h \left(x _ {i}\right)\right)\right) \right] \right] + 2 \cdot \underset {x \sim D} {\mathbb {E}} \left[ \underset {\sigma} {\mathbb {E}} \left[ \sup  _ {h ^ {\prime} \in \mathcal {C}} \left(\frac {1}{m} \sum_ {i = 1} ^ {m} \sigma_ {i} \left(h ^ {\prime} \left(x _ {i}\right)\right)\right) \right] \right] \\ = 2 R _ {n} (\mathcal {H}) + 2 R _ {n} (\mathcal {C}). \\ \end{array}
$$
We remark that while this value is much larger than that of  $R_{n}(\mathcal{H})$ , we only need information about  $\phi(h, x)$  and not the true label. Therefore, in many cases, this is preferable and not as expensive to learn.
We consider the agnostic setting of Theorem 3.2. Here, we have two notions of deviations; one is deviation in a model's ability to satisfy explanations, and the other is a model's ability to generalize to correctly produce the target function.
Proof. From Rademacher-based uniform convergence, for any  $h \in \mathcal{H}$ , with probability at least  $1 - \delta / 2$  over  $S_E$
$$
\left| \phi (h, \mathcal {D}) - \phi (h, S _ {E}) \right| \leq 2 R _ {k} (\mathcal {G}) + \sqrt {\frac {\ln (4 / \delta)}{2 k}} = \varepsilon_ {k}
$$
Therefore, with probability at least  $1 - \delta /2$ , for any  $h\in \mathcal{H}_{\phi ,t - \varepsilon_k}$  we also have  $\phi (h,S_E)\leq t$  and for any  $h$  with  $\phi (h,S_E)\leq t$ , we have  $h\in \mathcal{H}_{\phi ,t + \varepsilon_k}$ . In addition, by a uniform convergence bound, with probability at least  $1 - \delta /2$ , for any  $h\in \mathcal{H}_{\phi ,t + \varepsilon_k}$
$$
| \mathrm {e r r} _ {\mathcal {D}} (h) - \mathrm {e r r} _ {S} (h) | \leq R _ {n} (\mathcal {H} _ {\phi , t + \varepsilon_ {k}}) + \sqrt {\frac {\ln (4 / \delta)}{2 n}}.
$$
Now, let  $h'$  be the minimizer of  $\mathrm{err}_S(h)$  given that  $\phi(h, S_E) \leq t$ . By previous results, with probability  $1 - \delta$ , we have  $h' \in \mathcal{H}_{\phi, t + \varepsilon_k}$  and
$$
\begin{array}{l} \operatorname {e r r} _ {\mathcal {D}} (h ^ {\prime}) \leq \operatorname {e r r} _ {S} (h ^ {\prime}) + R _ {n} (\mathcal {H} _ {\phi , t + \varepsilon_ {k}}) + \sqrt {\frac {\ln (4 / \delta)}{2 n}} \\ \leq \operatorname {e r r} _ {S} (h _ {t - \varepsilon_ {k}} ^ {*}) + R _ {n} (\mathcal {H} _ {\phi , t + \varepsilon_ {k}}) + \sqrt {\frac {\ln (4 / \delta)}{2 n}} \\ \leq \mathrm {e r r} _ {\mathcal {D}} (h _ {t - \varepsilon_ {k}} ^ {*}) + 2 R _ {n} (\mathcal {H} _ {\phi , t + \varepsilon_ {k}}) + 2 \sqrt {\frac {\ln (4 / \delta)}{2 n}}. \\ \end{array}
$$
F EPAC-PAC learnability
We note that in our definition of EPAC learnability, we are only concerned with whether a model achieves a lower surrogate loss than  $\tau$ . However, the objective of minimizing the EPAC-ERM objective is to achieve both low average error and low surrogate loss. We characterize this property as EPAC-PAC learnability.