SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Nick Rittler
University of California - San Diego nrittler@ucsd.edu
Kamalika Chaudhuri
University of California - San Diego kamalika@cs.ucsd.edu
Inspired by the problem of improving classification accuracy on rare or hard subsets of a population, there has been recent interest in models of learning where the goal is to generalize to a collection of distributions, each representing a "group". We consider a variant of this problem from the perspective of active learning, where the learner is endowed with the power to decide which examples are labeled from each distribution in the collection, and the goal is to minimize the number of label queries while maintaining PAC-learning guarantees. Our main challenge is that standard active learning techniques such as disagreement-based active learning do not directly apply to the multi-group learning objective. We modify existing algorithms to provide a consistent active learning algorithm for an agnostic formulation of multi-group learning, which given a collection of  $G$  distributions and a hypothesis class  $\mathcal{H}$  with VC-dimension  $d$ , outputs an  $\epsilon$ -optimal hypothesis using  $\tilde{O}\left((\nu^2/\epsilon^2)Gd\theta_{\mathcal{G}}^2\log^2(1/\epsilon) + G\log(1/\epsilon)/\epsilon^2\right)$  label queries, where  $\theta_{\mathcal{G}}$  is the worst-case disagreement coefficient over the collection. Roughly speaking, this guarantee improves upon the label complexity of standard multi-group learning in regimes where disagreement-based active learning algorithms may be expected to succeed, and the number of groups is not too large. We also consider the special case where each distribution in the collection is individually realizable with respect to  $\mathcal{H}$ , and demonstrate  $\tilde{O}\left(Gd\theta_{\mathcal{G}}\log(1/\epsilon)\right)$  label queries are sufficient for learning in this case. We further give an approximation result for the full agnostic case inspired by the group realizable strategy.
There is a growing theory literature concerned with choosing a classifier that performs well on multiple subpopulations or "groups" [1, 2, 7, 6, 4, 5, 6, 3]. In many cases, the motivation comes from a perspective of fairness, where a typical requirement is that we classify with similar accuracy across groups [7, 6, 4]. In other cases, the motivation may simply be to train more reliable classifiers. For example, cancer detection models with good overall accuracy often suffer from poor ability to detect rare subtypes of cancer that are not well-represented or identified in training. This suggests that naive ERM may be insufficient in practice [8].
In this work, we consider the following formulation of "multi-group" learning. The learner is given a collection of distributions  $\mathcal{G} = \{D_g\}_{g=1}^G$ , each corresponding to a group, and a hypothesis class  $\mathcal{H}$ , and wants to pick a classifier that approximately minimizes the maximum classification error over group distributions. We consider this problem from an active learning perspective, where the learner has the power to choose which examples from each group it wants to label during training. In a standard extension of the active learning literature, we set out to design schemes for choosing which examples from each group should be labeled, where the goal is to minimize the number of label queries while retaining PAC-learning guarantees.
A major challenge in harnessing the power of active algorithms even in standard agnostic settings is making sure they are consistent. In the case of active learning, this means that as the number
of number of labels requested approaches infinity, the learner outputs an optimal hypothesis. To complicate things further, the main algorithmic paradigm for consistent agnostic active learning over a single distribution - disagreement based active learning (DBAL) - fails to admit direct application in the multi-group learning objective. The fundamental idea in DBAL is that the learner may safely spend its labeling budget in the "disagreement region", a subset of instance space where empirically well-performing hypotheses disagree about how new examples should be labeled. When the learner need only consider a single distribution, error differences between classifiers are specified entirely through their performance on the disagreement region, and so spending the labeling budget here allows the learner to figure out which hypotheses are best while saving on labels. The problem is that when multiple group distributions must be considered, the absolute errors of classifiers on each group must be estimated to compare performance of two classifiers in their worst case over collection, and this property no longer holds.
We resolve this via the observation that, while we cannot spend all our labeling budget in the disagreement region, we can exploit the agreement in its complement to cheaply estimate absolute errors of classifiers on each group. In particular, we estimate the absolute errors by choosing a representative classifier  $h_{\mathcal{H}'}$  in the set of empirically well-performing classifiers  $\mathcal{H}'$ , and estimating its error on the complement of the disagreement region on each group distribution. These error estimates can be used to construct estimates for the absolute errors on each group for each  $h \in \mathcal{H}'$  at the statistical cost of estimating a coin bias, leading to a relatively cheap, consistent active strategy.
We analyze the number of label queries made by this scheme in terms of a standard complexity measure in the active learning literature called the "disagreement coefficient" [9, 10], and show an upper bound of  $\tilde{O}\left((\nu^2/\epsilon^2)Gd\theta_{\mathcal{G}}^2\log^2(1/\epsilon) + G\log(1/\epsilon)/\epsilon^2\right)$ , where  $\theta_{\mathcal{G}}$  is the maximal disagreement coefficient over the collection of group distributions. We discuss some regimes where this label complexity can be expected to push below sample complexity lower bounds for a learner that can request samples from each group distribution during training, but does not have power to abstain from labeling specific examples.
We also consider the special case of agnostic learning where each group distribution is individually realizable, but no single hypothesis separates all groups simultaneously. In this case, we show that all dependence on  $1 / \epsilon^2$  in the label complexity can be replaced with  $\log (1 / \epsilon)$  when disagreement coefficients are bounded. It turns out that using the strategy we develop in this special case leads to an approximation algorithm for the general agnostic case, for which we give guarantees.
2.1 Multi-Group Learning
The majority of the empirical work on multi-group learning has been through the lens of "Group-Distributionally Robust Optimization" (G-DRO) [11, 12, 13]. The goal in G-DRO is to choose a classifier that minimizes the maximal risk against an unknown mixture over a collection of distributions  $\{D_g\}_{g=1}^G$  representing groups. One assumes a completely passive sampling setting - all data is given to the learner at the beginning of training, and the learner has no ability to draw extra, fine-grained samples. The strategy is usually empirical risk minimization (ERM) - or some regularized variant - on the empirical max loss over groups; for a set of classifiers parameterized by  $\phi \in \Phi$ , letting  $S_g$  denote the set of examples in the training set coming from  $D_g$ , one performs  $\min_{\phi \in \Phi} \max_{g \in [G]} \frac{1}{|S_g|} \sum_{(x_i, y_i) \in S_g} l(f_\phi(x_i), y_i)$  for some loss  $l$ . It is important to note that the learner knows the group identity of each sample in the training set, but is not provided with group information at test time, precluding the possibility of training a separate classifiers for each group.
"Multi-group PAC learning" consider the multi-group problem under the passive sampling assumption from a more classical learning-theoretic perspective [7, 6]. Here, one assumes there is a single distribution  $D$  from which one is given samples, but also a collection of subsets of instance space  $\mathcal{G}$  over which one wants to learn conditional distributions. Given a hypothesis class  $\mathcal{H}$ , the learner tries to improperly learn a classifier  $f$  that competes with the optimal hypothesis on each conditional distribution specified by a group  $g$  in the collection - formally, one requires that for a given error tolerance  $\epsilon$ ,  $f$  has the property  $\forall g \in \mathcal{G}$ ,  $\mathbb{P}_D(f(x) \neq y|x \in g) \leq \inf_{h \in \mathcal{H}} \mathbb{P}_D(h(x) \neq y|x \in g) + \epsilon$  with high probability. An interesting wrinkle in this literature is that the group identity of samples is available at both training and test times. It has been shown that a sample complexity of
Table 1: Overview of the complexity of multi-group learning. The  $\tilde{O}$  notation hides factors logarithmic in  $d$ ,  $G$ ,  $1/\delta$ , and  $\log(1/\epsilon)$ . We reserve discussion of regimes in which our algorithm improves on results in Collaborative Learning for Section 5.
Problem	Full Agnostic	Group-Realizable
Passive Multi-Group [6]	\(\tilde{O}\left(\log(|\mathcal{H}|)/\gamma\epsilon^{2}\right)\)	\(\tilde{O}\left(\log(|\mathcal{H}|)/\gamma\epsilon\right)\)
Collaborative Learning [3]	\(\tilde{O}\left(d\log(1/\epsilon)/\epsilon^{2}+G/\epsilon^{2}\right)\)	?
Active Multi-Group (us)	\(\tilde{O}\left((\nu^{2}/\epsilon^{2})Gd\theta_{G}^{2}\log^{2}(1/\epsilon)+G\log(1/\epsilon)/\epsilon^{2}\right)\)	\(\tilde{O}\left(Gd\log^{2}(1/\epsilon)\right)\)
$\tilde{O}\left(\log (|\mathcal{H}|) / \gamma \epsilon^2\right)$  is sufficient for agnostic learning in this model, where  $\gamma$  is the minimal mass of a group  $g$  under  $D$  [6].
"Collaborative learning" studies the multi-group problem under an alternative sampling model [1, 2, 3]. In this case, we are given a collection of distributions  $\{D_g\}_{g=1}^G$ , each corresponding to a group. Given some hypothesis class  $\mathcal{H}$ , the goal is to learn a classifier  $f$ , possibly improperly, that is evaluated against its worst-case loss over  $D_1, \ldots, D_G$ ; formally, we would like  $f$  to satisfy  $\max_{g \in [G]} \mathbb{P}_{D_g}(f(x) \neq y) \leq \inf_{h \in \mathcal{H}} \max_{g \in [G]} \mathbb{P}_{D_g}(h(x) \neq y) + \epsilon$ . In contrast with multi-group PAC learning, the learner may decide how many samples from each  $D_g$  it wants to collect during training, and group identity is hidden on test examples. This models the case where a learner may want to collect more data from a particularly difficult group of instances, such as a rare or hard-to-diagnose type of cancer. It has been shown for finite hypothesis classes that  $\tilde{\Theta}(\log(|\mathcal{H}|)/\epsilon^2 + G/\epsilon^2)$  total samples over all groups are necessary and sufficient to learn in this model;  $\tilde{O}(d\log(1/\epsilon)/\epsilon^2 + G/\epsilon^2)$  total samples are sufficient for VC-classes [3].
Our work extends the model of collaborative learning, and endows the learner with the ability to decide which samples from each group distribution  $D_g$  should be labeled. This is the standard framework of active learning, applied to the multi-group setting. As in collaborative learning, we assume group identity is hidden at test time.
2.2 Active Learning
Active learning concerns itself with the development of learning algorithms for training classifiers that have power over which training examples should be labeled [14, 15]. The field has largely focused on uncovering settings in which algorithmic approaches reduce the amount of labels required for PAC-style learning guarantees beyond sample complexity lower bounds that apply to i.i.d. data collection from the underlying distribution [16, 17]. In the agnostic, 0-1 loss setting, the standard upper bounds for label complexity follow  $\tilde{O}\left(\theta(d\log(1/\epsilon) + d\nu^2/\epsilon^2)\right)$ . Here,  $\nu$  is the "noise rate", i.e., the true error of the optimal hypothesis  $h^*$ , and  $\theta$  is a distribution-dependent parameter called the "disagreement coefficient". Thus, gains of active strategies over standard passive lower bounds of  $\Omega(d\nu/\epsilon^2)$  depend on certain easiness conditions like small noise rates and bounded disagreement coefficients [15].
The vast majority of the work on active learning has been done in the 0-1 loss setting [18, 9, 10, 19, 20, 21]. It has been significantly harder to push the design of active learning algorithms past the regime of accuracy on a fixed distribution. While some work has attempted to generalize classical ideas of active learning to different losses [22], these are heavily outnumbered in the literature.
As previously mentioned, the most difficult part of designing agnostic active learning strategies is maintaining consistency. The issue comes down to a phenomenon referred to as "sampling bias": because active learners would like to target certain parts of space to save on labels, there is a risk that the learner prematurely stops sampling on a part of space in which there is some detail in the distribution that could not be detected at a higher labeling resolution. This can easily lead to inconsistent strategies [15]. Thus, a major contribution of our work is exhibiting a consistent active scheme for the multi-group problem.
3.1 Learning Problem
We study a binary classification setting where examples fall in some instance space  $\mathcal{X}$ , and labels lie in  $\mathcal{Y} \coloneqq \{-1, 1\}$ . We suppose we are given some pre-specified, finite collection of distributions  $\mathcal{G} = \{D_g\}_{g=1}^G$  over  $\mathcal{X} \times \mathcal{Y}$  corresponding to groups. Given a hypothesis class  $\mathcal{H}$  of measurable classifiers with VC-dimension  $d$ , the goal of the leaner is to pick some  $h \in \mathcal{H}$  from finite data that performs well across all the distributions in  $\mathcal{G}$  in the worst case. Let  $L_{\mathcal{G}}(h \mid g) \coloneqq \mathbb{P}_{D_g}(h(x) \neq y)$  be the error of a hypothesis  $h$  on group  $g$ . Formally speaking, the learner would like to choose a classifier approximately obtaining
$$
\inf  _ {h \in \mathcal {H}} \max  _ {g \in [ G ]} L _ {\mathcal {G}} (h \mid g),
$$
using finite data. We often use  $L_{\mathcal{G}}^{\max}(h)$  as shorthand for  $\max_{g \in [G]} L_{\mathcal{G}}(h \mid g)$ . We use  $\nu \coloneqq \inf_{h \in \mathcal{H}} L_{\mathcal{G}}^{\max}(h)$  to denote the "noise rate" of  $\mathcal{H}$  on the multi-distribution objective. The use of the term "agnostic" throughout reflects the fact that we make no assumption that  $\nu = 0$  in our algorithm design or analysis. We assume for simplicity that there is some  $h^{*} \in \mathcal{H}$  attaining  $\nu$ .
3.2 Active Learning Model
We consider a standard active learning model specified as follows. Let  $supp(g)$  denote the support of the marginal over instance space of  $D_g$ . The active learner has access to two sampling oracles for each distribution specified by  $D_g$ . The first is  $U_g(\cdot)$ , which given a set  $S \subseteq \mathcal{X}$  measurable with respect to  $D_g$ , returns an unlabeled sample from  $D_g$  conditioned on  $S$ ; if  $\mathbb{P}_{D_g}(x \in S) = 0$ , then  $U_g(S)$  returns "None". The second is  $O_g(\cdot)$ , which given a point in  $supp(g)$ , returns a sample from the conditional distribution over labels specified by  $x$  and  $g$ . More formally, querying  $U_g(S)$  for  $S$  such that  $\mathbb{P}_{D_g}(x \in S) \neq 0$  is equivalent to drawing i.i.d. samples according to marginal over instance space of  $D_g$  (independent of previous randomness), and returning the first example that falls in  $S$ ; querying the oracle  $O_g(x)$  for  $x \in supp(g)$  is equivalent to receiving a sample from a Rademacher random variable with parameter  $\mathbb{P}_{D_g}(Y = 1 | X = x)$ .
As is standard in active learning, the active learner is assumed to have functionally unlimited access to queries from  $U_{g}(\cdot)$ . On the other hand, queries to oracles  $O_{g}(\cdot)$  are precious: the "label complexity" of a strategy executed by the active learner is the sum of queries to oracles  $O_{g}(\cdot)$  over all  $g$ , and is to be minimized given a desired generalization error guarantee.
4 Challenges in Multi-Group Active Learning
In this section, we give some background on classical disagreement-based methods on a single distribution, and discuss in more detail the challenge of designing consistent active learning strategies in the multi-group setting.
4.1 Background on Disagreement-Based Active Learning
Almost all agnostic active learning algorithms for accuracy over a single distribution boil down to disagreement-based methods [18, 10, 15, 16]. The fundamental idea in this school of algorithms is that one can learn the relative accuracy of two classifiers  $h$  and  $h'$  by only requesting labels for examples in the part of instance space on which they disagree about how examples should be labeled. More generally, given a set of classifiers  $\mathcal{H}' \subseteq \mathcal{H}$ , one can consider the "disagreement region" of  $\mathcal{H}'$ , defined as
$$
\Delta (\mathcal {H} ^ {\prime}) := \{x \in \mathcal {X}: \exists h, h ^ {\prime} \in \mathcal {H} ^ {\prime} s. t. h (x) \neq h ^ {\prime} (x) \}.
$$
As alluded to above, the difference in accuracy of classifiers  $h, h' \in \mathcal{H}'$  is specified entirely through this inherently label-independent notion. For a single distribution  $D$ , we may write
$$
\frac {\mathbb {P} _ {D} (h (x) \neq y) - \mathbb {P} _ {D} (h ^ {\prime} (x) \neq y)}{\mathbb {P} _ {D} (\Delta (\mathcal {H} ^ {\prime}))} = \mathbb {P} _ {D} \big (h (x) \neq y \mid \Delta (\mathcal {H} ^ {\prime}) \big) - \mathbb {P} _ {D} (h ^ {\prime} (x) \neq y \mid \Delta (\mathcal {H} ^ {\prime})),
$$
as by definition,  $h, h'$  have the same conditional loss on  $\Delta(\mathcal{H}')^c$ . Inspired by this observation, the idea is to label examples in  $\Delta(\mathcal{H}')$ , and ignore those outside of it. This allows the learner to learn about the relative performance of classifiers while saving on the labels of examples falling in  $\Delta(\mathcal{H}')^c$ .
In running a DBAL algorithm, one hopes certain classifiers quickly reveal themselves to be empirically so much worse on  $\Delta (\mathcal{H}^{\prime})$  than the current ERM hypothesis, that by standard concentration bounds, they can be inferred to be worse than  $\epsilon$ -optimal on  $D$  with high probability. Elimination of these classifiers shrinks the disagreement region, allowing the labeling to become further fine-grained. Given the above loss decomposition, this leads to consistent active learning strategies.
4.2 Labeling in the Disagreement Region: No Longer Enough
In the multi-group setting, the strategy of comparing performance of classifiers solely on  $\Delta (\mathcal{H}^{\prime})$  breaks down. Although the classifiers in  $\mathcal{H}^\prime$  still agree in  $\Delta (\mathcal{H}^{\prime})^{c}$ , this is not enough to infer differences in the worst case error over groups  $L_{\mathcal{G}}^{\mathrm{max}}$ ; this is because differences in performance on  $\Delta (\mathcal{H}^{\prime})$  are not generally representative of differences in absolute errors over group distributions. The following simple example makes this concrete.
Example 1. Consider the task of determining which of two classifiers  $h$  and  $h'$  has lower worst case error over distributions  $D_{1}$  and  $D_{2}$  with marginal supports  $S_{1} \subseteq \mathcal{X}$  and  $S_{2} \subseteq \mathcal{X}$ . Let their disagreement region be denoted by  $\Delta = \{x \in \mathcal{X} : h(x) \neq h'(x)\}$ , and let  $l(f, i, A)$  denote the conditional loss of classifier  $f$  on  $S_{i} \cap A$  under  $D_{i}$ . Suppose we only know their conditional losses on  $\Delta \cap S_{1}$  and  $\Delta \cap S_{2}$  under  $D_{1}$  and  $D_{2}$ , respectively. We see for  $h$  that
$$
l (h, i, A) = \left\{ \begin{array}{l l} 4 9 / 1 0 0 & i = 1, A = \Delta \cap S _ {1} \\ 5 2 / 1 0 0 & i = 2, A = \Delta \cap S _ {2} \\ ? & i = 1, A = \Delta^ {c} \cap S _ {1} \\ ? & i = 2, A = \Delta^ {c} \cap S _ {2} \end{array} \right.
$$
and for  $h^\prime$  that
$$
l (h ^ {\prime}, i, A) = \left\{ \begin{array}{l l} 5 1 / 1 0 0 & i = 1, A = \Delta \cap S _ {1} \\ 4 8 / 1 0 0 & i = 2, A = \Delta \cap S _ {2} \\ ? & i = 1, A = \Delta^ {c} \cap S _ {1} \\ ? & i = 2, A = \Delta^ {c} \cap S _ {2} \end{array} \right..
$$
Consider ignoring the performance of classifiers in  $\Delta^c$ , and using as a surrogate for the multi-group objective
$$
\max_{i\in \{1,2\}}l(h,i,S_{i}\cap \Delta).
$$
In this case, we would choose  $h'$  has the better of the two hypotheses.
Suppose now that  $\Delta \cap S_1$  and  $\Delta \cap S_2$  have mass  $\gamma$  under both  $D_{1}$  and  $D_{2}$ , and that  $l(h,1,\Delta^c\cap S_1) = l(h',1,\Delta^c\cap S_1) = 3 / 10$ . Finally, suppose that  $l(h,2,\Delta^{c}\cap S_{2}) = l(h^{\prime},2,\Delta^{c}\cap S_{2}) = 2 / 10$ . Then under the true multi-group objective, by decomposing the group losses, one can compute that  $h$  has a lower worst case error over groups  $D_{1}$  and  $D_{2}$ .
Thus, to utilize the disagreement region in multi-group algorithms, we will need to at least label some samples on  $\Delta (\mathcal{H}^{\prime})^{c}$  as  $\mathcal{H}'$  shrinks. The specification of such a strategy is the content of the next section.
5 General Agnostic Multi-Group Learning
5.1 An Agnostic Algorithm
The basic idea in Algorithm 1 is similar to classical DBAL approaches for a single distribution. We start with the full hypothesis class  $\mathcal{H}$ , and look to iteratively eliminate hypotheses from contention as we learn about how to classify on each group through targeted labeling.
Our solution to the problem posed to DBAL above is to keep track of the errors of well-performing hypotheses on the complement of the disagreement region in a way that exploits the agreement property. To do this, we construct a two-part estimate for the loss of a hypothesis on a given group. Denote the set of hypotheses still in contention at iteration  $i$  is  $\mathcal{H}_i$ . Let  $R_i = \Delta(\mathcal{H}_i)$  and  $S_{R_i,g}$  be a labeled sample from  $U(R_i)$  and  $S_{R_i^c,g}$  be a labeled sample from  $U(R_i^c)$ . We can now estimate the loss for some  $h \in \mathcal{H}_i$  on group  $g$  via
$$
L _ {S; R _ {i}} (h \mid g) := \mathbb {P} _ {D _ {G}} (x \in R _ {i}) \cdot L _ {S _ {R _ {i}, g}} (h) + \mathbb {P} _ {D _ {G}} (x \in R _ {i} ^ {c}) \cdot L _ {S _ {R _ {i} ^ {c}, g}} (h _ {\mathcal {H} _ {i}}),
$$
Algorithm 1 General Agnostic Algorithm
1: procedure MULTI_GROUP_AGNOSTIC( $\mathcal{H}, \epsilon, \delta$ ,  $\{U_g(\cdot)\}_{g=1}^{G}$ ,  $\{O_g(\cdot)\}_{g=1}^{G}$ )  
2:  $\mathcal{H}_1 \gets \mathcal{H}, I \gets \lceil \log(1/\epsilon) \rceil$   
3: for  $i \in [I]$  do  
4:  $R_i \gets \Delta(\mathcal{H}_i)$   
5:  $m_i \gets \max_{g' \in [G]} \mathbb{P}_{D_{g'}}(x \in \Delta(\mathcal{H}_i))$   
6: for  $g \in [G]$  do  
7:  $S_{R_i, g}' \gets 1024\left(\frac{m_i}{\epsilon^{2I-i}}\right)^2\left(2d\log(64/\epsilon) + \ln(8G[\log(1/\epsilon)]/\delta)\right)$  i.i.d. samples  
8: from  $U_g(R_i)$   
9:  $S_{R_i^c, g}' \gets \frac{128\ln(4G[\log(1/\epsilon)]/\delta)}{(\epsilon^{2I-i})^2}$  i.i.d. samples from  $U_g(R_i^c)$   
10: if "None"  $\in S_{R_i, g}'$  then ▷  $\mathbb{P}_{D_g}(x \in R_i) = 0$  in this case  
11:  $S_{R_i, g} \gets \emptyset$   
12: else  
13:  $S_{R_i, g} \gets \{(x, O_g(x)): x \in S_{R_i, g}'\}$   
14: end if  
15: if "None"  $\in S_{R_i^c, g}'$  then  
16:  $S_{R_i^c, g} \gets \emptyset$   
17: else  
18:  $S_{R_i^c, g} \gets \{(x, O_g(x)): x \in S_{R_i^c, g}'\}$   
19: end if  
20: end for  
21:  $\hat{h}_i = \arg \min_{h \in \mathcal{H}_i} L_{S; R_i}^{\max}(h)$   
22:  $H_{i+1} \gets \left\{h \in H_i : L_{S; R_i}^{\max}(h) \leq L_{S; R_i}^{\max}(\hat{h}_i) + 2^{I-i}\epsilon/4\right\}$   
23: end for  
24: return  $\hat{h} = \arg \min_{h \in H_{I+1}} L_{S; R_{I+1}}^{\max}(h)$   
25: end procedure