Contextual Bandits with Similarity Information

Aleksandrs Slivkins

Introduction

In a multi-armed bandit problem (henceforth, “multi-armed bandit” will be abbreviated as MAB), an algorithm is presented with a sequence of trials. In each round, the algorithm chooses one alternative from a set of alternatives (arms) based on the past history, and receives the payoff associated with this alternative. The goal is to maximize the total payoff of the chosen arms. The MAB setting has been introduced in 1952 in Robbins 1952 and studied intensively since then in Operations Research, Economics and Computer Science. This setting is a clean model for the exploration-exploitation trade-off, a crucial issue in sequential decision-making under uncertainty.

One standard way to evaluate the performance of a bandit algorithm is regret, defined as the difference between the expected payoff of an optimal arm and that of the algorithm. By now the MAB problem with a small finite set of arms is quite well understood, e.g. see Lai and Robbins 1985, Auer et al. 2002b, Auer et al. 2002a. However, if the arms set is exponentially or infinitely large, the problem becomes intractable unless we make further assumptions about the problem instance. Essentially, a bandit algorithm needs to find a needle in a haystack; for each algorithm there are inputs on which it performs as badly as random guessing.

Bandit problems with large sets of arms have been an active area of investigation in the past decade (see Section 2 for a discussion of related literature). A common theme in these works is to assume a certain structure on payoff functions. Assumptions of this type are natural in many applications, and often lead to efficient learning algorithms (Kleinberg 2005). In particular, a line of work started in Agrawal 1995 assumes that some information on similarity between arms is available.

In this paper we consider similarity information in the setting of contextual bandits (Woodroofe 1979, Auer 2002, Wang et al. 2005, Pandey et al. 2007, Langford and Zhang 2007), a natural extension of the basic MAB problem where before each round an algorithm is given the context – a hint about the payoffs in this round. Contextual bandits are directly motivated by the problem of placing advertisements on webpages, one of the crucial problems in sponsored search. One can cast it as a bandit problem so that arms correspond to the possible ads, and payoffs correspond to the user clicks. Then the context consists of information about the page, and perhaps the user this page is served to. Furthermore, we assume that similarity information is available on both the context and the arms. Following the work in Agrawal 1995, Kleinberg 2004, Auer et al. 2007, Kleinberg et al. 2008b on the (non-contextual) bandits, a particularly simple way to represent similarity information in the contextual bandit setting is via a similarity distance between the context-arm pairs, which gives an upper bound on the difference between the corresponding payoffs.

The contextual bandits framework is defined as follows. Let XX be the context set and YY be the arms set, and let P⊂X×Y\mathcal{P}\subset X\times Y be the set of feasible context-arms pairs. In each round tt, the following events happen in succession:

a context xt∈Xx_{t}\in X is revealed to the algorithm,

the algorithm chooses an arm yt∈Yy_{t}\in Y such that (xt,yt)∈P(x_{t},y_{t})\in\mathcal{P},

payoff (reward) πt∈\pi_{t}\in is revealed.

In general, the goal of a bandit algorithm is to maximize the total payoff ∑t=1Tπt\sum_{t=1}^{T}\pi_{t}, where TT is the time horizon. In the contextual MAB setting, we benchmark the algorithm’s performance in terms of the context-specific “best arm”. Specifically, the goal is to minimize the contextual regret:

The context-specific best arm is a more demanding benchmark than the best arm used in the “standard” (context-free) definition of regret.

The similarity information is given to an algorithm as a metric space (P,D)(\mathcal{P},\mathcal{D}) which we call the similarity space, such that the following Lipschitz condition In other words, μ\mu is a Lipschitz-continuous function on (X,P)(X,\mathcal{P}), with Lipschitz constant KLip=1K_{\text{Lip}}=1. Assuming KLip=1K_{\text{Lip}}=1 is without loss of generality (as long as KLipK_{\text{Lip}} is known to the algorithm), since we can re-define D←KLip D\mathcal{D}\leftarrow K_{\text{Lip}}\,D. holds:

Without loss of generality, D≤1\mathcal{D}\leq 1. The absence of similarity information is modeled as D=1\mathcal{D}=1.

An instructive special case is the product similarity space (P,D)=(X×Y,D)(\mathcal{P},\mathcal{D})=(X\times Y,\mathcal{D}), where (X,DX)(X,\mathcal{D}_{\text{X}}) is a metric space on contexts (context space), and (Y,DY)(Y,\mathcal{D}_{\text{Y}}) is a metric space on arms (arms space), and

Prior work: uniform partitions.

Hazan and Megiddo 2007 consider contextual MAB with similarity information on contexts. They suggest an algorithm that chooses a “uniform” partition SXS_{\text{X}} of the context space and approximates xtx_{t} by the closest point in SXS_{\text{X}}, call it xt′x^{\prime}_{t}. Specifically, the algorithm creates an instance A(x)\mathcal{A}(x) of some bandit algorithm A\mathcal{A} for each point x∈SXx\in S_{\text{X}}, and invokes A(xt′)\mathcal{A}(x^{\prime}_{t}) in each round tt. The granularity of the partition is adjusted to the time horizon, the context space, and the black-box regret guarantee for A\mathcal{A}. Furthermore, Kleinberg 2004 provides a bandit algorithm A\mathcal{A} for the adversarial MAB problem on a metric space that has a similar flavor: pick a “uniform” partition SYS_{\text{Y}} of the arms space, and run a kk-arm bandit algorithm such as exp3 Auer et al. 2002b on the points in SYS_{\text{Y}}. Again, the granularity of the partition is adjusted to the time horizon, the arms space, and the black-box regret guarantee for exp3.

Applying these two ideas to our setting (with the product similarity space) gives a simple algorithm which we call the uniform algorithm. Its contextual regret, even for adversarial payoffs, is

where dXd_{\text{X}} is the covering dimension of the context space and dYd_{\text{Y}} is that of the arms space.

Our contributions.

Using “uniform” partitions disregards the potentially benign structure of expected payoffs and context arrivals. The central topic in this paper is adaptive partitions of the similarity space which are adjusted to frequently occurring contexts and high-paying arms, so that the algorithms can take advantage of the problem instances in which the expected payoffs or the context arrivals are “benign” (“low-dimensional”), in a sense that we make precise later.

We present two main results, one for stochastic payoffs and one for adversarial payoffs. For stochastic payoffs, we provide an algorithm called contextual zooming which “zooms in” on the regions of the context space that correspond to frequently occurring contexts, and the regions of the arms space that correspond to high-paying arms. Unlike the algorithms in prior work, this algorithm considers the context space and the arms space jointly – it maintains a partition of the similarity space, rather than one partition for contexts and another for arms. We develop provable guarantees that capture the “benign-ness” of the context arrivals and the expected payoffs. In the worst case, we match the guarantee (3) for the uniform algorithm. We obtain nearly matching lower bounds using the KL-divergence technique from (Auer et al. 2002b, Kleinberg 2004). The lower bound is very general as it holds for every given (product) similarity space and for every fixed value of the upper bound.

Our stochastic contextual MAB setting, and specifically the contextual zooming algorithm, can be fruitfully applied beyond the ad placement scenario described above and beyond MAB with similarity information per se. First, writing xt=tx_{t}=t one can incorporate “temporal constraints” (across time, for each arm), and combine them with “spatial constraints” (across arms, for each time). The analysis of contextual zooming yields concrete, meaningful bounds this scenario. In particular, we recover one of the main results in Slivkins and Upfal 2008. Second, our setting subsumes the stochastic sleeping bandits problem Kleinberg et al. 2008a, where in each round some arms are “asleep”, i.e. not available in this round. Here contexts correspond to subsets of arms that are “awake”. Contextual zooming recovers and generalizes the corresponding result in Kleinberg et al. 2008a. Third, following the publication of a preliminary version of this paper, contextual zooming has been applied to bandit learning-to-rank in Slivkins et al. 2013.

For the adversarial setting, we provide an algorithm which maintains an adaptive partition of the context space and thus takes advantage of “benign” context arrivals. We develop provable guarantees that capture this “benign-ness”. In the worst case, the contextual regret is bounded in terms of the covering dimension of the context space, matching (3). Our algorithm is in fact a meta-algorithm: given an adversarial bandit algorithm Bandit, we present a contextual bandit algorithm which calls Bandit as a subroutine. Our setup is flexible: depending on what additional constraints are known about the adversarial payoffs, one can plug in a bandit algorithm from the prior work on the corresponding version of adversarial MAB, so that the regret bound for Bandit plugs into the overall regret bound.

Discussion.

Adaptive partitions (of the arms space) for context-free MAB with similarity information have been introduced in (Kleinberg et al. 2008b, Bubeck et al. 2011a). This paper further explores the potential of the zooming technique in (Kleinberg et al. 2008b). Specifically, contextual zooming extends this technique to adaptive partitions of the entire similarity space, which necessitates a technically different algorithm and a more delicate analysis. We obtain a clean algorithm for contextual MAB with improved (and nearly optimal) bounds. Moreover, this algorithm applies to several other, seemingly unrelated problems and unifies some results from prior work.

One alternative approach is to maintain a partition of the context space, and run a separate instance of the zooming algorithm from Kleinberg et al. 2008b on each set in this partition. Fleshing out this idea leads to the meta-algorithm that we present for adversarial payoffs (with Bandit being the zooming algorithm). This meta-algorithm is parameterized (and constrained) by a specific a priori regret bound for Bandit. Unfortunately, any a priori regret bound for zooming algorithm would be a pessimistic one, which negates its main strength – the ability to adapt to “benign” expected payoffs.

Map of the paper.

Section 2 is related work, and Section 3 is Preliminaries. Contextual zooming is presented in Section 4. Lower bounds are in Section 5. Some applications of contextual zooming are discussed in Section 6. The adversarial setting is treated in Section 8.

Related work

A proper discussion of the literature on bandit problems is beyond the scope of this paper. This paper follows the line of work on regret-minimizing bandits; a reader is encouraged to refer to (Cesa-Bianchi and Lugosi 2006, Bubeck and Cesa-Bianchi 2012) for background. A different (Bayesian) perspective on bandit problems can be found in (Gittins et al. 2011).

Most relevant to this paper is the work on bandits with large sets of arms, specifically bandits with similarity information (Agrawal 1995, Kleinberg 2004, Auer et al. 2007, Pandey et al. 2007, Kocsis and Szepesvari 2006, Munos and Coquelin 2007, Kleinberg et al. 2008b, Bubeck et al. 2011a, Kleinberg and Slivkins 2010, Maillard and Munos 2010). Another commonly assumed structure is linear or convex payoffs, e.g. (Awerbuch and Kleinberg 2008, Flaxman et al. 2005, Dani et al. 2007, Abernethy et al. 2008, Hazan and Kale 2009, Bubeck et al. 2012). Linear/convex payoffs is a much stronger assumption than similarity, essentially because it allows to make strong inferences about far-away arms. Other assumptions have been considered, e.g. (Wang et al. 2008, Bubeck and Munos 2010). The distinction between stochastic and adversarial payoffs is orthogonal to the structural assumption (such as Lipschitz-continuity or linearity). Papers on MAB with linear/convex payoffs typically allow adversarial payoffs, whereas papers on MAB with similarity information focus on stochastic payoffs, with notable exceptions of Kleinberg 2004 and Maillard and Munos 2010.

The notion of structured adversarial payoffs in this paper is less restrictive than the one in Maillard and Munos 2010 (which in turn specializes the notion from linear/convex payoffs), in the sense that the Lipschitz condition is assumed on the expected payoffs rather than on realized payoffs. This is a non-trivial distinction, essentially because our notion generalizes stochastic payoffs whereas the other one does not.

In (Auer 2002) and (Chu et al. 2011) payoffs are linear in context, which is a feature vector. (Woodroofe 1979, Wang et al. 2005) and (Rigollet and Zeevi 2010) study contextual MAB with stochastic payoffs, under the name bandits with covariates: the context is a random variable correlated with the payoffs; they consider the case of two arms, and make some additional assumptions. Lazaric and Munos 2009 consider an online labeling problem with stochastic inputs and adversarially chosen labels; inputs and hypotheses (mappings from inputs to labels) can be thought of as “contexts” and “arms” respectively. Bandits with experts advice (e.g. Auer 2002) is the special case of contextual MAB where the context consists of experts’ advice; the advice of a each expert is modeled as a distributions over arms. All these papers are not directly applicable to the present setting.

Experimental work on contextual MAB includes (Pandey et al. 2007) and (Li et al. 2010, Li et al. 2011).

Lu et al. 2010 consider the setting in this paper for a product similarity space and, essentially, recover the uniform algorithm and a lower bound that matches (3). The same guarantee (3) can also be obtained as follows. The “uniform partition” described above can be used to define “experts” for a bandit-with-expert-advice algorithm such as exp4 (Auer et al. 2002b): for each set of the partition there is an expert whose advise is simply an arbitrary arm in this set. Then the regret bound for exp4 yields (3). Instead of exp4 one could use an algorithm in McMahan and Streeter 2009 which improves over exp4 if the experts are not “too distinct”; however, it is not clear if it translates into concrete improvements over (3).

If the context xtx_{t} is time-invariant, our setting reduces to the Lipschitz MAB problem as defined in (Kleinberg et al. 2008b), which in turn reduces to continuum-armed bandits (Agrawal 1995, Kleinberg 2004, Auer et al. 2007) if the metric space is a real line, and to MAB with stochastic payoffs (Auer et al. 2002a) if the similarity information is absent.

Preliminaries

We will use the notation from the Introduction. In particular, xtx_{t} will denote the tt-th context arrival, i.e. the context that arrives in round tt, and yty_{t} will denote the arm chosen by the algorithm in that round. We will use x(1..T)x_{(1..T)} to denote the sequence of the first TT context arrivals (x1 , … ,xT)(x_{1}\,,\ \ldots\ ,x_{T}). The badness of a point (x,y)∈P(x,y)\in\mathcal{P} is defined as Δ(x,y)≜μ∗(x)−μ(x,y)\Delta(x,y)\triangleq\mu^{*}(x)-\mu(x,y). The context-specific best arm is

where ties are broken in an arbitrary but fixed way. To ensure that the max⁡\max in (4) is attained by some y∈Yy\in Y, we will assume that the similarity space (P,D)(\mathcal{P},\mathcal{D}) is compact.

Metric spaces. Covering dimension and related notions are crucial throughout this paper. Let P\mathcal{P} be a set of points in a metric space, and fix r>0r>0. An rr-covering of P\mathcal{P} is a collection of subsets of P\mathcal{P}, each of diameter strictly less than rr, that cover P\mathcal{P}. The minimal number of subsets in an rr-covering is called the rr-covering number of P\mathcal{P} and denoted Nr(P)N_{r}(\mathcal{P}). The covering number can be defined via radius-rr balls rather than diameter-rr sets. This alternative definition lacks the appealing “robustness” property: Nr(P′)≤Nr(P)N_{r}(\mathcal{P}^{\prime})\leq N_{r}(\mathcal{P}) for any P′⊂P\mathcal{P}^{\prime}\subset\mathcal{P}, but (other than that) is equivalent for this paper. The covering dimension of P\mathcal{P} (with multiplier cc) is the smallest dd such that Nr(P)≤c r−dN_{r}(\mathcal{P})\leq c\,r^{-d} for each r>0r>0. In particular, if SS is a subset of Euclidean space then its covering dimension is at most the linear dimension of SS, but can be (much) smaller.

Covering is closely related to packing. A subset S⊂PS\subset\mathcal{P} is an rr-packing of P\mathcal{P} if the distance between any two points in SS is at least rr. The maximal number of points in an rr-packing is called the rr-packing number and denoted Nrpack(P)N^{\mathtt{pack}}_{r}(\mathcal{P}). It is well-known that rr-packing numbers are essentially the same as rr-covering numbers, namely N2r(P)≤Nrpack(P)≤Nr(P)N_{2r}(\mathcal{P})\leq N^{\mathtt{pack}}_{r}(\mathcal{P})\leq N_{r}(\mathcal{P}).

The doubling constant c\textscdbl(P)c_{\textsc{dbl}}(\mathcal{P}) of P\mathcal{P} is the smallest kk such that any ball can be covered by kk balls of half the radius. The doubling constant (and doubling dimension log⁡c\textscdbl\log c_{\textsc{dbl}}) was introduced in Heinonen 2001 and has been a standard notion in theoretical computer science literature since Gupta et al. 2003. It was used to characterize tractable problem instances for a variety of problems (Talwar 2004, Kleinberg et al. 2009, Cole and Gottlieb 2006, e.g. see). It is known that c\textscdbl(P)≥c 2dc_{\textsc{dbl}}(\mathcal{P})\geq c\,2^{d} if dd is the covering dimension of P\mathcal{P} with multiplier cc, and that c\textscdbl(P)≤2dc_{\textsc{dbl}}(\mathcal{P})\leq 2^{d} if P\mathcal{P} is a bounded subset of dd-dimensional Euclidean space. A useful observation is that if distance between any two points in SS is >r>r, then any ball of radius rr contains at most c\textscdblc_{\textsc{dbl}} points of SS.

Accessing the similarity space. We assume full and computationally unrestricted access to the similarity information. While the issues of efficient representation thereof are important in practice, we believe that a proper treatment of these issues would be specific to the particular application and the particular similarity metric used, and would obscure the present paper. One clean formal way to address this issue is to assume oracle access: an algorithm accesses the similarity space via a few specific types of queries, and invokes an “oracle” that answers such queries.

Time horizon. We assume that the time horizon is fixed and known in advance. This assumption is without loss of generality in our setting. This is due to the well-known doubling trick which converts a bandit algorithm with a fixed time horizon into one that runs indefinitely and achieves essentially the same regret bound. Suppose for any fixed time horizon TT there is an algorithm ALGT\mathtt{ALG}_{T} whose regret is at most R(T)R(T). The new algorithm proceeds in phases i=1,2,3,…i=1,2,3,\ldots of duration 2i2^{i} rounds each, so that in each phase ii a fresh instance of ALG2i\mathtt{ALG}_{2^{i}} is run. This algorithm has regret O(log⁡T)R(T)O(\log T)R(T) for each round TT, and O(R(T))O(R(T)) in the typical case when R(T)≥TγR(T)\geq T^{\gamma} for some constant γ>0\gamma>0.

The contextual zooming algorithm

In this section we consider the contextual MAB problem with stochastic payoffs. We present an algorithm for this problem, called contextual zooming, which takes advantage of both the “benign” context arrivals and the “benign” expected payoffs. The algorithm adaptively maintains a partition of the similarity space, “zooming in” on both the “popular” regions on the context space and the high-payoff regions of the arms space.

Contextual zooming extends the (context-free) zooming technique in (Kleinberg et al. 2008b), which necessitates a somewhat more complicated algorithm. In particular, selection and activation rules are defined differently, there is a new notion of “domains” and the distinction between “pre-index” and “index”. The analysis is more delicate, both the high-probability argument in Claim 4.4 and the subsequent argument that bounds the number of samples from suboptimal arms. Also, the key step of setting up the regret bounds is very different, especially for the improved regret bounds in Section 4.4.

Let us define the notions that express the performance of contextual zooming. These notions rely on the packing number Nr(⋅)N_{r}(\cdot) in the similarity space (P,D)(\mathcal{P},\mathcal{D}), and the more refined versions thereof that take into account “benign” expected payoffs and “benign” context arrivals.

Our guarantees have the following form, for some integer numbers {Nr}r∈(0,1)\{N_{r}\}_{r\in(0,1)}:

Here and thereafter, C0=O(1)C_{0}=O(1) unless specified otherwise. In the pessimistic version, Nr=Nr(P)N_{r}=N_{r}(\mathcal{P}) is the rr-packing number of P\mathcal{P}. Then (5) can be simplified to R(T)≤inf⁡r∈(0,1) O(rT+1r Nr(P)log⁡T)R(T)\leq\textstyle{\inf_{r\in(0,1)}}\,O\left(rT+\tfrac{1}{r}\,N_{r}(\mathcal{P})\log T\right) since Nr(P)N_{r}(\mathcal{P}) is non-increasing in rr. The main contribution is refined bounds in which NrN_{r} is smaller.

For every guarantee of the form (5), call it NrN_{r}-type guarantee, prior work (e.g., Kleinberg 2004, Kleinberg et al. 2008b, Bubeck et al. 2011a) suggests a more tractable dimension-type guarantee. This guarantee is in terms of the covering-type dimension induced by NrN_{r}, defined as follows: One standard definition of the covering dimension is (6) for Nr=Nr(P)N_{r}=N_{r}(\mathcal{P}) and c=1c=1. Following Kleinberg et al. 2008b, we include an explicit dependence on cc in (6) to obtain a more efficient regret bound (which holds for any cc).

Using (5) with r0=T−1/(dc+2)r_{0}=T^{-1/(d_{c}+2)}, we obtain

For the pessimistic version (Nr=Nr(P)N_{r}=N_{r}(\mathcal{P})), the corresponding covering-type dimension dcd_{c} is the covering dimension of the similarity space. The resulting guarantee (7) subsumes the bound (3) from prior work (because the covering dimension of a product similarity space is dX+dYd_{\text{X}}+d_{\text{Y}}), and extends this bound from product similarity spaces (2) to arbitrary similarity spaces.

To account for “benign” expected payoffs, instead of rr-packing number of the entire set P\mathcal{P} we consider the rr-packing number of a subset of P\mathcal{P} which only includes points with near-optimal expected payoffs:

We define the rr-zooming number as Nr(Pμ,r)N_{r}(\mathcal{P}_{\mu,r}), the rr-packing number of Pμ,r\mathcal{P}_{\mu,r}. The corresponding covering-type dimension (6) is called the contextual zooming dimension.

The rr-zooming number can be seen as an optimistic version of Nr(P)N_{r}(\mathcal{P}): while equal to Nr(P)N_{r}(\mathcal{P}) in the worst case, it can be much smaller if the set of near-optimal context-arm pairs is “small” in terms of the packing number. Likewise, the contextual zooming dimension is an optimistic version of the covering dimension.

Consider the contextual MAB problem with stochastic payoffs. There is an algorithm (namely, Algorithm 4.2 described below) whose contextual regret R(T)R(T) satisfies (5) with NrN_{r} equal to Nr(Pμ,r)N_{r}(\mathcal{P}_{\mu,r}), the rr-zooming number. Consequently, R(T)R(T) satisfies the dimension-type guarantee (7), where dcd_{c} is the contextual zooming dimension.

In Theorem 4.1, the same algorithm enjoys the bound (7) for each c>0c>0. This is a useful trade-off since different values of cc may result in drastically different values of the dimension dcd_{c}. On the contrary, the “uniform algorithm” from prior work essentially needs to take the cc as input.

Further refinements to take into account “benign” context arrivals are deferred to Section 4.4.

2 Description of the algorithm

The algorithm is parameterized by the time horizon TT. In each round tt, it maintains a finite collection At\mathcal{A}_{t} of balls in (P,D)(\mathcal{P},\mathcal{D}) (called active balls) which collectively cover the similarity space. Adding active balls is called activating; balls stay active once they are activated. Initially there is only one active ball which has radius 11 and therefore contains the entire similarity space.

At a high level, each round tt proceeds as follows. Context xtx_{t} arrives. Then the algorithm selects an active ball BB and an arm yty_{t} such that (xt,yt)∈B(x_{t},y_{t})\in B, according to the “selection rule”. Arm yty_{t} is played. Then one ball may be activated, according to the “activation rule”.

In order to state the two rules, we need to put forward several definitions. Fix an active ball BB and round tt. Let r(B)r(B) be the radius of BB. The confidence radius of BB at time tt is

where nt(B)n_{t}(B) is the number of times BB has been selected by the algorithm before round tt. The domain of ball BB in round tt is a subset of BB that excludes all balls B′∈AtB^{\prime}\in\mathcal{A}_{t} of strictly smaller radius:

We will also denote (10) as dom (B,At)\mathtt{dom\,}(B,\mathcal{A}_{t}). Ball BB is called relevant in round tt if (xt,y)∈dom t(B)(x_{t},y)\in\mathtt{dom\,}_{t}(B) for some arm yy. In each round, the algorithm selects one relevant ball BB. This ball is selected according to a numerical score It(B)I_{t}(B) called index. (The definition of index is deferred to the end of this subsection.)

Now we are ready to state the two rules, for every given round tt.

selection rule. Select a relevant ball BB with the maximal index (break ties arbitrarily). Select an arbitrary arm yy such that (xt,y)∈dom t(B)(x_{t},y)\in\mathtt{dom\,}_{t}(B).

activation rule. Suppose the selection rule selects a relevant ball BB such that conft(B)≤r(B)\mathtt{conf}_{t}(B)\leq r(B) after this round. Then, letting yy be the arm selected in this round, a ball with center (xt,y)(x_{t},y) and radius 12 r(B)\tfrac{1}{2}\,r(B) is activated. (BB is then called the parent of this ball.)

It remains to define the index It(B)I_{t}(B). Let rewt(B)\mathtt{rew}_{t}(B) be the total payoff from all rounds up to t−1t-1 in which ball BB has been selected by the algorithm. Then the average payoff from BB is νt(B)≜rewt(B)max⁡(1,  nt(B))\nu_{t}(B)\triangleq\tfrac{\mathtt{rew}_{t}(B)}{\max(1,\;n_{t}(B))}. The pre-index of BB is defined as the average νt(B)\nu_{t}(B) plus an “uncertainty term”:

The “uncertainty term” in (11) reflects both uncertainty due to a location in the metric space, via r(B)r(B), and uncertainty due to an insufficient number of samples, via conft(B)\mathtt{conf}_{t}(B).

The index of BB is obtained by taking a minimum over all active balls B′B^{\prime}:

where D(B,B′)\mathcal{D}(B,B^{\prime}) is the distance between the centers of the two balls.

The meaning of index and pre-index is as follows. Both are upper confidence bound (UCB, for short) for expected rewards in BB. Pre-index is a UCB for μ(B)\mu(B), the expected payoff from the center of BB; essentially, it is the best UCB on μ(B)\mu(B) that can be obtained from the observations of BB alone. The min⁡\min expression in (12) is an improved UCB on μ(B)\mu(B), refined using observations from all other active balls. Finally, index is, essentially, the best available UCB for the expected reward of any pair (x,y)∈B(x,y)\in B.

Relevant balls are defined through the notion of the “domain” to ensure the following property: in each round when a parent ball is selected, some other ball is activated. This property allows us to “charge” the regret accumulated in each such round to the corresponding activated ball.

Running time.

The running time is dominated by determining which active balls are relevant. Formally, we assume an oracle that inputs context xx and a finite sequence (B,B1 , … ,Bn)(B,B_{1}\,,\ \ldots\ ,B_{n}) of balls in the similarity space, and outputs an arm yy such that (x,y)∈B∖∪j=1nBj(x,y)\in B\setminus\cup_{j=1}^{n}B_{j} if such arm exists, and null otherwise. Then each round tt can be implemented via ntn_{t} oracle calls with n<ntn<n_{t} balls each, where ntn_{t} is the current number of active balls. Letting f(n)f(n) denote the running time of one oracle call in terms of nn, the running time for each round the algorithm is at most nT f(nT)n_{T}\,f(n_{T}).

3 Analysis of the algorithm: proof of Theorem 4.1

We start by observing that the activation rule ensures several important invariants.

(confidence) for all times tt and all active balls BB,

(covering) in each round tt, the domains of active balls cover the similarity space.

(separation) for any two active balls of radius rr, their centers are at distance at least rr.

The confidence invariant is immediate from the activation rule.

For the covering invariant, note that ∪B∈A dom (B,A)=∪B∈A B\cup_{B\in\mathcal{A}}\,\mathtt{dom\,}(B,\mathcal{A})=\cup_{B\in\mathcal{A}}\,B for any finite collection A\mathcal{A} of balls in the similarity space. (For each v∈∪B∈A Bv\in\cup_{B\in\mathcal{A}}\,B, consider a smallest radius ball in A\mathcal{A} that contains BB. Then v∈dom (B,A)v\in\mathtt{dom\,}(B,\mathcal{A}).) The covering invariant then follows since At\mathcal{A}_{t} contains a ball that covers the entire similarity space.

To show the separation invariant, let BB and B′B^{\prime} be two balls of radius rr such that BB is activated at time tt, with parent BparB^{\text{par}}, and B′B^{\prime} is activated before time tt. The center of BB is some point (xt,yt)∈dom (Bpar,At)(x_{t},y_{t})\in\mathtt{dom\,}(B^{\text{par}},\mathcal{A}_{t}). Since r(Bpar)>r(B′)r(B^{\text{par}})>r(B^{\prime}), it follows that (xt,yt)∉B′(x_{t},y_{t})\not\in B^{\prime}. ∎

Throughout the analysis we will use the following notation. For a ball BB with center (x,y)∈P(x,y)\in\mathcal{P}, define the expected payoff of BB as μ(B)≜μ(x,y)\mu(B)\triangleq\mu(x,y). Let BtselB_{t}^{\mathtt{sel}} be the active ball selected by the algorithm in round tt. Recall that the badness of (x,y)∈P(x,y)\in\mathcal{P} is defined as Δ(x,y)≜μ∗(x)−μ(x,y)\Delta(x,y)\triangleq\mu^{*}(x)-\mu(x,y).

If ball BB is active in round tt, then with probability at least 1−T−21-T^{-2} we have that

Fix ball VV with center (x,y)(x,y). Let SS be the set of rounds s≤ts\leq t when ball BB was selected by the algorithm, and let n=∣S∣n=|S| be the number of such rounds. Then νt(B)=1n ∑s∈S  πs(xs,ys)\nu_{t}(B)=\tfrac{1}{n}\,\textstyle{\sum_{s\in S}}\;\pi_{s}(x_{s},y_{s}).

Note that (13) implies Ipre(B)≥μ(B)I^{\text{pre}}(B)\geq\mu(B), so that Ipre(B)I^{\text{pre}}(B) is indeed a UCB on μ(B)\mu(B).

Call a run of the algorithm clean if (13) holds for each round. From now on we will focus on a clean run, and argue deterministically using (13). The heart of the analysis is the following lemma.

Consider a clean run of the algorithm. Then Δ(xt,yt)≤14 r(Btsel)\Delta(x_{t},y_{t})\leq 14\,r(B_{t}^{\mathtt{sel}}) in each round tt.

Fix round tt. By the covering invariant, (xt, y∗(xt))∈B(x_{t},\,y^{*}(x_{t}))\in B for some active ball BB. Recall from (12) that It(B)=r(B)+Ipre(B′)+D(B,B′)I_{t}(B)=r(B)+I^{\text{pre}}(B^{\prime})+\mathcal{D}(B,B^{\prime}) for some active ball B′B^{\prime}. Therefore

On the other hand, letting BparB^{\text{par}} be the parent of BtselB_{t}^{\mathtt{sel}} and noting that by the activation rule

we can upper-bound It(Btsel)I_{t}(B_{t}^{\mathtt{sel}}) as follows:

Putting the pieces together, μ∗(xt)≤It(Btsel)≤μ(xt,yt)+14 r(Btsel)\mu^{*}(x_{t})\leq I_{t}(B_{t}^{\mathtt{sel}})\leq\mu(x_{t},y_{t})+14\,r(B_{t}^{\mathtt{sel}}). ∎

In a clean run, if ball BB is activated in round tt then Δ(xt,yt)≤10 r(B)\Delta(x_{t},y_{t})\leq 10\,r(B).

By the activation rule, BtselB_{t}^{\mathtt{sel}} is the parent of BB. Thus by Lemma 4.5 we immediately have Δ(xt,yt)≤14 r(Btsel)=28 r(B)\Delta(x_{t},y_{t})\leq 14\,r(B_{t}^{\mathtt{sel}})=28\,r(B).

To obtain the constant of 10 that is claimed here, we prove a more efficient special case of Lemma 4.5:

To prove (18), we simply replace (17) in the proof of Lemma 4.5 by similar inequality in terms of Ipre(Btsel)I^{\text{pre}}(B_{t}^{\mathtt{sel}}) rather than Ipre(Bpar)I^{\text{pre}}(B^{\text{par}}):

For the last inequality, we use the fact that conft(Btsel)≤r(Btsel)\mathtt{conf}_{t}(B_{t}^{\mathtt{sel}})\leq r(B_{t}^{\mathtt{sel}}) whenever BtselB_{t}^{\mathtt{sel}} is a parent ball. ∎

If ball B∈FrB\in\mathcal{F}_{r} is activated in round tt, then Corollary 4.6 asserts that its center (xt,yt)(x_{t},y_{t}) lies in the set Pμ,r\mathcal{P}_{\mu,r}, as defined in (8). By the separation invariant, the centers of balls in Fr\mathcal{F}_{r} are within distance at least rr from one another. It follows that ∣Fr∣≤Nr|\mathcal{F}_{r}|\leq N_{r}, where NrN_{r} is the rr-zooming number.

Fixing some r0∈(0,1)r_{0}\in(0,1), note that in each rounds tt when a ball of radius <r0<r_{0} was selected, regret is Δ(xt,yt)≤O(r0)\Delta(x_{t},y_{t})\leq O(r_{0}), so the total regret from all such rounds is at most O(r0 T)O(r_{0}\,T). Therefore, contextual regret can be written as follows:

The NrN_{r}-type regret guarantee in Theorem 4.1 follows by taking inf⁡\inf on all r0∈(0,1)r_{0}\in(0,1).

4 Improved regret bounds

Let us provide regret bounds that take into account “benign” context arrivals. The main difficulty here is to develop the corresponding definitions; the analysis then carries over without much modification. The added value is two-fold: first, we establish the intuition that benign context arrivals matter, and then the specific regret bound is used in Section 6.2 to match the result in Slivkins and Upfal 2008.

A crucial step in the proof of Theorem 4.1 is to bound the number of active radius-rr balls by Nr(Pμ,r)N_{r}(\mathcal{P}_{\mu,r}), which is accomplished by observing that their centers form an rr-packing SS of Pμ,r\mathcal{P}_{\mu,r}. We make this step more efficient, as follows. An active radius-rr ball is called full if conft(B)≤r\mathtt{conf}_{t}(B)\leq r for some round tt. Note that each active ball is either full or a child of some other ball that is full. The number of children of a given ball is bounded by the doubling constant of the similarity space. Thus, it suffices to consider the number of active radius-rr balls that are full, which is at most Nr(Pμ,r)N_{r}(\mathcal{P}_{\mu,r}), and potentially much smaller.

Consider active radius-rr active balls that are full. Their centers form an rr-packing SS of Pμ,r\mathcal{P}_{\mu,r} with an additional property: each point p∈Sp\in S is assigned at least 1/r21/r^{2} context arrivals xtx_{t} so that (xt,y)∈B(p,r)(x_{t},y)\in B(p,r) for some arm yy, and each context arrival is assigned to at most one point in SS. Namely, each point p∈Sp\in S is assigned all contexts xtx_{t} such that the corresponding ball is chosen in round tt. A set S⊂PS\subset\mathcal{P} with this property is called rr-consistent (with context arrivals). The adjusted rr-packing number of a set P′⊂P\mathcal{P}^{\prime}\subset\mathcal{P}, denoted Nradj(P′)N^{\text{adj}}_{r}(\mathcal{P}^{\prime}), is the maximal size of an rr-consistent rr-packing of P′\mathcal{P}^{\prime}. It can be much smaller than the rr-packing number of P′\mathcal{P}^{\prime} if most context arrivals fall into a small region of the similarity space.

We make one further optimization, tailored to the application in Section 6.2. Informally, we take advantage of context arrivals xtx_{t} such that expected payoff μ(xt,y)\mu(x_{t},y) is either optimal or very suboptimal. A point (x,y)∈P(x,y)\in\mathcal{P} is called an rr-winner if for each (x′,y′)∈B((x,y), 2r)(x^{\prime},y^{\prime})\in B((x,y),\,2r) it holds that μ(x′,y′)=μ∗(x′)\mu(x^{\prime},y^{\prime})=\mu^{*}(x^{\prime}). Let Wμ,r\mathcal{W}_{\mu,r} be the set of all rr-winners. It is easy to see that if BB is a radius-rr ball centered at an rr-winner, and BB or its child is selected in a given round, then this round does not contribute to contextual regret. Therefore, it suffices to consider (rr-consistent) rr-packings of Pμ,r∖Wμ,r\mathcal{P}_{\mu,r}\setminus\mathcal{W}_{\mu,r}.

Our final guarantee is in terms of Nadj(Pμ,r∖Wμ,r)N^{\text{adj}}(\mathcal{P}_{\mu,r}\setminus\mathcal{W}_{\mu,r}), which we term the adjusted rr-zooming number.

Consider the contextual MAB problem with stochastic payoffs. The contextual regret R(T)R(T) of the contextual zooming algorithm satisfies (5), where NrN_{r} is the adjusted rr-zooming number and C0C_{0} is the doubling constant of the similarity space times some absolute constant. Consequently, R(T)R(T) satisfies the dimension-type guarantee (7), where dcd_{c} is the corresponding covering-type dimension.

Lower bounds

We match the upper bound in Theorem 4.1 up to O(log⁡T)O(\log T) factors. Our lower bound is very general: it applies to an arbitrary product similarity space, and moreover for a given similarity space it matches, up to O(log⁡T)O(\log T) factors, any fixed value of the upper bound (as explained below).

We construct a distribution I\mathcal{I} over problem instances on a given metric space, so that the lower bound is for a problem instance drawn from this distribution. A single problem instance would not suffice to establish a lower bound because a trivial algorithm that picks arm y∗(x)y^{*}(x) for each context xx will achieve regret 00.

The distribution I\mathcal{I} satisfies the following two properties: the upper bound in Theorem 4.1 is uniformly bounded from above by some number RR, and any algorithm must incur regret at least Ω(R/log⁡T)\Omega(R/\log T) in expectation over I\mathcal{I}. Moreover, we constrict such I\mathcal{I} for every possible value of the upper bound in Theorem 4.1 on a given metric space, i.e. not just for problem instances that are “hard” for this metric space.

To formulate our result, let RμUB(T)R^{\text{UB}}_{\mu}(T) denote the upper bound in Theorem 4.1, i.e. is the right-hand side of (5) where Nr=Nr(Pμ,r)N_{r}=N_{r}(\mathcal{P}_{\mu,r}) is the rr-zooming number. Let RUB(T)R^{\text{UB}}(T) denote the pessimistic version of this bound, namely right-hand side of (5) where Nr=Nr(P)N_{r}=N_{r}(\mathcal{P}) is the packing number of P\mathcal{P}.

Consider the contextual MAB problem with stochastic payoffs, Let (P,D)(\mathcal{P},\mathcal{D}) be a product similarity space. Fix an arbitrary time horizon TT and a positive number R≤RUB(T)R\leq R^{\text{UB}}(T). Then there exists a distribution I\mathcal{I} over problem instances on (P,D)(\mathcal{P},\mathcal{D}) with the following two properties:

RμUB(T)≤O(R)R^{\text{UB}}_{\mu}(T)\leq O(R) for each problem instance in support(I)\mathtt{support}(\mathcal{I}).

To prove this theorem, we build on the lower-bounding technique from Auer et al. 2002b, and its extension to (context-free) bandits in metric spaces in Kleinberg 2004. In particular, we use the basic needle-in-the-haystack example from Auer et al. 2002b, where the “haystack” consists of several arms with expected payoff 12\tfrac{1}{2}, and the “needle” is an arm whose expected payoff is slightly higher.

Our construction is parameterized by two numbers: r∈(0,12]r\in(0,\tfrac{1}{2}] and N≤Nr(P)N\leq N_{r}(\mathcal{P}), where Nr(P)N_{r}(\mathcal{P}) is the rr-packing number of P\mathcal{P}. Given these parameters, we construct a collection I=IN,r\mathcal{I}=\mathcal{I}_{N,r} of Θ(N)\Theta(N) problem instances as follows.

Let NX,rN_{{\text{X}},r} be the rr-packing number of XX in the context space, and let NY,rN_{{\text{Y}},r} be the rr-packing number of YY in the arms space. Note that Nr(P)=NX,r×NY,rN_{r}(\mathcal{P})=N_{{\text{X}},r}\times N_{{\text{Y}},r}. For simplicity, let us assume that N=nX nYN=n_{\text{X}}\,n_{\text{Y}}, where 1≤nX≤NX,r1\leq n_{X}\leq N_{{\text{X}},r} and 2≤nY≤NY,r2\leq n_{\text{Y}}\leq N_{{\text{Y}},r}.

An rr-net is the set SS of points in a metric space such that any two points in SS are at distance >r>r from each other, and each point in the metric space is within distance ≤r\leq r from some point in SS. Recall that any rr-net on the context space has size at least NX,rN_{{\text{X}},r}. Let SXS_{\text{X}} be an arbitrary set of nXn_{\text{X}} points from one such rr-net. Similarly, let SYS_{\text{Y}} be an arbitrary set of nYn_{\text{Y}} points from some rr-net on the arms space. The sequence x(1..T)x_{(1..T)} of context arrivals is any fixed permutation over the points in SXS_{\text{X}}, repeated indefinitely.

All problem instances in I\mathcal{I} have 0-1 payoffs. For each x∈SXx\in S_{\text{X}} we construct a needle-in-the-haystack example on the set SYS_{\text{Y}}. Namely, we pick one point y∗(x)∈SYy^{*}(x)\in S_{\text{Y}} to be the “needle”, and define μ(x,y∗(x))=12+r4\mu(x,y^{*}(x))=\tfrac{1}{2}+\tfrac{r}{4}, and μ(x,y)=12+r8\mu(x,y)=\tfrac{1}{2}+\tfrac{r}{8} for each y∈SY∖{y∗(x)}y\in S_{\text{Y}}\setminus\{y^{*}(x)\}. We smoothen the expected payoffs so that far from SX×SYS_{\text{X}}\times S_{\text{Y}} expected payoffs are 12\tfrac{1}{2} and the Lipschitz condition (1) holds:

Note that we obtain a distinct problem instance for each function y∗(⋅):SX→SYy^{*}(\cdot):S_{\text{X}}\to S_{\text{Y}}. This completes our construction.

Analysis.

The useful properties of the above construction are summarized in the following lemma:

Fix r∈(0,12]r\in(0,\tfrac{1}{2}] and N≤Nr(P)N\leq N_{r}(\mathcal{P}). Let I=IN,r\mathcal{I}=\mathcal{I}_{N,r} and T0=N r−2T_{0}=N\,r^{-2}. Then:

for each problem instance in I\mathcal{I} it holds that RμUB(T0)≤O(N/r)(log⁡T0)R^{\text{UB}}_{\mu}(T_{0})\leq O(N/r)(\log T_{0}).

For the lower bound in Lemma 5.2, the idea is that in TT rounds each context in SXS_{\text{X}} contributes Ω(∣SY∣/r)\Omega(|S_{\text{Y}}|/r) to contextual regret, resulting in total contextual regret Ω(N/r)\Omega(N/r).

Before we proceed to prove Lemma 5.2, let us use it to derive Theorem 5.1. Fix an arbitrary time horizon TT and a positive number R≤RUB(T)R\leq R^{\text{UB}}(T). Recall that since Nr(P)N_{r}(\mathcal{P}) is non-increasing in rr, for some constant C>0C>0 it holds that

Let r=R2C T(1+log⁡T)r=\frac{R}{2C\,T(1+\log T)}. Then r≤12r\leq\tfrac{1}{2} and Tr2≤Nr(P)Tr^{2}\leq N_{r}(\mathcal{P}).

Denote k(r)=Nr(P)k(r)=N_{r}(\mathcal{P}) and consider function f(r)≜k(r)/r2f(r)\triangleq k(r)/r^{2}. This function is non-increasing in rr; f(1)=1f(1)=1 and f(r)→∞f(r)\to\infty for r→0r\to 0. Therefore there exists r0∈(0,1)r_{0}\in(0,1) such that f(r0)≤T≤f(r0/2)f(r_{0})\leq T\leq f(r_{0}/2). Re-writing this, we obtain

Thus r≤r0/2r\leq r_{0}/2 and finally T r2≤T r02/4≤k(r0/2)≤k(r)=Nr(P)T\,r^{2}\leq T\,r_{0}^{2}/4\leq k(r_{0}/2)\leq k(r)=N_{r}(\mathcal{P}). ∎

So, Lemma 5.2 with r≜R2C T(1+log⁡T)r\triangleq\frac{R}{2C\,T(1+\log T)} and N≜T r2N\triangleq T\,r^{2}. implies Theorem 5.1.

1 Proof of Lemma 5.2

Collection I\mathcal{I} consists of valid instances of contextual MAB problem with similarity space (P,D)(\mathcal{P},\mathcal{D}).

We need to prove that each problem instance in P\mathcal{P} satisfies the Lipschitz condition (1). Assume the Lipschitz condition (1) is violated for some points (x,y), (x′,y′)∈X×Y(x,y),\,(x^{\prime},y^{\prime})\in X\times Y. For brevity, let p=(x,y)p=(x,y), p′=(x′,y′)p^{\prime}=(x^{\prime},y^{\prime}), and let us write μ(p)≜μ(x,y)\mu(p)\triangleq\mu(x,y). Then ∣μ(p)−μ(p′)∣>D(p,p′)|\mu(p)-\mu(p^{\prime})|>\mathcal{D}(p,p^{\prime}).

By (19), μ(⋅)∈[12,12+r4]\mu(\cdot)\in[\tfrac{1}{2},\tfrac{1}{2}+\tfrac{r}{4}], so D(p,p′)<r4\mathcal{D}(p,p^{\prime})<\tfrac{r}{4}.

Without loss of generality, μ(p)>μ(p′)\mu(p)>\mu(p^{\prime}). In particular, μ(p)>12\mu(p)>\tfrac{1}{2}. Therefore there exists p0=(x0,y0)∈SX×SYp_{0}=(x_{0},y_{0})\in S_{\text{X}}\times S_{\text{Y}} such that D(p,p0)<r4\mathcal{D}(p,p_{0})<\tfrac{r}{4}. Then D(p′,p0)<r2\mathcal{D}(p^{\prime},p_{0})<\tfrac{r}{2} by triangle inequality.

Now, for any other p0′∈SX×SYp^{\prime}_{0}\in S_{\text{X}}\times S_{\text{Y}} it holds that D(p0,p0′)>r\mathcal{D}(p_{0},p^{\prime}_{0})>r, and thus by triangle inequality D(p,p0′)>3r4\mathcal{D}(p,p^{\prime}_{0})>\tfrac{3r}{4} and D(p′,p0′)>r2\mathcal{D}(p^{\prime},p^{\prime}_{0})>\tfrac{r}{2}. It follows that (19) can be simplified as follows:

For each instance in P\mathcal{P} and T0=N r−2T_{0}=N\,r^{-2} it holds that RμUB(T0)≤O(N/r)(log⁡T0)R^{\text{UB}}_{\mu}(T_{0})\leq O(N/r)(\log T_{0}).

Recall that RμUB(T0)R^{\text{UB}}_{\mu}(T_{0}) is the right-hand side of (5) with Nr=Nr(Pμ,r)N_{r}=N_{r}(\mathcal{P}_{\mu,r}), where Pμ,r\mathcal{P}_{\mu,r} is defined by (8).

Fix r′>0r^{\prime}>0. It is easy to see that

It follows that Nr′(Pμ,r′)≤NN_{r^{\prime}}(\mathcal{P}_{\mu,r^{\prime}})\leq N whenever r′≥r4r^{\prime}\geq\tfrac{r}{4}. Therefore, taking r0=r4r_{0}=\tfrac{r}{4} in (5), we obtain

Let R(x,T)R(x,T) be the contribution of each context x∈SXx\in S_{\text{X}} to contextual regret:

where yty_{t} is the arm chosen by the algorithm in round tt. Our goal is to show that R(x,T0)≥Ω(r nY)R(x,T_{0})\geq\Omega(r\,n_{\text{Y}}).

We will consider each context x∈SXx\in S_{\text{X}} separately: the rounds when xx arrives form an instance IxI_{x} of a context-free bandit problem that lasts for T0/nX=nY r−2T_{0}/n_{\text{X}}=n_{\text{Y}}\,r^{-2} rounds, where expected payoffs are given by μ(x,⋅)\mu(x,\cdot) as defined in (19). Let Ix\mathcal{I}_{x} be the family of all such instances IxI_{x}.

A uniform distribution over I\mathcal{I} can be reformulated as follows: for each x∈SXx\in S_{\text{X}}, pick the “needle” y∗(x)y^{*}(x) independently and uniformly at random from SYS_{\text{Y}}. This induces a uniform distribution over instances in Ix\mathcal{I}_{x}, for each context x∈SXx\in S_{\text{X}}. Informally, knowing full or partial information about y∗(x)y^{*}(x) for some xx reveals no information whatsoever about y∗(x′)y^{*}(x^{\prime}) for any x′≠xx^{\prime}\neq x.

Thus, it remains to handle each Ix\mathcal{I}_{x} separately: i.e., to prove that the expected regret of any bandit algorithm on an instance drawn uniformly at random from Ix\mathcal{I}_{x} is at least Ω(r nY)\Omega(r\,n_{\text{Y}}). We use the KL-divergence technique that originated in Auer et al. 2002b. If the set of arms were exactly SYS_{\text{Y}}, then the desired lower bound would follow from Auer et al. 2002b directly. To handle the problem instances in Ix\mathcal{I}_{x}, we use an extension of the technique from Auer et al. 2002b, which is implicit in Kleinberg 2004 and encapsulated as a stand-alone theorem in Kleinberg et al. 2013. We restate this theorem as Theorem A.2 in Appendix A.

It is easy to check that the family Ix\mathcal{I}_{x} of problem instances satisfies the preconditions in Theorem A.2. Fix x∈SXx\in S_{\text{X}}. For a given choice of the “needle” y∗=y∗(x)∈SYy^{*}=y^{*}(x)\in S_{\text{Y}}, let μ(x,y ∣ y∗)\mu(x,y\,|\,y^{*}). be the expected payoff of each arm yy, and let νy∗(⋅)=μ(x,⋅ ∣ y∗)\nu_{y^{*}}(\cdot)=\mu(x,\cdot\,|\,y^{*}) be the corresponding payoff function for the bandit instance IxI_{x}. Then {νy∗}\{\nu_{y^{*}}\}, y∗∈SYy^{*}\in S_{\text{Y}} is an “(ϵ,k)(\epsilon,k)-ensemble” for ϵ=r8\epsilon=\tfrac{r}{8} and k=∣SY∣k=|S_{\text{Y}}|. ∎

Applications of contextual zooming

We describe several applications of contextual zooming: to MAB with slow adversarial change (Section 6.1), to MAB with stochastically evolving payoffs (Section 6.2), and to the “sleeping bandits” problem (Section 6.3). In particular, we recover some of the main results in Slivkins and Upfal 2008 and Kleinberg et al. 2008a. Also, in Section 6.4 we discuss a recent application of contextual zooming to bandit learning-to-rank, which has been published in Slivkins et al. 2013.

Consider the (context-free) adversarial MAB problem in which expected payoffs of each arm change over time gradually. Specifically, we assume that expected payoff of each arm yy changes by at most σy\sigma_{y} in each round, for some a-priori known volatilities σy\sigma_{y}. The algorithm’s goal here is continuously adapt to the changing environment, rather than converge to the best fixed mapping from contexts to arms. We call this setting the drifting MAB problem.

Formally, our benchmark is a fictitious algorithm which in each round selects an arm that maximizes expected payoff for the current context. The difference in expected payoff between this benchmark and a given algorithm is called dynamic regret of this algorithm. It is easy to see that the worst-case dynamic regret of any algorithm cannot be sublinear in time. For example, consider problem instances with two arms such that the payoff of each arm in each round is either 12\tfrac{1}{2} or 12+σ\tfrac{1}{2}+\sigma (and can change from round to round). Over this family of problem instances, dynamic regret in TT rounds is at least 12 σT\tfrac{1}{2}\,\sigma T. We are primarily interested in algorithm’s long-term performance, as quantified by average dynamic regret R^(T)≜R(T)/T\hat{R}(T)\triangleq R(T)/T. Our goal is to bound the limit lim⁡T→∞R^(T)\lim_{T\to\infty}\hat{R}(T) in terms of the parameters: the number of arms and the volatilities σy\sigma_{y}. (In general, such upper bound is non-trivial as long as it is smaller than 1, since all payoffs are at most 1.)

We restate this setting as a contextual MAB problem with stochastic payoffs in which the tt-th context arrival is simply xt=tx_{t}=t. Then μ(t,y)\mu(t,y) is the expected payoff of arm yy at time tt, and dynamic regret coincides with contextual regret specialized to the case xt=tx_{t}=t. Each arm yy satisfies a “temporal constraint”:

for some constant σy\sigma_{y}. To set up the corresponding similarity space (P,D)(\mathcal{P},\mathcal{D}), let P=[T]×Y\mathcal{P}=[T]\times Y, and

Our solution for the drifting MAB problem is the contextual zooming algorithm parameterized by the similarity space (P,D)(\mathcal{P},\mathcal{D}). To obtain guarantees for the long-term performance, we run contextual zooming with a suitably chosen time horizon T0T_{0}, and restart it every T0T_{0} rounds; we call this version contextual zooming with period T0T_{0}. Periodically restarting the algorithm is a simple way to prevent the change over time from becoming too large; it suffices to obtain strong provable guarantees.

The general provable guarantees are provided by Theorem 4.1 and Theorem 4.7. Below we work out some specific, tractable corollaries.

Consider the drifting MAB problem with kk arms and volatilities σy≡σ\sigma_{y}\equiv\sigma. Contextual zooming with period T0T_{0} has average dynamic regret R^(T)=O(kσlog⁡T0)1/3\hat{R}(T)=O(k\sigma\log T_{0})^{1/3}, whenever T≥T0≥(kσ2)1/3 log⁡kσT\geq T_{0}\geq(\tfrac{k}{\sigma^{2}})^{1/3}\,\log\tfrac{k}{\sigma}.

It suffices to upper-bound regret in a single period. Indeed, if R(T0)≤RR(T_{0})\leq R for any problem instance, then R(T)≤R ⌈T/T0⌉R(T)\leq R\,{\lceil{T/T_{0}}\rceil} for any T>T0T>T_{0}. It follows that R^(T)≤2 R^(T0)\hat{R}(T)\leq 2\,\hat{R}(T_{0}). Therefore, from here on we can focus on analyzing contextual zooming itself, rather than contextual zooming with a period.

The main step is to derive the regret bound (5) with a specific upper bound on NrN_{r}. We will show that

Plugging Nr≤k (1+Tσr)N_{r}\leq k\,(1+\tfrac{T\sigma}{r}) into (5) and taking r0=(kσlog⁡T)1/3r_{0}=(k\sigma\log T)^{1/3} we obtain This choice of r0r_{0} minimizes the inf⁡\inf expression in (5) up to constant factors by equating the two summands.

Therefore, for any T≥(kσ2)1/3 log⁡kσT\geq(\tfrac{k}{\sigma^{2}})^{1/3}\,\log\tfrac{k}{\sigma} we have R^(T)=O(kσlog⁡T)1/3\hat{R}(T)=O(k\sigma\log T)^{1/3}.

It remains to prove (23). We use a pessimistic version of Theorem 4.1: (5) with Nr=Nr(P)N_{r}=N_{r}(\mathcal{P}), the rr-packing number of P\mathcal{P}. Fix r∈(0,1]r\in(0,1]. For any rr-packing SS of P\mathcal{P} and each arm yy, each time interval II of duration Δr≜r/σ\Delta_{r}\triangleq r/\sigma provides at most one point for SS: there exists at most one time t∈It\in I such that (t,y)∈S(t,y)\in S. Since there are at most ⌈T/Δr⌉{\lceil{T/\Delta_{r}}\rceil} such intervals II, it follows that Nr(P)≤k ⌈T/Δr⌉≤k (1+Tσr)N_{r}(\mathcal{P})\leq k\,{\lceil{T/\Delta_{r}}\rceil}\leq k\,(1+T\tfrac{\sigma}{r}). ∎

The restriction σy≡σ\sigma_{y}\equiv\sigma is non-essential: it is not hard to obtain the same bound with σ=1k∑yσy\sigma=\tfrac{1}{k}\sum_{y}\sigma_{y}. Modifying the construction in Section 5 (details omitted from this version) one can show that Corollary 6.1 is optimal up to O(log⁡T)O(\log T) factors.

The temporal version (xt=tx_{t}=t) of our contextual MAB setting with stochastic payoffs subsumes the drifting MAB problem and furthermore allows to combine the temporal constraints (21) described above (for each arm, across time) with ‘‘spatial constraints” (for each time, across arms). To the best of our knowledge, such MAB models are quite rare in the literature. The only other MAB model with this flavor that we are aware of, found in Hazan and Kale 2009, combines linear payoffs and bounded “total variation” (aggregate temporal change) of the cost functions. A clean example is

where (Y,DY)(Y,\mathcal{D}_{\text{Y}}) is the arms space. For this example, we can obtain an analog of Corollary 6.1, where the regret bound depends on the covering dimension of the arms space (Y,DY)(Y,\mathcal{D}_{\text{Y}}).

Consider the drifting MAB problem with spatial constraints (24), where σ\sigma is the volatility. Let dd be the covering dimension of the arms space, with multiplier kk. Contextual zooming with period T0T_{0} has average dynamic regret R^(T)=O(k σlog⁡T0)1d+3\hat{R}(T)=O(k\,\sigma\log T_{0})^{\tfrac{1}{d+3}}, whenever T≥T0≥k1d+3  σ−d+2d+3  log⁡kσT\geq T_{0}\geq k^{\tfrac{1}{d+3}}\;\sigma^{-\tfrac{d+2}{d+3}}\;\log\tfrac{k}{\sigma}.

We obtain Corollary 6.1 as a special case by setting d=0d=0.

It suffices to bound R^(T0)\hat{R}(T_{0}) for (non-periodic) contextual zooming. First we bound the rr-covering number of the similarity space (P,D)(\mathcal{P},\mathcal{D}):

where NrX(⋅)N_{r}^{\text{X}}(\cdot) is the rr-covering number in the context space, and NrY(⋅)N_{r}^{\text{Y}}(\cdot) is that in the arms space. We worked out the former for Corollary 6.1. Plugging this into (5) and taking r0=(k σlog⁡T)1/(3+d)r_{0}=(k\,\sigma\log T)^{1/(3+d)}, we obtain

The desired bound on R^(T0)\hat{R}(T_{0}) follows easily. ∎

2 Bandits with stochastically evolving payoffs

We consider a special case of drifting MAB problem in which expected payoffs of each arm evolve over time according to a stochastic process with a uniform stationary distribution. We obtain improved regret bounds for contextual zooming, taking advantage of the full power of our analysis in Section 4.

In particular, we address a version in which the stochastic process is a random walk with step ±σ\pm\sigma. This version has been previously studied in Slivkins and Upfal 2008 under the name “Dynamic MAB”. For the main case (σi≡σ\sigma_{i}\equiv\sigma), our regret bound for Dynamic MAB matches that in Slivkins and Upfal 2008.

To improve the flow of the paper, the proofs are deferred to Appendix 7.

We obtain a stronger version of (23) via Theorem 4.7. To use this theorem, we need to bound the adjusted rr-zooming number, call it NrN_{r}. We show that

Then we obtain a different bound on dynamic regret, which is stronger than Corollary 6.1 for k<σ−1/2k<\sigma^{-1/2}.

The crux of the proof is to show (25). Interestingly, it involves using all three optimizations in Theorem 4.7: Nr(Pμ,r)N_{r}(\mathcal{P}_{\mu,r}), Nr(Pμ,r∖Wμ,r)N_{r}(\mathcal{P}_{\mu,r}\setminus\mathcal{W}_{\mu,r}) and Nradj(⋅)N^{\text{adj}}_{r}(\cdot), whereas any two of them do not seem to suffice. The rest is a straightforward computation similar to the one in Corollary 6.1.

Dynamic MAB.

According to a well-known fact about random walks, For example, this follows as a simple application of Azuma-Hoeffding inequality.

We use contextual zooming with period T0T_{0}, but we parameterize it by a different similarity space (P,DT0)(\mathcal{P},\mathcal{D}_{T_{0}}) that we define according to (26). Namely, we set

The following corollary is proved using the same technique as Corollary 6.3:

3 Sleeping bandits

The sleeping bandits problem Kleinberg et al. 2008a is an extension of MAB where in each round some arms can be “asleep”, i.e. not available in this round. One of the main results in Kleinberg et al. 2008a is on sleeping bandits with stochastic payoffs. We recover this result using contextual zooming.

We model sleeping bandits as contextual MAB problem where each context arrival xtx_{t} corresponds to the set of arms that are “awake” in this round. More precisely, for every subset S⊂YS\subset Y of arms there is a distinct context xSx_{S}, and P={(xS,y): y∈S⊂Y}\mathcal{P}=\{(x_{S},y):\,y\in S\subset Y\}. is the set of feasible context-arm pairs. The similarity distance is simply D((x,y), (x′,y′))=1{y≠y′}\mathcal{D}((x,y),\,(x^{\prime},y^{\prime}))=\mathbf{1}_{\{y\neq y^{\prime}\}}. Note that the Lipschitz condition (1) is satisfied.

For this setting, contextual zooming essentially reduces to the “highest awake index” algorithm in Kleinberg et al. 2008a. In fact, we can re-derive the result Kleinberg et al. 2008a on sleeping MAB with stochastic payoffs as an easy corollary of Theorem 4.1.

Consider the sleeping MAB problem with stochastic payoffs. Order the arms so that their expected payoffs are μ1≤μ2≤…≤μn\mu_{1}\leq\mu_{2}\leq\ldots\leq\mu_{n}, where nn is the number of arms. Let Δi=μi+1−μi\Delta_{i}=\mu_{i+1}-\mu_{i}. Then

The rr-zooming number Nr(Pμ,r)N_{r}(\mathcal{P}_{\mu,r}) is equal to the number of distinct arms in Pμ,r\mathcal{P}_{\mu,r}, i.e. the number of arms i∈Yi\in Y such that Δ(x,i)≤12r\Delta(x,i)\leq 12r for some context xx. Note that for a given arm ii, the quantity Δ(x,i)\Delta(x,i) is minimized when the set of awake arms is S={i,i+1}S=\{i,i+1\}. Therefore, Nr(Pμ,r)N_{r}(\mathcal{P}_{\mu,r}) is equal to the number of arms i∈Yi\in Y such that Δi≤12r\Delta_{i}\leq 12r. It follows that

Moreover, the contextual MAB problem extends the sleeping bandits setting by incorporating similarity information on arms. The contextual zooming algorithm (and its analysis) applies, and is geared to exploit this additional similarity information.

4 Bandit learning-to-rank

Following a preliminary publication of this paper on arxiv.org, contextual zooming has been applied in Slivkins et al. 2013 to bandit learning-to-rank. Interestingly, the “contexts” studied in Slivkins et al. 2013 are very different from what we considered so far.

The basic setting, motivated by web search, was introduced in Radlinski et al. 2008. In each round a new user arrives. The algorithm selects a ranked list of kk documents and presents it to the user who clicks on at most one document, namely on the first document that (s)he finds relevant. A user is specified by a binary vector over documents. The goal is to minimize abandonment: the number of rounds with no clicks.

Slivkins et al. 2013 study an extension in which metric similarity information is available. They consider a version with stochastic payoffs: in each round, the user vector is an independent sample from a fixed distribution, and assume a Lipschitz-style condition that connects expected clicks with the metric space. They run a separate bandit algorithm (e.g., contextual zooming) for each of the kk “slots” in the ranking. Without loss of generality, in each round the documents are selected sequentially, in the top-down order. Since a document in slot ii is clicked in a given round only if all higher ranked documents are not relevant, they treat the set of documents in the higher slots as a context for the ii-th algorithm. The Lipschitz-style condition on expected clicks suffices to guarantee the corresponding Lipschitz-style condition on contexts.

Bandits with stochastically evolving payoffs: missing proofs

We prove Corollary 6.3 and Corollary 6.4 which address the performance of contextual zooming for the stochastically evolving payoffs. In each corollary we bound from above the average dynamic regret R^(T)\hat{R}(T) of contextual zooming with period T0T_{0}, for any T≥T0T\geq T_{0}. Since R^(T)≤2R^(T0)\hat{R}(T)\leq 2\hat{R}(T_{0}), it suffices to bound R^(T0)\hat{R}(T_{0}), which is the same as R^(T0)\hat{R}(T_{0}) for (non-periodic) contextual zooming. Therefore, we can focus on analyzing the non-periodic algorithm.

We start with two simple auxiliary claims.

Consider the contextual MAB problem with a product similarity space. Let Δ(x,y)≜μ∗(x)−μ(x,y)\Delta(x,y)\triangleq\mu^{*}(x)-\mu(x,y) be the “badness” of point (x,y)(x,y) in the similarity space. Then

First we show that the benchmark payoff μ(⋅)\mu(\cdot) satisfies a Lipschitz condition:

Indeed, it holds that μ∗(x)=μ(x,y)\mu^{*}(x)=\mu(x,y) and μ∗(x′)=μ(x,y′)\mu^{*}(x^{\prime})=\mu(x,y^{\prime}) for some arms y,y′∈Yy,y^{\prime}\in Y. Then

and likewise for the other direction. Now,

This is a textbook result; we provide a proof for the sake of completeness.

Integrating over Z∗Z^{*}, and letting F(z)≜Pr⁡[Z∗≤z]=zkF(z)\triangleq\Pr[Z^{*}\leq z]=z^{k}, we obtain that

It suffices to bound R^(T0)\hat{R}(T_{0}) for (non-periodic) contextual zooming.

Let DX(t,t′)≜σ∣t−t′∣\mathcal{D}_{\text{X}}(t,t^{\prime})\triangleq\sigma|t-t^{\prime}| be the context distance implicit in the temporal constraint (21). For each r>0r>0, pick a number TrT_{r} such that DX(t,t′)≤r  ⟺  ∣t−t′∣≤Tr\mathcal{D}_{\text{X}}(t,t^{\prime})\leq r\iff|t-t^{\prime}|\leq T_{r}. Clearly, Tr≜rσT_{r}\triangleq\tfrac{r}{\sigma}.

The crux is to bound the adjusted rr-zooming number, call it NrN_{r}, namely to show (25). For the sake of convenience, let us restate it here (and let us use the notation TrT_{r}):

Recall that Nr=Nadj(Pμ,r∖Wμ,r)N_{r}=N^{\text{adj}}(\mathcal{P}_{\mu,r}\setminus\mathcal{W}_{\mu,r}), where Wμ,r\mathcal{W}_{\mu,r} is the set of all rr-winners (see Section 4.4 for the definition). Fix r∈(0,1]r\in(0,1] and let SS be some rr-packing of Pμ,r∖Wμ,r\mathcal{P}_{\mu,r}\setminus\mathcal{W}_{\mu,r}. Partition the time into ⌈TTr⌉{\lceil{\tfrac{T}{T_{r}}}\rceil} intervals of duration TrT_{r}. Fix one such interval II. Let SI≜{(t,y)∈S: t∈I}S_{I}\triangleq\{(t,y)\in S:\,t\in I\}, the set of points in SS that correspond to times in II. Recall the notation Δ(x,y)≜μ∗(x)−μ(x,y)\Delta(x,y)\triangleq\mu^{*}(x)-\mu(x,y) and let

All quantities in (31) refer to a fixed time tIt_{I}, which will allow us to use the uniform marginals property.

Note that YIY_{I} contains at least one arm, namely the best arm y∗(tI)y^{*}(t_{I}). We claim that

Fix arm yy. First, DX(t,t′)≤r\mathcal{D}_{\text{X}}(t,t^{\prime})\leq r for any t,t′∈It,t^{\prime}\in I, so there exists at most one t∈It\in I such that (t,y)∈S(t,y)\in S. Second, suppose such tt exists. Since S⊂Pμ,rS\subset\mathcal{P}_{\mu,r}, it follows that Δ(t,y)≤12 r\Delta(t,y)\leq 12\,r. By Claim 7.1 it holds that

So y∈YIy\in Y_{I}. It follows that ∣SI∣≤∣YI∣|S_{I}|\leq|Y_{I}|.

To obtain (32), we show that SI=0S_{I}=0 whenever ∣YI∣=1|Y_{I}|=1. Indeed, suppose YI={y}Y_{I}=\{y\} is a singleton set, and ∣SI∣>0|S_{I}|>0. Then SI={(t,y)}S_{I}=\{(t,y)\} for some t∈It\in I. We will show that (t,y)(t,y) is an rr-winner, contradicting the definition of SS. For any arm y′≠yy^{\prime}\neq y and any time t′t^{\prime} such that DX(t,t′)≤2r\mathcal{D}_{\text{X}}(t,t^{\prime})\leq 2r it holds that

and so μ(t′,y)=μ∗(t′)\mu(t^{\prime},y)=\mu^{*}(t^{\prime}). Thus, (t,y)(t,y) is an rr-winner as claimed. This completes the proof of (32).

Now using (32) and Claim 7.2 we obtain that

Now that we have (30), the rest is a simple computation. We use Theorem 4.7, namely we take (5) with r0→0r_{0}\rightarrow 0, plug in (30), and recall that Tr≥1/r2  ⟺  r≥σ1/3T_{r}\geq 1/r^{2}\iff r\geq\sigma^{1/3}.

It suffices to bound R^(T0)\hat{R}(T_{0}) for (non-periodic) contextual zooming.

Recall that expected payoffs satisfy the temporal constraint (26). Consider the high-probability event that

Since expected regret due to the failure of (33) is negligible, from here on we will assume that (33) holds deterministically.

Let DX(t,t′)≜σ ∣t−t′∣1/2log⁡T0\mathcal{D}_{\text{X}}(t,t^{\prime})\triangleq\sigma\,|t-t^{\prime}|^{1/2}\log T_{0} be the distance on contexts implicit in (33). For each r>0r>0, define Tr≜(rσlog⁡T0)2T_{r}\triangleq(\tfrac{r}{\sigma\log T_{0}})^{2}. Then (30) follows exactly as in the proof of Corollary 6.3. We use Theorem 4.7 similarly: we take (5) with r0→0r_{0}\rightarrow 0, plug in (30), and note that Tr≥1/r2  ⟺  r≥(σlog⁡T0)1/2T_{r}\geq 1/r^{2}\iff r\geq(\sigma\log T_{0})^{1/2}. We obtain

Contextual bandits with adversarial payoffs

In this section we consider the adversarial setting. We provide an algorithm which maintains an adaptive partition of the context space and thus takes advantage of “benign” context arrivals. It is in fact a meta-algorithm: given a bandit algorithm Bandit, we present a contextual bandit algorithm, called ContextualBandit, which calls Bandit as a subroutine.

Recall that in each round tt, the context xt∈Xx_{t}\in X is revealed, then the algorithm picks an arm yt∈Yy_{t}\in Y and observes the payoff πt∈\pi_{t}\in. Here XX is the context set, and YY is the arms set. In this section, all context-arms pairs are feasible: P=X×Y\mathcal{P}=X\times Y.

Following Hazan and Megiddo 2007, we generalize the notion of regret for context-free adversarial MAB to contextual MAB. The context-specific best arm is

where the ties are broken in an arbitrary but fixed way. We define adversarial contextual regret as

Similarity information is given to an algorithm as a pair of metric spaces: a metric space (X,DX)(X,\mathcal{D}_{\text{X}}) on contexts (the context space) and a metric space (Y,DY)(Y,\mathcal{D}_{\text{Y}}) on arms (the arms space), which form the product similarity space (X×Y,DX+DY)(X\times Y,\mathcal{D}_{\text{X}}+\mathcal{D}_{\text{Y}}). We assume that for each round tt functions μt\mu_{t} and μt∗\mu^{*}_{t} are Lipschitz on (X×Y,DX+DY)(X\times Y,\mathcal{D}_{\text{X}}+\mathcal{D}_{\text{Y}}) and (X,DX)(X,\mathcal{D}_{\text{X}}), respectively, both with Lipschitz constant 11 (see Footnote 1). We assume that the context space is compact, in order to ensure that the max⁡\max in (34) is attained by some y∈Yy\in Y. Without loss of generality, diameter(X,DX)≤1\mathtt{diameter}(X,\mathcal{D}_{\text{X}})\leq 1.

Formally, a problem instance consists of metric spaces (X,DX)(X,\mathcal{D}_{\text{X}}) and (Y,DY)(Y,\mathcal{D}_{\text{Y}}), the sequence of context arrivals (denoted x(1..T)x_{(1..T)}), and a sequence of distributions (Πt)t≤T(\Pi_{t})_{t\leq T}. Note that for a fixed distribution Πt=Π\Pi_{t}=\Pi, this setting reduces to the stochastic setting, as defined in Introduction. For the fixed context case (xt=xx_{t}=x for all tt) this setting reduces to the (context-free) MAB problem with a randomized oblivious adversary.

2 Our results

Our algorithm is parameterized by a regret guarantee for Bandit for the fixed context case, namely an upper bound on the convergence time. The rr-convergence time T0(r)T_{0}(r) is the smallest T0T_{0} such that regret is R(T)≤rTR(T)\leq rT for each T≥T0T\geq T_{0}. For a more concrete theorem statement we will assume that the convergence time of Bandit is at most T0(r)≜cY r−(2+dY) log⁡(1r)T_{0}(r)\triangleq c_{\text{Y}}\,r^{-(2+d_{\text{Y}})}\,\log(\tfrac{1}{r}) for some constants cYc_{\text{Y}} and dYd_{\text{Y}} that are known to the algorithm. In particular, an algorithm in Kleinberg 2004 achieves this guarantee if dYd_{\text{Y}} is the cc-covering dimension of the arms space and cY=O(c2+dY)c_{\text{Y}}=O(c^{2+d_{\text{Y}}}).

From here on, the context space (X,DX)(X,\mathcal{D}_{\text{X}}) will be only metric space considered; balls and other notions will refer to the context space only.

To quantify the “goodness” of context arrivals, our guarantees are in terms of the covering dimension of x(1..T)x_{(1..T)} rather than that of the entire context space. (This is the improvement over the guarantee (3) for the uniform algorithm.) In fact, use a more refined notion which allows to disregard a limited number of “outliers” in x(1..T)x_{(1..T)}.

Consider the contextual MAB problem with adversarial payoffs, and let Bandit be a bandit algorithm. Assume that the problem instance belongs to some class of problem instances such that for the fixed-context case, convergence time of Bandit is at most T0(r)≜cY r−(2+dY) log⁡(1r)T_{0}(r)\triangleq c_{\text{Y}}\,r^{-(2+d_{\text{Y}})}\,\log(\tfrac{1}{r}) for some constants cYc_{\text{Y}} and dYd_{\text{Y}} that are known to the algorithm. Then ContextualBandit achieves adversarial contextual regret R(⋅)R(\cdot) such that for any time TT and any constant cX>0c_{\text{X}}>0 it holds that

where dXd_{\text{X}} is the relaxed covering dimension of x(1..T)x_{(1..T)} with multiplier cXc_{\text{X}} and slack T0(⋅)T_{0}(\cdot), and c\textscdblc_{\textsc{dbl}} is the doubling constant of x(1..T)x_{(1..T)}.

For a version of (36) that is stated in terms of the “raw” (r,kr)(r,k_{r})-covering numbers of x(1..T)x_{(1..T)}, see (38) in the analysis (page 38).

3 Our algorithm

The algorithm maintains a finite collection A\mathcal{A} of balls, called active balls. Initially there is one active ball of radius 11. Ball BB stays active once it is activated. Then a fresh instance ALGB\mathtt{ALG}_{B} of Bandit is created, whose set of “arms” is YY. ALGB\mathtt{ALG}_{B} can be parameterized by the time horizon T0(r)T_{0}(r), where rr is the radius of BB.

The algorithm proceeds as follows. In each round tt the algorithm selects one active ball B∈AB\in\mathcal{A} such that xt∈Bx_{t}\in B, calls ALGB\mathtt{ALG}_{B} to select an arm y∈Yy\in Y to be played, and reports the payoff πt\pi_{t} back to ALGB\mathtt{ALG}_{B}. A given ball can be selected at most T0(r)T_{0}(r) times, after which it is called full. BB is called relevant in round tt if it contains xtx_{t} and is not full. The algorithm selects a relevant ball (breaking ties arbitrarily) if such ball exists. Otherwise, a new ball B′B^{\prime} is activated and selected. Specifically, let BB be the smallest-radius active ball containing xtx_{t}. Then B′=B(xt,r2)B^{\prime}=B(x_{t},\tfrac{r}{2}), where rr is the radius of BB. BB is then called the parent of B′B^{\prime}. See Algorithm 8.3 for the pseudocode.

4 Analysis: proof of Theorem 8.2

First let us argue that algorithm ContextualBandit is well-defined. Specifically, we need to show that after the activation rule is called, there exists an active non-full ball containing xtx_{t}. Suppose not. Then the ball B′=B(xt,r2)B^{\prime}=B(x_{t},\tfrac{r}{2}) activated by the activation rule must be full. In particular, B′B^{\prime} must have been active before the activation rule was called, which contradicts the minimality in the choice of rr. Claim proved.

We continue by listing several basic claims about the algorithm.

The algorithm satisfies the following basic properties:

(Correctness) In each round tt, exactly one active ball is selected.

Each active ball of radius rr is selected at most T0(r)T_{0}(r) times.

(Separation) For any two active balls B(x,r)B(x,r) and B(x′,r)B(x^{\prime},r) we have DX(x,x′)>r\mathcal{D}_{\text{X}}(x,x^{\prime})>r.

Each active ball has at most c\textscdbl2c_{\textsc{dbl}}^{2} children, where c\textscdblc_{\textsc{dbl}} is the doubling constant of x(1..T)x_{(1..T)}.

Part (a) is immediate from the algorithm’s specification. For (b), simply note that by the algorithms’ specification a ball is selected only when it is not full.

To prove (c), suppose that DX(x,x′)≤r\mathcal{D}_{\text{X}}(x,x^{\prime})\leq r and suppose B(x′,r)B(x^{\prime},r) is activated in some round tt while B(x,r)B(x,r) is active. Then B(x′,r)B(x^{\prime},r) was activated as a child of some ball B∗B^{*} of radius 2r2r. On the other hand, x′=xt∈B(x,r)x^{\prime}=x_{t}\in B(x,r), so B(x,r)B(x,r) must have been full in round tt (else no ball would have been activated), and consequently the radius of B∗B^{*} is at most rr. Contradiction.

For (d), consider the children of a given active ball B(x,r)B(x,r). Note that by the activation rule the centers of these children are points in x(1..T)∩B(x,r)x_{(1..T)}\cap B(x,r), and by the separation property any two of these points lie within distance >r2>\tfrac{r}{2} from one another. By the doubling property, there can be at most c\textscdbl2c_{\textsc{dbl}}^{2} such points. ∎

Let us fix the time horizon TT, and let R(T)R(T) denote the contextual regret of ContextualBandit. Partition R(T)R(T) into the contributions of active balls as follows. Let B\mathcal{B} be the set of all balls that are active after round TT. For each B∈BB\in\mathcal{B}, let SBS_{B} be the set of all rounds tt when BB has been selected. Then

For each ball B=B(x,r)∈BB=B(x,r)\in\mathcal{B}, we have RB≤3 r T0(r)R_{B}\leq 3\,r\,T_{0}(r).

By the Lipschitz conditions on μt\mu_{t} and μt∗\mu^{*}_{t}, for each round t∈SBt\in S_{B} it is the case that

The tt-round regret of Bandit is at most R0(t)≜t T0−1(t)R_{0}(t)\triangleq t\,T_{0}^{-1}(t). Therefore, letting n=∣SB∣n=|S_{B}| be the number of times algorithm ALGB\mathtt{ALG}_{B} has been invoked, we have that

Therefore RB(T)≤R0(n)+2rnR_{B}(T)\leq R_{0}(n)+2rn. Recall that by Claim 8.4(b) we have n≤T0(r)n\leq T_{0}(r). Thus, by definition of convergence time R0(n)≤R0(T0(r))≤r T0(r)R_{0}(n)\leq R_{0}(T_{0}(r))\leq r\,T_{0}(r), and therefore RB(T)≤3 r T0(r)R_{B}(T)\leq 3\,r\,T_{0}(r). ∎

Let Fr\mathcal{F}_{r} be the collection of all full balls of radius rr. Let us bound ∣Fr∣|\mathcal{F}_{r}| in terms the (r,k)(r,k)-covering number of x(1..T)x_{(1..T)} in the context space, which we denote N(r,k)N(r,k).

There are at most N(r, T0(r))N(r,\,T_{0}(r)) full balls of radius rr.

Fix rr and let k=T0(r)k=T_{0}(r). Let us say that a point x∈x(1..T)x\in x_{(1..T)} is heavy if B(x,r)B(x,r) contains at least kk points of x(1..T)x_{(1..T)}, counting multiplicities. Clearly, B(x,r)B(x,r) is full only if its center is heavy. By definition of the (r,k)(r,k)-covering number, there exists a family S\mathcal{S} of N(r,k)N(r,k) sets of diameter ≤r\leq r that cover all heavy points in x(1..T)x_{(1..T)}. For each full ball B=B(x,r)B=B(x,r), let SBS_{B} be some set in S\mathcal{S} that contains xx. By Claim 8.4(c), the sets SBS_{B}, B∈FrB\in\mathcal{F}_{r} are all distinct. Thus, ∣Fr∣≤∣S∣≤N(r,k)|\mathcal{F}_{r}|\leq|\mathcal{S}|\leq N(r,k). ∎

Let Br\mathcal{B}_{r} be the set of all balls of radius rr that are active after round TT. By the algorithm’s specification, each ball in Fr\mathcal{F}_{r} has been selected T0(r)T_{0}(r) times, so ∣Fr∣≤T/T0(r)|\mathcal{F}_{r}|\leq T/T_{0}(r). Then using Claim 8.4(b) and Claim 8.6, we have

Trivially, for any full ball of radius rr we have T0(r)≤TT_{0}(r)\leq T. Thus, summing (37) over all such rr, we obtain

Note that (38) makes no assumptions on N(r,T0(r))N(r,T_{0}(r)). Now, plugging in T0(r)=cY r−(2+dY)T_{0}(r)=c_{\text{Y}}\,r^{-(2+d_{\text{Y}})} and N(r,T0(r))≤cX r−dXN(r,T_{0}(r))\leq c_{\text{X}}\,r^{-d_{\text{X}}} into (38) and optimizing it for rr it is easy to derive the desired bound (36).

Conclusions

We consider a general setting for contextual bandit problems where the algorithm is given information on similarity between the context-arm pairs. The similarity information is modeled as a metric space with respect to which expected payoffs are Lipschitz-continuous. Our key contribution is an algorithm which maintains a partition of the metric space and adaptively refines this partition over time. Due to this “adaptive partition” technique, one can take advantage of “benign” problem instances without sacrificing the worst-case performance; here “benign-ness” refers to both expected payoffs and context arrivals. We essentially resolve the setting where expected payoff from every given context-arm pair either does not change over time, or changes slowly. In particular, we obtain nearly matching lower bounds (for time-invariant expected payoffs and for an important special case of slow change).

We also consider the setting of adversarial payoffs. For this setting, we design a different algorithm that maintains a partition of contexts and adaptively refines it so as to take advantage of “benign” context arrivals (but not “benign” expected payoffs), without sacrificing the worst-case performance. Our algorithm can work with, essentially, any given off-the-shelf algorithm for standard (non-contextual) bandits, the choice of which can then be tailored to the setting at hand.

The main open questions concern relaxing the requirements on the quality of similarity information that are needed for the provable guarantees. First, it would be desirable to obtain similar results under weaker versions of the Lipschitz condition. Prior work (Kleinberg et al. 2008b, Bubeck et al. 2011a) obtained several such results for the non-contextual version of the problem, mainly because their main results do not require the full power of the Lipschitz condition. However, the analysis in this paper appears to make a heavier use of the Lipschitz condition; it is not clear whether a meaningful relaxation would suffice. Second, in some settings the available similarity information might not include any numeric upper bounds on the difference in expected payoffs; e.g. it could be given as a tree-based taxonomy on context-arm pairs, without any explicit numbers. Yet, one wants to recover the same provable guarantees as if the numerical information were explicitly given. For the non-contextual version, this direction has been explored in (Bubeck et al. 2011b, Slivkins 2011). (Bubeck et al. 2011b, Slivkins 2011) have been published after the preliminary publication of this paper on arxiv.org.

Another open question concerns our results for adversarial payoffs. Here it is desirable to extend our “adaptive partitions” technique to also take advantage of “benign” expected payoffs (in addition to “benign” context arrivals). However, to the best of our knowledge such results are not even known for the non-contextual version of the problem.

The author is grateful to Ittai Abraham, Bobby Kleinberg and Eli Upfal for many conversations about multi-armed bandits, and to Sebastien Bubeck for help with the manuscript. Also, comments from anonymous COLT reviewers and JMLR referees have been tremendously useful in improving the presentation.

References

A The KL-divergence technique, encapsulated

To analyze the lower-bounding construction in Section 5, we use an extension of the KL-divergence technique from Auer et al. 2002b, which is implicit in Kleinberg 2004 and encapsulated as a stand-alone theorem in Kleinberg et al. 2013. To make the paper self-contained, we state the theorem from Kleinberg et al. 2013, along with the relevant definitions. The remainder of this section is copied from Kleinberg et al. 2013, with minor modifications.

Consider a very general MAB setting where the algorithm is given a strategy set XX and a collection F\mathcal{F} of feasible payoff functions; we call it the feasible MAB problem on (X,F)(X,\mathcal{F}). For example, F\mathcal{F} can consist of all functions μ:X→\mu:X\to that are Lipschitz with respect to a given metric space. The lower bound relies on the existence of a collection of subsets of F\mathcal{F} with certain properties, as defined below. These subsets correspond to children of a given tree node in the ball-tree

Let XX be the strategy set and F\mathcal{F} be the set of all feasible payoff functions. An (ϵ,k)(\epsilon,k)-ensemble is a collection of subsets F1 , … ,Fk⊂F\mathcal{F}_{1}\,,\ \ldots\ ,\mathcal{F}_{k}\subset\mathcal{F} such that there exist mutually disjoint subsets S1 , … ,Sk⊂XS_{1}\,,\ \ldots\ ,S_{k}\subset X and a number μ0∈[13,23]\mu_{0}\in[\tfrac{1}{3},\tfrac{2}{3}] which satisfy the following. Let S=∪i=1kSiS=\cup_{i=1}^{k}S_{i}. Then

on X∖SX\setminus S, any two functions in ∪i Fi\cup_{i}\,\mathcal{F}_{i} coincide, and are bounded from above by μ0\mu_{0}.

for each ii and each function μ∈Fi\mu\in\mathcal{F}_{i} it holds that μ=μ0\mu=\mu_{0} on S∖SiS\setminus S_{i} and sup⁡(μi,Si)=μ0+ϵ\sup(\mu_{i},S_{i})=\mu_{0}+\epsilon.

Assume the payoff function μ\mu lies in ∪i Fi\cup_{i}\,\mathcal{F}_{i}. The idea is that an algorithm needs to play arms in SiS_{i} for at least Ω(ϵ−2)\Omega(\epsilon^{-2}) rounds in order to determine whether μ∈Fi\mu\in\mathcal{F}_{i}, and each such step incurs ϵ\epsilon regret if μ∉Fi\mu\not\in\mathcal{F}_{i}. In our application, subsets S1 , … ,SkS_{1}\,,\ \ldots\ ,S_{k} correspond to children u1 , … ,uku_{1}\,,\ \ldots\ ,u_{k} of a given tree node in the ball-tree, and each Fi\mathcal{F}_{i} consists of payoff functions induced by the ends in the subtree rooted at uiu_{i}.

Consider the feasible MAB problem with 0-1 payoffs. Let F1,…,Fk\mathcal{F}_{1},\ldots,\mathcal{F}_{k} be an (ϵ,k)(\epsilon,k)-ensemble, where k≥2k\geq 2 and ϵ∈(0, 112)\epsilon\in(0,\,\tfrac{1}{12}). Then for any t≤132 k ϵ−2t\leq\tfrac{1}{32}\,k\,\epsilon^{-2} and any bandit algorithm there exist at least k/2k/2 distinct ii’s such that the regret of this algorithm on any payoff function from Fi\mathcal{F}_{i} is at least 160 ϵt\tfrac{1}{60}\,\epsilon t.

In Auer et al. 2002b, the authors analyzed a special case of an (ϵ,k)(\epsilon,k)-ensemble in which there are kk arms u1 , … ,uku_{1}\,,\ \ldots\ ,u_{k}, and each Fi\mathcal{F}_{i} consists of a single payoff function that assigns expected payoff 12+ϵ\tfrac{1}{2}+\epsilon to arm uiu_{i}, and 12\tfrac{1}{2} to all other arms.