Online Decision Deferral under Budget Constraints

## Abstract

Abstract Machine Learning (ML) models are increasingly used to support or substitute decision making. In applications where skilled experts are a limited resource, it is crucial to reduce their burden and automate decisions when the performance of an ML model is at least of equal quality.
However, models are often pre-trained and fixed, while tasks arrive sequentially and their distribution may shift. In that case, the respective performance of the decision makers may change, and the deferral algorithm must remain adaptive. We propose a contextual bandit model of this online decision making problem. Our framework includes budget constraints and different types of partial feedback models. Beyond the theoretical guarantees of our algorithm, we propose efficient extensions that achieve remarkable performance on real-world datasets.

## 1 Introduction

Consider a decision-making system that must make investment decisions based on the company’s existing resources and on the characteristics of the available assets (the “context").
Although these strategic tasks are usually led by humans, the diversity and complexity of the observable variables have led to the introduction of Machine Learning (ML) models in the loop [].
The decision-making system is consequently composite: human experts and an ML model are working side by side, with possibly nonaligned expertise. The ML model might excel in certain scenarios due to its analytical precision, while human experts bring additional insights and contextual understanding to others. Therefore, it is crucial to design a deferral meta-model that can efficiently decide when the decision must be deferred to human experts and when not.

Existing *learning-to-defer* systems, e.g. [, ], often rely on a joint training method where the model and its deferral component are learnt together on large, expert-annotated datasets, with the goal of trading off prediction quality and other criteria such as fairness.
When data collection requires highly skilled experts, this traditional approach is very costly. Furthermore, in steadily evolving contexts, such as financial investments or content moderation, the data is subject to constant distribution shifts.

If directly retraining the ML model is not a viable option, then it is desirable to have an adaptive deferral model that estimates and adapts to the current and unknown quality of the ML model and of the human experts.

In this work, we model this scenario as an online two-armed contextual bandit problem that takes into account the budget constraints related to deferring to human experts [, , ].

We argue that the resulting online decision deferral system adds significant realism to the problem.
We distinguish two types of ‘observability’ of the decision’s performance.
In many scenarios, it can be impossible to evaluate alternative decisions post hoc, as an investment or content moderation decision may not allow to observe the counterfactual. This is the case of pure *bandit feedback*, where only the reward of the chosen action (or ‘arm’) can be observed.
Sometimes, however, counterfactual performance can be evaluated: for example, an alternative portfolio performance can be evaluated on market data a posteriori, assuming the investment decision of the agent does not significantly impact these markets. In that case, the observations are richer than the actual performance, and we call it *full information*.

#### Contributions.

We introduce a novel framework for online decision deferral in a budgeted setting with bandit or full information feedback. Our main contribution is to formalize this realistic problem into a tractable online learning setting and thoroughly evaluate the resulting algorithm through experiments on simulated and real data, yielding remarkable results in various settings. Our choice of setting and algorithm allows us to leverage relevant literature and obtain theoretical guarantees on the learnt deferral model.

## 2 Related Work

Learning to Defer.
Traditionally, deferral was introduced as a rejection mechanism within the model training procedure []. There, the goal of the system is to minimize the overall cost by rejecting whenever the confidence on the prediction is too low.
Learning to defer [] brings the human in the loop by taking into account the accuracy and bias that they could also have on these decisions: a deferral model should balance the uncertainty and biases of any downstream decision maker.
This alternative approach has gained attention both among theorists [, , , ] with a focus on uncertainty calibration, and in applications to domains such as medicine [].

Our approach is conceptually similar to the confidence-score method [, ], where a separate confidence score is computed for the human and model predictors. The decision to defer is based on comparing the scores. A weakness of this approach is that the model is not trained concurrently with the deferral system to complement humans where they are most uncertain []. However, in the cases where the model is fixed (for practical or legal reasons), it is optimal to defer with a deterministic threshold function [].

Online learning-to-defer. The online setting has been noted as an open problem in the learning-to-defer literature []. Bordt and Von Luxburg [] propose the first online model for learning to *advise*: the machine’s decision is always given to the human decision-maker, targeting applications like health care where the decision may only be taken by a human. Joshi et al. [] address sequential learning-to-defer in medical settings, proposing a model-based reinforcement learning method to learn the deferral decision; however, they assume offline access to batch data from clinicians. Gao et al. [] address the problem of counterfactual risk minimization in human-AI systems.

The question of optimizing decisions online while minimizing resource usage is more common to the online learning and operations research fields: for instance, Cesa-Bianchi et al. [] optimize online the Return on Investment, and Jain and Jamieson [] learn to manage a crowdfunding platform to maximize the global quality of funded projects. To the best of our knowledge, our model is the first to integrate a human expert in the loop of these online learning settings.

Bandits with Knapsacks. Bandits [] are sequential resource allocation problems with limited information: only the return of the chosen action, or *arm*, can be observed by the learner, and the observed return is often noisy. Knapsack constraints have been extensively studied in the stochastic setting
[, , , , ] and rely on online optimization techniques [, , ] to adapt to the cost sequence. There has also been recent interest in the adversarial setting, and proposed algorithms have achieved $O(\log T)$ competitive ratio over the optimal static policy [, ].

## 3 Formal Problem Setting

Figure: Figure 1: The deferral learner observes inputs online over a time horizon $T$, then decides whether to pay $c_{t}$ and defer to the human or to let an ML model decide for $c_{t}=0$. The deferral learner achieves the reward of the human decision $r_{\text{h},t}=r_{\text{h}}(x_{t})$ if the context was deferred to the human, and the ml decision reward $r_{\text{m},t}=r_{\text{m}}(x_{t})$ otherwise. The observation $O_{t}$ is the reward of the decision $r_{\pi(x_{t}),t}$ in the pure bandit feedback setting. In the full information setting, $O_{t}=\{r_{\text{m},t},r_{\pi(x_{t}),t}\}$.
Refer to caption: extracted/5890293/Figures/bandit_deferral_partial_feedback_2.png

We model online learning-to-defer as a two-armed contextual bandit problem with budget constraints. Over a horizon of $T$ interactions, the learner sequentially observes contexts represented by a vector $x_{t}\in\mathcal{X}\subset\mathbb{R}^{d}$, with $\lVert x\rVert_{2}\leq 1$. They can then decide to assign the task to a human, incurring a cost(^1^11This cost may be known a priori or not.) $c_{t}\in[0,1]$ and obtaining the reward $r_{\text{h},t}=r_{\text{h}}(x_{t})\in[0,1]$, or they can predict using the model and obtain the reward $r_{\text{m},t}=r_{\text{m}}(x_{t})\in[0,1]$ at no cost $c_{t}=0$. The total budget of the learner is fixed to $B>0$ and known in advance.

Following the online learning terminology, we denote the (possibly stochastic) policy of the learner as $\pi:\mathcal{X}\to\{\text{m,h}\}$. Her objective is to minimize the regret over $T$ rounds compared to a fixed ‘good’ policy $\pi^{*}$ whose definition is discussed further below:

$$ $R_{T}(\pi)\!=\!\!\sum_{t=1}^{T}r_{\pi^{*}(x_{t})}-\sum_{t=1}^{T}r_{\pi(x_{t}), t}\;\text{ s.t.}\sum_{t}c_{t}\leq B$ (1) $$

Because of the cost constraints, the algorithm must not only estimate whether $r_{\text{h},t}>r_{\text{m},t}$, but also whether the gain $r_{\text{h},t}-r_{\text{m},t}$ justifies the cost expenditure.

As seen in Figure 1, we distinguish two observation models:
*Full information* is when the model’s performance is always observable but the received reward is that of the chosen decision. The observation is $O_{t}=\{\text{m},\pi(x_{t})\}$ but reward is only $r_{\pi(x_{t}),t}$; in the
*Bandit* setting, the model’s performance can only be observed when chosen, i.e. $O_{t}=\{\pi(x_{t})\}$.

In the *full information* setting, paying the cost of a human intervention allows to guarantee a human-level performance while the quality of the model can be monitored passively, budget permitting, until we can safely use it when its performance could be superior. In the bandit setting, the model cannot be run in parallel with the human and must be specifically chosen to obtain a performance.
In both cases, the cost incurred and the reward obtained are always that of the chosen action only.

Generalized Linear rewards and costs. As a first step towards solving this online learning problem, we propose to assume the performance, or *rewards*, of the human and the model follow a generalized linear model. Generalized linear models are an extension of linear regression, where the expected value of the response variable given the predictor variable can be characterized by a link function $\mu$[]. The two typical examples of generalized linear models are linear ($\mu(x)=x$), and logistic models ($\mu(x)=1/(1+e^{-x})$). For each action, there exists an independent and unknown parameter vector $\theta_{a}^{*}\in[0,1]^{d}$ such that given a context $x\in\mathcal{X}$, $\mathbb{E}[r_{a}(x)]=\mu(x^{\top}\theta_{a}^{*})$. The costs and rewards are noisy; at round $t$, with context $x_{t}$ and decision $a\in\{\text{m, h}\}$, the reward is $r_{a,t}=\mu(x_{t}^{\top}\theta_{a}^{*})+\eta_{a,t}$, where $\eta_{a,t}$ is a zero-mean, $\sigma-$sub-Gaussian martingale noise, independent of $x_{t}$ and $a$. Additionally, the cost of deferring to the human also follows a generalized linear model; $c_{t}=c_{\text{h},t}=\mu(x_{t}^{\top}w^{*})+\eta_{c,t}$ for an unknown parameter $w^{*}\in[0,1]^{d}$.

Following prior literature[, ], we make some regularity assumptions: $\mu$ is twice differentiable, and its first and second derivatives are upper bounded by $L_{\mu}$ and $M_{\mu}$. For simplicity, we assume the link function $\mu$ is the same between the reward and cost and between actions. However, the algorithm can extend to varying $\mu$.
We also assume there exists a constant $\kappa\coloneqq\inf_{\lVert x\rVert\leq 1,\|\theta-\theta^{*}_{a}\|\leq 1}\mu^
{\prime}(x^{\top}\theta)>0$. Lastly, we make a regularity assumption on the context distribution: there exists a constant $\sigma_{0}$ such that $\lambda_{min}(\mathbb{E}_{x\sim D}xx^{\top})>\sigma_{0}>0$.

Defining OPT. Even when the sequence of rewards and costs are known in advance, finding the optimal solution is a famously NP-hard combinatorial optimization problem []. When the sequence is not known in advance, the optimal solution is an adaptive policy with full knowledge of the context distribution, the hidden parameters, and its remaining budget. Since the adaptive policy cannot be computed efficiently, the budgeted bandit algorithm is compared against a *static* policy(^2^22$\pi$ is independent of the time $t\in[T]$.) which is only required to fulfill the constraints in expectation[].

###### Definition 3.1 (Optimal Static Policy) .

Let $\Pi=\{\pi:\mathcal{X}\rightarrow[0,1]\}$ denote the set of policies, where $\pi(x)$ is the probability of deferring to the human on context $x$. Then, define the optimal static policy:

$$ $\displaystyle\pi^{*}=$ $\displaystyle\operatorname*{argmax}_{\pi\in\Pi}\mathbb{E}_{x\sim D}\pi(x)\mu( \theta_{\text{h}}^{\top}x)+(1-\pi(x))\mu(\theta_{\text{m}}^{\top}x)$ $\displaystyle\text{ subject to }\;T\mathbb{E}_{x\sim D}\pi(x)\mu(w^{\top}x)\leq B$ (2) $$

The optimal value achieved is then $\text{OPT}=T\mathbb{E}_{x\sim D}[\pi^{*}(x)\mu(\theta_{\text{h}}^{\top}x)+(1-
\pi^{*}(x))\mu(\theta_{\text{m}}^{\top}x)]$

It was shown by Agrawal and Devanur [] that the performance of this static policy is an upper bound on the true optimum.

###### Definition 3.1 (Optimal Static Policy) .

## 4 Algorithm

This problem was studied in the linear setting by Agrawal and Devanur [] who consider any number of arms, as well as any number of resources which are expended at different rates. We adapt their algorithm to allow generalized linear rewards and full information/bandit feedback (Algorithm 1). To show that the application of the algorithm to our setting is principled, we present regret bounds as a corollary (Corollary 4.3)

The algorithm is based on the optimism principle and relies on upper confidence bounds on the maximum likelihood estimates of the true but unknown parameters ($\theta^{*}_{\text{m}},\theta^{*}_{\text{h}},w^{*}$) [, , ]. This means that, rather than using the greedy estimates, the algorithm uses an optimistic one - the parameter which achieves the highest reward (or lowest cost) within the confidence ellipsoid around the least-squares estimate.

At each round, if the budget allows it, we evaluate the potential reward of the model (cost-free) and of the human and its associated cost, and we choose the option with maximal return. Note that we take into account the different observation regimes as described above: the model reward may or not be simultaneously observable to the human’s. The set of observed actions at $t$ is denoted $O_{t}$.

###### Definition 4.1 (Maximum Likelihood Estimator) .

Let $\hat{\theta}_{a,t}$ be the solution to $\sum_{i<t:a\in O_{i}}(y_{a,i}-\mu(x_{i}^{\top}\theta))x_{i}=0$. Additionally, let $\hat{w}_{a,t}$ be the solution to: $\sum_{i<t:a\in O_{i}}(c_{a,i}-\mu(x_{i}^{\top}w))x_{i}=0$.

###### Definition 4.2 (Optimistic estimates) .

Let $\beta(t)=\frac{\sigma}{\kappa}\sqrt{2d\log\left(\frac{1+2td}{\delta}\right)}$ for a failure probability $\delta\in(0,1)$. Define $M_{a,t}=\sum_{s<t:a\in O_{s}}x_{s}x_{s}^{\top}$.
Optimistic estimates of $\theta^{*}_{a}$ are computed as follows.

$$ $\widetilde{\theta}_{a,t}\leftarrow\widehat{\theta}_{a,t}+\beta(t)\frac{(M_{a,t })^{-1}x_{t}}{\sqrt{x_{t}^{\top}(M_{a,t})^{-1}x_{t}}}$ $$

Similarly, optimistic estimates for the cost function estimates are defined as

$$ $\widetilde{w}_{a,t}\leftarrow\widehat{w}_{a,t}-\beta(t)\frac{(M_{a,t})^{-1}x_{ t}}{\sqrt{x_{t}^{\top}(M_{a,t})^{-1}x_{t}}}$ $$

These are optimistic in the sense that for any $x\in\mathcal{X}$, for all $t\in[T]$, $\mathbb{P}(\langle x,\tilde{\theta}_{t}^{a}\rangle\geq\left\langle x,\theta_{
\ast}^{a}\right\rangle)\geq 1-\delta$ (see e.g. [, Chap.20]). Since $\mu$ is an increasing function, this is an upper bound on the expected reward.

Figure: Algorithm 1 Generalized Linear Bandit with Budget Constraints []

The regret guarantees (Corollary 4.3 below) combine the proof of Agrawal and Devanur [] with results on unconstrained generalized linear bandits[, ]. Additionally, we show that the full information setting we propose enjoys the same guarantees. The proof of the regret bounds is deferred to Appendix A.

Note that our setting differs slightly from conventions in prior literature[, , ]. In these works, the algorithm receives arm-dependent contexts $\{x_{t}\}_{a}$, and the hidden parameter $\theta^{*}$ is shared between arms. Though this difference is minor, it means that in our setting there is no shared information between arms: choosing the model does not allow us to gain information on the human’s parameter.

###### Corollary 4.3 (based on Agrawal and Devanur [ 1 ] ) .

Under the setting presented in Section 1, and assuming $B>d^{1/2}T^{3/4}$ Algorithm 1 achieves regret $R_{T}=O\left((\frac{\text{OPT}}{B}+1)\frac{L_{\mu}d\sigma}{\kappa}\sqrt{T\log
\frac{T}{d\delta}\log\frac{T}{d}}\right)$ with probability $1-\delta$.

This result means that the method is near optimal since the regret for an unconstrained linear contextual bandit algorithm is always bounded from below by $\Omega(d\sqrt{T})$ (see e.g. [, Chap. 24]). Note, however, that the budget must be large for this algorithm to perform well. Our experiments are motivated by settings with constant budget (i.e. $B=pT$ for a constant $p\in(0,1]$). However, for some smaller(^3^33Note that the condition on the budget is in $O()$, indicating that scaling constants are hidden. This discussion refers to orders of magnitudes rather than precise thresholding values.) values of $p,T$, *i.e.* for smaller datasets and small budget choices, $pT\leq dT^{3/4}$, and this may affect the convergence of the method.

###### Definition 4.1 (Maximum Likelihood Estimator) .

###### Definition 4.2 (Optimistic estimates) .

###### Corollary 4.3 (based on Agrawal and Devanur [ 1 ] ) .

#### Neural Linear Algorithm.

While the assumption of generalized linear costs and rewards is natural for analysis, it may not perform well for every dataset. To address this, we propose a neural variant which applies Algorithm 1 to learned context embeddings. This approach was introduced by Riquelme et al. [] in the pure bandit, cost-free setting, where it was shown to have empirical success over the linear algorithm.

We define three separate feed-forward neural networks - one to predict the model reward, one to predict the human reward, and one to predict the cost of deferral. When a context $x_{t}$ is observed, these neural networks are used to compute three separate embeddings. Each embedding is the output of the penultimate layer of the network, and is passed to deferral algorithm in place of the real context $x_{t}$.
They are used to update the maximum likelihood estimate, context covariance, and optimistic estimate for $\theta_{\text{h}}^{*},\theta_{\text{m}}^{*},$ and $w^{*}$ in the main loop of Algorithm 1. Depending on the action chosen, the algorithm may observe $r_{\text{m},t},r_{\text{h},t}$, and/or $c_{t}$. These are then used to update the neural networks to create more accurate embeddings.

Note that there are steps that can make this algorithm easier to apply in practice. If compute time is a concern, it is not necessary to train all three neural networks; a viable approach would be to train two embeddings for the human and the model, or even a single embedding for all three parameters. Additionally, we train the networks in batches after a certain number of examples arrive to avoid updating after every step.

## 5 Experiments

The goal of the following experiments is to examine the performance of Algorithm 1 in the expert deferral setting. All experiments take place in the Full Information setting. We defer a comparison to the Pure Bandit setting to Appendix C. Our code and data are available on [our GitHub repository](https://github.com/tsuehr/OnlineLearningToDeferWithKnapsack).

First, to explore how the algorithm learns to exploit the contexts, we examine its performance on artificial data for which the linear model is valid. We compare its performance against a variety of simple baselines.

### 5.1 Synthetic Linear Realizable Data

We tested Algorithm 1 on synthetic data that demonstrate the behavior under different budget constraints and reward functions. We draw the contexts from a discrete distribution with 20 binary features. Let $X=\{x\in\{0,1\}^{20}:\lVert x\rVert_{1}\leq 8\}$. At each time step, a vector $\bar{x}_{t}$ is drawn from the the probability distribution $p(x)\propto\lambda^{|x|}$, with $\lambda=0.3$.
Finally, the context is normalized, so $x_{t}=\frac{\bar{x}_{t}}{\lVert\bar{x_{t}}\rVert_{2}}$. This choice of distribution reduces the context space without reducing the dimension, and it mimics applications where the number of nonzero attributes follow a Bell curve.

#### Experiment 1: Learning the Optimal Policy

We compare the policy computed by the algorithm against the optimal static policy described in Definition 3.1. The results of this experiment are shown in Figure 2. We see that the regret of Algorithm 1 is sublinear, meaning that the performance of our algorithm gets closer to OPT as $T$ increases.

Figure: Figure 2: Mean and standard deviation of the regret over 100 trials. The reward and cost functions are sampled uniformly at random from $[0,1]^{d}$ for each trial.The algorithm is run over $T=50000$ random contexts with $B=8000$. Then, the reward received by OPT is computed for the same contexts.
Refer to caption: extracted/5890293/Figures/exp1_vsopt.png

#### Experiment 2: Evolution of Performance with Budget

In the next experiment, we observe how the performance can adapt to different budget constraints. At intermediate budget constraints, the algorithm can explore but must be mindful of limited resources. We demonstrate that Algorithm 1 performs near to optimal regardless of the regime.

The performance in this case also depends on the relative difference between the skills of the human and the model. We investigate two main regimes for which we construct specific parameters $(\theta_{m},\theta_{h})$. First, the human and the model have the same average reward, but complementary specialties, i.e. $\theta_{m}=1-\theta_{h}$, with(^4^44The symbol $\sim$ denotes ‘chosen uniformly at random’.) $\theta_{h}\sim\{x\in\{0,1\}^{20}:\lVert x\rVert_{1}\}=10\}$. Note that this reflects an intuitively ideal setting for our online deferral problem. In the second regime, the human expert has on average a much higher reward than the model, i.e. $\theta_{\text{h}}\sim[0,1]^{20}$ and $\theta_{\text{m}}\sim[0,0.5]^{20}$. In both settings, we compare this algorithm against two simple baselines - ModelOnly, which only uses the response of the model, and ArbitraryHuman, where the algorithm depletes the budget by deferring to the human on arbitrary instances. Additionally, we compare against BestReject, an algorithm that knows the expected model reward on each context and defers to the human if this reward is below a given threshold. We tested thresholds in increments of 0.01, and plotted the best. This algorithm is the optimum among algorithms that do not use any information about the human reward.

The results of this experiment are shown in Figure 3. In both settings, the algorithm significantly outperforms all simple baselines, attaining close to OPT (Definition 3.1).

Figure: Figure 3: Performance of Algorithm 1 as a percentage of OPT across five different budgets. The two plots correspond to two different human/model reward functions. (Left) $\theta_{h}\sim\{x\in\{0,1\}^{20}:\lVert x\rVert_{1}\}=10\}$, and $\theta_{\text{m}}=1-\theta_{\text{h}}$. (Right) $\theta_{\text{h}}\sim[0,1]^{20}$ and $\theta_{\text{m}}\sim[0,0.5]^{20}$. In both, the cost function is $w_{t}\sim[0,1]^{20}$. Each experiment runs for $T=50000$ time steps, and the mean and standard deviation over 20 trials are shown.
Refer to caption: extracted/5890293/Figures/exp-budget-horizontal.png

In the complementary performance setting, we see that the algorithm does not outperform BestReject by a significant margin. In this setting, the human reward was inversely correlated with the model reward, so the rejection algorithm necessarily deferred to the human on good contexts. In the second setting, the reward functions are uncorrelated, and BestReject has no information on the human reward. It also cannot take advantage of learning the cost function to optimally defer on instances with lower cost.

### 5.2 Real Datasets

In this section, we simulate the online deferral problem on tasks for which performance data was collected from human participants.
Unlike with the synthetic data, these experiments are not realizable: human performance data might not admit a good linear approximation. For the following datasets, we use both Algorithm 1 and its neural extension, described in Sec. 4. In this approach, the output of the last hidden layer of a neural network is used as the context $x_{t}$ when computing the maximum likelihood estimator (Definition 4.1). Further details on our implementation of this algorithm, including the model architectures used, are available in Appendix B.

#### Computing OPT.

In real datasets, the context, reward, and cost distributions are not known and cannot be used to compute OPT via Equation 3.1. Instead, we compute OPT via the following program, where $\pi_{t}$ is 1 if the optimal policy defers to the human at time $t$, and 0 otherwise.

$$ $\text{maximize }\displaystyle\sum\limits_{t=1}^{T}\pi_{t}(r_{\text{m},t}-r_{ \text{h},t})\quad\text{subject to }\displaystyle\sum\limits_{t=1}^{T}\pi_{t}c_ {t}\leq B\;,\;\pi_{j}\in[0,1]\,j=1,\dots,2^{d}$ $$

In the infinite budget case, this program simply sets $\pi_{t}$ to the maximum of $(r_{\text{m},t},r_{\text{h},t})$. With finite budget, it prefers to defer to the human in cases where the ratio of reward gained $(r_{\text{m},t},r_{\text{h},t})$ to cost $c_{t}$ is greater. This can be thought of as the optimal static policy over the empirical distribution defined by the dataset.

#### Knapsack Problem Dataset

The 0-1 knapsack problem is a computationally hard combinatorial optimization problem. Given a set of items with specified weights and values, the goal is to choose the set of items with the maximum value whose total weight is less than or equal to the capacity.

Figure: Algorithm 2 RatioMax4

In this dataset, 396 participants were asked to solve, via an online form, randomly generated integer instances of the knapsack problem with 18 items. Each participant solved 10 instances, and their performance was recorded as a percentage of the optimal value. The mean performance across all instances was 0.895. They were also given a time limit of 3 minutes, and their time to complete the problem was recorded. This dataset was compiled by Sühr et al. [] and we direct the interested reader to their work for more details on data collection, code, study design and the data used for our experiments in this work.

For the model, we used a modified greedy algorithm we call RatioMax4 (Algorithm 2). This algorithm greedily adds the item with the maximum value/weight ratio, until the capacity is reached or four items are added. This algorithm was chosen because it achieves almost identical performance to human participants on average, but it performs well on different instances. This is an ideal setting, since a good online deferral algorithm can achieve large gains by adapting to the relative areas of expertise.

The online deferral problem is as follows. At each time step, an instance of the knapsack problem is presented to the algorithm. The features presented include the weights and values of the knapsack (normalized by capacity), the total capacity, various summary statistics, along with the cumulative average performance and time spent for the current participant. The instances are presented in the same order as they were presented to the participants. The deferral system must decide whether to take the participant’s answer (and incur the cost represented by the time they spent on the instance) or to take the answer provided by Algorithm 2. Let $V$ be the value of the answer, and $V_{max}$ be the optimum value for this problem. The reward received is defined to be $\frac{0.1}{1.1-V/V_{max}}$. This nonlinear reward function incentivizes small improvements near $V/V_{max}\approx 1$.

Results. We model the reward and cost with a linear link function $(\mu(x)=x)$. Figure 4 shows the reward over time for the infinite budget setting. Both algorithms improve significantly over simply predicting with the human or model alone. The regret over time for three different budget constraints (infinite budget, $B=\frac{1}{2}T$, $B=\frac{1}{4}T$) are plotted in Figure 5. While both algorithms perform similarly in the first few hundred steps, the NeuralLinear algorithm performs better over time.

We observe that the regret appears to grow as $O(t^{2/3})$ over the time scale of the experiment, which indicates that the loss against OPT is sublinear. Note that this is contrary to the theoretical regret of $\tilde{O}(t^{1/2})$. There are several ways in which this experiment differs from the idealized setting. Mainly, the regret bound assumes that the noise in the reward and cost signals are independent of the contexts. This is not generally true in real-world datasets. For example, instances of the knapsack problem that involve more difficult arithmetic may have noisier reward signals. It would be interesting to investigate if a similar trend emerges in other bandit algorithms on real-world datasets.

In the limited budget setting, the regret is substantially higher. With fewer resources, the algorithm cannot explore the human arm as thoroughly, and it has less training data to predict from. In essence, the cost of information is much higher when the budget is limited.

Figure: Figure 4: The reward over time of the NeuralLinear and Linear variants on the Knapsack Problem dataset with no budget constraints. The reward of always deferring to the human (HumanOnly) and the model (ModelOnly) are plotted for comparison.
Refer to caption: extracted/5890293/Figures-RealData/Knapsack_Full_Reward.png

Figure: Figure 5: Loss versus OPT of the NeuralLinear and Linear variants of the algorithm on the Knapsack Problem dateset with three different budget constraints: infinite budget (Left), $B=1/2T$ (Middle), and $B=1/4T$ (Right). The lines show the mean over 20 trials (rearranging the order of the participants), and the shaded region represents one standard deviation.
Refer to caption: extracted/5890293/Figures-RealData/Knapsack_Full_Loss_wbars_alt.png

#### ImageNet 16H Dataset [ 33 ]

consists of 1200 unique images sampled from a subset of the ImageNet Large Scale Visual Recognition Challenge [], and divided into 16 categories. The images were perturbed by four different levels of phase noise, resulting in 4800 unique images for classification. These images were then provided to human study participants ($n=145$), resulting in 28997 total human-classified images. Their confidence and classification time were also recorded. The images were also classified by various commonly used models pre-trained on ImageNet.

We construct the deferral problem as follows. The algorithm receives a reward of 1 if the prediction of the chosen arm was correct, and 0 otherwise. The cost of deferring to the human is the time taken to classify the image (normalized to have mean 1).
The features presented to the algorithm include the model classification (encoded as a $16\times 1$ 1-hot vector), the logits of the model output, and the maximum logit of the output. Since the data from many human participants were combined, we also include the cumulative mean cost and accuracy of the current participant.

Results.

Figure: Figure 6: Ratio of total reward to OPT on the ImageNet16H deferral problem, using two different AI models and three different budget constraints. Shows the mean and standard deviation over 20 trials (rearranging the order of the participants). The top plot was generated with the baseline version of Densenet161 []. The bottom plot used the prediction of Densenet161 fine-tuned on noise-augmented images. Note that the BestReject model (striped) uses the best threshold parameter for the dataset and is not possible online.
Refer to caption: extracted/5890293/Figures-RealData/exp_imagenet_densenet161_hori.png

We model the reward with a logistic link function ($\mu(x)=1/(1+e^{-x})$), and we model the cost with a linear link function $(\mu(x)=x)$. The reward as a ratio of OPT for three different budget constraints are plotted in Figure 6. On this dataset, the NeuralLogistic and Logistic variants of the algorithm achieve similar performance. Since the features already consist of the output of the convolutional model, it is intuitive that the model reward can be predicted using a logistic model. Similarly, the cumulative performance was included as a feature, which could be a simple predictor to differentiate ‘good’ participants from ‘bad’ participants. Similarly to the Knapsack data, the algorithm performed significantly worse on the most extreme budget constraint, the baseline model with $B=0.25T$. On this dataset, the classification times had a long tail, meaning that a large number of participants had a significantly higher cost than the median. The algorithm was not able to properly predict the cost, perhaps indicating that the features were not expressive enough to predict the classification time. This proved to be a significant hindrance in the limited budget setting where the human frequently out-performed the model; deferring to the human as many times as possible was key to achieving performance near OPT.

## 6 Discussions and Conclusions

We introduced a novel online decision making framework that connects learning-to-defer problems with challenges more common to online learning and game theory such as budget constraints, partial observability and unknown performance models. Our algorithmic approach largely leverages existing works in the latter literature but our empirical results show the first concrete results on real data. Crucially, we are able to empirically demonstrate that we can learn how to efficiently assign decisions such that the combined performance is better than either of the predictors alone (model or human).

Limitations of the model. One major limitation of the model is the parametric nature of the predictions. While the NeuralLinear model allows us to learn descriptive features, this algorithm does not come with the same theoretical guarantees. It also requires several implementation choices to be made in advance, such as the architecture, learning rate, etc.

We focus on single-resource constraint with single human expert but the original algorithm from Agrawal and Devanur [] would naturally extend to allowing for multiple types of resource constraints or multiple experts with partially overlapping specializations.

Future directions. Our online approach is designed to readapt a deferral strategy after a possible distribution shift. Going further, our model should be extended to continuously adapt to such changes, for instance by building on recent works on non-stationary bandit models [, ].

## Acknowledgements

C. Vernade is funded by the Deutsche Forschungsgemeinschaft (DFG) under both the project 468806714 of the Emmy Noether Programme and under Germany’s Excellence Strategy – EXC number 2064/1 – Project number 390727645. The authors also thank the international Max Planck Research School for Intelligent Systems (IMPRS-IS) for supporting C. Vernade and T. Sühr.

## Appendix A Proof of Regret Guarantee

For simplicity, we drop the $a$ suffix and look at a single parameter $\theta^{*}$. Note that all the following also apply to $w$.

Define $C_{t}=\{\theta:\lVert\theta-\hat{\theta}_{t}\rVert_{M_{t}}\leq\frac{\sigma}{
\kappa}\sqrt{2d\log\left(\frac{1+2td}{\delta}\right)}=\beta(t)\}$. Let $\tau=\min_{t\in[T]}:\lambda_{min}(M_{t})\geq 1$. It was shown by Li et al. [] that with probability $1-\delta$, $\tau=O\left((d+\log 1/\delta)/\sigma_{0}^{2}\right)$ (recalling $\sigma_{0}=\lambda_{min}\mathbb{E}_{x\sim\mathcal{D}}xx^{\top}>0$).

We present two key lemmas from [] on generalized linear bandits.

###### Lemma A.1 (Lemma 3 of [ 20 ] ) .

With probability $1-\delta$, for all $t\geq\tau$, $\theta^{*}\in C_{t}$.

###### Lemma A.2 (Lemma 2 of [ 20 ] ) .

For all $t>\tau$

$$ $\sum_{s=\tau+1}^{t}\lVert x_{s}\rVert_{M_{t}^{-1}}\leq\sqrt{2(t-\tau)d\log \frac{t}{d}}$ $$

These three results lead to the following two corollaries, corresponding to two corollaries given by Agrawal and Devanur [] in the linear bandit case.

###### Corollary A.3 (Corollary 1 of [ 1 ] ) .

Let $\bar{\theta}\in C_{t}$. Then,

$$ $\sum_{s=\tau}^{T}|x_{t}^{\top}\bar{\theta}-x_{t}^{\top}\theta^{*}|\leq\beta(T) \sqrt{2Td\log\frac{T}{d}}$ $$

###### Proof.

$$ $\displaystyle\sum_{s=\tau}^{T}|x_{t}^{\top}\bar{\theta}-x_{t}^{\top}\theta^{*}|$ $\displaystyle\leq\sum_{t=\tau}^{T}\lVert\bar{\theta}-\theta^{*}\rVert_{V_{t}} \lVert x_{t}\rVert_{V_{t}^{-1}}$ $\displaystyle\leq\beta(T)\sqrt{2dT\log\frac{T}{d}}$ $$

The first line comes from a known matrix-norm inequality (Lemma 7 of []).

The second line comes from Lemmas A.1 and A.2.
∎

Via the definition of the optimistic estimate:

###### Corollary A.4 (Corollary 2 of [ 1 ] ) .

With probability $1-\delta$, for all $t\geq\tau$, $\mu(x_{t}^{\top}\tilde{\theta}_{t})\geq\mu(x_{t}^{\top}\theta^{*})$, and

$$ $\sum_{t=1}^{T}\mu(x_{t}^{\top}\tilde{\theta}_{t})-\mu(x_{t}^{\top}\theta^{*}) \leq L_{\mu}\beta(T)\sqrt{2dT\log\frac{T}{d}}$ $$

###### Proof.

The first part comes from the assumption that $\mu$ is an increasing function. Thus, $\mu(x_{t}^{\top}\tilde{\theta}_{t})\geq\mu(x_{t}^{\top}\theta^{*})$ by Lemma A.1 and the definition of $\tilde{\theta}$ as an optimistic estimator.

The second part follows from the assumption that $\mu$ is $L_{\mu}-$Lipschitz. So, $\sum_{t=1}^{T}\mu(x_{t}^{\top}\tilde{\theta}_{t})-\mu(x_{t}^{\top}\theta^{*})
\leq\sum_{t=1}^{T}L_{\mu}(x_{t}^{\top}\tilde{\theta}_{t}-x_{t}^{\top}\theta^{*})$, and the result follows from Corollary A.3.
∎

Now we have the tools we need to prove the regret bound.

###### Corollary A.5 .

Given $Z$, the algorithm achieves the following with probability $1-\delta$:

$$ $regret(T)=O\left(\left(\frac{\text{OPT}}{B}+1\right)\frac{L_{\mu}d\sigma}{ \kappa}\sqrt{T\log\frac{T}{d\delta}\log\frac{T}{d}}\right)$ $$

###### Proof.

We follow the proof steps presented in [], extending the claims to the generalized linear model when necessary.

Let $T_{stop}$ be the stopping time of the algorithm. Let $R^{\prime}(T)=O\left(\frac{d\sigma}{\kappa}\sqrt{T\log\frac{T}{d\delta}\log
\frac{T}{d}}\right)$. Fix $a$. Also define $T_{a}=\{\tau<s<T_{stop}:a_{t}=a\}$. Via the Azuma-Hoeffding inequality,

$$ $\left|\sum_{s=\tau+1}^{T_{stop}}c_{s}-\mu(x_{s}^{\top}w^{*}_{a_{t}})\right| \leq R^{\prime}(T)$ $$

$$ $\left|\sum_{s=\tau+1}^{T_{stop}}r_{s}-\mu(x_{s}^{\top}\theta^{*}_{a_{t}}) \right|\leq R^{\prime}(T)$ $$

Additionally, recalling Corollary A.4, with probability $1-\delta$, $\sum_{t=\tau+1}^{T_{stop}}\mu(x_{t}^{\top}\tilde{\theta}_{a_{t},t})-\mu(x_{t}^
{\top}\theta^{*}_{a_{t}})\leq L_{\mu}R^{\prime}(T)$ (and similarly for $w$). Therefore, as in the linear case, a bound on the estimated reward with $\tilde{\theta}$ can serve as a proxy for the bound with $\theta^{*}$.

Define $\tilde{r}_{t}=\mu(x_{t}^{\top}\tilde{\theta}_{a_{t},t})$ and $\tilde{c}_{t}=\mu(x_{t}^{\top}\tilde{w}_{a_{t},t})$.

###### Lemma A.6 (Lemma 8 of [ 1 ] ) .

$$ $\sum_{t=\tau}^{T_{stop}}\mathbb{E}[\tilde{r}_{t}]\geq\frac{T_{stop}}{T}\text{ OPT}+Z\sum_{t=\tau}^{T_{stop}}\gamma_{t}\mathbb{E}[\tilde{c}_{t}-B/T]$ $$

###### Proof.

Let $a^{*}$ be the action taken by the optimal static policy at $t$. By Corollary A.4, for any $x_{t}$, $\mu(x_{t}^{\top}\tilde{\theta}_{t,a^{*}})\geq\mu(x_{t}^{\top}\theta^{*}_{a^{*}})$. Therefore, $\mathbb{E}[\mu(x_{t}^{\top}\tilde{\theta}_{t,a^{*}})]\geq\text{OPT}/T$ and $\mathbb{E}[\mu(x_{t}^{\top}\tilde{w}_{a^{*},T})]\leq B/T$ (taking the expectation over the choice of $x_{t}$, conditioned on the history). However, since the algorithm chooses the optimal optimistic action:

$$ $\displaystyle\tilde{r}_{t}-Z\gamma_{t}\tilde{c}_{t}$ $\displaystyle\geq\mu(x_{t}^{\top}\tilde{\theta}_{t,a^{*}})-Z\gamma_{t}\mu(x_{t }^{\top}\tilde{w}_{t,a^{*}})$ $\displaystyle\mathbb{E}[\tilde{r}_{t}-Z\gamma_{t}\tilde{c}_{t}]$ $\displaystyle\geq\mathbb{E}[\mu(x_{t}^{\top}\tilde{\theta}_{t,a^{*}})]-Z\gamma _{t}\mathbb{E}[\mu(x_{t}^{\top}\tilde{w}_{t,a^{*}})]$ $\displaystyle\geq\frac{\text{OPT}}{T}-Z\gamma_{t}\frac{B}{T}$ $$

Sum to $T_{stop}$ to get the Lemma statement.
∎

The rest of the proof follows identically to [].
∎

###### Lemma A.1 (Lemma 3 of [ 20 ] ) .

###### Lemma A.2 (Lemma 2 of [ 20 ] ) .

###### Corollary A.3 (Corollary 1 of [ 1 ] ) .

###### Proof.

###### Corollary A.4 (Corollary 2 of [ 1 ] ) .

###### Proof.

###### Corollary A.5 .

###### Proof.

###### Lemma A.6 (Lemma 8 of [ 1 ] ) .

###### Proof.

## Appendix B Training Details for Neural Algorithm

For both the ImageNet16H data and the Knapsack data, the Neural algorithm trained three separate neural networks with the same architecture. They consist of an input layer with the same dimension as the context, a hidden layer of dimension 50, and a single output layer. Note that this means that in both experiments, the dimension of the linear system is 50. There is a ReLU activation between the input layer and the hidden layer, and a Sigmoid activation on the output. The weights of the networks were updated every 10 steps for the Knapsack data. For the ImageNet16H data, the weights were initially updated every 20 steps, decreasing to every 100 steps after time step 4000. Both were trained with mini-batches of size 500 using the Adam optimizer with learning rate 0.0005 for the Knapsack data and 0.0001 for the ImageNet16H data. The experiments were run on Google Colab servers using their T4 GPU.

Figure: Figure 7: The architecture for computing the embedding for the human arm. An identical architecture exists for the model arm and the cost.
Refer to caption: extracted/5890293/Figures/NNArchitecture.png

After updating the network weights, the embeddings for all previous contexts are recomputed using the new networks. These new embeddings are used to recompute the estimated parameters per Definition 4.2 and 4.1. As noted in [], this may not be practical in applications where all previous contexts cannot be stored, either due to space constraints or legal concerns. In these settings, one can continue to use the previous embeddings and apply weights which decrease the influence of old embeddings on the linear system over time.

## Appendix C Bandit Feedback Experiments

Overall, we do not observe a significant difference in performance between the bandit feedback setting and the full information setting. With random reward and cost functions, the average performance in the full information setting is slightly better, as seen in Figure 8. Interestingly, in the Knapsack dataset, the linear algorithm seemed to perform slightly better in the pure bandit setting (as shown in Figure 9). This may indicate that the full information setting overexplored the human arm.

Figure: Figure 8: The experiment described in Figure 2 with the Pure Bandit setting included. Mean and standard deviation of the regret over 100 trials. The reward and cost functions are sampled uniformly at random from $[0,1]^{d}$ for each trial.The algorithm is run over $T=50000$ random contexts with $B=8000$. Then, the reward received by OPT is computed for the same contexts.
Refer to caption: extracted/5890293/Figures/exp1_vsopt_withpb.png

Figure: Figure 9: The experiment described in Figure 5 with the Pure Bandit setting included. For clarity, only the means are plotted.
Refer to caption: extracted/5890293/Figures-RealData/Knapsack_Full_Loss_wbarspb.png

## Peer Reviews

confidence: 3
contribution: 1
initial_rating: 3
presentation: 2
questions: See the weaknesses above.
soundness: 2
strengths: The topic of the manuscript originates from a practical problem.
summary: The manuscript introduces a framework for online learning-to-defer under constrained budget for the human expert.
weaknesses: The original contribution of the paper is hard to justify as it is largely based on the work of Agrawal and Devanur (2016).

---

confidence: 4
contribution: 3
initial_rating: 6
presentation: 3
questions: 1.	In line~163, what is the distribution D there?
2.	Does Algorithm~1 work for the full information setting or the bandit information setting? Please clarify how the algorithm design differs when full information or bandit information is considered.  It would be good to discuss the implications of using the algorithm in each setting, and how this choice affects the algorithm's performance or implementation.
3.	In general full information online learning algorithm typically yields smaller regret (e.g., algorithms for online convex optimization Hazan9 & Levy NIPS 2014). Could you explain why this is not the case for the algorithm studied in this paper?
soundness: 2
strengths: 1. The problem formulation and the algorithm design seem to be novel and of practical interest. 
2. Theoretical regret guarantees are provided for the proposed algorithms.
summary: This paper studies an online decision-making problem with a human expert. The authors phrase the problem as a contextual bandit problem, where a deferral learner needs to choose whether to use an ML model or a human expert to obtain the reward. The authors propose an algorithm to solve this problem based on a UCB-like algorithm and characterize its regret guarantees. The authors further extend their algorithm using neural networks to handle complicated datasets.
weaknesses: 1. Considering optimal static policy seems to be limited as it can be far from the true dynamic optimal policy. Would it be possible or how difficult it is to extend the current regret analysis in the paper to handle dynamic regret which uses the dynamic optimal policy as benchmark?
2. The regret analysis seems to be straightforward extensions from existing works on UCB-based algorithms for bandit problems as the authors mentioned in Section~4.
3. There is no regret guarantee for the neural linear algorithm provided in the paper. Could you at least explain the specific challenges in deriving such guarantees for this approach?

---

confidence: 4
contribution: 1
initial_rating: 3
presentation: 2
questions: - Could the authors specify the contributions if any, beyond a simple combination of [Agrawal and Devanur, 2016] and [Li et al. (2017)] and the limited empirical evaluation on the ImageNet dataset?

- There have been several new developments in the Neural Bandits literature since Riquelme et al. (2018) (see [1], [2] and [3]). Why have the authors not used these frameworks instead?

[1] Dongruo Zhou, Lihong Li, and Quanquan Gu. Neural contextual bandits with ucb-based exploration. In International Conference on Machine Learning, pp. 11492–11502. PMLR, 2020.

[2] Weitong Zhang, Dongruo Zhou, Lihong Li, and Quanquan Gu. Neural thompson sampling. In International Conference on Learning Representation (ICLR), 2021.

[3] Rohan Deb, Yikun Ban, Shiliang Zuo, Jingrui He, and Arindam Banerjee. Contextual bandits with online neural regression. In The Twelfth International Conference on Learning Representations.
soundness: 2
strengths: None
summary: The paper proposes using the framework of Bandits with Knapsacks to choose a model's prediction or to defer to a skilled expert, where the expert is the limited resource available to the meta learner.
weaknesses: The paper has limited novelty and contribution.

1. The paper simply uses the an existing framework (Bandits with Knapsacks [Badanidiyuru et al., 2018], [Agrawal and Devanur, 2016]) to choose between a model's prediction or to defer to a skilled expert.
2. Limited contribution:
- The regret guarantee provided is a straightforward combination of the linear contextual bandit with knapsack guarantee [Agrawal and Devanur, 2016] with the generalized linear bandit analysis from  of [Li et al. (2017)], with the bulk of proof in the appendix filled with re-statments of specific Lemmas and Corollaries from [Agrawal and Devanur, 2016] and [Li et al. (2017)].

- The experiments are very limited. Section-5.1 is synthetic, while section 5.2 provides results for two different problems: 1) 0-1 Knapsack problem, that chooses between human solutions to the 0-1 knapsack problem and the solution to a greedy algorithm. This does not align with the original desription of distribution shift leading to decline in ML model's prediction accuracy. 2) ImageNet: chooses between a pretrained model and human prediction. Although this aligns with the original problem set-up, the evaluation is shallow and limited.

3. Some missing references on further developments in Bandits with Knapsacks:

- https://arxiv.org/abs/2211.07484v6

- https://arxiv.org/abs/2210.11834

- https://proceedings.mlr.press/v162/sivakumar22a.html

- https://proceedings.mlr.press/v238/deb24a

---

confidence: 3
contribution: 2
initial_rating: 5
presentation: 3
questions: a. Is it possible to obtain a theoretical guarantee (even if suboptimal) when $B$ is relatively small?

b. What is the challenge in extending the work of Agrawal and Devanur (2016) to your setting?

c. What are the empirical results of the proposed algorithm when $B < 0.25T$, such as $0.1T$?
soundness: 3
strengths: a. The authors consider an interesting and practical problem that is well-motivated.

b. The paper provides both theoretical analysis and experimental results for the proposed algorithm. The regret bound of the algorithm is near-optimal under certain conditions. Experiments are conducted on both synthetic and real datasets, and the proposed algorithms outperform the baselines.

c. The presentation is clear and easy to follow.
summary: This paper introduces a new online decision-making problem that includes budget constraints and different types of feedbacks. The authors formalize this problem into a contextual bandit setting and propose a new algorithm for generalized linear rewards. They show that the algorithm achieves a near-optimal regret bound. They also validate its effectiveness with empirical results on real-world datasets.
weaknesses: a. The proposed algorithm and analysis largely build on the work of Agrawal and Devanur (2016), which addresses a similar problem. Although the authors claim that they extend the algorithm to generalized linear rewards, it is unclear what specific challenges this extension presents and whether it requires new techniques.

b. The theoretical results only hold when the budget $B$ is relatively large, $B \geq d^{1/2} T^{3/4}$. This requirement may limit the applicability of the algorithm in scenarios with a limited budget.

c. The neural linear algorithm is a straightforward extension of Algorithm 1, treating the neural network’s embedding as the context. And there is no theoretical guarantees for the neural linear algorithm.

d. In the experiments, the authors only consider scenarios where $B$ is at least $0.25T$, which is a relatively large budget when $T$ is large. Results for smaller values of $B$ would be helpful to further validate the algorithm's performance.

Meta-review: The reviewers point out that the paper does not have algorithmic novelty. The authors clarify that this is the case, and the main point of novelty is to run an existing algorithm on a publicly available dataset. As such, there doesn't seem to be much disagreement between the two parties on the technical merit. My judgment ultimately rests on the fit: the authors should consider submitting the paper to a more practice-oriented venue (icml and neurips would likely be difficult). A good choice can be MSOM practice based research competition (see https://pubsonline.informs.org/page/msom/practice-based-research-competition) as well as the various tracks of the journal MSOM. The authors will likely have an easier time there.

Decision: Reject