Marc Abeille

Alessandro Lazaric

Linear Thompson Sampling Revisited

We derive an alternative proof for the regret of Thompson sampling (TS) in the stochastic linear bandit setting. While we obtain a regret bound of order O(d 3/2 √ T ) as in previous results, the proof sheds new light on the functioning of the TS. We leverage on the structure of the problem to show how the regret is related to the sensitivity (i.e., the gradient) of the objective function and how selecting optimal arms associated to optimistic parameters does control it. Thus we show that TS can be seen as a generic randomized algorithm where the sampling distribution is designed to have a fixed probability of being optimistic, at the cost of an additional √ d regret factor compared to a UCB-like approach. Furthermore, we show that our proof can be readily applied to regularized linear optimization and generalized linear model problems.

Introduction

The multi-armed bandit (MAB) framework [START_REF] Bubeck | Regret analysis of stochastic and nonstochastic multi-armed bandit problems[END_REF] formalizes in a synthetic way the exploration-exploitation trade-off in sequential decision-making, where a learner needs to balance between exploiting current estimates to select actions maximizing the reward and exploring actions to improve the accuracy of its estimates. Two popular approaches have been developed to trade off exploration and exploitation: the optimism in face of uncertainty (OFU) principle (see e.g., [START_REF] Agrawal | Sample mean based index policies with o(log n) regret for the multi-armed bandit problem[END_REF], [START_REF] Auer | Finitetime analysis of the multiarmed bandit problem[END_REF]), which consists in choosing the optimal action according to upper-confidence bounds on the true values, and the Thompson Sampling (TS) strategy, which randomizes actions on the basis of their uncertainty. In this paper we mostly focus on this second approach.

TS is an general heuristic for decision-making problems characterized by some unknown parameters. The first version of this Bayesian heuristic dates back to Thompson [1933], but it has been rediscovered several times and successfully applied to address the explorationexploitation trade-off in a wide range of problems (see e.g., [START_REF] Strens | A bayesian framework for reinforcement learning[END_REF][START_REF] Chapelle | An empirical evaluation of thompson sampling[END_REF][START_REF] Russo | Learning to optimize via posterior sampling[END_REF]. The basic idea is to assume a prior distribution over the unknown parameters and to use the Bayes rule to update it using the samples obtained over time. More precisely, at each time step the learner gathers information by executing the optimal action corresponding to a random parameter sampled from the current posterior distribution.

Related literature. While the Bayesian perspective of TS provides a convenient tool to derive the sampling distribution, the algorithm is still valid under a frequentist approach, i.e., when the true parameter is not a random variable but a fixed parameter. As a result, the regret of TS (i.e., the difference between the rewards collected by the algorithm and the optimal action) has been analyzed both in the Bayesian and in the frequentist setting. In MAB, TS has been shown to achieve optimal performance in the frequentist setting (see e.g., [START_REF] Benedict C May | Optimistic bayesian sampling in contextual-bandit problems[END_REF], Agrawal and Goyal 2012b[START_REF] Kaufmann | Thompson sampling: An asymptotically optimal finitetime analysis[END_REF][START_REF] Korda | Thompson sampling for 1-dimensional exponential family bandits[END_REF]) and the dependency of the regret on its prior has been studied in the Bayesian case by [START_REF] Bubeck | Prior-free and priordependent regret bounds for thompson sampling[END_REF]. In more general cases, such as the (generalized) linear bandit and reinforcement learning settings, most of the literature focused on the analysis of the Bayesian regret (see e.g., [START_REF] Russo | Learning to optimize via posterior sampling[END_REF], [START_REF] Osband | Bootstrapped thompson sampling and deep exploration[END_REF], [START_REF] Russo | An informationtheoretic analysis of thompson sampling[END_REF]). Notable exceptions are the analysis of TS in finite MDPs by [START_REF] Gopalan | Thompson sampling for learning parameterized markov decision processes[END_REF] and the study in linear contextual bandit (LB) by Agrawal and Goyal [2012b]. In this paper, we focus on LB and draw novel insights on the functioning of TS in this setting. In LB the value of an arm is obtained as the inner product between an arm feature vector x and an unknown global parameter θ . As opposed to the OFU approach, the main technical difficulty in analyzing TS lies in controlling the deviation in performance due to the randomness of the algorithm. Agrawal and Goyal [2012b] leverage on the MAB line of proof (as in Agrawal and Goyal [2012a]) classifying arms as saturated and unsaturated depending on wether their standard deviation is smaller or bigger than their gap to the optimal arm.1 While for unsaturated arms the regret is related to their standard deviation that decreases over time, they prove that TS has a small (but constant) probability to select saturated arms and thus it achieves a regret O d 3/2 √ T .

Contributions. The major contributions of this paper are: 1) Following the intuition of Agrawal and Goyal [2012b], we show that the TS does not need to sample from an actual Bayesian posterior distribution and that any distribution satisfying suitable concentration and anti-concentration properties guarantees a small regret. In particular, we show that the distribution should over-sample w.r.t. the standard least-squares confidence ellipsoid by a factor √ d to guarantee a constant probability of being optimistic.

2) We provide an alternative proof of TS achieving the same result as Agrawal and Goyal [2012b]. One of our major finding is that, leveraging on the properties of support functions from convex geometry, we are able to prove that the regret is related to the gradient of the objective function, that is ultimately controlled by the norm of the optimal arms associated to any optimistic parameter θ. This provides a novel insight on the fact that whenever an optimistic parameter θ t is chosen, not only its instantaneous regret is small but the corresponding optimal arm x t = arg max x x T θ t represents a useful exploration step that improves the accuracy of the estimation of θ over dimensions which are relevant to reduce regret in any subsequent non-optimistic step. This approach allows us to avoid the introduction of saturated/unsaturated arms and it illustrates why any TS-like algorithm (not necessarily Bayesian) with a constant probability of being optimistic has a bounded regret. 3) Finally, we show how our proof can be easily adapted to regularized linear optimization (with arbitrary penalty) and to the generalized linear model (GLM), for which we derive the first frequentist regret bound for TS, which was first suggested by Agrawal and Goyal [2012b] as a venue to explore.

Preliminaries

The setting. We consider the stochastic linear bandit model. Let X ⊂ R d be an arbitrary (finite or infinite) set of arms. When an arm x ∈ X is pulled, a reward is generated as r(x) = x T θ + ξ, where θ ∈ R d is a fixed but unknown parameter and ξ is a zero-mean noise. An arm x ∈ X is evaluated according to its expected reward x T θ and for any θ ∈ R d we denote the optimal arm and its value by

x (θ) = arg max x∈X x T θ, J(θ) = sup x∈X x T θ. (1)
Then x = x (θ ) is the optimal arm for θ and J(θ ) is its optimal value. At each step t, the learner selects an arm x t ∈ X based on the past observations (and possibly additional randomization), it observes the reward r t+1 = x T t θ + ξ t+1 , and it suffers a regret equal to the difference in expected reward between the optimal arm x and the arm x t . All the information observed up to time t is encoded in the filtration

F x t = (F 1 , σ(x 1 , r 2 , . . . , r t , x t ))
, where F 1 contains any prior knowledge (e.g., the bound S). The objective of the learner is to minimize the cumulative regret up to step T , i.e., R(T ) = T t=1 x ,T θx T t θ . We introduce general assumptions on the structure of the problem and on the noise ξ t+1 .

Assumption 1 (Arm set). The arm set X is a bounded closed (and hence compact) subset of R d such that

x ≤ X for all x ∈ X . We also assume X = 1.

Assumption 2 (Bandit parameter). There exists S ∈ R + such that θ ≤ S and S is known. Assumption 3 (Noise). The noise process {ξ t } t is a martingale difference sequence given F x t and it is conditionally R-subgaussian for some constant R ≥ 0,

∀t ≥ 1, E [ξ t+1 |F x t ] = 0, ∀α ∈ R, E e αξt+1 | F x t ≤ exp α 2 R 2 /2 .
(2)

Technical tools. Let (x 1 , . . . , x t ) ∈ X t be a sequence of arms and (r 2 , . . . , r t+1 ) be the corresponding rewards, then θ can be estimated by regularized least-squares (RLS). For any regularization parameter λ ∈ R + , the design matrix and the RLS estimate are defined as

V t = λI + t-1 s=1 x s x T s , θ t = V -1 t t-1 s=1 x s r s+1 . (3)
For any positive semi-definite matrix A, the weighted 2-norm . A is defined by x 2 A = x T Ax. We recall an important concentration inequality for RLS estimates.

Proposition 1 (Thm. 2 in Abbasi-Yadkori et al. [2011a]). For any δ ∈ (0, 1), under Asm. 1,2, and 3, for any F x t -adapted sequence (x 1 , . . . , x t ), the RLS estimator θ t is such that for any fixed t ≥ 1,

θ t -θ Vt ≤ β t (δ), ∀x ∈ R d , |x T ( θ t -θ )| ≤ x V -1 t β t (δ), (4)
w.p. 1δ (w.r.t. the noise {ξ t } t and any source of randomization in the choice of the arms), where

β t (δ) = R 2 log (λ + t) d/2 λ -d/2 δ + √ λS. (5)
At step t, we define the ellipsoid by V t and radius β t (δ ), where δ = δ/4T .From Eq. 4 we have that θ ∈ E RLS t with high probability. Finally, we report a standard result of RLS that, together with Prop. 1, shows that the prediction error on the x t s used to construct the estimator θ t is cumulatively small. Proposition 2. Let λ ≥ 1, for any arbitrary sequence (x 1 , x 2 , . . . , x t ) ∈ X t let V t+1 be the corresponding design matrix (Eq. 3), then

E RLS t = θ ∈ R d | ||θ- θ t || Vt ≤ β t (δ ) centered in θ t with orientation defined Input: θ1, V1 = λI, δ, T 1: Set δ = δ/(4T ) 2: for t = {1, . . . , T } do 3: Sample ηt ∼ D TS 4: Compute parameter θt = θt + βt(δ )V -1/2 t
t s=1 x s 2 V -1 s ≤ 2 log det(V t+1 ) det(λI) ≤ 2d log 1 + t λ . (6)
This result plays a central role in most of the proofs for linear bandit, since the regret is usually related to ||x s || V -1 s and Prop. 2 is used to bound its cumulative sum. While Agrawal and Goyal [2012b] achieve this by dividing arms in saturated and unsaturated, we follow a different path that leverages on the core features of the problem (structure of J(θ)) and of TS (probability of being optimistic).

3 Linear Thompson Sampling Agrawal and Goyal [2012b] define TS for linear bandit as a Bayesian algorithm where a Gaussian prior over θ is updated according to the observed rewards, a random sample is drawn from the posterior, and the corresponding optimal arm is selected at each step.

As hinted by Agrawal and Goyal [2012b], we show that TS can be defined as a generic randomized algorithm constructed on the RLS-estimate rather than an algorithm sampling from a Bayesian posterior (see Fig. 1). At any step t, given RLS-estimate θ t and the design matrix V t , TS samples a perturbed parameter θ t as

θ t = θ t + β t (δ )V -1/2 t η t , (7)
where η t is a random sample drawn i.i.d. from a suitable multivariate distribution D TS , which does not need to be associated with an actual posterior over θ . Then the optimal arm x t = x ( θ t ) is chosen, a reward r t+1 is observed and V t and θ t are updated according to Eq. 3. Notice that the resulting distribution on θ t is obtained rotating η t by the design matrix V t and scaling it by β t (δ). The computational complexity of TS is determined by the linear optimization problem solved when computing x ( θ t ) and by the sampling process from D TS . This is in contrast with OFUL [Abbasi-Yadkori et al., 2011a], which requires solving a bilinear optimization problem (i.e., arg max θ max x x T θ).

The key aspect to ensure small regret is that the perturbation η t is distributed so that TS explores enough but not too much. This translates into the following conditions on D TS .

Definition 1. D TS is a multivariate distribution on R d absolutely continuous with respect to the Lebesgue measure which satisfies the following properties:

1. (anti-concentration) there exists a strictly positive probability p such that for any u ∈ R d with u = 1,

P η∼D TS u T η ≥ 1 ≥ p,
2. (concentration) there exists c, c positive constants such that ∀δ ∈ (0, 1)

P η∼D TS η ≤ cd log c d δ ≥ 1 -δ.
Once interpreted in the construction of θ t , the definition of D TS basically requires TS to explore far enough from θ t (anti-concentration) but not too much (concentration). This implies that TS performs "useful" exploration with enough frequency (notably it performs optimistic steps), but without selecting arms with too large regret. Let γ t (δ) = β t (δ ) cd log(c d/δ), then we introduce the high-probability ellipsoid

E TS t = {θ ∈ R d | θ -θ t Vt ≤ γ t (δ )}.
The difference between E RLS t and E TS t lies in the additional factor √ d in the definition of γ t (δ) and it is crucial for both concentration and anti-concentration to hold at the same time. In Sect. 5 we prove that any distribution satisfying the conditions in Def. 1 introduces the right amount of randomness to achieve the desired regret without actually satisfying any Bayesian assumption. Def. 1 includes the Gaussian prior used by Agrawal and Goyal [2012b], but also other types of distributions such as the uniform on the unit ball B d (0, √ d) or distributions concentrated on the boundary of E TS t (refer to App. A for exact values of c, c , and p for uniform and Gaussian distributions).

Sketch of the proof

In this section we report a sketch of the proof providing a geometric intuition on the behavior of TS and how its actions (i.e., the sampled θ t and the corresponding x t ) influence the regret. For the sake of illustration, we consider the unit ball X = { x ≤ 1}, such that the optimal arm is just the projection of θ on the ball (x (θ) = θ/ θ ), and the optimal value is J(θ) = θ T θ/ θ = θ . We start by decomposing the regret using the definition of J(θ) as

R(T ) = T t=1 x ,T θ -x T t θ t + x T t θ t -x T t θ = T t=1 J(θ ) -J( θ t ) R TS (T ) + T t=1 x T t θ t -x T t θ R RLS (T )
,

where R TS depends on the randomization of TS and R RLS mostly depends on the properties of RLS.

Bounding R RLS (T ). The decomposition R RLS (T ) = T t=1 x T t θ t -x T t θ + T t=1 x T t θ t -x T t θ t ,
shows that both RLS estimate θ t and TS parameter θ t should concentrate appropriately. Since at each step t, θ t is sampled from D TS , the second term is kept under control by construction, while the first sum deals with the prediction error of RLS. As opposed to R TS , this error is not related to the exploration scheme and it is small for any sequence of arms. Intuitively, this is due to the fact that the RLS estimate is the minimizer of the regularized cumulative squared error θ T +1 = arg min θ T t=1 |r t+1x T t θ| 2 + λ θ 2 , so that x T t θ T +1 is an accurate prediction on the arms observed so far. The RLS minimizes the error in "hindsight" (i.e., after all rewards up to T ) and therefore it also controls the online error |r t+1x T t θt+1 | 2 , since by induction

T t=1 |r t+1 -x T t θ T +1 | 2 + λ θ T +1 2 ≥ T t=1 |r t+1 -x T t θ t+1 | 2 + λ θ 1 2 .
Having a small online error also implies a small prediction error |r t+1x T t θt | 2 . In fact, using a recursive version of Eq. 3, we have

θt+1 = θt + V -1 t x t (1 + x t 2 V -1 t ) -1 (r +1 -x T t θt ), which, together with x t 2 V -1 t ≤ 1/λ, leads to |r t+1 -x T t θt+1 | ≥ λ 1+λ |r t+1 -x T t θt |.
Since the cumulative prediction error is small, then the associated regret

T t=1 |x T t θ t -x T t θ
| is also small. This result can be seen as an intrinsic on-policy error guarantee of RLS. Nonetheless, notice that while RLS minimizes the prediction error for any sequence of arms, this does not imply the consistency of the estimator. For instance, when the same arm x is repeatedly played, the unknown parameter θ is wellestimated in the direction of x (thus making R RLS (T ) small) but it is poorly estimated in any other directions. This shows the need for a careful exploration strategy to recover consistency and hence a sub-linear regret.

Bounding R TS (T ).

We denote by

R TS t = J(θ ) -J( θ t ) each term in R TS (T ).
For optimistic algorithms this term is bounded by 0 at any step since w.h.p. J( θ t ) ≥ J(θ * ) by construction. In the Bayesian regret analysis of TS, this term is equal to 0 by assumption that θ * is drawn from the same prior as θ t . On the other hand, in the frequentist analysis, we have to control the deviations caused by the random sampling of θ t . This is achieved by showing that the arms selected by TS provide "useful" information about θ and contribute to keep the regret small. We follow three steps: 1) we show that the regret is related to the sensitivity of J w.r.t. the errors in estimating θ and we bound the regret with the gradient of J(θ) at any optimistic θ; 2) we show how the gradient in a point θ is intrinsically related to its corresponding optimal arm x (θ); 3) since we prove that TS is frequently optimistic, then we can finally link x (θ) to x t = x ( θ t ) and Prop. 2 allows us to finally bound the overall regret.

per-step regret

E TS t,2 E TS t,1 θ O X Figure 3: While E TS t,1 and E TS t,2 have an equivalent accurate estimation of θ , E TS t,1 has smaller regret than E TS t,2 .
Step 1 (regret and sensitivity of J). We first show why the exploration of TS should be well adapted to J(θ).

Using the definition of J(θ) = θ we have

R TS t = J(θ )-J( θ t ) = θ -θ t ≤ θ -θ t ≤ θ -θ t Vt λ min,t ,
where λ min,t is the smallest eigenvalue of V t . This bound shows that it is sufficient to estimate θ accurately over all its components (i.e., λ min,t tends to infinity) to obtain a no-regret algorithm. Nonetheless, the desired regret bound of O( √ T ) is obtained only if λ min,t increases as O(t). While this could be achieved by a fully explorative algorithm (e.g., a round robin over the canonic vectors e i reduces the ellipsoid E TS t to a ball of radius λ min,t ), it would severely increase the second term of R RLS (T ) and cause an overall linear regret 2 . Fortunately, inspecting the definition of R TS t reveals that not all components of θ must be equally well estimated. In fact, we have w.h.p. that

R TS t ≤ sup θ∈E RLS t sup θ ∈E TS t J(θ) -J(θ ) .
This shows that R TS t is determined by the diameter of ellipsoid E TS t w.r.t. J, which suggests that the estimation of θ should be more accurate on the dimensions on which J is more sensitive. In the case of X unit ball, the most sensitive direction of J is θ / θ itself and Fig. 3 illustrates two opposite cases where the accuracy in the estimation of θ is the same (i.e., V t has the same eigenvalues) but the regret may be very different. Let Θ opt = {θ : J(θ) ≥ J(θ )} be the set of optimistic parameters. In our example J(θ) = θ is convex thus we can make explicit the dependency of the regret on the sensitivity of J through its gradient evaluated at any θ ∈ Θ opt as (see Prop. 3 for the general case)

R TS t ≤ sup θ ∈E TS t J(θ) -J(θ ) ≤ sup θ ∈E TS t ∇J(θ) T (θ -θ ),
2 This happens because xt would be optimal w.r.t. a θt, which is not in the ellipsoid

E RLS t .
which shows that the regret of non-optimistic θ t is bounded by the gradient of J(θ) at any optimistic θ and its distance to any other point in the TS ellipsoid.

Step 2 (sensitivity of J and optimal arm). According to Prop. 1, the difference θθ in the previous inequality is well controlled whenever θ belongs to the ellipsoid, while the first term cannot be immediately controlled by the algorithm. Nonetheless, we notice that since J(θ) = θ , then ∇J(θ) = θ/ θ = x (θ) (see Lem. 2 for the general case). This shows how selecting the optimal arm associated to an optimistic θ is equivalent to controlling the gradient of J, which results in

R TS t ≤ sup θ ∈E TS t x (θ) T (θ -θ ).
From Prop. 2, we could conclude that the regret would be cumulatively small if x (θ) corresponded to the arms chosen by the TS (x t = x ( θ t )). As a result, we need a θ 1) that is optimistic (i.e., θ ∈ Θ opt ), 2) it belongs or is close to the ellipsoid E TS t and 3) it is used to select an arm x t . The first two requirements are at the core of the choice of the TS distribution in Def. 1 where the anticoncentration property guarantees enough probability to be optimistic, while the concentration property implies that θs are within a small ellipsoid. Let τ < t be any step when TS selects θ τ ∈ Θ opt with corresponding arm x τ = x ( θ τ ), then we have (see an illustration of this bound in Fig. 2 in the 1-d case)

R TS t ≤ sup θ ∈E TS t x T τ ( θ τ -θ ) ≤ x τ V -1 τ sup θ ∈E TS t θ τ -θ Vτ .
Introducing θ and using the fact that the design matrices forms a non-decreasing sequence (e.g. V τ ≤ V t ), we decompose

sup θ ∈E TS t θ τ -θ Vτ ≤ θ τ -θ Vτ + sup θ ∈E TS t θ -θ Vτ ≤ θ τ -θ Vτ + sup θ ∈E TS t θ -θ Vt
Since by Prop. 1 θ is contained in all confidence ellipsoids with high probability, then

R TS t ≤ β τ (δ ) + γ τ (δ ) + β t (δ ) + γ t (δ ) x τ V -1 τ ≤ 2β T (δ ) + 2γ T (δ ) x τ V -1 τ .
Let K be the number of times θ t ∈ Θ opt , t k the corresponding steps, and ν k = t kt k-1 , then the final regret can be written as

R TS (T ) ≤ 2 β T (δ ) + γ T (δ ) K k=1 ν k x t k V -1 t k
.

Step 3 (optimism). This bound shows the importance that TS is optimistic with high frequency. In fact, whenever θ t is in Θ opt , not only the corresponding instantaneous regret R TS t is upper-bounded by 0, but the exploration performed by playing arm x ( θ t ) has also a positive impact in controlling the regret for any subsequent non-optimistic step. Consider the extreme case when TS is never optimistic, then K = 1, ν 1 = T and R TS (T ) = O(T ). On the other hand, if TS is optimistic with a constant frequency, then we can easily show that R TS (T ) is bounded by O( √ T ). Consider the case where an optimistic θ is chosen with probability p. Since E[ν k ] = 1/p, we can prove that w.h.p.

R TS (T ) ≤ O(1/p √ T ) by Cauchy-Schwarz and Prop. 2 applied to K k=1 x t k 2 V -1 t k
, where K ≈ T . Unfortunately, sampling θ t from the RLS ellipsoid E RLS t may have a very small probability of being optimistic (see e.g., Fig. 2, where sampling uniformly in E RLS t has zero probability to return a θ t ∈ Θ opt ). For this reason, TS is required to draw θ t from a distribution over-sampling by a factor √ d w.r.t. E RLS t as in the definition of D TS . This guarantees a fixed probability p of being optimistic (see Lem. 3) and the final desired regret.

Formal Proof

In this section we report the main steps of the regret analysis, while we postpone technical lemmas to the supplementary material. We prove the following result.

Theorem 1. Under assumptions 1,2,3, the regret of TS is bounded w.p. 1δ as (δ

= δ 4T ) R(T ) ≤ β T (δ ) + γ T (δ )(1 + 4/p) 2T d log 1 + T λ + 4γ T (δ ) p 8T λ log 4 δ . (8)
As anticipated in introduction, this bound is of order O(d 3/2 √ T ) and it entirely matches the result of Agrawal and Goyal [2012b]. The analysis of the regret requires extra care in the definition of the filtrations. While in analyzing R RLS we consider all the knowledge up to step t (i.e., including the sampled parameter θ t ), in R TS we need to study the randomness of θ t conditional on all the information before sampling η t . We introduce an additional filtration besides F x t . Definition 2. We define the filtration F t as the accumulated information up to time t before the sampling procedure, i.e., F t = (F 1 , σ(x 1 , r 2 , x 2 , . . . , x t-1 , r t-1 )).

Notice that θ t and V -1 t are both F t and F x t adapted, while θ t is a random variable w.r.t. F t and it is fixed when considering F x t . Hence we have

F 1 ⊂ F 2 ⊂ F x 2 ⊂ F 3 ⊂ F x
3 , . . . . We are now ready to introduce the high-probability events we use in the rest of the proof. Definition 3. Let δ ∈ (0, 1) and δ = δ/(4T ) and t ∈ [1, T ]. We define E t as the event where the RLS estimate concentrates around θ for all steps s ≤ t, i.e., E t = ∀s ≤ t, θ sθ Vs ≤ β s (δ ) . We also define E t as the event where the sampled parameter θ s concentrates around θ s for all steps s ≤ t, i.e., E t = ∀s ≤ t, θ sθ s Vs ≤ γ s (δ ) .

Then we have that

E := E T ⊂ • • • ⊂ E 1 , E := E T ⊂ • • • ⊂ E 1 and we use E t = E t ∩ E t and E = E ∩ E. Lemma 1. Under Asm. 2, 3 we have P( E ∩ E) ≥ 1-δ 2 .
Conditioned on F t and event E t , we have θ ∈ E RLS t , while on event E t we have θ t ∈ E TS t , then we directly bound the regret as

R(T ) ≤ T t=1 J(θ )-J( θ t ) 1{E t }+ T t=1 x T t θ t -x T t θ 1{E t } ≤ T t=1 R TS t 1{E t }+ T t=1 R RLS t 1{E t }, w.p. 1 -δ/2.
In the interest of space we only report the formal proof to bound R TS t , while the bound on R RLS (T ) and the overall regret is postponed to App. D.

Similar to the sketch in Sect. 4, the proof follows three steps: 1) we use the convexity of J to upper-bound the regret by its expectation conditioned on being optimistic and to relate it to the gradient of J, 2) we relate the gradient of J to the arms chosen by TS over time, 3) we show that despite the randomization, TS has a constant probability of being optimistic.

Step 1 (Regret and gradient of J(θ)). On event E t , θ t belongs to E TS t and thus

R TS t 1{E t } ≤ J(θ ) -inf θ∈E TS t J(θ) 1{ E t }.
Recalling that Θ opt is the set of all optimistic θs, we can bound the previous expression by the expectation over any random choice of θ in Θ opt t := Θ opt ∩ E TS t where we restrict the optimistic set to the high-probability sampling ellipsoid, that is

R TS t ≤ E J( θ) -inf θ∈E TS t J(θ) 1{ E t } F t , θ ∈ Θ opt t , where θ = θ t + β t (δ )V -1/2 t
η with η ∼ D TS is the TS sampling distribution. We now rely on the following characterization of J(θ) (see App. C).

Proposition 3. For any set of arm X satisfying Asm. 1, J(θ) = sup x x T θ has the following properties: 1) J is real-valued as the supremum is attained in X , 2) J is convex on R d , 3) J is continuous with continuous first derivative except for a zero-measure set w.r.t. the Lebesgue's measure.

These properties follow from the fact that J is the support function of X and it shows that J is convex for any arm set X . As a result, we can directly relate R TS t to the gradient of J as

R TS t ≤ E sup θ∈E TS t ∇J( θ) T ( θ -θ)1{ E t } F t , θ ∈ Θ opt t ≤ E ∇J( θ) V -1 t sup θ∈E TS t θ-θ Vt F t , θ ∈ Θ opt t , E t P( E t ) ≤ 2γ t (δ )E ∇J( θ) V -1 t F t , θ ∈ Θ opt t , E t P( E t )
where we use Cauchy-Schwarz, we "push" the event E t into the conditioning and we use the fact that θ ∈ E TS t .

Step 2 (From gradient of J(θ) to optimal arm x (θ)). In the sketch of the proof there was a direct relationship between ∇J(θ) and the optimal arm corresponding to θ by direct construction. In the next lemma, we show that this connection is true for any arm set X (proof in App. C). Lemma 2. Under Asm. 1, for any θ ∈ R d , we have ∇J(θ) = x (θ) except for a zero-measure set w.r.t. the Lebesgue's measure.

This property strongly connects the exploration of TS to the actual regret. In fact, together with Prop. 2, it implies that selecting the optimal arm associated with any optimistic θ is equivalent to reducing the gradient of J and ultimately the regret R TS t . This motivates the next step where we show that since TS is often optimistic, then the arm x t = x ( θ t ) contributes to the reduction of the regret.

Step 3 (Optimism). The optimism of TS is a direct consequence of the convexity of J and the fact that the distribution of η is oversampling by a factor √ d w.r.t. the ellipsoid

E RLS t (proof in App. D). Lemma 3. Let Θ opt t := {θ ∈ R d |J(θ) ≥ J(θ )} ∩ E TS t be the set of optimistic parameters, θ t = θ t + β t (δ )V -1/2 t η with η ∼ D TS , then ∀t ≥ 1, P θ t ∈ Θ opt t |F t , E t ≥ p/2.
Let f ( θ t ) be an arbitrary non-negative function of θ t , then we can write the full expectation as

E[f ( θ t )|F t , E t ] ≥ E f ( θ t )| θ t ∈ Θ opt t , F t , E t P θ t ∈ Θ opt t ≥ E f ( θ t )| θ t ∈ Θ opt t , F t , E t p/2. Setting f ( θ) = 2γ t (δ ) x ( θ) V -1 t
and reintegrating

E t , we have R TS t ≤ 4γ t (δ )/p E x ( θ) V -1
t 1{ E t }|F t where 2/p can be interpreted as the expected time between any two optimistic samples. Finally, we can use Azuma's inequality to obtain the final bound with probability at least

1 -δ/2 R TS (T ) ≤ 4γ T (δ ) p T t=1 x t V -1 t + 8T λ log 4 δ , E RLS t θ t p p θ t θ * E TS t O X x t = x ( θ t ) Θ opt Θ grad (α)
x where x t is the optimal arm x ( θ t ) selected by TS. The proof is concluded using Cauchy-Schwarz and Prop. 2 to bound R TS (T ) and Prop. 1 to bound R RLS (T ).

Discussion

We developed an alternative proof for TS in LB with novel insights on the core elements of the algorithm (optimism) and the structure of the problem (support function J(θ)). There are a number of possible applications of our results and future directions of investigation.

Regularized linear optimization. Our proof holds for any arm set X and the corresponding constrained optimization problem max x∈X x T θ . Similarly, we can apply it to any regularized linear optimization problem max x∈R d f µ,c (x; θ), with f µ,c (x; θ) = x T θ + µc(x), where µ is a constant and c(x) is an arbitrary penalty function of x (e.g., norm-regularization). While there always exists a set of of constraints (corresponding to a set of arms X c,µ,θ ) such that the solution to the constrained and regularized problems coincide, such mapping is often unknown (e.g., c(x) = x 1 ) and thus TS cannot be run on X c,µ,θ but we need to directly deal with the regularized problem (i.e., sampling θ t and pulling arm x t = arg max x f µ,c (x; θ t )). In this case, it can be seen that the three main steps of our proof still hold. In fact (see App. G), 1) J(θ) is convex, 2) the gradient of J(θ) corresponds to the optimal arm x * (θ), 3) Lemma 3 holds unchanged since it relies on the convexity of J(θ) and the TS distribution D TS is the same. As a result, the regret bound follows. On the other hand, the original proof by Agrawal and Goyal [2012b] could be less readily applied to this case. First notice that the mapping from µ and c(x) to the constrained set X c,µ,θ requires the unknown parameter θ . This means that if we pass from the regularized problem to the constrained problem at each time step t, we would be working on a set X c,µ, θt which keeps changing over time. While Agrawal and Goyal [2012b] study the contextual bandit problem where X t changes arbitrarily over time, in this case X t would change in response to θ t itself (i.e., it would not available in advance) and the analysis would bound the per-step regret r t = max x∈X c,µ, θ t x T θx T t θ, which does not correspond to the desired regret on f µ,c (the true optimal arm x (θ ) may not even be in X c,µ, θt ). Alternatively, we need to formulate a suitable definition of saturated and unsaturated arms for f µ,c (x; θ), which does not seem trivial and it may require developing a more ad-hoc analysis.

Other extensions. Another interesting setting to study is stochastic combinatorial optimization with semi-bandit feedback, where the arm set is the hypercube and each component of the linear combination x T θ is observed. While [START_REF] Wen | Efficient learning in large-scale combinatorial semi-bandits[END_REF] derived a frequentist regret bound for a UCB-like strategy, only a Bayesian regret analysis for TS is available. Exploiting the fact that combinatorial optimization is a special case of linear optimization, our analysis could be adapted to derive frequentist regret bounds. In Sect. F we show that we can deal with more complex scenarios and we derive the first frequentist regret bound for TS in generalized linear models (GLM). Moreover, we can generalize our proof to the other convex optimization problems max x∈X f (x, θ), with linear observations (i.e., y = x T θ + ξ). If f (x, θ) is convex in θ, then J(θ) is convex as well, thus enabling the possibility to apply our line of proof. More precisely, the gradient of J to the arms played by TS should be related (step 2, Lem. 2) and the on-policy prediction error R RLS measured w.r.t. f should be bounded (Prop. 1). Whenever these properties are satisfied, the regret result follows. Notice that while the original proof by Agrawal and Goyal [2012b] may be extended to cover some of these problems, its requirements are slightly stronger. In fact, the definition of saturated and unsaturated arms relies on the fact that f (x, θ n ) concentrates to f (x, θ) for any x, while in our case, we only need to bound R RLS , which corresponds to an on-policy error, where prediction errors are measured on the specific arms selected by the algorithm. While this advantage may appear abstract, let consider the reinforcement learning case, where f (x, θ) is the value function of a policy x in an environment θ. In this case, f (x, θ ) may actually be unbounded for some x (i.e., the policy x does not control the system) and the definition of saturated/unsaturated arms could not be easily adjusted. This suggests that our proof could enable covering special RL cases as well. Finally, we remark that defining TS as a randomized algorithm and using convex geometry arguments in its analysis bears a strong resemblance with follow-the-pertubedleader algorithm and its regret analysis in adversarial linear bandit [START_REF] Abernethy | Fighting bandits with a new kind of smoothness[END_REF], suggesting that the two approaches may be strongly related.

About optimism and oversampling. As illustrated in Sect. 4, in the current proof optimistic steps allows to bound the regret of non-optimistic steps. Nonetheless, it can be shown that some non-optimistic steps (even very pessimistic!) may indeed be as "informative" as optimistic steps and allow reducing the regret as well. Let consider a minor change in the line of proof, anticipating the use of the convexity of J, i.e.,

R TS t ≤ sup θ∈E TS t ∇J(θ ) T (θ -θ)1{E t } ≤ ∇J(θ ) V -1 t 2γ t (δ )1{E t }.
If we sample a θ such that the gradient at it ∇J( θ) (i.e., which coincides with the corresponding optimal action x ( θ)) has the same V -1 t -norm as ∇J(θ ), then we could apply the same reasoning as in the original sketch of the proof and bound the regret of any subsequent step. More formally, we can define the set

Θ grad t = {θ : ∇J(θ) V -1 t ≥ ∇J(θ ) V -1 t
} of parameters that have larger gradient than θ 's. Similar to Θ opt , if the probability of sampling θ in Θ grad t is lower-bounded by a constant p , then the proof can be reproduced with exactly the same arguments and result. Even further, we could relax the requirement and define

Θ grad t (α) = {θ : ∇J(θ) V -1 t ≥ α ∇J(θ ) V -1 t }, with α < 1,
which would allow even a bigger probability at the cost of an extra constant factor α in the final regret. As illustrated in Fig. 4, in the case X = R d , Θ grad t (α) corresponds to a cone whose overlap with E TS may actually be even larger than for Θ opt . This illustration shows that the set of useful explorative actions does not necessarily coincide with the set of optimistic parameters and that many more parameters in E TS may contribute to reduce the regret. This may explain the empirical success of TS and it may suggest that the oversampling by a factor √ d to ensure optimism may be a too strong requirement. Finally, we remark that a similar optimistic argument is employed by [START_REF] Agrawal | Further optimal regret bounds for thompson sampling[END_REF] in MAB. Nonetheless, in Lemma 2 they prove that the probability of being optimistic increases over time. This may suggest that E TS needs to be only a constant fraction bigger than E RLS , since the initial small probability of being optimistic would tend to a constant (or even to 1) later on during the learning process. Whether this argument holds and how to prove it remains an open question.

A Examples of TS distributions

T η ≥ 1} ∩ B d (0, √ d
) is an hyper-spherical cap for any direction u of R d , the the anti-concentration property is satisfied provided that the ratio between the volume of an hyper-spherical cap of height √ d -1 and the volume of the ball of radius √ d is constant (i.e., independent from d). Using standard geometric results (see Prop. 9), one has that for any vector u = 1

P(u T η ≥ 1) = 1 2 I 1-1 d d + 1 2 , 1 2 , (9)
where I x (a, b) is the incomplete regularized beta function. In Prop. 10 we prove that

I 1-1 d d + 1 2 , 1 2 ≥ 1 8 √ 6π ,
and hence we obtain p = 1 16 √ 6π . .

Example 2: Gaussian case η ∼ N (0, I d ). The concentration property comes directly from the Chernoff bound for standard Gaussian random variable together with union bound argument. For any α > 0, we have

P( η ≤ α √ d) ≥ P(∀1 ≤ i ≤ d, |η i | ≤ α) ≥ 1 -dP(|η i | ≥ α).
Standard concentration inequality for Gaussian random variable gives, ∀α > 0,

P(|η i | ≥ α) ≤ 2e -α 2 /2 .
Plugging everything together with α = 2 log 2d δ gives the desired result with c = c = 2. Let η i be the i-th component of η for any 1 ≤ i ≤ d. Then η i ∼ N (0, 1). Since η is rotationally invariant, for any direction u of R d and an appropriate choice of basis, we have P(u T η ≥ 1) ≥ P(η 1 ≥ 1). From standard Gaussian properties (see Thm 2 of [START_REF] Chang | Chernoff-type bounds for the gaussian error function[END_REF]) we have

P(η 1 ≥ 1) = 1 2 erfc 1 √ 2 ≥ 1 4 √ eπ
which ensures the anti-concentration property with p = 1 4 √ eπ . Then define y = x + (xx) for some x ∈ bound(C). By definition of the open set int(C), ∃ > 0 such that y ∈ int(C). Moreover, x ∈ [y, x] e.g.

B Properties of convex function

x = (1 -t)x + ty, t = 1 1 + ∈]0, 1[
Using the convexity of f on has

f (x ) ≤ (1 -t)f (x) + tf (y) < (1 -t)f (x ) + tf (y) f (x ) < f (y)
which is impossible by assumption.

C Properties of support function (proof of Proposition 3 and Lemma 2)

We study the support function of a set C, which is a function f

C : R d → R such that f C (θ) = sup x∈C x T θ (10)
Those functions are at the core of convex geometry analysis.

Proposition 6. Let C ⊂ R d be a non-empty compact set and f C the associated support function. Then,

1. f C is real-valued and sup x∈C x T θ is attained in C, 2. f C is convex, 3. f C is continuous on R d
and twice differentiable almost everywhere with respect to the Lebesgue's measure.

Proof. 1. This comes directly from the compactness of C: since C is bounded, the support function is real-valued and since C is closed, the supremum is attained in C, 2. Let θ 1 , θ 2 two vectors of R d , and t ∈ (0, 1). By definition of the supremum, since f C is real-valued:

f C (tθ 1 + (1 -t)θ 2 ) = sup x∈C tx T θ 1 + (1 -t)x T θ 2 ≤ t sup x∈C x T θ 1 + (1 -t) sup x∈C x T θ 2
3. The continuity is consequence of the convexity of f C on the open convex set R d and the second order differentiability comes from Alexandrov's theorem 2.

Proposition 7. Let x(θ) ∈ arg sup x∈C x T θ, denote as ∇f C (θ) and ∂f C (θ) the gradient (when it is uniquely defined) and the sub-gradient of

f C in θ ∈ R d . Then, 1. for all θ ∈ R d , x(θ) ∈ ∂f C (θ),
2. their exists a null set N with respect to the Lebesgue's measure such that x(θ) = ∇f C (θ) for all θ ∈ R d \ N , 3. equivalentely, x(θ) = ∇f C (θ) where the equality holds in the sense of the distribution.

Proof. Thanks to proposition 6, we know that the supremum is attained in x(θ) ∈ C. Moreover, Alexandrov's theorem guarantee that N is a null-set. Since the sub-gradient is reduced to a singleton where the function is differentiable e.g. ∂f C (θ) = {∇f C (θ)} for all θ ∈ R d \ N , one just need to show to x(θ) ∈ ∂f C (θ) for all θ ∈ R d . Since f C (θ) = max x∈C x T θ, their exist at least one x(θ) ∈ C for which the maximum is attained i.e. x(θ)

T θ = f C (θ). Moreover, for any θ ∈ R d , f C ( θ) ≥ x(θ) T θ by definition. Therefore, f C ( θ) -x(θ) θ ≥ 0 := f C (θ) -x(θ) T θ f C ( θ) ≥ f C (θ) + x(θ) T θ -θ , ∀ θ ∈ R d
which is the definition of the sub-gradient.

D Regret Proofs

We collect here the main tools that we need to derive the proof. We first recall the Azuma's concentration inequality for super-martingale.

Proposition 8. If a super-martingale (Y t ) t≥0 corresponding to a filtration F t satisfies |Y t -Y t-1 | < c t for some constant c t for all t = 1, . . . , T then for any α > 0, Proof of Lemma 1. We first bound the two events separately.

P(Y T -Y 0 ≥ α) ≤ 2e - α 2 2 T t=1 c 2 t E TS t O B d (0, 1) η t H t G t G ⊥ t
Bounding E. This bound is a straightforward application of Proposition 1 together with a union bound argument. Let δ = δ/(4T ), then

∀1 ≤ t ≤ T, P θ t -θ Vt ≤ β t (δ ) ≥ 1 -δ from union bound, P T t=1 θ t -θ Vt ≤ β t (δ ) ≥ 1 - T t=1 P θ t -θ Vt ≥ β t (δ ) ⇒ P T t=1 θ t -θ Vt ≤ β t (δ ) ≥ 1 - T t=1 δ ⇒ P E ≥ 1 -T δ = 1 - δ 4 .
Bounding E. This bound comes directly from the concentration property of the TS sampling distribution.

From the expression of θ t = θ t + β t (δ )V -1/2 t η t where η t is drawn i.i.d. from D TS , we have

∀1 ≤ t ≤ T, P θ t -θ t Vt ≤ β t (δ ) cd log c d δ = P η t ≤ cd log c d δ .
Then from Definition 1, we have

P η t ≤ cd log c d δ ≥ 1 -δ .
As before, a union bound over the two bounds ensures that

P( E) ≥ 1 -T δ = 1 - δ 4 .
Finally, a union bound argument between the two terms leads to

P( E ∩ E) ≥ 1 - δ 2 .
Proof of Lemma 3. We need to study the probability that a θ drawn at time t from the TS sampling distribution is optimistic, i.e., J( θ) ≥ J(θ ), under event E t . More formally let

p t = P J( θ) ≥ J(θ )|F t , E t .
Using the definition of E t we have that θ ∈ E RLS t (i.e., the true parameter vector belongs to the RLS ellipsoid) and then we can replace J(θ ) by the supremum over the ellipsoid as

p t ≥ P J( θ) ≥ sup θ∈E RLS t J(θ) F t , E t .
By recalling the definition of the TS sampling process, we can write θ = θ t + β t (δ )V -1/2 t η, where η ∼ D TS and for notational convenience, we define the function f t (η) = J( θ t + β t (δ )V -1/2 t η). Let θ t = arg sup θ∈E RLS t J(θ) and η t be the corresponding η (i.e., η t is such that θ t = θ t + β t (δ )V -1/2 t η t ). Since the supremum is taken within E RLS t , η t belongs to the unit ball (i.e., η t ∈ B d (0, 1)). As a result, we can rewrite the previous expression as

p t ≥ P f t (η) ≥ f t (η t ) F t , E t .
Since the function f t inherits all the properties of J, notably its convexity in η, we know that the supremum on a convex closed set is reached at least at one point ηt and that it belongs to the boundary (see Prop. 4), which in our case corresponds to η t = 1. Moreover, let H t (η t ) be the hyperplane tangent to η t . H t (η t ) splits R d in two complementary subspaces G t and G ⊥ t where G t does not contain the unit ball by convention. Again, the convexity of f t ensures that f t (η) ≥ f t (η t ) for all η ∈ G t as proved in Prop. 5. As illustrated in Fig. 5 the probability of being optimistic is now reduced to the probability that η drawn from D TS falls into G t , which corresponds to

p t ≥ P η ∈ G t F t , E t .
Let u t be the vector defining the hyperspace H t (η t ), notice that the subspace u t is entirely defined by the filtration F t and the event E t and it is thus independent from η t . As a result, we obtain

p t ≥ P u T t η ≥ 1 F t , E t ≥ p,
where the last step immediately follows from property 1 of Def. 1 of the TS sampling distribution.

Finally, we show that this property is not affected, up to a second order term, by the high-probability concentration event. It relies on the fact that the chosen confidence level δ = δ/4T is small compared to the anti-concentration probability p of Def. 1. For sake of simplicity, we assume that T ≥ 1/2p which implies that δ ≤ p/2. For any events A and B, one has

P(A ∩ B) = 1 -P(A c ∪ B c ) ≥ P(A) -P(B c )

Applying the previous inequality to

A := {J( θ) ≥ J(θ )} and B := { θ ∈ E TS t } where E TS t = {θ ∈ R d | θ -θ t Vt ≤ γ t (δ )} leads to P( θ t ∈ Θ opt ∩ E TS t |F t , Êt ) ≥ p -δ ≥ p/2
Proof of Theorem 1. We first bound the two regret terms R TS (T ) and R RLS (T ).

Bound on R TS (T ). We collect the bounds on each term R TS t and obtain

R TS (T ) ≤ T t=1 R TS t 1{E t } ≤ 4γ T (δ ) p T t=1 E x ( θ) V -1 t |F t . (11)
Since this term contains an expectation, we cannot directly apply Proposition 2 and we first need to rewrite to the total regret R TS (T ) as

R TS (T ) ≤ 4γ T (δ ) p T t=1 x t V -1 t + T t=1 E x ( θ) V -1 t |F t -x t V -1 t R TS 2 . ( 12
)
From Prop. 2, the first term is bounded as, T t=1

x t V -1 t ≤ √ T T t=1 x t 2 V -1 t 1/2 ≤ 2T d log 1 + T λ .
We now proceed applying Azuma inequality 8 to the second term which is a martingale by construction. Under assumption 1, x t ≤ 1 for all t ≥ 1, so since

V -1 t ≤ 1 λ I one gets, E x ( θ) V -1 t |F t -x t V -1 t ≤ 2 √ λ , a.s.
This provides an upper-bound on each element of R TS 2 which holds with probability at least 1 -δ 2 as

R TS 2 ≤ 8T λ log 4 δ .
Bound on R RLS (T ). The bound on R RLS is derived as previous results in [ Abbasi-Yadkori et al., 2011b, Agrawal andGoyal, 2012b]. We decompose the term in a sampling prediction error and a RLS prediction error as follow

R RLS (T ) ≤ T t=1 |x T t ( θ t -θ t )|1{E t } + T t=1 |x T t ( θ t -θ )|1{E t } By definition of the concentration event E t , |x T t ( θ t -θ t )|1{E t } ≤ x t V -1 t γ t (δ ), |x T t ( θ t -θ )|1{E t } ≤ x t V -1 t β t (δ ), so from proposition 2, R RLS (T ) ≤ β T (δ ) + γ T (δ ) 2T d log 1 + T λ . (13)
Final bound. We finally plug everything together since from lemma 1 the concentration event holds with probability at least 1 -δ 2 . Using the bound on R TS (T ) and a union bound argument one obtains the desired result which holds with probability at least 1δ.

E Hyperspherical cap and beta function

= R -r > 0. Then, V cap d (h) = 1 2 V d (R)I 1-( r R ) 2 d + 1 2 , 1 2
where I x (a, b) is the incomplete regularized beta function.

Proof. The proof can be found in [START_REF] Li | Concise formulas for the area and volume of a hyperspherical cap[END_REF].

Proposition 10. Let I x (a, b) is the incomplete regularized beta function,

∀d ≥ 2, I 1-1 d d + 1 2 , 1 2 ≥ 1 8 √ 6π
F Generalized Linear Bandit

We present here how to apply our derivation to the generalized linear bandit (GLM) problem of [START_REF] Filippi | Parametric bandits: The generalized linear case[END_REF]. The regret bound is obtained by basically showing that the GLM problem can be reduced to studying the linear case.

The setting. Let X ⊂ R d be an arbitrary (finite or infinite) set of arms. Every time an arm x ∈ X is pulled, a reward is generated as r(x) = µ(x T θ ) + ξ, where µ is the so-called link function, θ ∈ R d is a fixed but unknown parameter vector and ξ is a random zero-mean noise. The value of an arm x ∈ X is evaluated according to its expected reward µ(x T θ ) and for any parameter θ ∈ R d we denote the optimal arm and its optimal value as

x (θ) = arg max x∈X µ(x T θ), J GLM (θ) = sup x∈X µ(x T θ). (14)
Then x = x (θ ) is the optimal arm associated with the true parameter θ and J GLM (θ ) its optimal value. At each step t, a learner chooses an arm x t ∈ X using all the information observed so far (i.e., sequence of arms and rewards) but without knowing θ and x . At step t, the learner suffers an instantaneous regret corresponding to the difference between the expected rewards of the optimal arm x and the arm x t played at time t. The objective of the learner is to minimize the cumulative regret up to a finite step T ,

R GLM (T ) = T t=1 µ(x ,T θ ) -µ(x T t θ ) . (15)
Assumptions. The assumptions associated with this more general problem are the same as in the linear bandit problem plus one regarding the link function. Formally, we require assumption 1, 2 and 3 and add:

Assumption 4 (link function). The link function µ : R → R is continuously differentiable, Lipschitz with constant k µ and such that c µ = inf θ∈R d ,x∈X (x T θ) > 0.

Technical tools. Let (x 1 , . . . , x t ) ∈ X t be a sequence of arms and (r 2 , . . . , r t+1 ) be the corresponding observed (random) rewards, then the unknown parameter θ can be estimated by GLM estimator. Following Filippi et al.

[2010] one gets, for any regularization parameter λ ∈ R + ,

θ GLM t = arg min θ∈R d t-1 s=1 r s+1 -µ(x T s θ) x s 2 V -1 t , (16)
where V t is the same design matrix as in the linear case. Similar to Prop. 1, we have a concentration inequality for the GLM estimate.

Proposition 11 (Prop. 1 in appendix.A in [START_REF] Filippi | Parametric bandits: The generalized linear case[END_REF]). For any δ ∈ (0, 1), under assumptions 1, 2, 3 and 4, for any F x t -adapted sequence (x 1 , . . . , x t , . . .), the prediction returned by the GLM estimator θ GLM t (Eq. 16) is such that for any fixed t ≥ 1,

θ GLM t -θ Vt ≤ β t (δ) c µ , (17)
and

∀x ∈ R d , µ(x T θ GLM t ) -µ(x T θ ) ≤ k µ β t (δ) c µ x V -1 t , x T θ GLM t -x T θ ≤ β t (δ) c µ x V -1 t , (18)
with probability 1δ (w.r.t. the noise sequence {ξ t } t and any other source of randomization in the definition of the sequence of arms), where β t (δ) is defined as in Eq. 5.

The Asm. 4 on the link function together with the properties of the GLM estimator implies the following:

1. since the first derivative is strictly positive, µ is strictly increasing and x (θ) = arg max x∈X x T θ so we retrieve the optimal arm of the linear case (and the support function),

Finally, the same proof as in the linear case leads to the following bound for the Generalized Linear Bandit regret.

Lemma 4. Under assumptions 1,2,3 and 4, the cumulative regret of TS over T steps is bounded as

R GLM (T ) ≤ k µ c µ β T (δ ) + γ T (δ )(1 + 2/p) 2T d log 1 + T λ + 2k µ γ T (δ ) pc µ 8T λ log 4 δ (19)
with probability 1δ where δ = δ 4T .

G Regularized Linear Optimization

We consider here the Regularized Linear Optimization (RLO) problem as an extension of the Linear Bandit problem. Given a set of arms X ⊂ R d and an unknown parameter θ ∈ R d , a learner aims at each time step t = 1, . . . , T to select action x t ∈ X which maximizes its associated reward x T t θ + µc(x t ) where µ is a known constant and c an arbitrary (yet known) real-valued function. Whenever arm x is pulled, the learner receives a noisy observation y = x T θ + ξ. As for LB, we introduce the function f (x; θ) = x T θ + µc(x), and denote as x (θ) = arg max x∈X f (x; θ) and J(θ) = max x∈X f (x; θ) the optimal action and optimal reward associated with θ. The regret is therefore defined as R RLO (T ) = T t=1 f (x (θ ); θ )f (x t ; θ ). Since this problem is just the regularized extension of the Linear Bandit, the TS algorithm is similar to Alg. 1 where r t is replaced y t and x t = arg max x∈X f (x, θ t ). Under the same assumptions, the regret shares the same bound and our line of proof holds. First, we decompose the regret R(T ) = Then, J is real-valued and convex which implies its continuous differentiability thanks to Alexandrov's theorem. As a consequence, the first step of the proof holds.

The equality between the gradient ∇J(θ) and the optimal arm x (θ) can be derived as in Prop. 7: for any θ, θ ∈ R d , by definition, J(θ) = f (x (θ); θ) and J( θ) ≥ f (x (θ); θ). Then, J( θ)f (x (θ), θ) ≥ 0 := J(θ)f (x (θ), θ),

J( θ) ≥ J(θ) + f (x (θ), θ) -f (x (θ), θ) = J(θ) + x (θ) T θ -θ , ∀ θ ∈ R d ,
which is the definition of the sub-gradient. Finally, the almost everywhere differentiability of J ensures the sub-gradient to be a singleton and hence equals the gradient. Therefore, Lem. 2 holds and so is step 2. Finally, since the optimism just relies on the convexity of J and on the over-sampling, it is satisfied in the RLO and step 3 holds. As a result, we obtain the same regret bound as in the LB.

Figure 1 :

 1 Figure 1: Thompson sampling algorithm.

Figure 4 :

 4 Figure 4: Illustration of the non-optimistic region that could contribute to reduce the regret.

Example 1 :

 1 Uniform distribution η ∼ U B d (0, √ d) . The uniform distribution satisfies the concentration property with constants c = 1 and c = e d by definition. Since the set {η|u

Proposition 4 .

 4 Let f : R d → R be a convex function and C be a closed convex set of R d . Then, on C, f reaches its maximum on the boundary of C. Proof. Let's denote as int(C) and bound(C) the interior and the boundary of the closed convex set C respectively. Assume that ∃x ∈ int(C) such that f (x ) > f (x) for any x ∈ bound(C) and f (x ) ≥ f (y) for any y ∈ int(C).

Figure 5 :

 5 Figure 5: Illustration of the probability of selecting an optimistic θ t .

Proposition 9 .

 9 Let V d (R) be the volume of the d-dimensional ball of radius R and let V cap d (h) the volume of the hyperspherical cap of heigh h

  x (θ ); θ )f (x t ; θ t )) + (f (x t ; θ t )f (x t ; θ )) = T t=1 J(θ ) -J( θ t ) =R TS (T ) + T t=1 x T t θ tx T t θ =R RLS (T ).Since Prop. 1 holds thanks to the linear observations y t , R RLS (T ) is bounded as in the LB. Finally, to bound R TS (T ), one just need to ensure that Prop. 3, Lem. 2 and Lem. 3 hold. The convexity of the function f with respect to θ implies the convexity of J: ∀x ∈ X , ∀θ, θ ∈ R d , ∀α ∈ (0, 1),J(αθ + (1α)θ ) = max x∈X f (x; αθ + (1α)θ ) ≤ max x∈X αf (x; θ) + (1α)f (x; θ ) ≤ αJ(θ) + (1α)J(θ ).

  Illustration of the steps 2) and 3) of the proof in R 1 and R 2 . Left: The regret at step t could be bounded by the gradient of the function J at a previous optimistic θτ times the distance between θτ and the current θt.

				Θ opt
				θ t	θ t
				p
			X	x	x t = x ( θ t )
			O
	Figure 2: Notice that θ
	is always included in E RLS t	(in dark gray) and thus θs sampled from E TS t	(in light gray) are never too far. Right: TS has a
	constant probability of being optimistic thanks to the over-sampling of D TS .

Proceedings of the 20 th International Conference on Artificial Intelligence and Statistics (AISTATS) 2017, Fort Lauderdale, Florida, USA. JMLR: W&CP volume 54. Copyright 2017 by the author(s).

Here we refer to the definition introduced in the arXiv paper, which slightly differs from the original ICML paper.

Acknowledgement This research is supported in part by a grant from CPER Nord-Pas de Calais/FEDER DATA Advanced data science and technologies 2015-2020, CRIStAL (Centre de Recherche en Informatique et Automatique de Lille), and the French National Research Agency (ANR) under project ExTra-Learn n.ANR-14-CE24-0010-01.

Proposition 5. Let f : R d → R be a convex function. Let B d (0, 1) be the unit d-dimensional ball and S d (0, 1) the associated unit sphere. Given a point x ∈ S d (0, 1), define as H(x) the hyperplan tangent to B d (0, 1) at the point x. H(x) split R d into two complementary subspace G(x) and G ⊥ (x) where G(x) does not contain the unit ball by convention. Then for any x ∈ S d (0, 1) such that f (x ) ≥ f (x) for all x ∈ B d (0, 1), one has

Proof. We first notice that from Proposition 4 x is well defined since the maximum is reached on the boundary. The associated subspace G(x ) is then

We want to show that f (y) ≥ f (x ) for any y ∈ G(x ). We introduce the increasing sequence of subspace

, n ≥ 2.

For any y = x + u in G n , we associate

By definition of y (and hence u), we have

Since the statement of the proposition holds for any G n , then we obtain the desired result for G by continuity of f . Let y ∈ G(x ), y = x + u. If u T x > 0, then ∃n ≥ 2 such that y ∈ G n and the proposition is satisfied. Otherwise, if u T x = 0, we introduce the sequences {u n } and {y n } defined as:

x ,

By construction, y n ∈ G n and y n → y as n → ∞. Since the f (y n ) ≥ f (x ) for any n ≥ 2 we obtain the desired result taking the limit since f is continuous as a convex function on R d .

Theorem 2 (A.D. Alexandrov). Let f : R d → R be a convex function, then it is twice differentiable almost everywhere with respect to the Lebesgue's measure.

Proof. This result is an extension of the Rademacher's theorem for convex functions. A proof can be found in [START_REF] Niculescu | Convex functions and their applications: a contemporary approach[END_REF], theorem 3.11.2.

Proof. The incomplete regularized beta function can be expressed in terms of the beta function B(a, b) and the incomplete beta function B x (a, b) where

Hence we seek for a lower bound on B 1-

2 + 1 2 and an upper bound for B d+1 2 + 1 2 .

1. Let first find an lower bound for the incomplete beta function. Since t → t

From the increasing property of x → (1 -α x ) x for any α < 1 the sequence (1

is increasing and

2. Now we seek for an upper bound for B d+1 2 + 1 2 . Since B(a, b) = Γ(a)Γ(b) Γ(a+b) one has:

From [START_REF] Chen | Completely monotonic function associated with the gamma functions and proof of wallis' inequality[END_REF] we have the following inequalities for the gamma function ∀n ≥ 1:

Together with Γ(x + 1) = xΓ(x) and treating separately cases where d is even or not, one gets ∀d ≥ 2

3. Using the obtained upper and lower bound we get: