Lecture 6

Learning with bandit feedback

The regret-minimization model (Definition L4.7) considered so far assumes that the learner receives enough information from the environment that she can compute her utility not only on the strategy she selected to play at each round of the interaction but also any counter-factual strategy that she could have played at that round. That is, we assume full-information feedback. This is a strong assumption, and in many cases, the decision-maker only receives partial feedback. In this lecture, we consider the case where the decision maker receives feedback only on the strategy they played. This is known as bandit feedback.

L6.1 Setup and general considerations

Like in our prior lectures, we will study linear settings, where our sequential decision-maker chooses a strategy \(\boldsymbol{x}^{(t)} \in \mathcal{X}\) in some strategy set satisfying \(\mathcal{X} \subseteq \mathbb{R}^{n}\). In the full-information setting that we have already studied, the feedback that our decision maker receives, at every round \(t\), is a utility function \(u^{(t)}: \boldsymbol{x} \mapsto \left\langle \boldsymbol{g}^{(t)},\boldsymbol{x} \right\rangle\), from which they can compute their realized utility, \(w^{(t)} \coloneqq \left\langle \boldsymbol{g}^{(t)},\boldsymbol{x}^{(t)} \right\rangle\), for the strategy they played as well as the counterfactual utility they would have received from any strategy they could have played. In the bandit setting, the decision-maker only receives as feedback their realized utility \(w^{(t)}\) as opposed to their complete utility function \(u^{(t)}\).

As a general principle, algorithms for the bandit setting are constructed from regret minimizers for the full-information setting. Indeed, the key idea is to construct an estimator \(\tilde{\boldsymbol{g}}^{(t)}\) of the (unobserved) utility gradient \(\boldsymbol{g}^{(t)}\), and feed that into a full-information regret minimizer. The estimator is constructed from the observed utility \(w^{(t)}\) and the chosen strategy \(\boldsymbol{x}^{(t)}\).

The utility function can still be picked adversarially by the environment. However, to get guarantees, it is necessary to reduce the power of the environment by letting the utility \(u^{(t)}\) only depend on \(\boldsymbol{x}^{(1)}, \dots , \boldsymbol{x}^{(t-1)}\) but not on \(\boldsymbol{x}^{(t)}\). In other words, the environment can pick the utility adaptively, but must decide the utility before the learner picks the strategy, and not after. This restriction still allows convergence to equilibria if bandit algorithms are used by players to iteratively update their strategies in games.

Typically, the construction of bandit algorithms follows the template shown in Figure L6.1.

ExplorationtermStrategysamplerFull-info.regr. minim.GradientEstimatorBandit regretminimizer𝑤(𝑡)𝒈̃(𝑡)𝒚(𝑡)∈𝒳︀𝒑(𝑡)∈𝒳︀𝝃(𝑡)∈𝒳︀𝒙(𝑡)∈𝒳︀(← for high-prob.regret bounds only)
Figure L6.1. General template for bandit learning algorithms. \(\mathcal{X}\) is the space of strategies of the learner. The output of the “strategy sampler” is a strategy from a restricted set of strategies. The name “strategy sampler” is generally a misnomer, but it is fitting in the widely-studied setting where \(\mathcal{X}=\Delta (A)\) for some finite set of actions \(A\). In this case, a common instantiation of the strategy sampler is to take as input a distribution \(\boldsymbol{p}^{(t)} \in \Delta (A)\) and sample an action \(a^{(t)} \sim \boldsymbol{p}^{(t)}\). In this case, \(\boldsymbol{x}^{(t)}\) would be a single-atom distribution with an atom at \(a^{(t)}\). But, in general, we allow for more general \(\mathcal{X}\)‘s and more general samplers.

Some loss-based algorithms obtain pseudoregret bounds without an explicit exploration mixture. High-probability guarantees require additional control of estimation errors; a uniform mixture alone does not provide that guarantee. We explain the difference next.

Stochastic regret guarantees.   Because online learning algorithms benefit from randomization, as is crucially the case in bandit settings, the regret of a bandit algorithm is a random variable. This adds a layer of complexity when approaching the analysis of bandit algorithms. As a rule of thumb, three “flavors” of guarantees are typically considered in the literature. We list them from the weakest (and easiest to obtain) to the strongest (and hardest to obtain):

To make sense of the measures with respect to which the expectations and probabilities are computed in the above definitions, consider a randomized algorithm for the learner that takes as input the history, \((\boldsymbol{x}^{(τ)},w^{(τ)})_{τ<t}\), observable to the learner so far and produces a strategy \(\boldsymbol{x}^{(t)}\) and, similarly, a randomized algorithm for the adversary that takes as input the history, \((\boldsymbol{x}^{(τ)},u^{(τ)})_{τ<t}\), observable to the adversary so far and chooses a utility function \(u^{(t)}\). Pitting the two algorithms against each other defines a probability measure with respect to which the above expectations and probabilities are defined.

Finally, notice that Pseudoregret and expected regret guarantees are different, since \(\operatorname*{max} \mathop{\mathbb{E}}\limits \le \mathop{\mathbb{E}}\limits \operatorname*{max}\), but the converse is not true in general. This means that bounding expected regret automatically bounds the pseudoregret but the opposite is not necessarily the case. In fact, bounds on the pseudoregret are not strong enough to conclude convergence to the set of equilibria, in general.

L6.2 Adversarial bandit learning in normal-form games

Let’s start from the case of normal-form games, in which our decision maker faces the choice of picking an action out of a finite set \(A\). The setting in this case is also known as adversarial multi-armed bandit problem. We have \(\mathcal{X} = \Delta (A)\).

Strategy sampler.   In this settings, most algorithms use the natural strategy sampler: given a distribution \(\boldsymbol{p}^{(t)} \in \Delta (A)\), the decision maker samples an action \(a^{(t)} \in A\) according to the probabilities in \(\boldsymbol{p}^{(t)}\). The vector \(\boldsymbol{x}^{(t)}\) is then set to the deterministic distribution \(\boldsymbol{e}_{a^{(t)}}\). Clearly, \(\mathop{\mathbb{E}}\limits_{t} [\boldsymbol{x}^{(t)}] = \boldsymbol{p}^{(t)}.\)

Gradient estimator.   For this setting, the standard gradient estimator is the importance sampling estimator. Given the utility scalar \(w^{(t)} \in [0, 1]\), the importance sampling estimator is defined as

\[\displaystyle \tilde{\boldsymbol{g}}^{\left(t\right)} \coloneqq \left(\frac{w^{\left(t\right)}}{p_{a^{\left(t\right)}}^{\left(t\right)}}\right) \boldsymbol{e}_{a^{\left(t\right)}} \in \mathbb{R}^{A}.\]

Theorem L6.1 .

Assume \(p_{a}^{(t)}>0\) for every action. Let \(w^{(t)} = \left\langle \boldsymbol{g}^{(t)},\boldsymbol{x}^{(t)} \right\rangle\) where \(\boldsymbol{g}^{(t)}\) is some unknown utility gradient. Then, the importance sampling estimator \(\tilde{\boldsymbol{g}}^{(t)}\) is unbiased, that is, \(\mathop{\mathbb{E}}\limits_{t} [\tilde{\boldsymbol{g}}^{(t)}] = \boldsymbol{g}^{(t)}.\)

Proof.

The result follows by direct calculation. The randomness is due to the sampling of the action \(a^{(t)}\). Each action \(a \in A\) is sampled with probability \(p_{a}^{(t)}\). Hence,

\[\displaystyle \mathop{\mathbb{E}}\limits_{t} \left[\tilde{\boldsymbol{g}}^{\left(t\right)}\right] = \sum_{a \in A} p_{a}^{\left(t\right)} \left(\frac{g_{a}^{\left(t\right)}}{p_{a}^{\left(t\right)}}\right) \boldsymbol{e}_{a} = \sum_{a \in A} p_{a}^{\left(t\right)} \left(\frac{\left\langle \boldsymbol{g}^{\left(t\right)},\boldsymbol{e}_{a} \right\rangle}{p_{a}^{\left(t\right)}}\right) \boldsymbol{e}_{a} = \sum_{a \in A} g_{a}^{\left(t\right)} \boldsymbol{e}_{a} = \boldsymbol{g}^{\left(t\right)}.\]

□

L6.2.1 The Exp3 algorithm

Exp3 (short for “exponential weights for exploration and exploitation”) adapts multiplicative weights (Section L5.1.4) to bandit feedback and was introduced by Auer, Cesa-Bianchi, Freund and Schapire [ACFS02[ACFS02] Auer, P., Cesa-Bianchi, N., Freund, Y., & Schapire, R. E. (2002). The nonstochastic multiarmed bandit problem. SIAM Journal on Computing, 32(1), 48–77.]. We use a variant that needs no explicit exploration mixture. Convert rewards \(g_{a}^{(t)} \in [0,1]\) into losses \(ℓ_{a}^{(t)}=1-g_{a}^{(t)}\). This changes neither realized regret nor pseudoregret.

Start with positive weights \(W_{1,a}=1\). At time \(t\), sample action \(a^{(t)}\) from \(p_{a}^{(t)}=\frac{W_{t,a}}{\sum_{b}} W_{t,b}\) and observe its loss. Set

\[\displaystyle \hat{\boldsymbol{ℓ}}^{\left(t\right)}=\frac{1-w^{\left(t\right)}}{p_{a^{\left(t\right)}}^{\left(t\right)}} \boldsymbol{e}_{a^{\left(t\right)}}, \quad W_{t+1,a}=W_{t,a} \operatorname{exp}\left(-η \hat{ℓ}_{a}^{\left(t\right)}\right).\]

Equivalently, the full-information utility learner receives \(-\hat{\boldsymbol{ℓ}}^{(t)}\).

Theorem L6.2 (Exp3) .

For \(K=|A|\ge 2\), this algorithm satisfies

\[\displaystyle \text{PseudoReg}^{\left(T\right)} \le \frac{\operatorname{log} K}{η} + η K \frac{T}{2}.\]
Taking \(η=\sqrt{\frac{2 \operatorname{log} K}{K T}}\) gives \(\text{PseudoReg}^{(T)} \le \sqrt{2K T \operatorname{log} K}\) against any nonanticipating adversary.

Proof Sketch.

Because the estimates are nonnegative, \(\operatorname{exp}(-z)\le 1-z+\frac{z^{2}}{2}\) applies for every \(z=η \hat{ℓ}_{a}^{(t)}\), even if an estimate is large. The exponential-weights potential bound against each fixed action \(a\) is

\[\displaystyle \sum_{t} \left\langle \boldsymbol{p}^{\left(t\right)},\hat{\boldsymbol{ℓ}}^{\left(t\right)} \right\rangle - \sum_{t} \hat{ℓ}_{a}^{\left(t\right)} \le \frac{\operatorname{log} K}{η} + \frac{η}{2} \sum_{t} \sum_{b} p_{b}^{\left(t\right)} \left(\hat{ℓ}_{b}^{\left(t\right)}\right)^{2}.\]

Conditional unbiasedness identifies the expected loss terms, while

\[\displaystyle \mathop{\mathbb{E}}\limits_{t}\left[\sum_{b} p_{b}^{\left(t\right)} \left(\hat{ℓ}_{b}^{\left(t\right)}\right)^{2}\right]=\sum_{b} \left(ℓ_{b}^{\left(t\right)}\right)^{2} \le K.\]
Take expectations and then maximize over the fixed comparator. This proves pseudoregret; it does not interchange a random hindsight maximum with expectation. □

L6.2.2 Tsallis entropy

It can be shown that, information theoretically, no bandit learning algorithm for a finite set of actions \(|A|\) can achieve better than \(\Omega (\sqrt{T |A|})\) expected regret in general. The regret guaranteed by the Exp3 algorithm is therefore optimal only up to a logarithmic factor. It remained open for a long time whether this logarithmic factor could be removed. A positive answer was given by Audibert and Bubeck [AB10[AB10] Audibert, J.-Y., & Bubeck, S. (2010). Regret bounds and minimax policies under partial monitoring. The Journal of Machine Learning Research, 11, 2785–2836.], who proposed the idea of replacing MWU (Section L5.1.4) with FTRL (Section L5.2.3) instantiated with the negative \((1/2)\)-Tsallis entropy regularizer

\[\displaystyle ψ\left(\boldsymbol{x}\right) = 2 - 2 \sum_{a \in A} \sqrt{x_{a}}.\]

Theorem L6.3 .

If FTRL with (1/2)-Tsallis entropy receives the estimated utilities \(-\hat{\boldsymbol{ℓ}}^{(t)}\) defined above, with learning rate \(η = \sqrt{1 / T}\), the resulting bandit algorithm guarantees pseudoregret

\[\displaystyle \text{PseudoReg}^{\left(T\right)} = O\left(\sqrt{T\left|A\right|}\right),\]
which is the optimal bound for bandit learning on finite probability distributions.

A simplified analysis can also be found in [ZS21[ZS21] Zimmert, J., & Seldin, Y. (2021). Tsallis-INF: An optimal algorithm for stochastic and adversarial bandits. Journal of Machine Learning Research, 22(28), 1–49.].

L6.2.3 The Exp3.P algorithm

Exp3.P uses both uniform exploration and an upper-confidence correction to reward estimates [ACFS02]. For \(K=|A|\ge 2\), let \(\boldsymbol{y}^{(t)}\) be normalized positive weights and sample from

\[\displaystyle \boldsymbol{p}^{\left(t\right)}=\left(1-\gamma \right)\boldsymbol{y}^{\left(t\right)}+\gamma \frac{\mathbf{1}}{K}.\]

With the reward estimator \(\tilde{\boldsymbol{g}}\) defined earlier, update the weights by

\[\displaystyle W_{t+1,a}=W_{t,a} \operatorname{exp}\left(η \left(\tilde{g}_{a}^{\left(t\right)} + \frac{\alpha}{p_{a}^{\left(t\right)} \sqrt{K T}}\right)\right).\]

The positive bonus accounts for uncertainty; uniform exploration bounds inverse sampling probabilities. This is a different estimator/update from the loss-form Exp3 above.

Theorem L6.4 (Exp3.P [ACFS02]) .

Initialize all weights equally. For horizon \(T\ge 1\) and \(\delta \in (0,1)\), choose

\[\displaystyle \gamma =\operatorname*{min}\left\{\frac{3}{5},2\sqrt{\frac{3K \operatorname{log} K}{5T}}\right\}, \quad η=\frac{\gamma}{3K}, \quad \alpha =2\sqrt{\operatorname{log}\left(K \frac{T}{\delta}\right)}.\]

Then, with probability at least \(1-\delta\),

\[\displaystyle \text{Reg}^{\left(T\right)} \le O\left(\sqrt{K T \operatorname{log}\left(K \frac{T}{\delta}\right)} + \operatorname{log}\left(K \frac{T}{\delta}\right)\right).\]

The confidence parameter enters the logarithm and the bonus. Adding exploration to an unbiased estimator, without this correction or another concentration-control mechanism, is not the Exp3.P algorithm.

L6.3 Adversarial bandit learning on general convex domains

Today, we know that bandit optimization is possible well past probability simplexes. In fact, we can construct bandit algorithms for any convex and compact domain \(\mathcal{X} \subseteq \mathbb{R}^{d}\). In particular, we mention the general general result by Abernethy, Hazan and Rakhlin [AHR08[AHR08] Abernethy, J. D., Hazan, E., & Rakhlin, A. (2008). Competing in the Dark: An Efficient Algorithm for Bandit Linear Optimization. COLT, 263–274.], who showed that the a bandit algorithm can be constructed starting from a full-information regret miminizer built using the FTRL algorithm with a self-concordant distance-generating function.

Bibliography for this lecture

[ACFS02]Auer, P., Cesa-Bianchi, N., Freund, Y., & Schapire, R. E. (2002). The nonstochastic multiarmed bandit problem. SIAM Journal on Computing, 32(1), 48–77.
[AB10]Audibert, J.-Y., & Bubeck, S. (2010). Regret bounds and minimax policies under partial monitoring. The Journal of Machine Learning Research, 11, 2785–2836.
[ZS21]Zimmert, J., & Seldin, Y. (2021). Tsallis-INF: An optimal algorithm for stochastic and adversarial bandits. Journal of Machine Learning Research, 22(28), 1–49.
[AHR08]Abernethy, J. D., Hazan, E., & Rakhlin, A. (2008). Competing in the Dark: An Efficient Algorithm for Bandit Linear Optimization. COLT, 263–274.