SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Kiarash Banihashem  
University of Maryland, College Park  
kiarash@umd.edu
Suho Shin  
University of Maryland, College Park  
suhoshin@umd.edu
MohammadTaghi Hajiaghayi  
University of Maryland, College Park  
hajiagha@umd.edu
Max Springer  
University of Maryland, College Park  
mss423@umd.edu
We present an oracle-efficient relaxation for the adversarial contextual bandits problem, where the contexts are sequentially drawn i.i.d from a known distribution and the cost sequence is chosen by an online adversary. Our algorithm has a regret bound of  $O(T^{\frac{2}{3}}(K\log (|\Pi |))^{\frac{1}{3}})$  and makes at most  $O(K)$  calls per round to an offline optimization oracle, where  $K$  denotes the number of actions,  $T$  denotes the number of rounds and  $\Pi$  denotes the set of policies. This is the first result to improve the prior best bound of  $O((TK)^{\frac{2}{3}}(\log (|\Pi |))^{\frac{1}{3}})$  as obtained by Syrgkanis et al. at NeurIPS 2016, and the first to match the original bound of Langford and Zhang at NeurIPS 2007 which was obtained for the stochastic case.
One of the most important problems in the study of online learning algorithms is the contextual bandits problem. As a framework for studying decision making in the presence of side information, the problem generalizes the classical multi-armed bandits problem and has numerous practical applications spanning across clinical research, personalized medical care and online advertising, with substantial emphasis placed on modern recommender systems.
In the classical multi-armed bandits problem, a decision maker is presented with  $K$  actions (or arms) which it needs to choose from over a sequence of  $T$  rounds. In each round, the decision maker makes its (possibly random) choice and observes the cost of its chosen action. Depending on the setting, this cost is generally assumed to be either stochastic or adversarial. In the stochastic setting, the cost of each action is sampled i.i.d. from a fixed, but a priori unknown, distribution. In the more general adversarial setting, no such assumption is made and the costs in each round can be controlled by an online adversary. The goal of the learner is to minimize its regret, defined as the absolute difference between its total cost and the total cost of the best fixed action in hindsight.
The contextual bandits problem generalizes this by assuming that in each round, the learner first sees some side information, referred to as a context,  $x \in \mathcal{X}$  and chooses its action based on this information. As in prior work (Rakhlin and Sridharan, 2016; Syrgkanis et al., 2016b), we assume that the  $x$  are sampled i.i.d. from a fixed distribution  $\mathcal{D}$ , and that the learner can generate samples from  $\mathcal{D}$  as needed. In addition, the learner has access to a set of policies,  $\Pi$ , where a policy is defined as a mapping from contexts to actions. As before, the goal of the learner is to minimize its regret, which we here define as the absolute difference between its total cost and the total cost of the best policy of  $\Pi$  in hindsight.
It is well-known that by viewing each policy as an expert, the problem can be reduced to the bandits with experts problem where, even in the adversarial setting, the Exp4 (Auer et al., 1995) algorithm achieves the optimal regret bound of  $O(\sqrt{TK\log(|\Pi|)})$ . Computationally however, the reduction is inefficient as the algorithm's running time would be linear in  $|\Pi|$ . Since the size of the policy set,  $\Pi$ , can be very large (potentially exponential), the utility of this algorithm is restricted in practice.
Given the computational challenge, there has been a surge of interest in oracle-efficient algorithms. In this setting, the learner is given access to an Empirical Risk Minimization (ERM) optimization oracle which, for any sequence of pairs of contexts and loss vectors, returns the best fixed policy in  $\Pi$ . This effectively reduces the online problem to an offline learning problem, where many algorithms (e.g., SVM) are known to work well both in theory and practice. This approach was initiated by the seminal work of Langford and Zhang (2007), who obtained a regret rate of  $O(T^{2/3}(K\log |\Pi|)^{1/3})$  for stochastic rewards, using an  $\epsilon$ -greedy algorithm. This was later improved to the information-theoretically optimal  $O(\sqrt{TK\log|\Pi|})$  (Dudik et al., 2011). Subsequent works have focused on improving the running time of these algorithms (Beygelzimer et al., 2011; Agarwal et al., 2014; Simchi-Levi and Xu, 2022), and extending them to a variety of problem settings such as auction design (Dudik et al., 2020), minimizing dynamic regret (Luo et al., 2018; Chen et al., 2019), bandits with knapsacks (Agrawal et al., 2016), semi-bandits (Krishnamurthy et al., 2016), corralling bandits (Agarwal et al., 2017), smoothed analysis (Haghtalab et al., 2022; Block et al., 2022), and reinforcement learning (Foster et al., 2021).
Despite the extensive body of work, progress for adversarial rewards has been slow. Intuitively, approaches for the stochastic setting do not generalize to adversarial rewards because they try to "learn the environment" and in the adversarial setting, there is no environment to be learnt. This issue can be seen in the original multi-armed bandits problem as well. While the regret bounds for the adversarial setting and the stochastic setting are the same, the standard approaches are very different. In the stochastic setting, the most standard approach is the UCB1 algorithm (Auer et al., 2002), which is intuitive and has a relatively simple analysis. In the adversarial setting however, the standard approach is considerably more complex: the problem is first solved in the "full feedback" setting, where the learner observes all of the rewards in each iteration, using the Hedge algorithm. This is then used as a black box to obtain an algorithm for the partial (or bandit) feedback setting by constructing unbiased estimates for the rewards vector. The analysis is also much more involved compared to UCB1; a standard analysis of the black box reduction leads to the suboptimal bound of  $T^{3/4}K^{1/2}$ , and further obtaining the optimal  $\sqrt{TK}$  bound requires a more refined second moment analysis (see Chapter 6 of Slivkins (2019) for a more detailed overview).
As a result, oracle-efficient algorithms for the adversarial setting were first proposed by the independent works of Rakhlin and Sridharan (2016) and Syrgkanis et al. (2016a) in ICML 2016, who obtained a regret bound of  $O(T^{3/4}K^{1/2}\log(|\Pi|)^{1/4})$  and left obtaining improvements as an open problem. This was subsequently improved to  $O((TK)^{2/3}\log(|\Pi|)^{1/3})$  by Syrgkanis et al. (2016b) at NeurIPS 2016.
1.1 Our contribution and techniques
In this work, we design an oracle-efficient algorithm with a regret bound of  $O(T^{2/3}(K \log |\Pi|)^{1/3})$ . Our result is the first improvement after that of Syrgkanis et al. (2016b), and maintains the best regret upper bound to the extent of our knowledge. This is also the first result to match the bound of Langford and Zhang (2007), the original baseline algorithm for the stochastic version of the problem. We state the informal version of our main result (Theorem 7) in the following.
Theorem 1 (Informal). For large enough  $T$ , there exists an algorithm (Algorithm 1) that achieves expected regret on the order of  $O(T^{2/3}(K\log |\Pi|)^{1/3})$  for the adversarial contextual bandits problem using at most  $O(K)$  calls per round to an ERM oracle.
In order to compare this result with prior work, it is useful to consider the regime of  $K = T^{\alpha}$  for a constant  $\alpha > 0$ . In this regime, our work leads to a sublinear regret bound for any  $\alpha < 1$ , while
<sup>1</sup>We note that any approach for the adversarial setting works for the stochastic setting as well. However, both in theory and practice, specialised approaches are more commonly used.
2When  $T$  is small, our improvement compared to prior work is more significant; we focus on the large  $T$  setting to obtain a fair comparison.
prior work (Rakhlin and Sridharan, 2016; Syrgkanis et al., 2016b) can only obtain sublinear regret for  $\alpha < 1/2$ .
Our improved dependence on  $K$  is important practically since, for many real-world implementations such as recommender systems, the number of possible actions is very large. Additionally, many bandits algorithms consider "fake" actions as part of a reduction. For example, a large number of actions may be considered as part of a discretization scheme for simulating a continuous action space (Slivkins, 2009). In such cases, the improved dependence on  $K$  could potentially imply an overall improvement with respect to  $T$ , as the parameters in the algorithm are often chosen in such a way that optimizes their trade-off.
From a technical standpoint, our result builds on the existing works based on the relax-and-randomize framework of Rakhlin et al. (2012). Rakhlin and Sridharan (2015) used this framework, together with the "random playout" method, to study online prediction problems with evolving constraints under the assumption of a full feedback model. Rakhlin and Sridharan (2016) extended these techniques to the partial (bandit) feedback model, and developed the BISTRO algorithm which achieves a  $O(T^{3/4}K^{1/2}\log(|\Pi|)^{1/4})$  regret bound for the adversarial contextual bandits problem. Subsequently, Syrgkanis et al. (2016b) used a novel distribution of hallucinated rewards as well as a sharper second moment analysis to obtain a regret bound of  $O((TK)^{2/3}\log(|\Pi|)^{1/3})$ . We further improve the regret rate to  $O(T^{2/3}(K\log(|\Pi|)^{1/3})$  by reducing the support of the hallucinated rewards vector to a single random entry. We note the previous approaches of Rakhlin and Sridharan (2016); Syrgkanis et al. (2016b), as well as the closely related work of Rakhlin and Sridharan (2015), set all of the entries of the hallucinated cost to i.i.d Rademacher random variables.
We show that our novel relaxation preserves the main properties required for obtaining a regret bound, specifically, it is admissible. We then prove that the Rademacher averages term that arises from our new relaxation improves by a factor of  $K$ , which consequently leads to a better regret bound. We further refer to Section 3 for a more detailed description of our algorithm, and to Section 4 for the careful analysis.
Contextual bandits. There are three prominent problem setups broadly studied in the contextual bandits literature: Lipschitz contextual bandits, linear contextual bandits, and contextual bandits with policy class. Lipschitz contextual bandits (Lu et al., 2009; Cutkosky and Boahren, 2017) and linear contextual bandits (Chu et al., 2011) assume a structured payoff based on a Lipschitz or linear realizability assumption, respectively. The strong structural assumptions made by these works however make them impractical for many settings.
To circumvent this problem, many works consider contextual bandits with policy classes where the problem is made tractable by making assumptions on the benchmark of regret. In these works, the learner is given access to a policy class  $\Pi$  and competes against the best policy in  $\Pi$ . This approach also draws connections to offline machine learning models that in recent years have had a huge impact on many applications. In order for an algorithm to be useful in practice however, it needs to be computationally tractable, thus motivating the main focus of this work.
Online learning with adversarial rewards. Closely related to our work is the online learning with experts problem where, in each round, the learner observes a set of  $N$  experts making recommendations for which action to take, and decides which action to choose based on these recommendations. The goal of the learner is to minimize its regret with respect to the best expert in hindsight. In the full feedback setting, where the learner observes the cost of all actions, the well-known Hedge (Cesa-Bianchi et al., 1997) algorithm based on a randomized weighted majority selection rule achieves the best possible regret bound of  $O(\sqrt{T\ln N})$ . Correspondingly, in the partial feedback setting, Exp4 (Auer et al., 1995) exploits Hedge by constructing unbiased "hallucinated" costs based on the inverse propensity score technique, and achieves the optimal regret bound of  $O(\sqrt{KT\ln N})$ . By considering an expert for each policy, the contextual bandits problem can be reduced to this problem. This reduction suffers from computational intractability however due to the linear dependence on  $|\Pi|$  in the running time. Since the number of policies can be very large in practice, this poses a major bottleneck in many cases. We alleviate this intractability issue through a computationally feasible oracle-based algorithm with improved regret bound.
Oracle efficient online learning. Stemming from the seminal work of Kalai and Vempala (2005), there has been a long line of work investigating the computational barriers and benefits of online learning in a variety of paradigms. Broadly speaking, the bulk of online algorithms are designed on the basis of two popular frameworks in this literature: follow-the-perturbed-leader (Kalai and Vempala, 2005; Suggala and Netrapalli, 2020; Dudík et al., 2020; Haghtalab et al., 2022) and relax-and-randomize (Rakhlin et al., 2012). Both frameworks aim to inject random noise into the input set before calling an oracle to construct a more robust sequence of actions to be played against an adversary, but differ in how they introduce such noise to the system. Our algorithm builds on the relax-and-randomize technique and improves upon the previous best result of Syrgkanis et al. (2016b).
Despite their computational advantages, it is known that oracle efficient algorithms have fundamental limits and, in some settings, they may not achieve optimal regret rates (Hazan and Koren, 2016). Whether this is the case for the adversarial contextual bandits problem remains an open problem.
In this section, we explain the notation and problem setup, and review the notion of relaxation based algorithms in accordance with prior work (Rakhlin and Sridharan, 2016; Syrgkanis et al., 2016b).
2.1 Notation and problem setup
Given an integer  $K$ , we use  $[K]$  to denote the set  $\{1, \ldots, K\}$  and  $a_{1:K}$  to denote  $\{a_1, \ldots, a_k\}$ . We similarly use  $(a, b, c)_{1:K}$  to denote the set of tuples  $\{(a_1, b_1, c_1), \ldots, (a_K, b_K, c_K)\}$ . The vector of zeros is denoted as  $\mathbf{0}$ , and similarly, the vector of ones is denoted  $\mathbf{1}$ .
We consider the contextual bandits problem with  $[T]$  rounds. In each round  $t\in [T]$ , a context  $x_{t}$  is shown to the learner, who chooses an action  $\hat{y}_t\in [K]$ , and incurs a loss of  $c_{t}(\hat{y}_{t})$ , where  $c_{t}\in [0,1]^{k}$  denotes the cost vector. The choice of the action  $\hat{y}_t$  can be randomized and we assume that the learner samples  $\hat{y}_t$  from some distribution  $q_{t}$ . The cost vector is chosen by an adversary who knows the cost vector  $x_{t}$  and the distribution  $q_{t}$  but, crucially, does not know the value of  $\hat{y}_t$ .
As in prior work (Rakhlin and Sridharan, 2016; Syrgkanis et al., 2016b), we operate in the hybrid i.i.d-adversarial model where  $x_{t}$  is sampled from some fixed distribution  $\mathcal{D}$ , and the learner has sampling access to the distribution  $\mathcal{D}$ . We additionally assume that the feedback to the learner is partial, i.e., the learner only observes  $c_{t}(\hat{y}_{t})$  and not the full cost vector  $c_{t}$ .
The learner's goal is to minimize its total cost compared to a set of policies  $\Pi$ , where a policy is defined as a mapping from contexts to actions. Formally, the learner aims to minimize its regret, which we define as
$$
\operatorname {R E G} := \sum_ {t = 1} ^ {T} \left\langle q _ {t}, c _ {t} \right\rangle - \inf  _ {\pi \in \Pi} \sum_ {t = 1} ^ {T} c _ {t} (\pi (x _ {t})),
$$
where  $\langle q_t, c_t \rangle$  denotes the dot product of  $q_t$  and  $c_t$ , and inf denotes the infimum.
We assume that the learner has access to a value-of-ERM optimization oracle that takes as input a sequence of contexts and cost vectors  $(x, c)_{1:t}$ , and outputs the minimum cost obtainable by a policy in  $\Pi$ , i.e.,  $\inf_{\pi \in \Pi} \sum_{\tau=1}^{t} c_{\tau}(\pi(x_{\tau}))$ .
2.2 Relaxation Based Algorithms
In each round  $t \in [T]$  after selecting an action and observing the adversarial cost, the learner obtains an information tuple, which we denote by  $I_{t}(x_{t},q_{t},\hat{y}_{t},c_{t}(\hat{y}_{t}),S_{t})$ . Here,  $\hat{y} \sim q_t$  is the action chosen from the learner's distribution, and  $S_{t}$  is the internal randomness of our algorithm, which can also be used in the subsequent rounds.
Given the above definition, the notions of admissible relaxation and admissible strategy are defined as follows.
Definition 2. A partial information relaxation  $\mathrm{REL}(\cdot)$  is a mapping from the information sequence  $(I_1,\dots,I_t)$  to a real value for any  $t\in [T]$ . Moreover, a partial-information relaxation is deemed
admissible if for any such  $t$ , and for all  $I_1, \dots, I_{t-1}$ :
$$
\mathbb {E} _ {x _ {t} \sim D} \left[ \inf  _ {q _ {t}} \sup  _ {c _ {t}} \mathbb {E} _ {\hat {y} _ {t} \sim q _ {t}, S _ {t}} \left[ c _ {t} (\hat {y} _ {t}) + \operatorname {R E L} (I _ {1: t}) \right] \right] \leq \operatorname {R E L} (I _ {1: t - 1}), \tag {1}
$$
and for all  $x_{1:T}, c_{1:T}$  and  $q_{1:T}$ :
$$
\mathbb {E} _ {\hat {y} _ {1: T} \sim q _ {t}, S _ {1: T}} \left[ \operatorname {R E L} \left(I _ {1: T}\right) \right] \geq - \inf  _ {\pi} \sum_ {t = 1} ^ {T} c _ {t} (\pi (x _ {t})). \tag {2}
$$
A randomized strategy  $q_{1:T}$  is admissible if it certifies the admissibility conditions (1) and (2).
Intuitively, relaxation functions allow us to decompose the regret across time steps, and bound each step separately using Equation (1). The following lemma formalizes this idea.
Lemma 3 (Rakhlin and Sridharan (2016)). Let REL be an admissible relaxation and  $q_{1:T}$  be a corresponding admissible strategy. Then, for any  $c_{1:T}$ , we have the bound
$$
\mathbb {E} \left[ \operatorname {R E G} \right] \leq \operatorname {R E L} (\emptyset).
$$
3 Contextual Bandits Algorithm
We here define an admissible strategy in correspondence with the relaxation notion from the prior section, and use it to outline our contextual bandits algorithm. As mentioned in Section 1.1, our algorithm is based on the BISTRO+ algorithm of Syrgkanis et al. (2016b), and our improvement is obtained by defining a new relaxation function, which we discuss below. We discuss how this improves the regret bound in Section 4.
Unbiased cost vectors. In order to handle the partial feedback nature of the problem, we use the standard technique of forming an unbiased cost vector from the observed entry, together with the discretization scheme of Syrgkanis et al. (2016b). Let  $\gamma < 1$  be a parameter to be specified later. Using the information  $I_{t}$  collected on round  $t$ , we set our estimator to be the random vector whose elements are defined by a Bernoulli random variable
$$
\hat {c} _ {t} (i) = \left\{ \begin{array}{l l} K \gamma^ {- 1} \cdot \mathbb {1} [ i = \hat {y} _ {t} ] & \text {w i t h p r o b a b i l i t y} \gamma \cdot \frac {c _ {t} (\hat {y} _ {t})}{K q _ {t} (\hat {y} _ {t})} \\ 0 & \text {o t h e r w i s e} \end{array} . \right. \tag {3}
$$
We note that this is only defined for  $\min_i q_t(i) \geq \gamma / K$ , thus imposing a constraint that must be ensured by our algorithm. It is easy to verify that this vector is indeed an unbiased estimator:
$$
\mathbb {E} _ {\hat {y} _ {t} \sim q _ {t}} [ \hat {c} _ {t} (i) ] = q _ {t} (i) \cdot \gamma \frac {c _ {t} (i)}{K q _ {t} (i)} \cdot K \gamma^ {- 1} = c _ {t} (i).
$$
Relaxation function. We first construct a one-hot Rademacher random vector by randomly sampling an action  $i \in [K]$  and setting  $\varepsilon_{t}(j) = 0$  for  $i \neq j$  and  $\varepsilon_{t}(i)$  to a Rademacher random variable in  $\{-1,1\}$ . We additionally define  $Z_{t} \in \{0, K\gamma^{-1}\}$  that takes value  $K\gamma^{-1}$  with probability  $\gamma$  and 0 otherwise. Using the notation  $\rho_{t}$  for the random variable tuple  $(x, \varepsilon, Z)_{t+1:T}$ , we define our relaxation REL as
$$
\operatorname {R E L} \left(I _ {1: t}\right) = \mathbb {E} _ {\rho_ {t}} \left[ R \left(\left(x, \hat {c} _ {t}\right) _ {1: t}, \rho_ {t}\right) \right], \tag {4}
$$
where  $R((x,\hat{c}_t)_{1:t},\rho_t)$  is defined to be
$$
\gamma (T - t) - \inf  _ {\pi} \left(\sum_ {\tau = 1} ^ {t} \hat {c} (\pi (x _ {\tau})) + \sum_ {\tau = t + 1} ^ {T} 2 Z _ {\tau} \varepsilon_ {\tau} (\pi (x _ {\tau}))\right).
$$
We note the contrast between the above definition and the relaxation frameworks used in prior work (Rakhlin and Sridharan, 2015, 2016; Syrgkanis et al., 2016b): These works all set every entry in  $\varepsilon_{t}$  to a Rademacher random variables, while we set only a single (randomly chosen) entry to a Rademacher random variable and set the rest of the entries to zero.
The changes in the relaxation function are motivated by the algorithm analysis (see Section 4). Specifically, in order to ensure admissibility, the symmetrization step of the Relax and randomize framework applies only to a single (random) action. Applying noise to all the entries, as is done in
prior work, leads to valid upper bound but is not tight. As we show in Lemma 9, applying noise to a single entry is sufficient, as long as this entry is chosen uniformly at random. The reduced noise leads to an improved Rademacher averages term (see Theorem 6), which in turn leads to a better regret bound.
Randomized strategy. As in prior work (Rakhlin and Sridharan, 2015, 2016; Syrgkanis et al., 2016b), we use the "random layout" technique to define our strategy. We use hallucinated future cost vectors, together with unbiased estimates of the past cost, to choose a strategy that minimizes the total cost across  $T$  rounds.
Define  $D \coloneqq \{K\gamma^{-1} \cdot \mathbf{e}_{\mathbf{i}} : i \in [K]\} \cup \{\mathbf{0}\}$ , where  $\mathbf{e}_{\mathbf{i}}$  is the  $i$ -th standard basis vector in  $K$  dimensions. We further define  $\Delta_{D}$ , the set of distributions over  $D$ , and  $\Delta_{D}^{\prime} \subseteq \Delta_{D}$  to be the set
$$
\{p \in \Delta_ {D}: \max  _ {i \in [ K ]} p (i) \leq \frac {\gamma}{K} \}. \tag {5}
$$
Recall that  $\rho_{t}$  denotes the random variable tuple  $(x,\varepsilon ,Z)_{t + 1:T}$ . We sample  $\rho_{t}$  and define  $q_{t}^{*}(\rho_{t})$  as:
$$
q _ {t} ^ {*} (\rho_ {t}) := \min  _ {q \in \Delta_ {K}} \sup  _ {p _ {t} \in \Delta_ {D} ^ {\prime}} \mathbb {E} _ {\hat {c} _ {t} \sim p _ {t}} [ \langle q, \hat {c} _ {t} \rangle + R ((x, \hat {c}) _ {1: t}, \rho_ {t}) ]. \tag {6}
$$
We then sample the action  $\hat{y}_t$  from the distribution  $q_t(\rho_t)$  defined as
$$
q _ {t} \left(\rho_ {t}\right) := (1 - \gamma) q _ {t} ^ {*} \left(\rho_ {t}\right) + \frac {\gamma}{K} \cdot \mathbf {1}. \tag {7}
$$
In order to calculate  $q_{t}(\rho_{t})$ , we use a water-filling argument similar to Rakhlin and Sridharan (2016) and Syrgkanis et al. (2016b). Formally, we will use the following lemma, the proof of which is in Appendix B.
Lemma 4. There exists a water-filling algorithm that computes the value  $q_{t}^{*}(\rho_{t})$  for any given  $\rho_{t}$  in time  $O(K)$  with only  $K + 1$  accesses to a value-of-ERM oracle in every round.
A full pseudocode of our approach is provided in Algorithm 1.
Algorithm 1: Contextual Bandits Algorithm
for  $t = 1,2,\dots ,T$  do Observe context  $x_{t}$  Draw random variable tuple  $\rho_t = (x,\varepsilon ,Z)_{t + 1:T}$  Compute  $q_{t}(\rho_{t})$  via Equation 7 Draw action  $\hat{y}_t\sim q_t(\rho_t)$  and observe  $c_{t}(\hat{y}_{t})$  Estimate cost vector  $\hat{c}_t$  via Equation 3   
end
4 Analysis
In this section, we provide the formal statement of our theoretical guarantees and discuss their proofs. Due to space constraints, some of the proofs are deferred to the supplementary material.