SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Eden Saig, Inbal Talgam-Cohen, Nir Rosenfeld
{edens,italgam,nirr}@cs.technion.ac.il
When machine learning is outsourced to a rational agent, conflicts of interest might arise and severely impact predictive performance. In this work, we propose a theoretical framework for incentive-aware delegation of machine learning tasks. We model delegation as a principal-agent game, in which accurate learning can be incentivized by the principal using performance-based contracts. Adapting the economic theory of contract design to this setting, we define budget-optimal contracts and prove they take a simple threshold form under reasonable assumptions. In the binary-action case, the optimality of such contracts is shown to be equivalent to the classic Neyman-Pearson lemma, establishing a formal connection between contract design and statistical hypothesis testing. Empirically, we demonstrate that budget-optimal contracts can be constructed using small-scale data, leveraging recent advances in the study of learning curves and scaling laws. Performance and economic outcomes are evaluated using synthetic and real-world classification tasks.
The acclaimed success of machine learning at effectively solving difficult prediction tasks across diverse problem domains has made it highly appealing for firms, institutions, and individual practitioners. But machine learning has also become increasingly complex, cumbersome, and difficult to operate—and not all those who seek to learn have access to the necessary expertise, infrastructure, and designated resources required for learning effectively. This gap has created a new market for outsourced machine learning, in which a client interested in obtaining an accurate predictive model can hire the services of a specialized provider which, for a price, trains the model on their behalf. Consider for example a hospital purchasing a classifier for deciding between hospitalization and outpatient treatment when triaging patients. The provider invests in curating, cleaning and annotating training data, and delivers a trained model in return to payment from the hospital.
Having a budget to expend on outsourced learning [51], we model the client as aiming to obtain the best possible predictive model. At first glance, it is tempting to assume that the optimal strategy is simply to pay the provider the maximal feasible amount—and hope to get a high-end model in return. After all, if the client were to spend the budget directly on learning, investing the maximal available sum would yield the best possible results. But this neglects to account for the incentives of the provider, who is interested in maximizing profit. Since the actions of the provider remain private, it is in his best interest to (secretly) minimize efforts, which in turn can result in his delivering a suboptimally-trained model. In our example, the provider can cut costs by annotating only a subset of the data, obtaining cheaper low-quality annotations, or neglecting to meticulously remove all outliers.
Outsourced learning is hence susceptible to moral hazard, an economic situation which might occur under information asymmetry, and to the detriment of the client. Motivated by this observation, in this paper we initiate the study of delegated learning, and aim to explore the economic, algorithmic, and statistical implications that occur when learning is delegated to a specialized provider. Our key novelty is in instantiating delegated learning as a problem of optimal contract design [10, 42, 47, 48]. Broadly, contracts are an important monetary device that allows the client to establish a payment scheme
Figure 1: Delegated classification interaction sequence. The principal examines initial information, and designs a contract  $t : \{0, \dots, m\} \to \mathbb{R}_{\geq 0}$ . Having observed  $t$ , the agent strategically selects a dataset size  $n$  that will maximize his expected utility. He samples a training set  $S \sim D^{n}$ , incurs cost  $c_{n}$ , then trains the classifier  $h \in \mathcal{H}$  and sends it to the principal. Upon receiving  $h$ , the principal evaluates its accuracy on a random validation set  $V \sim D^{m}$ , and pays the agent according to the contract  $t$ .
which, if properly set, serves to align incentives and guarantee that both parties are well-off. Our main challenge is to design effective contracts specialized to the task of delegated learning on a budget.
Towards this, we begin with a conventional supervised classification setup, and impose economic structure by assuming that acquiring training examples is costly. We then conceptually "split" the conventional self-sufficient learner into two rational entities: a principal, who controls the budget and is interested in maximizing predictive accuracy; and an agent, who controls learning (in particular the training set) and is interested in maximizing profit. This allows us to model principal-agent relations as a Stackelberg game, in which the principal commits to a contract  $t$ , determining a priori the amount to be paid for every possible (stochastic) level of obtained accuracy. The agent best-responds to the contract by choosing the profit-maximizing number of samples  $n$ , and training the predictive model.
Under this setting, we study the algorithmic problem of designing an optimal contract. As is standard in economic analysis, we begin with the assumption that the principal has full information on the distribution of possible outcomes for each of the agent's possible actions. In our setting, actions correspond to the number of training samples, and outcomes to the empirical classifier accuracy; thus, the main object of interest for contract design in delegated learning settings is the learning curve, which describes the (stochastic) performance of learning per sample size. Under certain plausible conditions on the learning curve, namely MLRP and a certain notion of concavity, our main result here is that optimal contracts are simple, and in particular, take on the form of simple threshold functions. Simple contracts are appealing because they are straightforward to understand and communicate; in our setting, they are also easy to compute, and we give a closed-form solution for the optimal threshold contract. Providing an interpretation of the closed-form solution, our findings establish a new connection between contracts and the renowned Neymon-Pearson lemma [45], which we consider as one of our central theoretical contributions.
We then switch gears and turn to empirically studying the construction of contracts from partial information. In particular, we consider a setting where the principal can only estimate the learning curve from small available data (e.g., by bootstrapping on small  $n$  and extrapolating). Using the recent LCDB dataset of learning curves [43], we show that threshold contracts generally perform well on estimated curves despite the inherent uncertainty. We also explore the role of different parameters of our setup, consider various tradeoffs in curve-fitting and contract design, and discuss limitations by pointing out certain failure modes to which contracts may be susceptible.
Taken together, our results shed light on why and how simple contracts for delegated learning work to correctly balance between the incentives of both delegator and delegatee in outsourced learning.
Previous works have considered delegation of ML-related tasks that differ from our task of training a classifier: labeling of data points in [14], gathering information in [16], and computing a costly high-dimensional function in [5]. In the delegated task of [24], the agent provides a classifier and the principal verifies its near-optimality within  $\mathcal{H}$ . A fundamental difference is that their agent is assumed to be adversarial rather than rational, and so interactive proofs are used instead of economic incentives.
The Neyman-Pearson lemma has recently been connected to economic design by [8] in the context of adverse selection rather than moral hazard. The agent has a hidden type (e.g., whether a new
drug is effective), and the optimal menu to offer this agent is designed based on the theory of e-values. When the hidden type has binary support, the method is equivalent to Neyman-Pearson. A "moral" link between the design of contracts (for a non-budgeted principal) and statistical inference (in particular likelihood ratios) was observed already in [25], but no connection was made to the power of hypothesis tests. Other intersections of ML and contracts that do not involve delegation of learning-related tasks include strategic classification [e.g., 36, 37, 3] and online learning of optimal contracts [29, 17, 52] Contract settings with a binary action and/or outcome space have been studied in [e.g., 20, 7, 22]. Not to be confused with our notion of delegation, there is a growing computational literature on delegation without monetary payments [e.g., 35].
To extrapolate from partial data, our work builds upon recent advancements in the study of learning curves, which characterize the expected generalization of learning as a function of dataset size and other exogenous factors [49]. There is growing empirical evidence that performance of modern neural networks can be predicted using simple scaling laws [e.g., 34, 41, 50, 23, 2, 46, 30], and theoretical results that back these findings in simplified settings [11, 12, 33, 9].
Perhaps closest to ours is the concurrent work [4], which analyzes a similar setting under different assumptions: Rather than assuming budget constraints, they assume that the principal's utility is linear in accuracy and payout, and the learning curve takes a specific functional form. Based on these assumptions, they derive approximately optimal linear contracts which are robust to adverse selection. In contrast, we obtain globally optimal simple contracts based on hypothesis testing, and present data-driven methods to handle partial information. Together, the two studies demonstrate the important role of simple contracts in the growing ecosystem of machine learning delegation.
The core of our setting is based on a standard supervised classification task. Let  $x \in \mathcal{X}$  be features and  $y \in \mathcal{Y}$  be labels, and assume there is some unknown joint distribution  $D$  over  $(x,y)$  pairs. Given a sample set  $S = \{(x_i,y_i)\}_{i=1}^n \sim D^n$ , the goal in learning is to use  $S$  to find a classifier  $h: \mathcal{X} \to \mathcal{Y}$  from a class  $\mathcal{H}$  that maximizes expected accuracy,  $\mathrm{acc}_D(h) = \mathbb{P}_{(x,y) \sim D}[h(x) = y]$ . Because the underlying distribution  $D$  is unknown, expected performance is estimated by the empirical average on an additional held-out validation set  $V \sim D^m$  of size  $m$ , as  $\mathrm{acc}_V(h) = \frac{1}{m} \sum_{i=1}^{m} \mathbb{1}[h(x_i) = y_i]$ , which is a consistent and unbiased estimator of  $\mathrm{acc}_D(h)$ . We will assume throughout that both the learning algorithm and the validation set size  $m$  are known and fixed.
Learning on a budget. We will be interested in studying learning when certain resources are limited or costly. Our main focus will be on the setting where the main cost of learning is the number of labeled examples  $n$ , but we note that our approach can in principle extend to other forms of learning 'effort'.<sup>1</sup> We assume the learner has a monetary budget  $B$  to spend on samples, and is interested in maximizing accuracy under budget constraints. Let  $c_{n} \geq 0$  be the cost of  $n$  samples (assumed to be increasing in  $n$ ), then the learner aims to solve:
$$
n ^ {*} = \operatorname {a r g m a x} _ {n} \mathbb {E} _ {h _ {n}} \left[ \operatorname {a c c} _ {D} \left(h _ {n}\right) \right] \quad \text {s . t .} \quad c _ {n} \leq B \tag {1}
$$
where  $h_n$  is a classifier learned from a random dataset of size  $|S| = n$ . Note that  $h_n$  is a random variable with distribution depending on  $n$ . We denote the out-of-sample accuracy of  $h_n$  by  $\alpha_n = \mathrm{acc}_D(h_n)$ . When the learner is a self-sufficient entity, and when the expected  $\alpha_n$  improves monotonically in  $n$ , then  $n^*$  in Eq. (1) in naturally the largest affordable  $n$  (see Sec. 3). However, as we will see, when learning is delegated—this seemingly straightforward observation can break.
Delegation. We model the delegation of learning as a conceptual partition of the learner into two distinct entities: an agent, who controls learning; and a principal, who controls the validation process. The principal outsources the learning task to the agent, who in turn uses the training set  $S$  to train the classifier  $h$ ; once delivered, the principal validates the performance of  $h$  using the validation set  $V$ . Whereas the classifier's accuracy benefits the principal alone, the cost of learning (i.e., the cost of acquiring  $S$ ) is born exclusively by the agent. Importantly, the amount of invested effort remains private to the agent; in our example, the principal cannot know how many examples received quality labeling. Because the agent seeks to maximize profit, the principal can use her budget as a source of monetary payment to incentivize the agent to invest in larger  $|S| = n$ . Intuitively, one could expect
<sup>1</sup>For example, [34] argue that not only training-set size, but also computation time and model size are related to accuracy through scaling laws, which have tight connections to the assumptions we discuss in Sec. 3.
Figure 2: A delegated classification setting (data from Sec. 4). (Left) Each costly action taken by the agent (training set size  $n$ ) induces a distribution  $f_{n}$  of possible outcomes (classifier accuracy). The principal seeks to construct a contract  $t$  that incentivizes a profit-maximizing agent to take actions entailing favorable outcomes. Note the  $f_{n}$  exhibit increasing expectation, but decreasing variance, in  $n$ . (Center) Three contracts for a given budget  $B$ , mapping outcomes to payments. (Top-right) Agent's utilities  $u_{n}(t)$  and best responses  $n(t)$  (stars) for each contract  $t$ . (Bottom-right) Expected accuracies for principal resulting from each contract; here the threshold contract is optimal (see Sec. 3).
larger payments to entail larger  $n$ , and therefore higher-accuracy  $h$ . However, as we will see, this is not always the case, and careful planning is required in order to fully utilize a given budget.
2.1 Delegation as contract design
As the training set remains private to the agent, there is an information gap between the two parties. This creates a conflict of interest for the agent known as moral hazard [10], in which the agent may be tempted to invest sub-par effort, while claiming that efforts were in fact his honest best. In economics, the celebrated solution to moral hazard are contracts [31]: pay-per-performance rules that a-priori determine future payments for every possible outcome, which we formally describe next.
Contract design. A contract setting is defined by a set of actions  $\mathcal{A} = \{a_1, \ldots, a_N\}$  that can be taken by the agent, and a set of possible outcomes  $j \in \{0, \ldots, m\}$ . Each action  $a_i$  is associated with a cost  $c_i$ , and w.l.o.g. we assume  $c_1 \leq \dots \leq c_N$  so that actions correspond to increasing effort levels. The agent's choice to perform action  $a \in \mathcal{A}$  yields a random outcome  $j \sim f_a$  for the principal, where  $f_a$  describes a distribution over the possible outcomes associated with action  $a$ . The principal, who does not observe the agent's chosen action, can incentivize the agent through a contract,  $t: \{0, \ldots, m\} \to \mathbb{R}_{\geq 0}$ , according to which she pays the agent  $t(j) \geq 0$  when the materialized outcome is  $j$ . Given contract  $t$ , let  $u_a(t)$  be the agent's expected utility from taking action  $a \in \mathcal{A}$  at cost  $c_a$  (via stochastic outcomes  $j \sim f_a$ ), and let  $a(t)$  be the agent's best response—an action that maximizes his expected utility (and following standard tie-breaking assumptions as in [18]). Then:
$$
u _ {a} (t) = \mathbb {E} _ {j \sim f _ {a}} [ t (j) ] - c _ {a}, \quad a (t) \in \operatorname {a r g m a x} _ {a \in \mathcal {A}} u _ {a} (t). \tag {2}
$$
Every action  $a^*$  that is the best response  $a^* = a(t)$  to some contract  $t$  is called implementable. In economic terms, the principal and agent are playing a Stackelberg game, in which the principal commits to a contract  $t$  and the agent best-responds by choosing action  $a(t)$  that maximizes his expected utility  $u_a(t)$ . The goal of the principal is to design a contract  $t$  which incentivizes the agent to take best-response actions yielding favorable outcomes for the principal.
**Contracts for delegated learning.** We propose to formulate delegated learning as a problem of optimal contract design, instantiated as follows. First, we relate agent actions  $a$  with the number of samples  $n$ , and denote  $\mathcal{A} = \{n_1, \dots, n_N\}$  as the possible sizes of  $S$  that the learning agent can work with. The cost of acquiring samples naturally maps as  $c_a = c_n$ , and agent's best response is  $a(t) = n(t)$ . Next, we associate outcomes  $j$  with accuracy for the principal by defining  $j$  as the number of validation samples (out of the possible  $m$ ) on which  $h$  is correct; note this implies  $\mathrm{acc}_V(h) = j / m$ , and we will therefore use  $j$  and  $\mathrm{acc}_V(h)$  as 'outcomes' interchangeably. Finally, for an action  $n$ , we set  $f_n$  to be the distribution over possible accuracies obtained when learning with  $n$  samples, namely  $f_n(j) = \mathbb{P}_{h_n,V}[\mathrm{acc}_V(h_n) = j / m] \forall j$ . We will also use the matrix form  $F_{nj} = f_n(j)$ , where  $F \in [0,1]^{N \times (m + 1)}$ . Note that  $F$  admits two sources of variation: (i) a-priori variation in  $h_n$  due to stochasticity in  $S \sim D^n$ ; and (ii) a-posteriori variation in  $j$  for any fixed  $h_n$
due to stochasticity in  $V \sim D^{m}$ . When  $h_n$  is fixed, the outcome distribution admits a simple binomial form, namely  $j \sim \mathrm{Binomial}(m, \alpha_n)$ . Empirically, we observe this to be the dominant component.
2.2 Delegation as an optimization problem
Budget-optimal contracts. Recall that the principal seeks to maximize accuracy under budget constraints (Eq. (1)). Once learning is delegated to an agent and framed as a contract design problem, the principal's objective becomes:
$$
t ^ {*} = \operatorname {a r g m a x} _ {t \in [ 0, B ] ^ {m}} \mathbb {E} _ {h _ {n (t)}} \left[ \operatorname {a c c} _ {D} \left(h _ {n (t)}\right) \right] \tag {3}
$$
Contract  $t^*$  is chosen to incentivize the agent to invest effort  $n(t)$  (via Eq. (2)) such that the training of  $h_{n(t)}$  yields high dividends for the principal in terms of expected accuracy. We will refer to  $t^*$  as a budget-optimal contract, and to the general task of finding  $t^*$  as budget-optimal contract design.
Information structure. Delegated learning settings have actions  $n$  and costs  $c_{n}$  known to both sides, and outcome distribution  $F_{nj}$  known to the agent. For the principal, we explore varying levels of knowledge: In Sec. 3, we assume (as in the classic contract design literature) that the principal has full information of  $F$  (i.e., knows the learning curve), and focus on characterizing the optimal contract. In Sec. 4 we relax this assumption, and explore a partial-information setting in which the principal relies instead on an empirically-estimated curves  $\hat{F}$ .
3 Budget-Optimal Contract Design
3.1 The problem
Why agents cut corners. The conceptual challenge in designing contracts lies in that agents cannot reliably report what they did. For example, consider a principal who, after delegation, received a classifier attaining 0.74 (validation) accuracy. Should she be happy? The crux is that there are two ways that this could have happened: (i) the agent invested high effort in learning (large  $n$ ), but received an uninformative  $S$  by chance, and delivered a low-quality  $h$  as a result; and (ii) the agent invested low effort (small  $n$ ). Since the agent's actions are private, and because outcomes are stochastic, the principal can never know for certain which is the true underlying cause. In other words, a 'lazy' (or rather strategic) agent can hide behind the uncertainty that is inherent in learning outcomes.[2]
Contract types. To overcome this informational gap, the principal must devise a contract to align incentives and encourage the agent to prefer certain actions over others. But not all contracts are equally effective. Fig. 2 illustrates for a budget  $B$  three contract types and their economic implications:
- Constant contract  $(t(j) = B)$ : The agent is paid  $B$  regardless of the outcome. His best-response in this case is to choose the least-costly action—to the detriment of the principal.
- Linear contract  $(t(j) = Bj / m)$ : The agent is paid a fraction of  $B$ , linear in the resulting accuracy. Linear contracts are a popular and extensively-studied class of contracts [e.g., 32, 15]. Nonetheless, and though seemingly sensible, linear contracts turn out to be sub-optimal for our setting.
- Threshold contract  $(t(j) = B\mathbb{1}[j \geq j_0]$  for some  $j_0$ ): The agent is paid  $B$  provided the empirical accuracy surpasses a threshold  $j_0$ . In the example in Fig. 2, the threshold contract is optimal.
Rather than committing  $a$ -priori to some type of contract, we seek to find the best budget-optimal contract by solving Eq. (3). For this it is useful to have structure.
Stochastic learning curves (and where to find them). Our approach uses the observation that there is a tight connection between the set of distributions  $\{f_n\}$  encoded in  $F$ , and learning curves, which describe the anticipated accuracy of a classifier as a function of the size of its training set. Learning curves typically depict only expected accuracy, but there is also inherent variation in outcomes. We will therefore broadly use the term 'stochastic learning curve' to describe both mean trend and variation in accuracy as a function of  $n$ ; formally, a stochastic learning curve is defined precisely by  $F$ . This connection is useful because learning curves have structure: First, expected learning curves are typically monotone [34, 11]; when not [43, 49], they can be monotonized [12]. Second, stochastic learning curves are likely to satisfy the monotone likelihood ratio property (MLRP), which states that the better the performance of a classifier, the more likely it was trained on more data (see Def. 1).
2The agent can also hide in the uncertainty due to  $V$ , particularly when  $m$  is small; see experiment in Sec. 4.2.
Table 1: Characterization of simple min-budget contracts in different settings. Simple contract forms include all-or-nothing contracts and their subclass of threshold contracts. The table specifies for each configuration either the simple form that is optimal (in one case through equivalence to the Neyman-Pearson lemma), or that the simple form is non-optimal or intractable.
Problem size	Structural assumptions
Actions	Outcomes	No assumptions	MLRP	Concave-MLRP
|A|=2	any size	All-or-nothing (T1)	Threshold (B.7.1)
|A|>2	m+1=2	All-or-nothing (B.5.1)	Threshold (B.7.2)
m+1>2	Simple is NP-hard (T3)	∃ non-threshold (B.7.3)	Threshold (T4)
3.2 Optimization via min-budget contracts
Our main technique for solving Eq. (3) relies on a reduction to what we refer to as min-budget contracts. Given an (implementable) target action  $n^* \in \mathcal{A}$ , a min-budget contract for  $n^*$  is a contract  $t$  that incentivizes the agent to employ precisely the action  $n^*$ , while minimizing the maximum payment by the principal  $\| t \|_{\infty} = \max_{j \in \{0, \dots, m\}} \{t(j)\}$ ; i.e.,  $t$  implements  $n^*$  at minimum budget. Formally:
$$
t ^ {*} = \operatorname {a r g m i n} _ {t} \| t \| _ {\infty} \quad \text {s . t .} \quad n (t) = n ^ {*} \tag {4}
$$
Our reduction relies on the following claim (Proof in Appendix B.1):
Proposition 1. Every budget-optimal contract design problem has an optimal solution which is also min-budget.