Robin Allesiardo

Raphaël Féraud

Odalric-Ambrym Maillard

Random Shuffling and Resets for the Non-stationary Stochastic Bandit Problem

We consider a non-stationary formulation of the stochastic multi-armed bandit where the rewards are no longer assumed to be identically distributed. For the best-arm identification task, we introduce a version of SUCCESSIVE ELIMINATION based on random shuffling of the K arms. We prove that under a novel and mild assumption on the mean gap ∆, this simple but powerful modification achieves the same guarantees in term of sample complexity and cumulative regret than its original version, but in a much wider class of problems, as it is not anymore constrained to stationary distributions. We also show that the original SUCCESSIVE ELIMINATION fails to have controlled regret in this more general scenario, thus showing the benefit of shuffling. We then remove our mild assumption and adapt the algorithm to the best-arm identification task with switching arms. We adapt the definition of the sample complexity for that case and prove that, against an optimal policy with N -1 switches of the optimal arm, this new algorithm achieves an expected sample complexity of O(∆ -2 N Kδ -1 log(Kδ -1 )), where δ is the probability of failure of the algorithm, and an expected cumulative regret of O(∆ -1 N T K log(T K)) after T time steps.

Introduction

The theoretical framework of the multi-armed bandit problem formalizes the fundamental exploration/exploitation dilemma that appears in decision making problems facing partial information. At a high level, a set of K arms is available to a player. At each turn, she has to choose one arm and receives a reward corresponding to the played arm, without knowing what would have been the received reward had she played another arm. The player faces the dilemma of exploring, that is playing an arm whose mean reward is loosely estimated in order to build a better estimate or exploiting, that is playing a seemingly best arm based on current mean estimates in order to maximize her cumulative reward. The accuracy of the player policy at time horizon T is typically measured in terms of sample complexity or of regret. The sample complexity is the number of plays required to find an approximation of the best arm with high probability.

In that case, the player can stop playing after identifying this arm. The regret is the difference between the cumulative rewards of the player and the one that could be acquired by a policy assumed to be optimal.

The stochastic multi-armed bandit problem assumes the rewards to be generated independently from stochastic distribution associated with each arm. Stochastic algorithms usually assume distributions to be constant over time like with the Thompson Sampling (TS) [START_REF] Thompson | On the likelihood that one unknown probability exceeds another in view of the evidence of two samples[END_REF], UCB [2] or Successive Elimination (SE) [START_REF] Even-Dar | Action Elimination and Stopping Conditions for the Multi-Armed Bandit and Reinforcement Learning Problems[END_REF]. Under this assumption of stationarity, TS and UCB achieve optimal upper-bounds on the cumulative regret with logarithmic dependencies on T . SE algorithm achieves near optimal sample complexity.

In the adversarial multi-armed bandit problem, rewards are chosen by an adversary. This formulation can model any form of non-stationarity. The EXP3 algorithm [START_REF] Auer | The Nonstochastic Multiarmed Bandit Problem[END_REF][START_REF] Neu | Explore no more: improved high-probability regret bounds for non-stochastic bandits[END_REF] achieves an optimal regret of O( √ T ) against an oblivious opponent that chooses rewards before the beginning of the game, with respect to the best policy that pulls the same arm over the totality of the game. This weakness is partially overcomed by EXP3.S [START_REF] Auer | The Nonstochastic Multiarmed Bandit Problem[END_REF], a variant of EXP3, that forgets the past adding at each time step a proportion of the mean gain and achieves controlled regret with respect to policies that allow arm switches during the run.

The switching bandit problem introduces non-stationarity within the stochastic bandit problem by allowing means to change at some time-steps. Discounted UCB [START_REF] Kocsis | Discounted UCB[END_REF] and sliding-window UCB [START_REF] Garivier | On Upper-Confidence Bound Policies for Non-stationary Bandit Problems[END_REF] are adaptations of UCB to the switching bandit problem and achieve a regret bound of O( √ M T log T ), where M -1 is the number of distribution changes. EXP3.R [START_REF] Allesiardo | EXP3 with Drift Detection for the Switching Bandit Problem[END_REF] combines EXP3 with a switch detector based on Hoeffding inequality [START_REF] Hoeffding | Probability Inequalities for Sums of Bounded Random Variables[END_REF] in order to detect switches of best arm. This detector does not require mean rewards to be constant on the tested interval. This use of the Hoeffding inequality on nonidentical distributions is extented to SE in this paper to allow the algorithm to achieve efficient theoretical guarantees on non-stationary distributions of rewards. EXP3.R achieves a regret bound of O(N √ T log T ), where N -1 is the number of times when the best arm changes. As this is always smaller (and potentially much smaller) than the number of distribution changes (N ≤ M ), EXP3.R appears to be a strong competitor. It is also worth citing META-EVE [START_REF] Hartland | Multi-armed Bandit, Dynamic Environments and Meta-Bandits[END_REF] that associates UCB with a mean change detector, reseting the algorithm when a change is detected. While no analysis is provided, it has demonstrated strong empirical performances. [START_REF] Seldin | One Practical Algorithm for Both Stochastic and Adversarial Bandits[END_REF]. For instance, in the setting with contaminated rewards, rewards are mainly drawn from stationary distributions except for a minority of rewards of means chosen in advance by an adversary. In order to guarantee their proposed algorithm EXP3++ achieves logarithmic guarantees, the adversary is constrained in the sense it cannot lowered the gap between arms more than a factor 1/2. They also proposed another variant called adversarial with gap [START_REF] Seldin | One Practical Algorithm for Both Stochastic and Adversarial Bandits[END_REF] which assumes the existence of a round after which an arm persists to be the best. This work is motivated by the desire to create generic algorithms able to perform bandit tasks with various reward types, stationary, adversary or mainly stationary. However, despite achieving good performances on a wide range of problems, each one needs a specific parametrization (i.e. an instance of EXP3++ parametrized for stationnary rewards may not perform well if rewards are choosen by an adversary).

Stochastic and Adversarial. Several variants combining stochastic and adversarial rewards have been proposed by Seldin & Slivkins

Our contribution. We consider a formalization of the bandit problem where rewards are drawn from stochastic distributions of arbitrary means defined before the beginning of the game. In this non-stationary stochastic bandit context, our first contribution is to introduce and analyze a randomized version of SUCCESSIVE ELIMINATION. We show that the seemingly minor modification -a randomized round-robin procedure -leads to a dramatic improvement of the performance over the original SUCCESSIVE ELIMINATION algorithm. We show for instance in Theorem 1 and Corollary 1 that the proposed SUCCESSIVE ELIMINATION WITH RANDOMIZED ROUND-ROBIN (SER3) algorithm achieves a controlled sample complexity and cumulative regret in situations where SUCCESSIVE ELIMINATION may even suffers from a linear regret in the time horizon T , as supported by numerical experiments (see Section 5). Our second contribution is to identify a notion of gap that generalizes the gap from stochastic bandits to the non-stationary case, and derive gap-dependent (also known as problem-dependent) sample complexity and regret bounds, instead of the more classical and less informative problem-free bounds. This paper is organized as follows. Section 3 starts with the case of non-stationary stochastic bandits when the best arm does not change during the game. We show that the sample complexity of SER3 is controlled as O( K ∆ 2 log K δ∆ ) where ∆ generalizes the usual notion of stochastic gap from the stationary case. This comes under a mild assumption (see assumption 1). In Section 4, we then extend the setting to a full-blown switching problem when the best arm is allowed to change over time. We naturally extend the definition of sample complexity to allow the optimal arm to change over time (see Definition 1), and introduce the RANDOMIZED SUCCESSIVE ELIMINATION WITH RESETS (SER4) algorithm. We show in Theorem 2 and Corollary 2 that this algorithm achieves an expected sample complexity of O( N K log(K/δ)/(δ∆ 2 )) where N -1 is the number of arm switches assumed to be known. Corollary 3 extend this result to the expected cumulative regret with an upper-bound of O(∆ -1 N T K log(T K)). These results do not assume any constraint on the behavior of the stochastic distributions and provide a gap-dependent performance bound in the challenging setting of non-stationary stochastic bandits competing against switching best arms. We finally illustrate the proposed approaches on synthetic problems in Section 5.

Setting

We consider a generalization of the adversarial setting where the adversary chooses before the beginning of the game a sequence of distributions instead of directly choosing a sequence of rewards. This generalizes the setting since choosing arbitrarily a reward y k (t) is equivalent to drawing this reward from a distribution of mean y k (t) and a variance of zero.

The problem. Let [K] = 1, ..., K be a set of K arms. The reward y kt (t) ∈ [0, 1] obtained by the player after playing the arm k t is drawn from a distribution of mean µ kt (t) ∈ [0, 1]. The instantaneous gap between arms k and k at time t is:

∆ k,k (t) def = µ k (t) -µ k (t) . (1)
Let k * (t) be the arm played by the optimal policy at time t.

The notion of sample complexity. In the literature [START_REF] Kaufmann | On the Complexity of Best Arm Identification in Multi-Armed Bandit Models[END_REF], the sample-complexity of an algorithm is the number of samples needed by this algorithm to find a policy achieving a specific level of performance with high probability. We denote δ ∈ (0, 0.5] the probability of failure. For instance, for the best arm identification in the stochastic stationary bandit (that is when ∀k∀t , µ k (t) = µ k (t + 1) and k * (t) = k * (t + 1)), the sample complexity is the number of sample needed to find, with a probability at least 1δ, an arm k * of mean reward max k∈[K] µ k . In section 3.1 we define the best arm in the stochastic non-stationary bandit problem without switches and in section 4 we propose a new definition of the sample complexity for the best arm identification problem with switches.

Analysis in sample complexity are useful for building hierarchical models of contextual bandits in a greedy way [START_REF] Féraud | Random Forest for the Contextual Bandit Problem[END_REF], reducing the exploration space.

The notion of regret. We define the pseudo cumulative regret as the difference of mean rewards between the arms chosen by the optimal policy and those chosen by the player:

T t=1 µ k * (t) (t) -µ kt (t) .
(2)

Usually, in the stochastic bandit setting, the distributions of rewards are stationary and the instantaneous gap ∆ k,k (t) = µ k (t)µ k (t) is the same for all the time-steps.

Best Arm Identification in Non-stationary Stochastic

Bandits.

In this section, we present the algorithm SUCCESSIVE ELIMINATION WITH RANDOM-IZED ROUND-ROBIN (SER3, see algorithm 1), a randomized version of SUCCESSIVE ELIMINATION which tackles the best arm identification problem when rewards are non-stationary.

A modified Successive Elimination algorithm

We elaborate on several notions required to understand the behavior of the algorithm and to relax the constrain of stationarity.

The elimination mechanism The elimination mechanism was introduced by SUC-CESSIVE ELIMINATION [START_REF] Even-Dar | Action Elimination and Stopping Conditions for the Multi-Armed Bandit and Reinforcement Learning Problems[END_REF]. Estimators of the rewards are built by sequentially sampling the arms. After τ min turns of round-robin, the elimination mechanism starts to occur. A lower-bound of the reward of the best empirical arm is computed and compared with an upper-bound of the reward of all other arms. If the lower-bound is higher than one of the upper-bounds, then the associated arm is eliminated and stop being considered by the algorithm. Processes of sampling and elimination are repeated until the elimination of all arms except one.

Algorithm 1 SUCCESSIVE ELIMINATION WITH RANDOMIZED ROUND-ROBIN (SER3) input: δ ∈ (0, 0.5], ∈ [0, 1), τ min = log K δ output: an -approximation of the best arm S 1 = [K], ∀k, μk (0) = 0, t = 1, τ = 1 While |S τ | > 1 Shuffle S τ For each k ∈ S τ do Play k μk (τ ) = τ -1 τ μk (τ -1) + y k (t) τ t = t + 1 End for k max = arg max k∈S μk (τ ) If τ ≥ τ min Remove from S τ +1 all k such as: μmax (τ ) -μk (τ ) + ≥ 2 τ log 4Kτ 2 δ End if τ = τ + 1 End while
Hoeffding inequality. SUCCESSIVE ELIMINATION assumes that the rewards are drawn from stochastic distributions that are identical over time (rewards are identically distributed). However, the Hoeffding inequality used by this algorithm does not require stationarity and only requires independence. We remember the Hoeffding inequality: Lemma 1 (Hoeffding inequality [START_REF] Hoeffding | Probability Inequalities for Sums of Bounded Random Variables[END_REF]). If X 1 , X 2 , ..., X τ are τ independent random variables and 0 ≤ X i ≤ 1 for all (i = 1, 2, ..., τ ), then for τ > 0

P t i=1 X i τ -E t i=1 X i τ ≥ τ ≤ 2 exp -2 2 τ τ .
Thus we can use this inequality to calculate confidence bounds of empirical means computed with rewards drawn from non identical distributions.

Randomization of the Round-Robin. We illustrate the need of randomization with an example tricking a deterministic algorithm (see figure 1).

µ k (t) t = 1 t = 2 t = 3 t = 4 t = 5 t = 6 k = 1 0.6 1 0.6 1 0.6 1 k = 2 0.4 0.8 0.4 0.8 0.4 0.8
Figure 1: A sequence of mean rewards tricking a deterministic bandit algorithm.

The best arm seem to be k = 1 as µ 1 (t) is greater than µ 2 (t) at every time-step t. However, by sampling the arms with a deterministic policy playing sequentially k = 1 and then k = 2, after t = 6 the algorithm has only sampled rewards from a distribution of mean 0.6 for k = 1 and of mean 0.8 for k = 2. After enough time following this pattern, an elimination algorithm will eliminate the first arm. Our algorithm SER3 adds a shuffling of the arm set after each round-robin cycle to SUCCESSIVE ELIMINATION and avoids this behavior.

Uniqueness of the best arm. The best arm identification task assumes a criteria identifying the best arm without ambiguity. We define the optimal arm as:

k * = arg max k∈[K] T t=1 µ k (t) . (3)
As an efficient algorithm will find the best arm before the end of the run, we use assumption 1 to ensure its uniqueness at every time-step. First, we define some notations. A run of SER3 is a succession of round-robin. The set

[τ ] = {(t 1 , |S 1 |), ..., (t τ , |S τ |)} is a realization of SER3 and t i is the timestep when the round-robin i th of size |S i | starts (t i = 1 + i-1 j=1 |S j |).
As arms are only eliminated, |S i | ≥ |S i+1 |. We denote T(τ ) the set containing all possible realizations of τ round-robin steps. Now, we can introduce assumption 1 that ensures the best arm is the same at any time-step.

Assumption 1 (Positive mean-gap). For any k ∈ [K] -{k * } and any [τ ] ∈ T(τ ) with τ ≥ τ min , we have:

∆ * k ([τ ]) = 1 τ τ i=1 ti+|Si|-1 j=ti ∆ k * ,k (j) |S i | > 0 . ( 4
)
Assumption 1 is quite weak (see e.g. figure 2(b)) and can tolerate a large noise when τ is high. As the optimal arm must distinguish itself from others, instantaneous gaps are more constrained at the beginning of the game. It is quite similar to the assumption used by Seldin & Slivkins [START_REF] Seldin | One Practical Algorithm for Both Stochastic and Adversarial Bandits[END_REF] to be able to achieve logarithmic expected regret on moderately contaminated rewards, i.e., the adversary does not lower the averaged gap too much. Another analogy can be done with the adversarial with gap setting [START_REF] Seldin | One Practical Algorithm for Both Stochastic and Adversarial Bandits[END_REF], τ min representing the time needed for the optimal arm to accumulate enough rewards and to distinguish itself from the suboptimal arms.

Figure 2(a) illustrates assumption 1. In this example the mean of the optimal arm k * is lower than the second one on time-steps t ∈ {5, 6, 7}. Thus even if the instantaneous gap is negative during these time-steps, the mean gap ∆ * k ([τ ]) stays positive. The parameter τ min protects the algorithm from local noise at the initialization of the algorithm. In order to ease the reading of the results, we here assume τ min = log K δ . Assumption 1 can be seen as a sanity-check assumption ensuring that the best-arm identification problem indeed makes sense. In section 4, we consider the more general switching bandit problem. In this case, assumption 1 may not be verified (see figure 2(b)), and is naturally extended by dividing the game in segments wherein assumption 1 is satisfied.

Analysis

The sample-complexity is the number of observations needed to find an -optimal arm with high probability. All theoretical results are provided for = 0 and therefore accept only k * as the optimal arm. All proofs are provided in the appendix.

Theorem 1. For K ≥ 2, δ ∈ (0, 0.5], and τ min = log K δ , the sample-complexity of SER3 is upper bounded by:

O K ∆ 2 log( K δ∆ )
where

∆ = min [τ ],k 1 τ τ i=1 ti+|Si|-1 t=ti ∆ k * ,k (t)
|Si| . Guarantee on the sample complexity can be transposed in guarantee on the cumulative regret. In that case, when only one arm remains in the set, the player continues to play this last arm until the end of the game.

Corollary 1. For K ≥ 2, and δ = 1/T , and τ min = log(KT ), the expected cumulative regret of SER3 is upper bounded by:

min O K -1 ∆ log( KT ∆ ) , O T K log T K
These guarantees are the same as the original SUCCESSIVE ELIMINATION performed with a deterministic round-robin on arms with stationary rewards. Indeed, when reward distributions are stationary, we have for all t and all [τ ]:

1 τ τ i=1 ti+|Si|-1 t=ti ∆ k * ,k (t) |S i | = ∆ k * ,k (t) = ∆ k * ,k (t + 1) . (5)
However, in a non-stationary environment satisfying assumption 1 SUCCESSIVE ELIMINATION will eliminate the optimal arm if the adversary knows the order of its round-robin before the beginning of the run and exploits this knowledge against the learner, thus resulting in a linear cumulative regret.

Remark: These logarithmic guarantees result from assumption 1 that allows to stop the exploration of eliminated arms. They do not contradict the lower bound for non-stationary bandit whose scaling is in Ω( √ T ) [START_REF] Garivier | On Upper-Confidence Bound Policies for Non-stationary Bandit Problems[END_REF] as it is due to the cost of the constant exploration for the case where the best arm changes.

Non-stationary Stochastic Multi-armed Bandit with Best Arm Switches

The switching bandit problem has been proposed by Garivier et al. [START_REF] Garivier | On Upper-Confidence Bound Policies for Non-stationary Bandit Problems[END_REF] and assumes means to be stationary between switches. In particular, the algorithm SW-UCB is built on this assumption. The setting has been extended by Allesiardo and Féraud with EXP3.R [START_REF] Allesiardo | EXP3 with Drift Detection for the Switching Bandit Problem[END_REF] to allow mean rewards to change at every time-steps. We follow this setting and consider that a best arm switch occurs when the arm with the highest mean change.

Algorithm. In order to allow the algorithm to choose another arm when a switch occurs, at each turn, estimators of SER3 are reseted with a probability ϕ ∈ [0, 1] and a new task of best arm identification is started. We name this algorithm SUCCESSIVE ELIMINATION WITH RANDOMIZED ROUND-ROBIN AND RESETS (SER4).

The sample complexity of the best arm identification problem with switches. The optimal policy is the sequence of couples (optimal arm, time when the switch occurred):

{(k * 1 , 1), ..., (k * N , T N )} , (6)
with k * n = k * n+1 and ∆ k * n ,k (t) > 0 for any k ∈ [K] -{k * n } and any t ∈ [T n , T n+1
). The optimal policy starts playing the arm k * n at the time-step T n . Time-steps T n when switches occur are unknown to the player.

The cost of switches. A cost associated to the number of iterations after a switch when the player does not know the optimal arm and does not sample is added to the usual sample complexity.

Definition 1. Let A be an algorithm. The sample-complexity of A performing a best arms identification task for a segmentation {T

n } n=1..N of [1 : T ], with T 1 = 1 < T 2 < • • • < T N < T , is N n=1 Tn+1-1 t=Tn (s(t) + 1 kt =k * n )
, where s(t) is a binary variable equal to 1 if and only if the time-step t is used by the sampling process of A, k t is the arm identified as optimal by A at time t, k * n is the optimal arm over the segment n and

T N +1 = T + 1.
Performance analysis. We now provide the performance guarantees of the SER4 algorithm, both in terms of sample complexity and in cumulative regret.

Theorem 2. For K ≥ 2, δ = 1/T , τ min = log K δ and ϕ ∈ (0, 1], the expected sample complexity of SER4 w.r.t. the randomization of resets is upper bounded by:

O ϕK δ∆ 2 log( K δ∆ ) + N ϕ
with a probability of at least 1δ.

We tune ϕ in order to minimize the sample complexity.

Corollary 2. For K ≥ 2, δ = 1/T , τ min = log K δ , ∆ ≥ 1 KT and ϕ = N δ K log( K δ )
, the expected sample complexity of SER4 w.r.t. the randomization of resets is upper bounded by:

O   1 ∆ 2 N K log( K δ ) δ   .
Remark 2: transposing Theorem 1 for the case where ∈ [ 1 KT , 1] is straightforward. This allows to tune the bound by setting ϕ = (N δ)/(K log(T K)). This result can also be transposed in bound on the expected cumulative regret. We consider that the algorithm continues to play the last arm of the set until a reset occurs.

O N T K log(KT ) ∆ . ( 7
)
Remark 3: A similar dependency in √ T ∆ -1 appears also in EXP3.R (see Corrolary 1 in [START_REF] Allesiardo | EXP3 with Drift Detection for the Switching Bandit Problem[END_REF]) and in SW-UCB (see Theorem 1 in [START_REF] Garivier | On Upper-Confidence Bound Policies for Non-stationary Bandit Problems[END_REF]), and is standard in this type of results.

Numerical Experiments

We compare our algorithms with the state-of-the-art. For each problem, K = 20 and T = 10 7 . The instantaneous gap between the optimal arm and the others is constant, ∆ = 0.05, i.e. the mean of the optimal arm is µ * (t) = µ(t)+∆. During all experiments, probabilities of failure of SUCCESSIVE ELIMINATION (SE), SER3 and SER4 are setted to δ = 0.05. Constant explorations of all algorithms of the EXP3 family are setted to γ = 0.05. Results are averaged over 50 runs. On problems 1 and 2, variances are low (in the order of 10 3 ) and thus not showed. On problem 3, variances are plotted as the grey areas under the curves.

Problem 1: Sinusoidal means. The index of the optimal arm k * is drawn before the game and does not change. The mean of all suboptimal arm is µ(t) = cos(2πt/K)/5 + 0.5. This problem challenges SER3 against SE, UCB and EXP3. SER3 achieves a low cumulative regret, successfully eliminating sub-optimal arms at the beginning of the run. Contrarily, SE is tricked by the periodicity of the sinusoidal means and eliminates the optimal arm. The deterministic policy of UCB is not adapted to the non-stationarity of rewards and thus the algorithm suffers from an high regret. The unbiased estimators of EXP3 enable the algorithm to quickly converge on the best arm. However, EXP3 suffers from a linear regret due to its constant exploration until the end of the game.

Problem 2: Decreasing means with positive gap. The optimal arm k * does not change during the game. The mean of all suboptimal arms is µ(t) = 0.95min(0.45, 10 -7 t).

On this problem, SER3 is challenged against SE, UCB and EXP3. SER3 achieves a low cumulative regret, successfully eliminating sub-optimal arms at the beginning of the run. Contrarily to problem 1, mean rewards evolve slowly and SUCCESSIVE ELIMINATION (SE) achieves the same level of performance than SER3. Similarly to problem 1, UCB achieves an high cumulative regret. The cumulative regret of EXP3 is low at the end of the game but would still increase linearly with time.

Problem 3: Decreasing means with arm switches. At every turn, the optimal arm k * (t) changes with a probability of 10 -6 . In expectation, there are 10 switches by run. The mean of all suboptimal arms is µ(t) = 0.95min(0.45, 10 -7 (t[mod 10 6 ]).

On problem 3, SER4 is challenged against SW-UCB, EXP3.S, EXP3.R and META-EVE. The probability of reset of SER4 is ϕ = 5 -5 . The size of the window of SW-UCB is 10 5 . The historic considered by EXP3.R is H = 4 • 10 5 and the regularization parameter of EXP3.S is α = 10 -5 .

SER4 obtains the lowest cumulative regret, confirming the random resets approach to overcome switches of best arm. SW-UCB suffers from the same issues as UCB in previous problems and obtains a very high regret. Constant changes of mean cause META-EVE to reset very frequently and to obtain a lower regret than SW-UCB. EXP3.S and EXP3.R achieves both low regrets but EXP3.R suffers from the large size of historic needed to detect switches with a gap of ∆. We can notice that the randomization of resets in SER4, while allowing to achieves the best performances on this problem, involve an highest variance. Indeed, on some runs, a reset may occur latelly after a best arm switch whereas the use of windows or regularization parameters will be more consistant.

Conclusion

We studied the benefit of random shuffling in the design of sequential elimination bandit algorithms. We showed that the use of random shuffling extends their range of application to a new class of best arm identification problems involving non-stationary distributions, without requiring new parameter, while achieving the same level of guarantees than SE with stationary distributions. We introduced SER3 and extended it to the switching bandit problem with SER4 by adding a probability of restarting the best arm identification task. Up to our knowledge, we proved the first sample complexity based upper-bound for the best arm identification problem with arm switches. The upper-bound over the cumulative regret of SER4 depends only of the number N -1 of arm switches, as opposed to the number of distribution changes M -1 in SW-UCB (M ≥ N can be of order T in our setting). A Technical results

A.1 Proof of Theorem 1

The proof consists of three main steps. The first step makes explicit the conditions leading to the elimination of an arm from the set. The second step shows that the optimal arm will not be eliminated with high probability. Finally, the third step shows that a sub-optimal arm will be eliminated after at most a critical number of steps τ * , which then allows to derive an upper-bound on the sample complexity.

Step 1. Conditions for the elimination of an arm. From Hoeffding's inequality, for any deterministic round-robin length τ and arm k we have:

P (|μ k -E[μ k ]| ≥ τ ) ≤ 2 exp -2 2 τ τ .
where E denotes the expectation with respect to the distribution D y . By setting t = 1 2τ log 4Kτ 2 δ , we have:

P (|μ k -E[μ k (τ )]| ≥ t ) ≤ 2 exp   -2 1 2τ log 4Kτ 2 δ 2 τ 2   = δ 2Kτ 2 .
Applying Hoeffding's inequality for each round-robin size τ ∈ N , applying a standard union bound and using that ∞ τ =1 1/τ 2 = π 2 /6, the following inequality holds simultaneously for any τ with a probability at least 1 -δπ 2 12K :

μk (τ ) -τ ≤ E[μ k ] ≤ μk (τ ) + τ . (8)
Let S i ⊂ {1, . . . , K} be the set containing all the arms that are not eliminated by the algorithm at the start of the i th round-robin. By construction of the algorithm, an arm k remains in the set of selected arms as long as for each arm k ∈ S τ -{k }: μk (τ )τ < μk (τ ) + τ and τ ≥ τ min [START_REF] Kaufmann | On the Complexity of Best Arm Identification in Multi-Armed Bandit Models[END_REF] Combining [START_REF] Hoeffding | Probability Inequalities for Sums of Bounded Random Variables[END_REF] and the left inequality of (9), it holds on an event Ω of high probability

E[μ k (τ )] -2 τ < E[μ k (τ )] + 2 τ . (10)
We denote t τ , the time-step where the τ th round-robin starts (t τ = 1 + τ -1

i=1 |S i |).
Let us remind that T(τ ) is the set containing all possible realizations of τ sequences of round-robin. Each arm k is played one time during each round-robin phase and thus τ observations per arm are available after τ th round-robin phases. The empirical mean reward μk (τ ) of each arm k after the τ th round-robin is:

μk (τ ) = r∈T(τ ) 1 r=[τ ] τ tτ +|Sτ |-1 j=1 y k (j)1 k=kj . (11)
Decomposing the second sum in round-robin phases and taking the expectation with respect to the reward distribution D y we have:

E Dy [μ k (τ )] = r∈T(τ ) 1 r=[τ ] τ τ i=1 ti+|Sτ |-1 j=ti µ k (j)1 k=kj . (12)
Taking the expectation of equation ( 12) with respect to the randomization of the round-robin we have:

E[μ k (τ )] = r∈T(τ ) 1 r=[τ ] τ τ i=1 ti+|Sτ |-1 j=ti µ k (j) |S i | . (13)
Now, under the event Ω for which [START_REF] Kocsis | Discounted UCB[END_REF] holds for k and k , we deduce by using ( 13) that r∈T(τ )

1 r=[τ ] τ   τ i=1 ti+|Sτ |-1 j=ti µ k (j) |S i | - τ i=1 ti+|Sτ |-1 j=ti µ k (j) |S i |   < 4 τ . (14)
Let us introduce the following mean-gap quantity

∆ k,k ([τ ]) = r∈T(τ ) 1 r=[τ ] τ   τ i=1 ti+|Sτ |-1 j=ti µ k (j) |S i | - τ i=1 ti+|Sτ |-1 j=ti µ k (j) |S i |   .
Replacing the value of t in (14), it comes

∆ k,k ([τ ]) < 4 1 2τ log 4Kτ 2 δ , ∆ k,k ([τ ]) 2 < 8 τ log 4Kτ 2 δ . (15)
An arm will be eliminated if (15) becomes false and if τ ≥ τ min .

Step 2. The optimal arm is not eliminated. For k = k * and k = k * , by assumption 1 (∆ k,k * ([τ ]) is negative after τ min ), ( 15) is always true for τ ≥ τ min , implying that the optimal arm will always remain in the set with a probability of at least 1 -δ K for all τ .

Step 3. The elimination of sub-optimal arms. If the arm k still remain in the set, it will be eliminated if inequality (15) is not satisfied and if τ * ≥ τ min .

Let us consider k = k * , k = k * , and define the quantity

∆ k ([τ ]) = r∈T(τ ) 1 r=[τ ] τ   τ i=1 ti+|Sτ |-1 j=ti µ k (j) |S i | - τ i=1 ti+|Sτ |-1 j=ti µ k (j) |S i |   .
Let us also introduce for convenience the critical value

τ * = 64 ∆ k ([τ ]) 2 log 4K δ∆ k ([τ ])
.

Notice that τ * ≥ τ min , satisfying one of the two conditions needed to eliminate an arm.

We introduce the following quantity

C(t) def = 8 τ log 4Kτ 2 δ .
For τ = τ * , we derive the following bound .

C(τ * ) = ∆ k ([τ ]) 2 8 log 4K δ∆ k ([τ ]) log 4K δ + 2 log 64K 2 ∆ k ([τ ]) 2 + 2 log log 4K δ∆ k ([τ ]) , = ∆ k ([τ ]) 2 8 log 4K δ∆ k ([τ ]) log 4K δ -4 log ∆ k ([τ ]) + 12 log 2 + 2 log log 4K δ∆ k ([τ ]) , ≤ ∆ k ([τ ]) 2 8 log 4K δ∆ k ([τ ])
We remark that for X > 13 we have 12 log 2 + 2 log log X < 4 log X .

Hence, provided that for K ≥ 2, δ ∈ (0, 0.5] and ∆ k ([τ ]) > 0, we have 4K δ∆ k ([τ ]) > 13 and

C(τ * ) ≤ ∆ k ([τ ]) 2 8 log 4K δ∆ k ([τ ]) 8 log 4K δ∆ k ([τ ]) ≤ ∆ k ([τ ]) 2 . ( 16
)
As C(τ * ) is strictly decreasing with regard to t, (16) is true for all τ > τ * , invalidating (15) and involving the elimination of the suboptimal arms k with a probability at least 1δ/K.

We conclude the proof by summing over all the arms, taking the union bound and lower-bounding all ∆ k ([τ ]) by ∆ = min

A.2 Proof of Corollary 1

We first provide the proof of the distribution dependent upper-bound.

The cumulated pseudo regret of the algorithm is:

R(T ) = k =k * τ i=1 ti+|Si|-1 t=ti ∆ k * ,k (t)1 k=kt . ( 18
)
Taking in each round-robin the expectation of the corresponding random variable k t with respect to the randomization of the round-robin (denoted by E kt ), it comes:

E[R(T )] = E k =k * τ i=1 ti+|Si|-1 t=ti E kt [∆ k * ,k (t)1 k=kt ] = E k =k * τ i=1 ti+|Si|-1 t=ti ∆ k * ,k (t) |S i | . E[R(T )] = E k =k * τ 1 τ τ i=1 ti+|Si|-1 t=ti ∆ k * ,k (t) |S i | ∆ * k = E k =k * τ ∆ * k . (19)
The penultimate step of the proof of Theorem 1 allows us to upper-bound τ with the previously introduced critical value τ * on an event of high probability 1δ, while the cumulative regret is controlled by the trivial upper bound T on the complementary event of probability not higher than δ, leading to:

E[R(T )] ≤ k =k * 64 ∆ 2 k log 4K δ∆ k ∆ k + δT . ( 20
)
We conclude the proof of the distribution dependent upper-bound by setting δ = 1/T and :

E[R(T )] = O K -1 ∆ log( KT ∆ ) , (21)
with ∆ = min [τ ],k

1 τ τ i=1 ti+|Si|-1 t=ti ∆ k * ,k (t)
|Si| . We now upper-bound the regret in the worst case in order to derive a distribution independent bound. To this end, we consider a sequence that ensures that, with high probability, no suboptimal arm is eliminated by the algorithm at the end of the T rounds, while maximizing the instantaneous regret. According to [START_REF] Kocsis | Discounted UCB[END_REF]

  (a) Assumption 1 is satisfied as the mean gap remains positive. (b) Assumption 1 is not satisfied. This sequence involves a best arm switch as the mean gap become non positive.

Figure 2 :

 2 Figure 2: Two examples of sequence of mean rewards.

Corollary 3 .

 3 For K ≥ 2, and δ = 1/T , τ min = log(KT ), ∆ ≥ 1 KT and ϕ = N T K log(KT ) , the expected cumulative regret of SER4 w.r.t. the randomization of resets is upper bounded by:

Figure 3 :

 3 Figure 3: Cumulative regret of SER3, SE, UCB and EXP3 on the Problem 1.

  (a) Cumulative regret of SER3, SE UCB and EXP3 on the Problem 2. (b) Cumulative regret of SER4, SW-UCB, EXP3.S, EXP3.R and META-EVE on the Problem 3.

Figure 4 and

 4 Figure 4

[ 2 ]

 2 Auer, Peter, Cesa-Bianchi, Nicolò, & Fischer, Paul. 2002a. Finite-time Analysis of the Multiarmed Bandit Problem. Machine Learning, 47(2-3), 235-256.

  an arm is not eliminated as long asE[μ k (τ )] -E[μ k (τ )] < 4 τ .

								(22)
	By injecting (22) in (19) and replacing τ by its value 2 τ log 4Kτ 2 δ	we obtain:
	E[R(T )] <	k =k *	τ 4	2 τ	log	4Kτ 2 δ	+ δT .	(23)

The non-elimination of sub-optimal arms involves τ = T K and by setting δ = 1 T we obtain the distribution independent upper-bound:

A.3 Proof of Theorem 2

In order to prove Theorem 2, we consider the following quantities:

• The expected number of times when the estimators are reseted: N reset = ϕT .

• The sample complexity needed to find the best arm between each reset is

• The time before a reset, that follows a negative binomial distribution of parameters r = 1 and p = 1ϕ. Its expectation is upper-bounded by 1/ϕ.

• The number of arm switches: N -1.

The sample complexity of SER4 is the total number of time-steps spent sampling an arm added to the time between each switch and reset.

Taking the expectation with respect to the randomization of resets, we obtain an upper-bound on the expected number of suboptimal plays given by

The first term is the expectation of the total number of time-steps required by the algorithm in order to find the best arms at its initialization and then after each reset of the algorithm. The second term is the expected total number of steps lost by the algorithm when not reseting the algorithm after the N -1 arm switches.

We obtain the final statement of the Theorem by setting T = 1 δ .

A.4 Proof of Corollary 3

Converting Corollary 2 into a distribution dependent upper-bound on the cumulative regret is straightforward by setting δ = 1 T , replacing the sample complexity in the proof of Theorem 2 by the cumulative regret and using the upper-bound of Corollary 1.

Setting ϕ = N T K log(KT ) and assuming ∆ ≥ 1 KT we obtain the final statement of the theorem:

We also derive below a distribution independent upper-bound. We introduce some notations, N reset is the number of resets, τ reset i is the number of round-robin phases between the i th and the (i + 1) th resets and L n is the number of timesteps before a reset after the n th arm switch.

When the resets are fixed, the expected cumulative regret is:

At this point, we note that {τ reset i } i is an i.i.d sequence of random variables and that N reset is a random stopping time with respect to this sequence. Moreover, f is a concave function. We can thus apply Wald's equation followed by Jensen's inequality and deduce that

We upper-bound log(

ϕK and E[L n ] ≤ 1 ϕ , we have

The previous equation makes appear a trade-off in ϕ, and we set ϕ = √ N T 2/3 . Finally we have shown that