Title: REINFORCEMENT LEARNING ALGORITHM SELECTION

Abstract: This paper formalises the problem of online algorithm selection in the context of Reinforcement Learning (RL). The setup is as follows: given an episodic task and a finite number of off-policy RL algorithms, a meta-algorithm has to decide which RL algorithm is in control during the next episode so as to maximize the expected return. The article presents a novel meta-algorithm, called Epochal Stochastic Bandit Algorithm Selection (ESBAS). Its principle is to freeze the policy updates at each epoch, and to leave a rebooted stochastic bandit in charge of the algorithm selection. Under some assumptions, a thorough theoretical analysis demonstrates its near-optimality considering the structural sampling budget limitations. ESBAS is first empirically evaluated on a dialogue task where it is shown to outperform each individual algorithm in most configurations. ESBAS is then adapted to a true online setting where algorithms update their policies after each transition, which we call SSBAS. SSBAS is evaluated on a fruit collection task where it is shown to adapt the stepsize parameter more efficiently than the classical hyperbolic decay, and on an Atari game, where it improves the performance by a wide margin.

1. INTRODUCTION:

Reinforcement Learning (RL, Sutton & Barto (1998) ) is a machine learning framework for optimising the behaviour of an agent interacting with an unknown environment. For the most practical problems, such as dialogue or robotics, trajectory collection is costly and sample efficiency is the main key performance indicator. Consequently, when applying RL to a new problem, one must carefully choose in advance a model, a representation, an optimisation technique and their parameters. Facing the complexity of choice, RL and domain expertise is not sufficient. Confronted to the cost of data, the popular trial and error approach shows its limits.

We develop an online learning version (Gagliolo & Schmidhuber, 2006; 2010) of Algorithm Selection (AS, Rice (1976) ; Smith-Miles (2009) ; Kotthoff (2012) ). It consists in testing several algorithms on the task and in selecting the best one at a given time. For clarity, throughout the whole article, the algorithm selector is called a meta-algorithm, and the set of algorithms available to the meta-algorithm is called a portfolio. The meta-algorithm maximises an objective function such as the RL return. Beyond the sample efficiency objective, the online AS approach besides addresses four practical problems for online RL-based systems. First, it improves robustness: if an algorithm fails to terminate, or outputs to an aberrant policy, it will be dismissed and others will be selected instead. Second, convergence guarantees and empirical efficiency may be united by covering the empirically efficient algorithms with slower algorithms that have convergence guarantees. Third, it enables curriculum learning: shallow models control the policy in the early stages, while deep models discover the best solution in late stages. And four, it allows to define an objective function that is not an RL return.

A fair algorithm selection implies a fair budget allocation between the algorithms, so that they can be equitably evaluated and compared. In order to comply with this requirement, the reinforcement algorithms in the portfolio are assumed to be off-policy, and are trained on every trajectory, regardless which algorithm controls it. Section 2 provides a unifying view of RL algorithms, that allows information sharing between algorithms, whatever their state representations and optimisation techniques. It also formalises the problem of online selection of off-policy RL algorithms.

Next, Section 3 presents the Epochal Stochastic Bandit AS (ESBAS), a novel meta-algorithm addressing the online off-policy RL AS problem. Its principle relies on a doubling trick: it divides the time-scale into epochs of exponential length inside which the algorithms are not allowed to update their policies. During each epoch, the algorithms have therefore a constant policy and a stochastic multi-armed bandit can be in charge of the AS with strong pseudo-regret theoretical guaranties. A thorough theoretical analysis provides for ESBAS upper bounds. Then, Section 4 evaluates ESBAS on a dialogue task where it outperforms each individual algorithm in most configurations.

Afterwards, in Section 5, ESBAS, which is initially designed for a growing batch RL setting, is adapted to a true online setting where algorithms update their policies after each transition, which we call SSBAS. It is evaluated on a fruit collection task where it is shown to adapt the stepsize parameter more efficiently than the classical hyperbolic decay, and on Q*bert, where running several DQN with different network size and depth in parallel allows to improve the final performance by a wide margin. Finally, Section 6 concludes the paper with prospective ideas of improvement.

2. ALGORITHM SELECTION FOR RL 2.1 UNIFYING VIEW OF RL ALGORITHMS Agent:

Stochastic environment a(t) o(t + 1) r(t + 1)

Figure 1 : RL framework: after performing action a(t), the agent perceives observation o(t + 1) and receives reward r(t + 1).

The goal of this section is to enable information sharing between algorithms, even though they are considered as black boxes. We propose to share their trajectories expressed in a universal format: the interaction process.

Reinforcement Learning (RL) consists in learning through trial and error to control an agent behaviour in a stochastic environment: at each time step t ∈ N, the agent performs an action a(t) ∈ A, and then perceives from its environment a signal o(t) ∈ Ω called observation, and receives a reward r(t) ∈ R, bounded between R min and R max . Figure 1 illustrates the RL framework. This interaction process is not Markovian: the agent may have an internal memory.

In this article, the RL problem is assumed to be episodic. Let us introduce two time scales with different notations. First, let us define meta-time as the time scale for AS: at one meta-time τ corresponds a meta-algorithm decision, i.e. the choice of an algorithm and the generation of a full episode controlled with the policy determined by the chosen algorithm. Its realisation is called a trajectory. Second, RL-time is defined as the time scale inside a trajectory, at one RL-time t corresponds one triplet composed of an observation, an action, and a reward.

Let E denote the space of trajectories. A trajectory ε τ ∈ E collected at meta-time τ is formalised as a sequence of (observation, action, reward) triplets:

ε τ = o τ (t), a τ (t), r τ (t) t∈ 1,|ετ | ∈ E,

where |ε τ | is the length of trajectory ε τ . The objective is, given a discount factor 0 ≤ γ < 1, to generate trajectories with high discounted cumulative reward, also called return, and noted

µ(ε τ ) = |ετ |

t=1 γ t-1 r τ (t). Since γ < 1 and R is bounded, the return is also bounded. The trajectory set at meta-time T is denoted by

D T = {ε τ } τ ∈ 1,T ∈ E T . A sub-trajectory of ε τ until RL-time t is called the history at RL-time t and written ε τ (t) with t ≤ |ε τ |. The history records what happened in episode ε τ until RL-time t: ε τ (t) = o τ (t ), a τ (t ), r τ (t ) t ∈ 1,t ∈ E.

The goal of each RL algorithm α is to find a policy π * : E → A which yields optimal expected returns. Such an algorithm α is viewed as a black box that takes as an input a trajectory set D ∈ E + , where E + is the ensemble of trajectory sets of undetermined size: E + = T ∈N E T , and that outputs a policy π α D . Consequently, a RL algorithm is formalised as follows: α : E + → (E → A). Such a high level definition of the RL algorithms allows to share trajectories between algorithms: a trajectory as a sequence of observations, actions, and rewards can be interpreted by any algorithm in its own decision process and state representation. For instance, RL algorithms classically rely on an MDP defined on a explicit or implicit state space representation S α D thanks to a projection Φ α D : E → S α D . Then, α trains its policy π α D T on the trajectories projected on its state space representation. Off-policy RL optimisation techniques compatible with this approach are numerous in the literature (Watkins, 1989; Ernst et al., 2005; Mnih et al., 2013) . As well, any post-treatment of the state set, any alternative decision process (Lovejoy, 1991) , and any off-policy algorithm may be used. The algorithms are defined here as black boxes and the considered meta-algorithms will be indifferent to how the algorithms compute their policies, granted they satisfy the off-policy assumption.

2.2. ONLINE ALGORITHM SELECTION:

Pseudo-code 1: Online RL AS setting Data: D 0 ← ∅: trajectory set Data: P ← {α k } k∈ 1,K : algorithm portfolio Data: µ : E → R: the objective function

for τ ← 1 to ∞ do Select σ (D τ -1 ) = σ(τ ) ∈ P; Generate trajectory ε τ with policy π σ(τ ) Dτ-1 ; Get return µ(ε τ ); D τ ← D τ -1 ∪ {ε τ }; end

The online learning approach is tackled in this article: different algorithms are experienced and evaluated during the data collection. Since it boils down to a classical exploration/exploitation trade-off, multi-armed bandit (Bubeck & Cesa-Bianchi, 2012) have been used for combinatorial search AS (Gagliolo & Schmidhuber, 2006; 2010) and evolutionary algorithm meta-learning (Fialho et al., 2010) . The online AS problem for off-policy RL is novel and we define it as follows:

• D ∈ E + is the current trajectory set; • P = {α k } k∈ 1,K is the portfolio of off-policy RL algorithms; • µ : E → R is the objective function, generally set as the RL return.

Pseudo-code 1 formalises the online RL AS setting. A meta-algorithm is defined as a function from a trajectory set to the selection of an algorithm: σ : E + → P. The meta-algorithm is queried at each meta-time τ = |D τ -1 |+1, with input D τ -1 , and it ouputs algorithm σ (D τ -1 ) = σ(τ ) ∈ P controlling with its policy π σ(τ ) Dτ-1 the generation of the trajectory ε τ in the stochastic environment. Figure 2 illustrates the algorithm with a diagram flow. The final goal is to optimise the cumulative expected return. It is the expectation of the sum of rewards obtained after a run of T trajectories:

(1)

E σ T τ =1 µ (ε τ ) = E σ T τ =1 Eµ σ(τ ) D σ τ -1 , with Eµ α D = E π α D [µ (ε)

] as a condensed notation for the expected return of policy π α D , trained on trajectory set D by algorithm α. Equation 1 transforms the cumulative expected return into two nested Algorithm Selection σ expectations. The outside expectation E σ assumes the meta-algorithm σ fixed and averages over the trajectory set generation and the corresponding algorithms policies. The inside expectation Eµ assumes the policy fixed and averages over its possible trajectories in the stochastic environment. Nota bene: there are three levels of decision: meta-algorithm σ selects algorithm α that computes policy π that is in control. In this paper, the focus is at the meta-algorithm level.

D τ α 1 α 2 . . . α K Agent π σ(τ ) D τ Environment Trajectory ε τ : o τ (t), a τ (t), r τ (t) t Return µ(ε τ ): |ε τ | t=1 γ t-1 r τ (t) Portfolio RL framework σ(τ ) π σ(τ ) D τ a(t) o(t + 1) r(t + 1) ε τ µ(ε τ )

2.3. META-ALGORITHM EVALUATION:

In this paper, we focus on sample efficiency, where a sample is meant to be a trajectory. This is motivated by the following reasons. First, in most real-world systems, the major regret is on the task failure. The time expenditure is only a secondary concern that is already assessed by the discount factor dependency in the return. Second, it would be inconsistent to consider regret on a different time scale as the algorithm selection. Also, policy selection on non-episodic RL is known as a very difficult task where state-of-the-art algorithms only obtain regrets of the order of O( √ T log(T )) on stationary policies Azar et al. (2013) . Third, the regret on the decision steps cannot be assessed, since the rewards are discounted in the RL objective function. And finally, the bandit rewards (defined as the objective function in Section 2.2) may account for the length of the episode.

In order to evaluate the meta-algorithms, let us formulate two additional notations. First, the optimal expected return Eµ * ∞ is defined as the highest expected return achievable by a policy of an algorithm in portfolio P. Second, for every algorithm α in the portfolio, let us define σ α as its canonical metaalgorithm, i.e. the meta-algorithm that always selects algorithm α: ∀τ , σ α (τ ) = α. The absolute pseudo-regret ρ σ abs (T ) defines the regret as the loss for not having controlled the trajectory with an optimal policy:

EQUATION

It is worth noting that an optimal meta-algorithm will unlikely yield a null regret because a large part of the absolute pseudo-regret is caused by the sub-optimality of the algorithm policies when the trajectory set is still of limited size. Indeed, the absolute pseudo-regret considers the regret for not selecting an optimal policy: it takes into account both the pseudo-regret of not selecting the best algorithm and the pseudo-regret of the algorithms for not finding an optimal policy. Since the metaalgorithm does not interfere with the training of policies, it ought not account for the pseudo-regret related to the latter.

2.4. RELATED WORK:

Related to AS for RL, Schweighofer & Doya (2003) use meta-learning to tune a fixed RL algorithm in order to fit observed animal behaviour, which is a very different problem to ours. In Cauwet et al. (2014) ; Liu & Teytaud (2014) , the RL AS problem is solved with a portfolio composed of online RL algorithms. The main limitation from these works relies on the fact that on-policy algorithms were used, which prevents them from sharing trajectories among algorithms (Cauwet et al., 2015) . Meta-learning specifically for the eligibility trace parameter has also been studied in White & White (2016) . Wang et al. (2016) study the learning process of RL algorithms and selects the best one for learning faster on a new task. This work is related to batch AS.

An intuitive way to solve the AS problem is to consider algorithms as arms in a multi-armed bandit setting. The bandit meta-algorithm selects the algorithm controlling the next trajectory ε and the objective function µ(ε) constitutes the reward of the bandit. The aim of prediction with expert advice is to minimise the regret against the best expert of a set of predefined experts. When the experts learn during time, their performances evolve and hence the sequence of expert rewards is non-stationary.

The exponential weight algorithms (Auer et al., 2002b; Cesa-Bianchi & Lugosi, 2006) are designed for prediction with expert advice when the sequence of rewards of experts is generated by an oblivious adversary. This approach has been extended for competing against the best sequence of experts by adding in the update of weights a forgetting factor proportional to the mean reward (see Exp3.S in Auer et al. (2002b) ), or by combining Exp3 with a concept drift detector Allesiardo & Féraud (2015) .

The exponential weight algorithms have been extended to the case where the rewards are generated by any sequence of stochastic processes of unknown means (Besbes et al., 2014) .

A recent article Graves et al. (2017) uses Exp3.S algorithm Auer et al. (2002b) for curriculum learning Bengio et al. (2009) . The drawback of adversarial approaches is that they lead to very conservative algorithms which has to work against an adversary.

For handeling non-stationarity of rewards, another way is to assume that the rewards generated by each arm are not i.i.d., but are governed by some more complex stochastic processes. The stochastic bandit algorithm such as UCB can be extended to the case of switching bandits using a discount factor or a window to forget the past Garivier & Moulines (2011) . Restless bandits Whittle (1988) ; Ortner et al. (2012) assume that a Markov chain governs the reward of arms independently of whether the learner is played or not the arm. These classes of bandit algorithms are not designed for experts that learn and hence evolve at each time step.

Our approach takes the opposite view of adversarial bandits: we design a stochastic algorithm specifically for curriculum learning based on the doubling trick. This reduction of the algorithm selection problem into several stochastic bandit problems with doubling time horizon begins to favour fast algorithms, and then more efficient algorithms.

3. EPOCHAL STOCHASTIC BANDIT:

ESBAS description -To solve the off-policy RL AS problem, we propose a novel meta-algorithm called Epochal Stochastic Bandit AS (ESBAS). Because of the non-stationarity induced by the algorithm learning, the stochastic bandit cannot directly select algorithms. Instead, the stochastic bandit can choose fixed policies. To comply with this constraint, the meta-time scale is divided into epochs inside which the algorithms policies cannot be updated: the algorithms optimise their policies only when epochs start, in such a way that the policies are constant inside each epoch. This can be seen as a doubling trick. As a consequence and since the returns are bounded, at each new epoch, the problem can rigorously be cast into an independent stochastic K-armed bandit Ξ, with K = |P|.

Pseudo-code 2: ESBAS with UCB1 Data: D 0 , P, µ: the online RL AS setting

for β ← 0 to ∞ do for α k ∈ P do π k D 2 β -1 : policy learnt by α k on D 2 β -1 end n ← 0, ∀α k ∈ P, n k ← 0, and x k ← 0 for τ ← 2 β to 2 β+1 -1 do α kmax = argmax α k ∈P x k + ξ log(n) n k Generate trajectory ε τ with policy π kmax D 2 β -1 Get return µ(ε τ ), D τ ← D τ -1 ∪ {ε τ } x kmax ← n kmax x kmax + µ(ε τ ) n kmax + 1 n kmax ← n kmax + 1 and n ← n + 1 end end

The ESBAS meta-algorithm is formally sketched in Pseudo-code 2 embedding UCB1 Auer et al. (2002a) as the stochastic Karmed bandit Ξ. The meta-algorithm takes as an input the set of algorithms in the portfolio. Meta-time scale is fragmented into epochs of exponential size. The β th epoch lasts 2 β metatime steps, so that, at meta-time τ = 2 β , epoch β starts. At the beginning of each epoch, the ESBAS meta-algorithm asks each algorithm in the portfolio to update their current policy. Inside an epoch, the policy is never updated anymore. At the beginning of each epoch, a new Ξ instance is reset and run. During the whole epoch, Ξ selects at each meta-time step the algorithm in control of the next trajectory.

Theoretical analysis -ESBAS intends to minimise the regret for not choosing the algorithm yielding the maximal return at a given meta-time τ . It is short-sighted: it does not intend to optimise the algorithms learning. We define the short-sighted pseudo-regret as follows:

EQUATION

The short-sighted pseudo-regret depends on the gaps ∆ α β : the difference of expected return between the best algorithm during epoch β and algorithm α. The smallest non null gap at epoch β is noted ∆ † β . We write its limit when β tends to infinity with ∆ † ∞ . Analysis relies on three assumptions that are formalised in Section B of the supplementary material. First, more data is better data states that algorithms improve on average from having additional data. Second, order compatibility assumes that, if a dataset enables to generate a better policy than another dataset, then, on average, adding new samples to both datasets should not change the dataset ordering. Third and last, let us introduce and discuss more in depth the learning is fair assumption. The fairness of budget distribution has been formalised in Cauwet et al. (2015) . It is the property stating that every algorithm in the portfolio has as much resources as the others, in terms of computational time and data. It is an issue in most online AS problems, since the algorithm that has been the most selected has the most data, and therefore must be the most advanced one. A way to circumvent this issue is to select them equally, but, in an online setting, the goal of AS is precisely to select the best algorithm as often as possible. Our answer is to require that all algorithms in the portfolio are learning off-policy, i.e. without bias induced by the behavioural policy used in the learning dataset. By assuming that all algorithms learn off-policy, we allow information sharing Cauwet et al. (2015) between algorithms. They share the trajectories they generate. As a consequence, we can assume that every algorithm, the least or the most selected ones, will learn from the same trajectory set. Therefore, the control unbalance does not directly lead to unfairness in algorithms performances: all algorithms learn equally from all trajectories. However, unbalance might still remain in the exploration strategy if, for instance, an algorithm takes more benefit from the exploration it has chosen than the one chosen by another algorithm. For analysis purposes, we assumes the complete fairness of AS.

Based on those assumptions, three theorems show that ESBAS absolute pseudo-regret can be expressed in function of the absolute pseudo-regret of the best canonical algorithm and ESBAS shortsighted pseudo-regret. They also provide upper bounds on the ESBAS short-sighted pseudo-regret as a function of the order of magnitude of the gap ∆ † β . Indeed, the stochastic multi-armed bandit algorithms have bounds that are, counter-intuitively, inversely proportional to the gaps between the best arm and the other ones. In particular if ∆ † β tends to 0, the algorithm selection might prove to be difficult, depending on the order of magnitude of it tending to 0. The full theoretical analysis can be found in the supplementary material, Section B. We provide here an intuitive overlook of its results. Table 1 numerically reports those bounds for a two-fold portfolio, depending on the nature of the algorithms. It must be read by line. According to the first column: the order of magnitude of ∆ † β , the ESBAS short-sighted pseudo-regret bounds are displayed in the second column, and the third and fourth columns display the ESBAS absolute pseudo-regret bounds also depending on the order of magnitude of the best canonical algorithm absolute pseudo-regret: ρ σ * abs (T ). Regarding the short-sighted upper bounds, the main result appears in the last line, when the algorithms converge to policies with different performance: ESBAS converges with a regret in O log 2 (T )/∆ † ∞ . Also, one should notice that the bounds of the first two lines are obtained by summing the gaps: this means that the algorithms are perceived equally good and that their gap goes beyond the threshold of distinguishability. This threshold is structurally at

∆ † β ∈ O(1/ √ T ).

The impossibility to determine which is the better algorithm is interpreted in Cauwet et al. (2014) as a budget issue. The meta-time necessary to distinguish through evaluation arms that are ∆ † β apart takes Θ(1/∆ †2 β ) meta-time steps. If the budget is inferior, then we are under the distinguishability threshold and the best bounds are obtained by summing up the gaps. As a consequence, if 

∆ † β ∈ O(1/ √ T ), then 1/∆ †2 β ∈ Ω(T ).

∆ † β ρ σ ESBAS ss (T ) ρ σ ESBAS abs (T ) in function of ρ σ * abs (T ) ρ σ * abs (T ) ∈ O(log(T )) ρ σ * abs (T ) ∈ O(T 1-c * ) Θ (1/T ) O (log(T )) O (log(T )) Θ(T -c † ), and c † ≥ 0.5 O(T 1-c † ) O(T 1-c † ) O(T 1-c † ) Θ(T -c † ), and c † < 0.5 O(T c † log(T )) O(T c † log(T )) O(T 1-c * ), if c † < 1 -c * O(T c † log(T )), if c † ≥ 1 -c * Θ (1) O log 2 (T )/∆ † ∞ O log 2 (T )/∆ † ∞ O(T 1-c * )

4. ESBAS DIALOGUE EXPERIMENTS:

ESBAS is particularly designed for RL tasks when it is impossible to update the policy after every transition or episode. Policy update is very costly in most real-world applications, such as dialogue systems (Khouzaimi et al., 2016) for which a growing batch setting is preferred (Lange et al., 2012) . ESBAS practical efficiency is therefore illustrated on a dialogue negotiation game (Laroche & Genevay, 2016 ) that involves two players: the system p s and a user p u . Their goal is to find an agreement among 4 alternative options. At each dialogue, for each option η, players have a private uniformly drawn cost ν p η ∼ U[0, 1] to agree on it. Each player is considered fully empathetic to the other one. The details of the experiment can be found in the supplementary material, Section C.1.1.

All learning algorithms are using Fitted-Q Iteration (Ernst et al., 2005) , with a linear parametrisation and an β -greedy exploration : β = 0.6 β , β being the epoch number. Several algorithms differing by their state space representation Φ α are considered: simple, fast, simple-2, fast-2, n-ζ-{simple/fast/simple-2/fast-2}, and constant-µ. See Section C.1.2 for their full descriptions. The algorithms and ESBAS are playing with a stationary user simulator built through Imitation Learning from real-human data. All the results are averaged over 1000 runs. The performance figures plot the curves of algorithms individual performance σ α against the ESBAS portfolio control σ ESBAS in function of the epoch (the scale is therefore logarithmic in meta-time). The performance is the average return of the RL problem. The ratio figures plot the average algorithm selection proportions of ESBAS at each epoch. We define the relative pseudo regret as the difference between the ESBAS absolute pseudo-regret and the absolute pseudo-regret of the best canonical meta-algorithm. Relative pseudo-regrets have a 95% confidence interval about ±6 ≈ ±1.5 × 10 -4 per trajectory. Extensive numerical results are provided in Table 2 of the supplementary material.

Figures 3a and 3b plot the typical curves obtained with ESBAS selecting from a portfolio of two learning algorithms. On Figure 3a , the ESBAS curve tends to reach more or less the best algorithm in each point as expected. Surprisingly, Figure 3b reveals that the algorithm selection ratios are not very strong in favour of one or another at any time. Indeed, the variance in trajectory set collection makes simple better on some runs until the end. ESBAS proves to be efficient at selecting the best algorithm for each run and unexpectedly obtains a negative relative pseudo-regret of -90. Figures 3c and 3d plot the typical curves obtained with ESBAS selecting from a portfolio constituted of a learning algorithm and an algorithm with a deterministic and stationary policy. ESBAS succeeds in remaining close to the best algorithm at each epoch and saves 5361 return value for not selecting the constant algorithm, but overall yields a regret for not using only the best algorithm. ESBAS also performs well on larger portfolios of 8 learners (see Figure 3e ) with negative relative pseudo-regrets: -10, even if the algorithms are, on average, almost selected uniformly as Figure 3f reveals. Each individual run may present different ratios, depending on the quality of the trained policies. ESBAS also offers some curriculum learning, but more importantly, early bad policies are avoided.

Algorithms with a constant policy do not improve over time and the full reset of the K-multi armed bandit urges ESBAS to unnecessarily explore again and again the same underachieving algorithm. One easy way to circumvent this drawback is to use this knowledge and to not reset their arms. By operating this way, when the learning algorithm(s) start(s) outperforming the constant one, ESBAS simply neither exploits nor explores the constant algorithm anymore. Without arm reset for constant algorithms, ESBAS's learning curve follows perfectly the learning algorithm's learning curve when this one outperforms the constant algorithm and achieves strong negative relative pseudo-regrets.

Again, the interested reader may refer to Table 2 in supplementary material for the numerical results. Still, another harmful phenomenon may happen: the constant algorithm overrides the natural exploration of the learning algorithm in the early stages, and when the learning algorithm finally outperforms the constant algorithm, its exploration parameter is already low. This can be observed in experiments with constant algorithm of expected return inferior to 1, as reported in Table 2 .

5. SLIDING STOCHASTIC BANDIT ALGORITHM SELECTION:

We propose to adapt ESBAS to a true online setting where algorithms update their policies after each transition. The stochastic bandit is now trained on a sliding window containing the last τ /2 selections. Even though the arms are not stationary over this window, the bandit eventually forgets the oldest arm pulls. This algorithm is called SSBAS for Sliding Stochastic Bandit AS. Despite the lack of theoretical convergence bounds, we demonstrate on two domains and two different meta-optimisation tasks that SSBAS impressively outperforming all algorithms in the portfolio by a wide margin.

5.1. GRIDWORLD DOMAIN Figure 4: gridworld:

The goal here is to demonstrate that SSBAS can perform efficient hyper-parameter optimisation on a simple tabular domain: a 5x5 gridworld problem (see Figure 4 ), where the goal is to collect the fruits placed at each corner as fast as possible. The episodes terminate when all fruits have been collected or after 100 transitions. The objective function µ used to optimise the stochastic bandit Ψ is no longer the RL return, but the time spent to collect all the fruits (200 in case of it did not). The agent has 18 possible positions and there are 2 4 -1 = 15 non-terminal fruits configurations, resulting in 270 states. The action set is A = {N, E, S, W }. The reward function mean is 1 when eating a fruit, 0 otherwise. The reward function is corrupted with a strong Gaussian white noise of variance ζ 2 = 1.

The portfolio is composed of 4 Q-learning algorithms varying from each other by their learning rates: {0.001, 0.01, 0.1, 0.5}. They all have the same linearly annealing τ -greedy exploration.

The selection ratios displayed in 5 show that SSBAS selected the algorithm with the highest (0.5) learning rate in the first stages, enabling to propagate efficiently the reward signal through the visited states, then, over time preferentially chooses the algorithm with a learning rate of 0.01, which is less sensible to the reward noise, finally, SSBAS favours the algorithm with the finest learning rate (0.001). After 1 million episodes, SSBAS enables to save half a transition per episode on average as compared to the best fixed learning rate value (0.1), and two transitions against the worst fixed learning rate in the portfolio (0.001).

We compare SSBAS to the efficiency of a linearly annealing learning rate: 1/(1 + 0.0001τ ): SSBAS performs under 21 steps on average after 10 5 , while the linearly annealing learning rate algorithm still performs a bit over 21 steps after 10 6 steps. This is because SSBAS can adapt the best performing learning rate over time. We also compare SSBAS performance to Exp3.S's performance (Auer et al., 2002b) . The analysis of the algorithm selection history shows that Exp3.S is too conservative and fails at efficiently select the shallowest algorithms in the beginning of the learning (number of steps at the 10000 th episode: 28.3 for SSBAS vs 39.1 for Exp3.S), producing trajectories of lesser quality and therefore critically delaying the general training of all algorithms (number of steps at the 100000 th episode: 20.9 for SSBAS vs 22.5 for Exp3.S). Overall, SSBAS outperforms Exp3.S by a significant and wide margin: number of steps averaged over all the training 10^5 episodes: 28.7 for SSBAS vs 33.6 for Exp3.S.

5.2. ATARI DOMAIN:

: Q*BERT Figure 6: Q*bert

We investigate here AS for deep RL on the Arcade Learning Environment (ALE, Bellemare et al. ( 2013)) and more precisely the game Q*bert (see a frame on Figure 6 ), where the goal is to step once on each block. Then a new similar level starts. In later levels, one needs to step twice on each block, and even later stepping again on the same blocks will cancel the colour change. We used three different settings of DQN instances: small uses the setting described in Mnih et al. (2013) , large uses the setting in Mnih et al. (2015) , and finally huge uses an even larger network (see the supplementary material, Section C.2 for details). DQN is known to reach a near-human level performance at Q*bert.

Our SSBAS instance runs 6 algorithms with 2 different random initialisations of each DQN setting. Disclaimer: contrarily to other experiments, each curve is the result of a single run, and the improvement might be aleatory. Indeed, the DQN training is very long and SSBAS needs to train all the models in parallel. A more computationally-efficient solution might be to use the same architecture as Osband et al. (2016) .

7 reveals that SSBAS experiences a slight delay keeping in touch with the best setting performance during the initial learning phase, but, surprisingly, finds a better policy than the single algorithms in its portfolio and than the ones reported in the previous DQN articles. We observe that the large setting is surprisingly by far the worst one on the Q*bert task, implying the difficulty to predict which model is the most efficient for a new task. SSBAS allows to select online the best one.

6. CONCLUSION:

In this article, we tackle the problem of selecting online off-policy RL algorithms. The problem is formalised as follows: from a fixed portfolio of algorithms, a meta-algorithm learns which one performs the best on the task at hand. Fairness of algorithm evaluation implies that the RL algorithms learn off-policy. ESBAS, a novel meta-algorithm, is proposed. Its principle is to divide the meta-time scale into epochs. Algorithms are allowed to update their policies only at the start each epoch. As the policies are constant inside each epoch, the problem can be cast into a stochastic multi-armed bandit. An implementation is detailed and a theoretical analysis leads to upper bounds on the regrets. ESBAS is designed for the growing batch RL setting. This limited online setting is required in many real-world applications where updating the policy requires a lot of resources.

Experiments are first led on a negotiation dialogue game, interacting with a human data-built simulated user. In most settings, not only ESBAS demonstrates its efficiency to select the best algorithm, but it also outperforms the best algorithm in the portfolio thanks to curriculum learning, and variance reduction similar to that of Ensemble Learning. Then, ESBAS is adapted to a full online setting, where algorithms are allowed to update after each transition. This meta-algorithm, called SSBAS, is empirically validated on a fruit collection task where it performs efficient hyper-parameter optimisation. SSBAS is also evaluated on the Q*bert Atari game, where it achieves a substantial improvement over the single algorithm counterparts.

We interpret ESBAS/SSBAS's success at reliably outperforming the best algorithm in the portfolio as the result of the four following potential added values. First, curriculum learning: ESBAS/SSBAS selects the algorithm that is the most fitted with the data size. This property allows for instance to use shallow algorithms when having only a few data and deep algorithms once collected a lot. Second, diversified policies: ESBAS/SSBAS computes and experiments several policies. Those diversified policies generate trajectories that are less redundant, and therefore more informational. As a result, the policies trained on these trajectories should be more efficient. Third, robustness: if one algorithm fails at finding good policies, it will soon be discarded. This property prevents the agent from repeating again and again the same obvious mistakes. Four and last, run adaptation: of course, there has to be an algorithm that is the best on average for one given task at one given meta-time. But depending on the variance in the trajectory collection, it did not necessarily train the best policy for each run. The ESBAS/SSBAS meta-algorithm tries and selects the algorithm that is the best at each run. Some of those properties are inherited by algorithm selection similarity with ensemble learning (Dietterich, 2002) . Wiering & Van Hasselt (2008) uses a vote amongst the algorithms to decide the control of the next transition. Instead, ESBAS/SSBAS selects the best performing algorithm.

Regarding the portfolio design, it mostly depends on the available computational power per sample ratio. For practical implementations, we recommend to limit the use of two highly demanding algorithms, paired with several faster algorithms that can take care of first learning stages, and to use algorithms that are diverse regarding models, hypotheses, etc. Adding two algorithms that are too similar adds inertia, while they are likely to not be distinguishable by ESBAS/SSBAS. More detailed recommendations for building an efficient RL portfolio are left for future work.

A GLOSSARY 

B THEORETICAL ANALYSIS:

The theoretical aspects of algorithm selection for reinforcement learning in general, and Epochal Stochastic Bandit Algorithm Selection in particular, are thoroughly detailed in this section. The proofs of the Theorems are provided in Sections E, F, and G. We recall and formalise the absolute pseudo-regret definition provided in Section 2.3.

Definition 1 (Absolute pseudo-regret). The absolute pseudo-regret ρ σ abs (T ) compares the metaalgorithm's expected return with the optimal expected return:

ρ σ abs (T ) = T Eµ * ∞ -E σ T τ =1 Eµ σ(τ ) D σ τ -1 . (4) B.1 ASSUMPTIONS

The theoretical analysis is hindered by the fact that AS, not only directly influences the return distribution, but also the trajectory set distribution and therefore the policies learnt by algorithms for next trajectories, which will indirectly affect the future expected returns. In order to allow policy comparison, based on relation on trajectory sets they are derived from, our analysis relies on two assumptions.

Assumption 1 (More data is better data). The algorithms train better policies with a larger trajectory set on average, whatever the algorithm that controlled the additional trajectory:

EQUATION

Assumption 1 states that algorithms are off-policy learners and that additional data cannot lead to performance degradation on average. An algorithm that is not off-policy could be biased by a specific behavioural policy and would therefore transgress this assumption.

Assumption 2 (Order compatibility). If an algorithm trains a better policy with one trajectory set than with another, then it remains the same, on average, after collecting an additional trajectory from any algorithm:

EQUATION

)

Assumption 2 states that a performance relation between two policies trained on two trajectory sets is preserved on average after adding another trajectory, whatever the behavioural policy used to generate it. From these two assumptions, Theorem 1 provides an upper bound in order of magnitude in function of the worst algorithm in the portfolio. It is verified for any meta-algorithm σ.

Theorem 1 (Not worse than the worst). The absolute pseudo-regret is bounded by the worst algorithm absolute pseudo-regret in order of magnitude:

EQUATION

)

Contrarily to what the name of Theorem 1 suggests, a meta-algorithm might be worse than the worst algorithm (similarly, it can be better than the best algorithm), but not in order of magnitude. Its proof is rather complex for such an intuitive result because, in order to control all the possible outcomes, one needs to translate the selections of algorithm α with meta-algorithm σ into the canonical meta-algorithm σ α 's view.

B.2 SHORT-SIGHTED PSEUDO-REGRET ANALYSIS OF ESBAS:

ESBAS intends to minimise the regret for not choosing the best algorithm at a given meta-time τ . It is short-sighted: it does not intend to optimise the algorithms learning.

Definition 2 (Short-sighted pseudo-regret). The short-sighted pseudo-regret ρ σ ss (T ) is the difference between the immediate best expected return algorithm and the one selected:

EQUATION

)

Theorem 2 (ESBAS short-sighted pseudo-regret). If the stochastic multi-armed bandit Ξ guarantees a regret of order of magnitude O(log(T )/∆ † β ), then:

EQUATION

)

Theorem 2 expresses in order of magnitude an upper bound for the short-sighted pseudo-regret of ESBAS. But first, let define the gaps:

∆ α β = max α ∈P Eµ α D σ ESBAS 2 β -1 -Eµ α D σ ESBAS 2 β -1

. It is the difference of expected return between the best algorithm during epoch β and algorithm α. The smallest non null gap at epoch β is noted:

∆ † β = min α∈P,∆ α β >0 ∆ α β . If ∆ † β does not exist, i.e.

if there is no non-null gap, the regret is null.

Several upper bounds in order of magnitude on ρ ss (T ) can be easily deduced from Theorem 2, depending on an order of magnitude of ∆ † β . See the corollaries in Section F.1, Table 1 and more generally Section 3 for a discussion.

B.3 ESBAS ABSOLUTE PSEUDO-REGRET ANALYSIS:

The short-sighted pseudo-regret optimality depends on the meta-algorithm itself. For instance, a poor deterministic algorithm might be optimal at meta-time τ but yield no new information, implying the same situation at meta-time τ + 1, and so on. Thus, a meta-algorithm that exclusively selects the deterministic algorithm would achieve a short-sighted pseudo-regret equal to 0, but selecting other algorithms are, in the long run, more efficient. Theorem 2 is a necessary step towards the absolute pseudo-regret analysis.

The absolute pseudo-regret can be decomposed between the absolute pseudo-regret of the best canonical meta-algorithm (i.e. the algorithm that finds the best policy), the regret for not always selecting the best algorithm, and potentially not learning as fast, and the short-sighted regret: the regret for not gaining the returns granted by the best algorithm. This decomposition leads to Theorem 3 that provides an upper bound of the absolute pseudo-regret in function of the best canonical meta-algorithm, and the short-sighted pseudo-regret.

The fairness of budget distribution is the property stating that every algorithm in the portfolio has as much resources as the others, in terms of computational time and data. Section 3 discusses it at length. For analysis purposes, Theorem 3 assumes the fairness of AS:

Assumption 3 (Learning is fair). If one trajectory set is better than another for training one given algorithm, it is the same for other algorithms.

EQUATION

Theorem 3 (ESBAS absolute pseudo-regret upper bound). Under assumption 3, if the stochastic multi-armed bandit Ξ guarantees that the best arm has been selected in the T first episodes at least T /K times, with high probability 1δ T , with δ T ∈ O(1/T ), then:

EQUATION

where meta-algorithm σ * selects exclusively algorithm α * = argmin α∈P ρ σ α abs (T ). Successive and Median Elimination (Even-Dar et al., 2002) and Upper Confidence Bound (Auer et al., 2002a) under some conditions (Audibert et al., 2010) are examples of appropriate Ξ satisfying both conditions stated in Theorems 2 and 3. Again, see Table 1 and more generally Section 3 for a discussion of those bounds.

C.1.3 EVALUATION PROTOCOL:

In all our experiments, ESBAS has been run with UCB parameter ξ = 1/4. We consider 12 epochs. The first and second epochs last 20 meta-time steps, then their lengths double at each new epoch, for a total of 40,920 meta-time steps and as many trajectories. γ is set to 0.9. The algorithms and ESBAS are playing with a stationary user simulator built through Imitation Learning from realhuman data. All the results are averaged over 1000 runs. The performance figures plot the curves of algorithms individual performance σ α against the ESBAS portfolio control σ ESBAS in function of the epoch (the scale is therefore logarithmic in meta-time). The performance is the average return of the reinforcement learning return: it equals γ | | R ps (s f ) in the negotiation game. The ratio figures plot the average algorithm selection proportions of ESBAS at each epoch. We define the relative pseudo regret as the difference between the ESBAS absolute pseudo-regret and the absolute pseudo-regret of the best canonical meta-algorithm. All relative pseudo-regrets, as well as the gain for not having chosen the worst algorithm in the portfolio, are provided in Table 2 . Relative pseudo-regrets have a 95% confidence interval about ±6 ≈ ±1.5 × 10 -4 per trajectory.

C.1.4 ASSUMPTIONS TRANSGRESSIONS:

Several results show that, in practice, the assumptions are transgressed. Firstly, we observe that Assumption 3 is transgressed. Indeed, it states that if a trajectory set is better than another for a given algorithm, then it's the same for the other algorithms. Still, this assumption infringement does not seem to harm the experimental results. It even seems to help in general: while this assumption is consistent curriculum learning, it is inconsistent with the run adaptation property advanced in Subsection 6 that states that an algorithm might be the best on some run and another one on other runs.

And secondly, off-policy reinforcement learning algorithms exist, but in practice, we use state space representations that distort their off-policy property (Munos et al., 2016) . However, experiments do not reveal any obvious bias related to the off/on-policiness of the trajectory set the algorithms train on.

C.2 Q*BERT EXPERIMENT DETAILS:

The three DQN networks (small, large, and huge) are built in a similar fashion, with relu activations at each layer except for the output layer which is linear, with RMSprop optimizer (ρ = 0.95 and = 10 -7 ), and with He uniform initialisation. The hyperparameters used for training them are also the same and equal to the ones presented in the table hereinafter: no-op max 30

Only their shapes differ:

• small has a first convolution layer with a 4x4 kernel and a 2x2 stride, and a second convolution layer with a 4x4 kernel and a 2x2 stride, followed by a dense layer of size 128, and finally the output layer is also dense.

• large has a first convolution layer with a 8x8 kernel and a 4x4 stride, and a second convolution layer with a 4x4 kernel and a 2x2 stride, followed by a dense layer of size 256, and finally the output layer is also dense.

• huge has a first convolution layer with a 8x8 kernel and a 4x4 stride, a second convolution layer with a 4x4 kernel and a 2x2 stride, and a third convolution layer with a 3x3 kernel and a 1x1 stride, followed by a dense layer of size 512, and finally the output layer is also dense. -125 -319

Table 2 : ESBAS pseudo-regret after 12 epochs (i.e. 40,920 trajectories) compared with the best and the worst algorithms in the portfolio, in function of the algorithms in the portfolio (described in the first column). The '+' character is used to separate the algorithms. all-4 means all the four learning algorithms described in Section C.1.2 simple + fast + simple-2 + fast-2. all-4-n-1 means the same four algorithms with one additional feature of noise. Finally, all-2-simple means simple + simple-2 and all-2-n-1-simple means n-1-simple + n-1-simple-2. On the second column, the redder the colour, the worse ESBAS is achieving in comparison with the best algorithm. Inversely, the greener the colour of the number, the better ESBAS is achieving in comparison with the best algorithm. If the number is neither red nor green, it means that the difference between the portfolio and the best algorithm is insignificant and that they are performing as good. This is already an achievement for ESBAS to be as good as the best. On the third column, the bluer the cell, the weaker is the worst algorithm in the portfolio. One can notice that positive regrets are always triggered by a very weak worst algorithm in the portfolio. In these cases, ESBAS did not allow to outperform the best algorithm in the portfolio, but it can still be credited with the fact it dismissed efficiently the very weak algorithms in the portfolio.

E NOT WORSE THAN THE WORST:

Theorem 1 (Not worse than the worst). The absolute pseudo-regret is bounded by the worst algorithm absolute pseudo-regret in order of magnitude:

EQUATION

Proof. From Definition 1:

(12a) ρ σ abs (T ) = T Eµ * ∞ -E σ T τ =1 Eµ σ(τ ) D σ τ -1 , (12b) ρ σ abs (T ) = T Eµ * ∞ - α∈P E σ   |sub α (D σ T )| i=1 Eµ α D σ τ α i -1   , (12c) ρ σ abs (T ) = α∈P E σ   |sub α (D σ T )|Eµ * ∞ - |sub α (D σ T )| i=1 Eµ α D σ τ α i -1   ,

where sub α (D) is the subset of D with all the trajectories generated with algorithm α, where τ α i is the index of the i th trajectory generated with algorithm α, and where |S| is the cardinality of finite set S. By convention, let us state that Eµ α

D σ τ α i -1 = Eµ * ∞ if |sub α (D σ T )|< i. Then: (13) ρ σ abs (T ) = α∈P T i=1 E σ Eµ * ∞ -Eµ α D σ τ α i -1

.

To conclude, let us prove by mathematical induction the following inequality:

E σ Eµ α D σ τ α i -1 ≥ E σ α Eµ α D σ α i-1

is true by vacuity for i = 0: both left and right terms equal Eµ α ∅ . Now let us assume the property true for i and prove it for i + 1:

(14a) E σ Eµ α D σ τ α i+1 -1 = E σ   Eµ α D σ τ α i -1 ∪ε α ∪ D σ τ α i+1 -1 \D σ τ α i   , (14b) E σ Eµ α D σ τ α i+1 -1 = E σ Eµ α D σ τ α i -1 ∪ε α ∪ τ α i+1 -1 τ =τ α i +1 ε σ(τ ) , (14c) E σ Eµ α D σ τ α i+1 -1 = E σ Eµ α D σ τ α i -1 ∪ε α ∪ τ α i+1 -τ α i -1 τ =1 ε σ(τ α i +τ )

.

If |sub α (D σ T )|≥ i + 1, by applying mathematical induction assumption, then by applying Assumption 2 and finally by applying Assumption 1 recursively, we infer that: The mathematical induction proof is complete. This result leads to the following inequalities:

(15a) E σ Eµ α D σ τ α i -1 ≥ E σ α Eµ α D σ α i-1 , (15b) E σ Eµ α D σ τ α i -1 ∪ε α ≥ E σ α Eµ α D σ α i-1 ∪ε α , (15c) E σ Eµ α D σ τ α i -1 ∪ε α ≥ E σ α Eµ α D σ α i , (15d) E σ Eµ α D σ τ α i -1 ∪ε α ∪ τ α i+1 -τ α i -1 τ =1 ε σ(τ α i +τ ) ≥ E σ α Eµ α D σ α i . If |sub α (D σ T )|< i + 1,

(16a) ρ σ abs (T ) ≤ α∈P T i=1 E σ α Eµ * ∞ -Eµ α D σ α i-1 , (16b) ρ σ abs (T ) ≤ α∈P ρ σ α abs (T ) , (16c) ρ σ abs (T ) ≤ K max α∈P ρ σ α abs (T ) ,

which leads directly to the result:

(17) ∀σ, ρ σ abs (T ) ∈ O max α k ∈P ρ σ k abs (T ) .

This proof may seem to the reader rather complex for such an intuitive and loose result but algorithm selection σ and the algorithms it selects may act tricky. For instance selecting algorithm α only when the collected trajectory sets contains misleading examples (i.e. with worse expected return than with an empty trajectory set) implies that the following unintuitive inequality is always true:

Eµ α D σ τ -1 ≤ Eµ α D σ α τ -1

. In order to control all the possible outcomes, one needs to translate the selections of algorithm α into σ α 's view.

F ESBAS SHORT-SIGHTED PSEUDO-REGRET UPPER ORDER OF MAGNITUDE:

Theorem 2 (ESBAS short-sighted pseudo-regret). If the stochastic multi-armed bandit Ξ guarantees a regret of order of magnitude O(log(T )/∆ † β ), then:

EQUATION

Proof. By simplification of notation, Eµ α 

D β = Eµ α D σ ESBAS 2 β -1 . From Definition 2: (18a) ρ σ ESBAS ss (T ) = E σ ESBAS T τ =1 max α∈P Eµ α D σ ESBAS τ -1 -Eµ σ ESBAS (τ ) D σ ESBAS τ -1 , (18b) ρ σ ESBAS ss (T ) = E σ ESBAS T τ =1 max α∈P Eµ α βτ -Eµ σ ESBAS (τ ) βτ , (18c) ρ σ ESBAS ss (T ) ≤ E σ ESBAS   log 2 (T ) β=0 2 β+1 -1 τ =2 β max α∈P Eµ α β -Eµ σ ESBAS (τ ) β   , (18d) ρ σ ESBAS ss (T ) ≤ log 2 (T ) β=0 ρ σ ESBAS ss (β),

(19a) ρ σ ESBAS ss (β) = E σ ESBAS   2 β+1 -1 τ =2 β max α∈P Eµ α β -Eµ σ ESBAS (τ ) β   , (19b) ρ σ ESBAS ss (β) ∈ O log(2 β ) ∆ β , (19c) ρ σ ESBAS ss (β) ∈ O β ∆ β , (19d) ⇔ ∃κ 1 > 0, ρ σ ESBAS ss (β) ≤ κ 1 β ∆ β , (19e) where 1 ∆ β = α∈P 1 ∆ α β (19f) and where ∆ α β =    +∞ if Eµ α β = max α ∈P Eµ α β , max α ∈P Eµ α β -Eµ α β otherwise.

Since we are interested in the order of magnitude, we can once again only consider the upper bound of

1 ∆ β : (20a) 1 ∆ β ∈ α∈P O 1 ∆ α β , (20b) 1 ∆ β ∈ O max α∈P 1 ∆ α β , (20c) ⇔ ∃κ 2 > 0, 1 ∆ β ≤ κ 2 ∆ † β ,

where the second best algorithm at epoch

β such that ∆ † β > 0 is noted α † β . Injected in Equation 18d, it becomes: (21) ρ σ ESBAS ss (T ) ≤ κ 1 κ 2 log 2 (T ) β=0 β ∆ † β , which proves the result. F.1 COROLLARIES OF THEOREM 2 Corollary 1. If ∆ † β ∈ Θ (1), then ρ σ ESBAS ss (T ) ∈ O log 2 (T ) ∆ † ∞ , where ∆ † ∞ = µ * ∞ -µ † ∞ > 0.

Proof. ∆ † β ∈ Ω (1) means that only one algorithm α * converges to the optimal asymptotic performance µ * ∞ and that ∃∆

† ∞ = µ * ∞ -µ † ∞ > 0 such that ∀ 2 > 0, ∃β 1 ∈ N, such that ∀β ≥ β 1 , ∆ † β > ∆ † ∞ -.

In this case, the following bound can be deduced from equation 21:

(22a) ρ σ ESBAS ss (T ) ≤ κ 4 + log(T ) β=β1 κ 1 κ 2 ∆ † ∞ - β, (22b) ρ σ ESBAS ss (T ) ≤ κ 4 + κ 1 κ 2 log 2 (T ) 2(∆ † ∞ -)

, where κ 4 is a constant equal to the short-sighted pseudo-regret before epoch

β 1 : (23) κ 4 = ρ σ ESBAS ss 2 β1-1

Equation 22b directly leads to the corollary.

Corollary 2. If ∆ † β ∈ Θ β -m † , then ρ σ ESBAS ss (T ) ∈ O log m † +2 (T ) .

Proof. If ∆ † β decreases slower than polynomially in epochs, which implies decreasing polylogarithmically in meta-time, i.e. ∃κ 5 > 0, ∃m † > 0,

∃β 2 ∈ N, such that ∀β ≥ β 2 , ∆ † β > κ 5 β -m † , then, from Equation 21: (24a) ρ σ ESBAS ss (T ) ≤ κ 6 + log(T ) β=β2 κ 1 κ 2 κ 5 β -m † β, (24b) ρ σ ESBAS ss (T ) ≤ κ 6 + log(T ) β=β2 κ 1 κ 2 κ 5 β m † +1 , (24c) ρ σ ESBAS ss (T ) ≤ κ 1 κ 2 κ 5 log m † +2 (T ),

where κ 6 is a constant equal to the short-sighted pseudo-regret before epoch β 2 :

(25)

κ 6 = ρ σ ESBAS ss 2 β2-1 .

Equation 24c directly leads to the corollary.

Corollary 3. If ∆ † β ∈ Θ T -c † , then ρ σ ESBAS ss (T ) ∈ O T c † log(T ) .

Proof. If ∆ † β decreases slower than a fractional power of meta-time T , then ∃κ 7 > 0, 0 < c † < 1,

∃β 3 ∈ N, such that ∀β ≥ β 3 , ∆ † β > κ 7 T -c † ,

and therefore, from Equation 21:

(26a) ρ σ ESBAS ss (T ) ≤ κ 8 + log(T ) β=β3 κ 1 κ 2 κ 7 τ -c † β, (26b) ρ σ ESBAS ss (T ) ≤ κ 8 + log(T ) β=β3 κ 1 κ 2 κ 7 (2 β ) -c † β, (26c) ρ σ ESBAS ss (T ) ≤ κ 8 + log(T ) β=β3 κ 1 κ 2 κ 7 β 2 c † β ,

where κ 8 is a constant equal to the short-sighted pseudo-regret before epoch

β 3 : (27) κ 8 = ρ σ ESBAS ss 2 β3-1 .

The sum in Equation 26c is solved as follows:

EQUATION

EQUATION

EQUATION

n i =i0 ix i = x (x -1) 2 (x -1)nx n -x n -(x -1)i 0 x i0-1 + x i0 . This result, injected in Equation 26c, induces that ∀ 3 > 0, ∃T 1 ∈ N, ∀T ≥ T 1 : (29a) ρ σ ESBAS ss (T ) ≤ κ 8 + κ 1 κ 2 (1 + )2 c † κ 7 (2 c † -1) log(T )2 c † log(T ) , (29b) ρ σ ESBAS ss (T ) ≤ κ 8 + κ 1 κ 2 (1 + )2 c † κ 7 (2 c † -1) T c † log(T ),

which proves the corollary.

G ESBAS ABOLUTE PSEUDO-REGRET BOUND:

Theorem 3 (ESBAS absolute pseudo-regret upper bound). Under assumption 3, if the stochastic multi-armed bandit Ξ guarantees that the best arm has been selected in the T first episodes at least T /K times, with high probability 1δ T , with δ T ∈ O(1/T ), then:

EQUATION

where meta-algorithm σ * selects exclusively algorithm α * = argmin α∈P ρ σ α abs (T ).

Proof. The ESBAS absolute pseudo-regret is written with the following notation simplifications :

D τ -1 = D σ ESBAS τ -1 and k τ = σ ESBAS (τ ): (30a) ρ σ ESBAS abs (T ) = T Eµ * ∞ -E σ ESBAS T τ =1 Eµ σ ESBAS (τ ) D σ ESBAS τ -1 , (30b) ρ σ ESBAS abs (T ) = T Eµ * ∞ -E σ ESBAS T τ =1

Eµ kτ Dτ-1 .

Let σ * denote the algorithm selection selecting exclusively α * , and α * be the algorithm minimising the algorithm absolute pseudo-regret:

(31) α * = argmin α k ∈P ρ σ k abs (T ).

Note that σ * is the optimal constant algorithm selection at horizon T , but it is not necessarily the optimal algorithm selection: there might exist, and there probably exists a non constant algorithm selection yielding a smaller pseudo-regret.

The ESBAS absolute pseudo-regret ρ σ ESBAS abs (T ) can be decomposed into the pseudo-regret for not having followed the optimal constant algorithm selection σ * and the pseudo-regret for not having selected the algorithm with the highest return, i.e. between the pseudo-regret on the trajectory and the pseudo-regret on the immediate optimal return: .

The key point in Equation 33 is to evaluate the size of sub * (D τ -1 ).

On the one side, Assumption 3 of fairness states that one algorithm learns as fast as any another over any history. The asymptotically optimal algorithm(s) when τ → ∞ is(are) therefore the same one(s) whatever the the algorithm selection is. On the other side, let 1δ τ denote the probability, that at time τ , the following inequality is true:

(34) |sub * (D τ -1 ) |≥ τ -1 3K .

With probability δ τ , inequality 34 is not guaranteed and nothing can be inferred about Eµ * sub * (Dτ-1) , except it is bounded under by R min /(1γ). Let E τ -1 3K be the subset of E τ -1 such that ∀D ∈ E τ -1 3K , |sub * (D)|≥ (τ -1)/3K . Then, δ τ can be expressed as follows:

(35)

δ τ = D∈E τ -1 \E τ -1 3K P(D|σ ESBAS ).

With these new notations:

(36a) Eµ * ∞ -E σ ESBAS Eµ * sub * (Dτ-1) ≤ Eµ * ∞ - D∈E τ -1 3K P(D|σ ESBAS )Eµ * sub * (D) -δ τ R min 1 -γ , (36b) Eµ * ∞ -E σ ESBAS Eµ * sub * (Dτ-1) ≤ (1 -δ τ )Eµ * ∞ - D∈E τ -1 3K P(D|σ ESBAS )Eµ * sub * (D) + δ τ Eµ * ∞ - R min 1 -γ .

Let consider E * (α, N ) the set of all sets D such that |sub α (D)|= N and such that last trajectory in D was generated by α. Since ESBAS, with Ξ, a stochastic bandit with regret in O(log(T )/∆), guarantees that all algorithms will eventually be selected an infinity of times, we know that : (39d)

Then, by applying results from Equations 38b and 39d into Equation 36b, one obtains:

(40) Eµ * ∞ -E σ ESBAS Eµ * sub * (Dτ-1) ≤ Eµ * ∞ -E σ *   Eµ α D σ * τ -1 3K   + δ τ Eµ * ∞ - R min 1 -γ .

Next, the terms in the first line of Equation 32 are bounded as follows:

(41a) T Eµ * ∞ -E σ ESBAS T τ =1 Eµ * sub * (Dτ-1) ≤ T Eµ * ∞ -E σ *   T τ =1 Eµ α D σ * τ -1 3K   + T τ =1 δ τ Eµ * ∞ - R min 1 -γ , (41b) T Eµ * ∞ -E σ ESBAS T τ =1 Eµ * sub * (Dτ-1) ≤ T T 3K ρ σ * abs T 3K + Eµ * ∞ - R min 1 -γ T τ =1 δ τ .

Again, for T ≥ 9K 2 :

(42) From this observation, one directly concludes the following inequality: We recall here that the stochastic bandit algorithm Ξ was assumed to guarantee to try the best algorithm α * at least T /K times with high probability 1δ T and δ T ∈ O(T -1 ). Now, we show that at any time, the longest stochastic bandit run (i.e. the epoch that experienced the biggest number of pulls) lasts at least N = τ 3 : at epoch β τ , the meta-time spent on epochs before β τ -2 is equal to

EQUATION

:



Figures and Tables:

Figure 2: Algorithm selection for reinforcement learning flow diagram

However, the budget, i.e. the length of epoch β starting at meta-time T = 2 β , equals T . ∆ † β ∈ O(1/ √ T ) can therefore be considered as the structural limit of distinguishability between the algorithms. Additionally, the absolute upper bounds are logarithmic in the best case and still inferior to O( √ T ) in the worst case, which compares favorably with those of discounted UCB and Exp3.S in O( T log(T )) and Rexp3 in O(T 2/3 ), or the RL with Policy Advice's regret bounds of O( √ T log(T )) on stationary policies Azar et al. (2013) (on non-episodic RL tasks).

Figure 3: The figures on the top plot the performance over time. The figures on the bottom show the ESBAS selection ratios over the epochs.

Figure 5: ratios (averaged over 3000 runs) obtained with SSBAS on the gridworld task.

Figure 7: Comparative performance over time of SSBAS versus the algorithms in its portfolio on Q*bert (1 run).

× 10 -4 exploration parameter 5 × t -1 × 10 -6 replay start size 5 × 10 -4

the same inequality is straightforwardly obtained, since, by convention Eµ k D τ k i+1 = Eµ * ∞ , and since, by definition ∀D ∈ E + , ∀α ∈ P, Eµ * ∞ ≥ Eµ α D .

where β τ is the epoch of meta-time τ . A bound on short-sighted pseudo-regret ρ σ ESBAS ss (β) for each epoch β can then be obtained by the stochastic bandit Ξ regret bounds in O (log(T )/∆):

sub * (Dτ-1) is the expected return of policy π * sub * (Dτ-1) , learnt by algorithm α * on trajectory set sub * (D τ -1 ), which is the trajectory subset of D τ -1 obtained by removing all trajectories that were not generated with algorithm α * .First line of Equation 32 can be rewritten as follows: σ ESBAS Eµ * sub * (Dτ-1)

ESBAS )Eµ α sub α (D) ≥ E σ α Eµ α D σ α NOne also notices the following piece-wisely domination from applying recursively Assumption 1:ESBAS )Eµ * sub * (D) ≤ D∈E + (α * , τ -1 3K )&|D|≤τ -1 P(D|σ ESBAS ) Eµ * ∞ -Eµ * sub * (D) ,(39b)(39c) (1δ τ )Eµ * ∞ -D ∈E τ -1 3K P(D|σ ESBAS )Eµ * sub * (D) ≤ D∈E + (α * , τ -1 3K ) P(D|σ ESBAS ) Eµ * ∞ -Eµ * sub * (D) , (1δ τ )Eµ * ∞ -D ∈E τ -1 3K P(D|σ ESBAS )Eµ * sub * (D) ≤ Eµ * ∞ -D∈E + (α * , τ -1 3K )P(D|σ ESBAS )Eµ * sub * (D) .

Bounds on ρ σ ESBAS ss (T ) and ρ σ ESBAS abs (T ) given various settings for a two-fold portfolio AS.

Table content: <table/>

Regarding the first term in the second line of Equation 32, from applying recursively Assumption 2:(43a) E σ ESBAS Eµ * sub * (Dτ ) ≤ E σ ESBAS Eµ * Dτ ,

Table content: <table><tr><td>T Eµ  *  ∞ -E σ ESBAS</td><td>T τ =1</td><td>Eµ  *  sub  abs</td><td>T 3K</td><td>+ Eµ  *  ∞ -</td><td>R min 1 -γ</td><td>T τ =1</td><td>δ τ .</td></tr><tr><td/><td/><td>E σ ESBAS Eµ  *  sub</td><td/><td/><td/><td/><td>(43b)</td></tr></table>

Peer review (iclr2018):
 The authors consider the problem of dynamically choosing between several reinforcement learning algorithms for solving a reinforcement learning with discounted rewards and episodic tasks. The authors propose the following solution to the problem: - During epochs of exponentially increasing size (this technique is well known in the bandit litterature and is called a "doubling trick"), the various reinforcement learning algorithms are "frozen" (i.e. they do not adapt their policy) and the K available algorithms are sampled using the UCB1 algorithm in order to discover the one which yields the highest mean reward. Overall the paper is well written, and presents some interesting novel ideas on aggregating reinforcement learning algorithms. Below are some remarks: - An alternative and perhaps simpler formalization of the problem would be learning with expert advice (using algorithms such as "follow the perturbed leader"), where each of the available reinforcement learning algorithms acts as an expert. What is more, these algorithms usually yield O(sqrt(T)log(T)), which is the regret obtained by the authors in the worse case (where all the learning algorithms do converge to the optimal policy at the optimal speed O(1/sqrt(T)). It would have been good to see how those approaches perform against the proposed algorithms. - The authors use UCB1, but they did not try KL-UCB, which is stricly better (in fact it is optimal for bounded rewards). In particular the numerical performance of the latter is usually vastly better than the former, especially when rewards have a small variance. - The performance measure used by the authors is rather misleading ("short sighted regret"): they compare what they obtain to what the policy discovered by the best reainforcement learning algorithm .underline{based on the trajectories they have seen}, and the trajectories themselves are generated by the choices made by the algorthms at previous time. Ie in general, there might be cases in which one does not explore enough with this approach (i.e one does not try all state-action pairs enough), so that while this performance measure is low, the actual regret is very high and the algorithm does not learn the optimal policy at all (while this could be done by simply exploring at random log(T) times ...).