Ronan Fruit

Alessandro Lazaric

Exploration-Exploitation in MDPs with Options

While a large body of empirical results show that temporally-extended actions and options may significantly affect the learning performance of an agent, the theoretical understanding of how and when options can be beneficial in online reinforcement learning is relatively limited. In this paper, we derive an upper and lower bound on the regret of a variant of UCRL using options. While we first analyze the algorithm in the general case of semi-Markov decision processes (SMDPs), we show how these results can be translated to the specific case of MDPs with options and we illustrate simple scenarios in which the regret of learning with options can be provably much smaller than the regret suffered when learning with primitive actions.

Introduction

The option framework [START_REF] Sutton | Between mdps and semi-mdps: A framework for temporal abstraction in reinforcement learning[END_REF] is a simple yet powerful model to introduce temporally-extended actions and hierarchical structures in reinforcement learning (RL) [START_REF] Sutton | Introduction to Reinforcement Learning[END_REF]]. An important feature of this framework is that Markov decision process (MDP) planning and learning algorithms can be easily extended to accommodate options, thus obtaining algorithms such as option value iteration and Qlearning [START_REF] Sutton | Between mdps and semi-mdps: A framework for temporal abstraction in reinforcement learning[END_REF], LSTD [START_REF] Sorg | Linear Options[END_REF], and actor-critic [Bacon and Precup, 2015]. Temporally extended actions are particularly useful in high dimensional problems that naturally decompose into a hierarchy of subtasks. For instance, [START_REF] Tessler | A deep hierarchical approach to lifelong learning in minecraft[END_REF] recently obtained promising results by combining options and deep learning for lifelong learning in the challenging domain of Minecraft. A large body of the literature has then focused on Appearing in Proceedings of the 20 th International Conference on Artificial Intelligence and Statistics (AISTATS) 2017, Fort Lauderdale, Florida, USA. JMLR: W&CP volume 54. Copyright 2017 by the authors.

how to automatically construct options that are beneficial to the learning process within a single task or across similar tasks (see e.g., [START_REF] Mcgovern | Automatic discovery of subgoals in reinforcement learning using diverse density[END_REF][START_REF] Menache | Q-cut -dynamic discovery of sub-goals in reinforcement learning[END_REF], Şimşek and Barto, 2004, Castro and Precup, 2012, Levy and Shimkin, 2011]). An alternative approach is to design an initial set of options and optimize it during the learning process itself (see e.g., interrupting options Mann et al. 2014 and options with exceptions Sairamesh and Ravindran 2012). Despite the empirical evidence of the effectiveness of most of these methods, it is well known that options may as well worsen the performance w.r.t. learning with primitive actions [Jong et al., 2008]. Moreover, most of the proposed methods are heuristic in nature and the theoretical understanding of the actual impact of options on the learning performance is still fairly limited. Notable exceptions are the recent results of Mann and Mannor [2014] and Brunskill and Li [2014]. Nonetheless, Mann and Mannor [2014] rather focus on a batch setting and they derive a sample complexity analysis of approximate value iteration with options. Furthermore, the PAC-SMDP analysis of Brunskill and Li [2014] describes the performance in SMDPs but it cannot be immediately translated into a sample complexity of learning with options in MDPs.

In this paper, we consider the case where a fixed set of options is provided and we study their impact on the learning performance w.r.t. learning without options. In particular, we derive the first regret analysis of learning with options. Relying on the fact that using options in an MDP induces a semi-Markov decision process (SMDP), we first introduce a variant of the UCRL algorithm [Jaksch et al., 2010] for SMDPs and we upper-and lower-bound its regret (sections 3 and 4). While this result is of independent interest for learning in SMDPs, its most interesting aspect is that it can be translated into a regret bound for learning with options in MDPs and it provides a first understanding on the conditions sufficient for a set of options to reduce the regret w.r.t. learning with primitive actions (Sect. 5). Finally, we provide an illustrative example where the empirical results support the theoretical findings (Sect. 6).

MDPs and options.

A finite MDP is a tuple M = S, A, p, r where S is a finite set of states, A is a finite set of actions, p(s ′ |s, a) is the probability of transitioning from state s to state s ′ when action a is taken, r(s, a, s ′ ) is a distribution over rewards obtained when action a is taken in state s and the next state is s ′ . A stationary deterministic policy π : S → A maps states to actions. A (Markov) option is a tuple o = I o , β o , π o where I o ⊂ S is the set of states where the option can be initiated, β o : S → [0, 1] is the probability distribution that the option ends in a given state, and π o : S → A is the policy followed until the option ends. Whenever the set of primitive actions A is replaced by a set of options O, the resulting decision process is no longer an MDP but it belongs to the family of semi-Markov decision processes (SMDP).

Proposition 1. [START_REF] Sutton | Between mdps and semi-mdps: A framework for temporal abstraction in reinforcement learning[END_REF] Throughout the rest of the paper, we only consider an "admissible" set of options O such that all options terminate in finite time with probability 1 and in all possible terminal states there exists at least one option that can start, i.e., ∪ o∈O {s : β o (s) > 0} ⊆ ∪ o∈O I o . This also implies that the resulting SMDP M O is communicating whenever the original MDP M is communicating. Finally, we notice that a stationary deterministic policy constructed on a set of options O may result into a non-stationary policy on the set of actions A.

Learning in SMDPs. Relying on this mapping, we first study the exploration-exploitation trade-off in a generic SMDP. A thorough discussion on the implications of the analysis of learning in SMDPs for the case of learning with options in MDPs is reported in Sect. 5. For any SMDP M = S, A, p, r, τ , we denote by τ (s, a, s ′ ) (resp. r(s, a, s ′ )) the expectation of τ (s, a, s ′ ) (resp. r(s, a, s ′ )) and by τ (s, a) = s ′ ∈S τ (s, a, s ′ )p(s ′ |s, a) (resp. r(s, a) = s ′ ∈S r(s, a, s ′ )p(s ′ |s, a)) the expected holding time (resp. cumulative reward) of action a from state s.

In the next proposition we define the average-reward performance criterion and we recall the properties of the optimal policy in SMDPs.

Proposition 2. Denote N (t) = sup n ∈ N, n i=1 τ i ≤ t the number of decision steps that occurred before time t. For any policy π and s ∈ S:

ρ π (s) def = lim sup t→+∞ E π N (t) i=1 r i t s 0 = s ρ π (s) def = lim inf t→+∞ E π N (t)
i=1 r i t s 0 = s .

(

) 1
If M is communicating and the expected holding times and reward are finite, there exists a stationary deterministic optimal policy π * such that for all states s and policies π, ρ π * (s) ≥ ρ π (s) and ρ π * (s) = ρ π * (s) = ρ * .

Finally, we recall the average reward optimality equation for a communicating SMDP u * (s) = max a∈A r(s, a) -ρ * τ (s, a)

+ s ′ ∈S p(s ′ |s, a)u * (s ′ ) , (2)
where u * and ρ * are the bias (up to a constant) and the gain of the optimal policy π * .

We are now ready to consider the learning problem.

For any i ∈ N * , a i denotes the action taken by the agent at the i-th decision step1 and s i denotes the state reached after a i is taken, with s 0 being the initial state. We denote by (r i (s, a, s ′ )) i∈N * (resp.

(τ i (s, a, s ′ )) i∈N * ) a sequence of i.i.d. realizations from distribution r(s, a, s ′ ) (resp. τ (s, a, s ′ )). When the learner explores the SMDP, it observes the sequence (s 0 , . . . , s i , a i+1 , r i+1 (s i , a i+1 , s i+1 ), τ i+1 (s i , a i+1 , s i+1 ), . . .). The performance of a learning algorithm is measured in terms of its cumulative regret.

Definition 1. For any SMDP M , any starting state s ∈ S, and any number of decision steps n ≥ 1, let {τ i } n i=1 be the random holding times observed along the trajectory generated by a learning algorithm A. Then the total regret of A is defined as

∆(M, A, s, n) = n i=1 τ i ρ * (M ) - n i=1 r i .
(3)

We first notice that this definition reduces to the standard regret in MDPs for τ i = 1 (i.e., primitive actions always terminate in one step). The regret measures the difference in cumulative reward obtained by the optimal policy and the learning algorithm. While the performance of the optimal policy is measured by its asymptotic average reward ρ * , the total duration after n decision steps may vary depending on the policy. As a result, when comparing the performance of π * after n decision steps, we multiply it by the length of the trajectory executed by the algorithm A. More formally, from the definition of ρ * (Eq. 1) and Prop. 2 we have2

E π * N (t) i=1 r i s 0 = s ∼ t→+∞ ρ * t + o(t).
By introducing the total duration N (t) of A we have

ρ * t + o(t) = ρ * N (t) i=1 τ i + ρ * t - N (t) i=1 τ i + o(t).
We observe that t -N (t)

i=1 τ i = o(t) almost surely since t - N (t) i=1 τ i ≤ τ N (t)+1
and τ N (t)+1 is bounded by an almost surely finite (a.s.) random variable since the expected holding time for all state-action pairs is bounded by assumption. So τ N (t)+1 /t → t→+∞ 0 a.s. and

E π * N (t) i=1 r i s 0 = s ∼ t→+∞ ρ * N (t) i=1 τ i + o(t),
which justifies the definition of the regret.

SMDP-UCRL

In this section we introduce UCRL-SMDP (Fig. 1), a variant of UCRL [Jaksch et al., 2010]. At each episode k, the set of plausible SMDPs M k is defined by the current estimates of the SMDP parameters and a set of constraints on the rewards, the holding times and the transition probabilities derived from the confidence intervals. Given M k , extended value iteration (EVI) finds an SMDP M k ∈ M k that maximizes ρ * ( M k ) and the corresponding optimal policy π * k is computed. To solve this problem, we note that it can be equivalently formulated as finding the optimal policy of an extended3 SMDP M + k obtained by combining all SMDPs in M k : M + k has the same state space and an extended continuous action space A + k . Choosing an action a + ∈ A + k amounts to choosing an action

Input: Confidence δ ∈]0, 1[, S,
A, br, σr, bτ , στ , Rmax, τmax and τmin. Initialization: Set i = 1, and observe initial state s0.

For episodes k = 1, 2, ... do Initialize episode k: 1. Set the start step of episode k, i k := i 2. For all (s, a) initialize the counter for episode k, ν k (s, a) := 0 and set counter prior to episode k, N k (s, a) = #{ι < i k : sι = s, aι = a} 3. For s, s ′ , a set the accumulated rewards, duration and transition counts prior to episode k,

R k (s, a) = i k -1 ι=1 rι1s ι=s,aι =a, T k (s, a) = i k -1 ι=1 τι1s ι =s,aι=a P k (s, a, s ′ ) = #{ι < i k : sι = s, aι = a, sι+1 = s ′ } Compute estimates pk (s ′ | s, a) := P k (s,a,s ′ ) max{1,N k (s,a)} and τk (s, a) := T k (s,a) N k (s,a) and rk (s, a) := R k (s,a) N k (s,a)
Compute policy π k : 4. Let M k be the set of all SMDPs with states and actions as in M , and with transition probabilities p, rewards r, and holding time τ such that for any (s, a)

| r -rk | ≤ β r k and Rmaxτmax ≥ r(s, a) ≥ 0 | τ -τk | ≤ β τ k and τmax ≥ τ (s, a) ≥ r(s, a)/Rmax, τmin p(•) -pk (•) 1 ≤ β p k and s ′ ∈S p(s ′ | s, a) = 1
5. Use extended value iteration (EVI) to find a policy π k and an optimistic SMDP M k ∈ M k such that: k is executed until the number of samples for a state-action pair is doubled. Since the structure is similar to UCRL's, we focus on the elements that need to be rederived for the specific SMDP case: the confidence intervals construction and the extended value iteration algorithm.

ρ k := min s ρ( M k , π k , s) ≥ max M ′ ∈M k ,π,s ρ(M ′ , π, s)- Rmax √ i k Execute policy π k : 6. While ν k (si, π k (si)) < max{1, N k (si, π k (si)} do
Confidence intervals. Unlike in MDPs, we consider a slightly more general scenario where cumulative rewards and holding times are not bounded but are subexponential r.v. (see Lem. 3). As a result, the confidence intervals used at step 4 are defined as follows. For any state action pair (s, a) and for rewards, transition probabilities, and holding times we define

β r k (s, a) = σr 14 log(2SAi k /δ) max{1,N k (s,a)} , if N k (s, a) ≥ 2b 2 r σ 2 r log 240SAi 7 k δ 14br log(2SAi k /δ) max{1,N k (s,a)} , otherwise β p k (s, a) = 14S log(2Ai k /δ) max{1, N k (s, a)} , β τ k (s, a) = στ 14 log(2SAi k /δ) max{1,N k (s,a)} , if N k (s, a) ≥ 2b 2 τ σ 2 τ log 240SAi 7 k δ 14bτ log(2SAi k /δ) max{1,N k (s,a)} , otherwise
where σ r , b r , σ τ , b r are suitable constants characterizing the sub-exponential distributions of rewards and holding times. As a result, the empirical estimates rk , τk , and pk are ±β r k (s, a), β τ k (s, a), β p k (s, a) away from the true values.

Extended value iteration (EVI).

We rely on a data-transformation (also called "uniformization") that turns an SMDP M into an "equivalent" MDP M eq = S, A, p eq , r eq with same state and action spaces and such that ∀s, s ′ ∈ S, ∀a ∈ A:

r eq (s, a) = r(s, a) τ (s, a) p eq (s ′ |s, a) = τ τ (s, a) p(s ′ |s, a) -δ s,s ′ + δ s,s ′ (4)
where δ s,s ′ = 0 if s = s ′ and δ s,s ′ = 1 otherwise, and τ is an arbitrary non-negative real such that τ < τ min . M eq enjoys the following equivalence property.

Proposition 3 ([Federgruen et al., 1983], Lemma 2).

If (v * , g * ) is an optimal pair of bias and gain in M eq then (τ -1 v * , g * ) is a solution to Eq. 2, i.e., it is an optimal pair of bias/gain for the original SMDP M .

As a consequence of the equivalence stated in Prop. 3, computing the optimal policy of an SMDP amounts to computing the optimal policy of the MDP obtained after data transformation (see App. A for more details). Thus, EVI is obtained by applying a value iteration scheme to an MDP M + k,eq equivalent to the extended SMDP M + k . We denote the state values of the j-th iteration by u j (s). We also use the vector notation u j = (u j (s)) s∈S . Similarly, we denote by p(• | s, a) = ( p(s ′ | s, a)) s ′ ∈S the transition probability vector of state-action pair (s, a). The optimistic reward at episode k is fixed through the EVI iterations and it is obtained as r j+1 (s, a) = min rk (s, a) + β r k (s, a); R max τ max , i.e., by taking the largest possible value compatible with the confidence intervals. At iteration j, the optimistic transition model is obtained as

p j+1 (• | s, a) ∈ Arg max p(•)∈P k (s,a) {p ⊺ u j } and P k (s, a)
is the set of probability distributions included in the confidence interval defined by β p k (s, a). This optimization problem can be solved in O(S) operations using the same algorithm as in UCRL. Finally, the optimistic holding time depends on u j and the optimistic transition model p j+1 as τ j+1 (s, a) = min τ max ; max τ min ; τk (s, a)

-sgn r j+1 (s, a)+τ p j+1 (•|s, a) ⊺ u j -u j (s) β τ k (s, a) ,
The min and max insure that τ j+1 ranges between τ min and τ max . When the term r j+1 (s, a)+ p j+1 (•|s, a) ⊺ u ju j (s) is positive (resp. negative), τ j+1 (s, a) is set to the minimum (resp. largest) possible value compatible with its confidence intervals so as to maximize the right-hand side of Eq. 5 below. As a result, for any τ ∈ ]0, τ min [, EVI is applied to an MDP equivalent to the extended SMDP M + k generated over iterations as

u j+1 (s) = max a∈A r j+1 (s, a) τ j+1 (s, a) (5)
+ τ τ j+1 (s, a) p j+1 (• | s, a) ⊺ u j -u j (s) + u j (s)
with arbitrary u 0 . Finally, the stopping condition is

max s∈S {u i+1 (s)-u i (s)}-min s∈S {u i+1 (s)-u i (s)} < ǫ. (6)
We prove the following.

Lemma 1. If the stopping condition holds at iteration i of EVI, then the greedy policy w.r.t. u i is ǫ-optimal w.r.t. extended SMDP M + k . The stopping condition is always reached in a finite number of steps.

As a result, we can conclude that running EVI at each episode k with an accuracy parameter ǫ

= R max / √ i k guarantees that π k is R max / √ i k -optimal w.r.t. max M ′ ∈M k ρ * (M ′ ).

Regret Analysis

In this section we report upper and lower bounds on the regret of UCRL-SMDP. We first extend the notion of diameter to the case of SMDP as follows.

Definition 2. For any SMDP M , we define the diameter D(M ) by

D(M ) = max s,s ′ ∈S min π E π T (s ′ )|s 0 = s (7)
where T (s ′ ) is the first time in which s ′ is encountered, i.e., T (s

′ ) = inf n i=1 τ i : n ∈ N, s n = s ′ .
Note that the diameter of an SMDP corresponds to an average actual duration and not an average number of decision steps. However, if the SMDP is an MDP the two definitions of diameter coincides. Before reporting the main theoretical results about UCRL-SMDP, we introduce a set of technical assumptions.

Assumption 1. For all s ∈ S and a ∈ A, we assume that τ max ≥ τ (s, a) ≥ τ min > 0 and max s∈S,a∈A r(s,a) τ (s,a)

≤ R max with τ min , τ max , and R max known to the learning algorithm. Furthermore, we assume that the random variables (r(s, a, s ′ )) s,a,s ′ and (τ (s, a, s ′ )) s,a,s ′ are either 1) sub-Exponential with constants (σ r , b r ) and (σ τ , b τ ), or 2) bounded in [0, R max T max ] and [T min , T max ], with T min > 0. We also assume that the constants characterizing the distributions are known to the learning agent.

We are now ready to introduce our main result.

Theorem 1. With probability of at least 1 -δ, it holds that for any initial state s ∈ S and any n > 1, the regret of UCRL-SMDP ∆(M, A, s, n) is bounded by:

O D √ S + C(M, n, δ) R max SAn log n δ , (8)
where C(M, n, δ) depends on which case of Asm. 1 is considered4

1) sub-Exponential

C(M, n, δ) = τ max + σ r ∨ b r R max + σ τ ∨ b τ log n δ , 2) bounded C(M, n, δ) = T max + (T max -T min ).
Proof. The proof (App. B) follows similar steps as in [Jaksch et al., 2010]. Apart from adapting the concentration inequalities to sub-exponential r.v. and deriving the guarantees about EVI applied to the equivalent MDP M eq (Lem. 1), one of the key aspects of the proof is to show that the learning complexity is actually determined by the diameter D(M ) in Eq. 2. As for the analysis of EVI, we rely on the data-transformation and we show that the span of u j (Eq. 5) can be bounded by the diameter of M eq , which is related to the diameter of the original SMDP as D(M eq ) = D(M )/τ (Lem. 6 in App. B).

The bound. The upper bound is a direct generalization of the result derived by Jaksch et al. [2010] for UCRL in MDPs. In fact, whenever the SMDP reduces to an MDP (i.e., each action takes exactly one step to execute), then n = T and the regret, the diameter, and the bounds are the same as for UCRL. If we consider R max = 1 and bounded holding times, the regret scales as O(DS √ An + T max √ SAn). The most interesting aspect of this bound is that the extra cost of having actions with random duration is only partially additive rather than multiplicative (as it happens e.g., with the per-step reward R max ). This shows that errors in estimating the holding times do not get amplified by the diameter D and number of states S as much as it happens for errors in reward and dynamics. This is confirmed in the following lower bound.

Theorem 2. For any algorithm A, any integers S, A ≥ 10, any reals T max ≥ 3T min ≥ 3, R max > 0, D > max{20T min log A (S), 12T min }, and for n ≥ max{D, T max }SA, there is an SMDP M with at most S states, A actions, and diameter D, with holding times in [T min , T max ] and rewards in 0, 1 2 R max T max satisfying ∀s ∈ S, ∀a ∈ A s , r(s, a) ≤ R max τ (s, a), such that for any initial state s ∈ S the expected regret of A after n decision steps is lower-bounded by:

E [∆(M, A, s, n)] = Ω √ D + T max R max √ SAn
Proof. Similar to the upper bound, the proof (App. C) is based on [Jaksch et al., 2010] but it requires to perturb transition probabilities and rewards at the same time to create a family of SMDPs with different optimal policies that are difficult to discriminate. The contributions of the two perturbations can be made independent. More precisely, the lower bound is obtained by designing SMDPs where learning to distinguish between "good" and "bad" transition probabilities and learning to distinguish between "good" and "bad" rewards are two independent problems, leading to two additive terms √ D and √ T max in the lower bound.

The bound. Similar to UCRL, this lower bound reveals a gap of √ DS on the first term and √ T max . While closing this gap remains a challenging open question, it is a problem beyond the scope of this paper.

In the next section, we discuss how these results can be used to bound the regret of options in MDPs and what are the conditions that make the regret smaller than using UCRL on primitive actions.

Regret in MDPs with Options

Let M be an MDP and O a set of options and let M O be the corresponding SMDP obtained from Prop. 1. We index time steps (i.e., time at primitive action level) by t and decision steps (i.e., time at option level) by i. We denote by N (t) the total number of decision steps that occurred before time t. Given n decision steps, we denote by T n = n i=1 τ i the number of time steps elapsed after the execution of the n first options so that N (T n ) = n. Any SMDP-learning algorithm A O applied to M O can be interpreted as a learning algorithm A on M so that at each time step t, A selects an action of M based on the policy associated to the option started at decision step N (t). We can thus compare the performance of UCRL and UCRL-SMDP when learning in M . We first need to relate the notion of average reward and regret used in the analysis of UCRL-SMDP to the original counterparts in MDPs. Lemma 2. Let M be an MDP, O a set of options and M O the corresponding SMDP. Let π O be any stationary policy on M O and π the equivalent policy on M (not necessarily stationary). For any state s ∈ S O , any learning algorithm A, and any number of decision steps n we have ρ πO (M O , s) = ρ π (M, s) and

∆(M, A, T n ) = ∆(M O ,A, n) + T n (ρ * (M ) -ρ * (M O )) .
The linear regret term is due to the fact that the introduction of options amounts to constraining the space of policies that can be expressed in M . As a result, in general we have ρ

* (M ) ≥ ρ * (M O ) = max πO ρ πO (M O ),
where π O is a stationary deterministic policy on M O . Thm. 2 also guarantees that the optimal policy computed in the SMDP M O (i.e., the policy maximizing ρ πO (M O , s)) is indeed the best in the subset of policies that can be expressed in M by using the set of options O. In order to use the regret analysis of Thm. 1, we still need to show that Asm. 1 is verified.

Lemma 3. An MDP provided with a set of options is an SMDP where the holding times and rewards τ (s, o, s ′ ) and r(s, o, s ′ ) are distributed as subexponential random variables. Moreover, the holding time of an option is sub-Gaussian if and only if it is almost surely bounded.

This result is based on the fact that once an option is executed, we obtain a Markov chain with absorbing states corresponding to the states with non-zero termination probability β o (s) and the holding time is the number of visited states before reaching a terminal state. While in general this corresponds to a subexponential distribution, whenever the option has a zero probability to reach the same state twice before terminating (i.e., there is no cycle), then the holding times become bounded. Finally, we notice that no intermediate case between sub-exponential and bounded distributions is admissible (e.g., sub-Gaussian). Since these are the two cases considered in Thm. 1, we can directly apply it and obtain the following corollary.

Corollary 1. For any MDP M = {S, A, p, r} with r(s, a, s ′ ) ∈ [0, R max ] and a set of options O, consider the resulting SMDP

M O = {S O , A O , p O , r O , τ O }.
Then with probability of at least 1 -δ, it holds that for any initial state s ∈ S and any n > 1, the regret of UCRL-SMDP in the original MDP is bounded as

O D O S O + C(M O , n, δ) R O max S O On log n δ + T n (ρ * (M ) -ρ * (M O )) ,
where O is the number of options.

We can also show that the lower bound holds for MDPs with options as well. More precisely, it is possible to create an MDP and a set of options such that the lower bound is slightly smaller than that of Thm. 2.

Corollary 2. Under the same assumptions as in Theorem 2, there exists an MDP with options such that the regret of any algorithm is lower-bounded as

Ω D O + T max -T min R O max S O On + T n (ρ * (M ) -ρ * (M O )) .
This shows that MDPs with options are slightly easier to learn than SMDPs. This is due to the fact that in SMDPs resulting from MDPs with options rewards and holding times are strictly correlated (i.e., r(s, o, s ′ ) ≤ R max τ (s, o, s ′ ) a.s. and not just in expectation for all (s, o, s ′ )).

We are now ready to proceed with the comparison of the bounds on the regret of learning with options and primitive actions. We recall that for UCRL

∆(M, UCRL, s, T n ) = O(DSR max √ AT n ).
We first notice that 5 R O max ≤ R max and since S O ⊆ S we have that S O ≤ S. Furthermore, we introduce the following simplifying conditions: 1) ρ * (M ) = ρ * (M O ) (i.e., the options do not prevent from learning the optimal policy), 2) O ≤ A (i.e., the number of options is not larger than the number of primitive actions), 3) options have bounded holding time (case 2 in Asm. 1). While in general comparing upper bounds is potentially loose, we notice that both upper-bounds are derived using similar techniques and thus they would be "similarly" loose and they both have almost matching worst-case lower bounds. Let R(M, n, δ) be the ratio between the regret upper bounds of UCRL-SMDP using options O and UCRL, then we have (up to numerical constants)

R(M, n) ≤ D O √ S O + T max S O On log(n/δ) DS AT n log(T n /δ) ≤ D O √ S + T max D √ S n T n ,
where we used n ≤ T n to simplify the logarithmic terms. Since lim inf n→+∞ Tn n ≥ τ min , then the previous expression gives an (asymptotic) sufficient condition for reducing the regret when using options, that is

D O √ S + T max D √ Sτ min ≤ 1. (9)
In order to have a better grasp on the cases covered by this condition, let D O = αD, with α ≥ 1. This corresponds to the case when navigating through some 5 The largest per-step reward in the SMDP is defined as states becomes more difficult with options than with primitive actions, thus causing an increase in the diameter. If options are such that T max ≤ D √ S and τ min > (1 + α) 2 , then it is easy to see that the condition in Eq. 9 is satisfied. This shows that even when the introduction of options partially disrupt the structure of the original MDP (i.e., D O ≥ D), it is enough to choose options which are long enough (but not too much) to guarantee an improvement in the regret. Notice that while conditions 1) and 2) are indeed in favor of UCRL-SMDP, S O , O, and T max are in general much smaller than S, A, D √ S (S and D are large in most of interesting applications). Furthermore, τ min is a very loose upper-bound on lim inf n→+∞ Tn n and in practice the ratio Tn n can take much larger values if τ max is large and many options have a high expected holding time. As a result, the set of MDPs and options on which the regret comparison is in favor of UCRL-SMDP is much wider than the one defined in Eq. 9. Nonetheless, as illustrated in Lem. 3, the case of options with bounded holding times is quite restrictive since it requires the absence of self-loops during the execution of an option. If we reproduce the same comparison in the general case of sub-exponential holding times, then the ratio between the regret upper bounds becomes

R O max ≥ maxs∈S,a∈A r(s,a) τ (s,a) .
R(M, n) ≤ D O √ S + C(M, n, δ) D √ S n T n , where C(M, n, δ) = O( log(n/δ)).
As a result, as n increases, the ratio is always greater than 1, thus showing that in this case the regret of UCRL-SMDP is asymptotically worse than UCRL. Whether this is an artefact of the proof or it is an intrinsic weakness of options, it remains an open question.

Illustrative Experiment

We consider the navigation problem in Fig. 2. In any of the d 2 states of the grid except the target, the four cardinal actions are available, each of them being successful with probability 1. If the agent hits a wall then it stays in its current position with probability 1.

When the target state is reached, the state is reset to any other state with uniform probability. The reward of any transition is 0 except when the agent leaves the target in which case it equals R max . The optimal policy simply takes the shortest path from any state to the target state. The diameter of the MDP is the longest shortest path in the grid, that is D = 2d -2. Let m be any non-negative integer smaller than d and in every state but the target we define four macro-actions: LEFT, RIGHT, UP and DOWN (blue arrows in the figure). When LEFT is taken, primitive action left is applied up to m times (similar for the other three options). For any state s ′ which is k ≤ m steps on the left of the starting state s, we set β o (s ′ ) = 1/(m-k+1) so that the probability of the option to be interrupted after any k ≤ m steps is 1/m. If the starting state s is l steps close to the left border with l < m then we set β o (s ′ ) = 1/(l -k + 1) for any state s ′ which is k ≤ l steps on the left. As a result, for all options started m steps far from any wall, T max = m and the expected duration is τ := τ (s, o) = (m + 1)/2, which reduces to T max = l and τ = (l + 1)/2 for an option started l < m step from the wall and moving towards it.

More precisely, all options have an expected duration of τ (s, o) = τ in all but in md states, which is small compared to the total number of d 2 states. The SMDP formed with this set of options preserves the number of state-action pairs S O = S = d 2 and A ′ = A = 4 and the optimal average reward ρ * (M ) = ρ * (M ′ ), while it slightly perturbs the diameter D O ≤ D+m(m+1) (see App. F for further details). Thus, the two problems seem to be as hard to learn. However the (asymptotic) ratio between the regret upper bounds becomes

lim n→∞ R(M, n) ≤ (2d -2 + m 2 + m)d + m (2d -2)d lim n→∞ n T n ≤ 1 + 2 m 2 d lim n→∞ n T n ,
where we assume m, d ≥ 2. While a rigorous analysis of the ratio between the number of option decision steps n and number of primitive actions T n is difficult, we notice that as d increases w.r.t. m, the chance of executing options close to a wall decreases, since for any option only md out of d 2 states will lead to a duration smaller than τ and thus we can conclude that n/T n tends to 1/τ = 2/(m + 1) as n and d grow. As a result, the ratio would reduce to (1+2m 2 /d) 2/(m + 1) that is smaller than 1 for a wide range of values for m and d. Finally, the ratio is (asymptotically in

d) min- imized by m ≈ √ d, which gives R(M, n) = O(d -1/4
), thus showing that as d increases there is always an appropriate choice of m for which learning with options becomes significantly better than learning with primitive actions. In Fig. 3a we Cumulative Regret this finding by studying the ratio between the actual regrets (and not their upper-bounds) as d and m (i.e., T max ) vary, and with a fixed value of T n that is chosen big enough for every d. As expected, for a fixed value of d, the ratio R first decreases as m increases, reaches a minimum and starts increasing to eventually exceed 1. As d increases, the value of the minimum decreases, while the optimal choice of m increases. This behaviour matches the theory, which suggests that the optimal choice for m increases as O( √ d). In Fig. 3b we report the cumulative regret and we observe that high values of T max worsen the learning performances w.r.t. learning without options (T max = 1, plotted in black). Finally, Fig. 3c shows that, as n tends to infinity, T n /n tends to converge to (m + 1)/2 when m ≪ d, whereas it converges to slightly smaller values when m is close to d because of the truncations operated by walls.

∆(T n ) ×10 7 T max = 1 T max = 2 T max = 3 T max = 4 T max = 5 T max = 6 T max = 7 T max = 8 (
Discussion. Despite its simplicity, the most interesting aspect of this example is that the improvement on the regret is not obtained by trivially reducing the number of state-action pairs, but it is intrinsic in the way options change the dynamics of the exploration process. The two key elements in designing a successful set of options O is to preserve the average reward of the optimal policy and the diameter. The former is often a weaker condition than the latter. In this example, we achieved both conditions by designing a set O where the termination conditions allow any option to end after only one step. This preserves the diameter of the original MDP (up to an additive constant), since the agent can still navigate at the level of granularity of primitive actions. Consider a slightly different set of options O ′ , where each option moves exactly by m steps (no intermediate interruption). The number of steps to the target remains unchanged from any state and thus we can achieve the optimal performance. Nonetheless, having π * in the set of policies that can be represented with O ′ does not guarantee that the UCRL-SMDP would be as efficient in learning the optimal policy as UCRL. In fact, the expected number of steps needed to go from a state s to an adjacent state s ′ may significantly increase. Despite being only one primitive action apart, there may be no sequence of options that allows to reach s ′ from s without relying on the random restart triggered by the target state. A careful analysis of this case shows that the diameter is as large as D O ′ = D(1 + m 2 ) and there exists no value of m that satisfies Eq. 9 (see App. F).

Conclusions

We derived upper and lower bounds on the regret of learning in SMDPs and we showed how these results apply to learning with options in MDPs. Comparing the regret bounds of UCRL-SMDP with UCRL, we provided sufficient conditions on the set of options and the MDP (i.e., similar diameter and average reward) to reduce the regret w.r.t. learning with primitive actions. To the best of our knowledge, this is the first attempt of explaining when and how options affect the learning performance. Nonetheless, we believe that this result leaves space for improvements. In fact, Prop. 1 implies that the class of SMDPs is a strict superset of MDPs with options. This suggests that a more effective analysis could be done by leveraging the specific structure of MDPs with options rather than moving to the more general model of SMDPs. This may actually remove the additional log(n/δ) factor appearing because of sub-exponential distributions in the UCRL-SMDP regret. An interesting direction of research is to use this theoretical result to provide a more explicit and quantitative objective function for option discovery, in the line of what is done in [Brunskill and Li, 2014]. Finally, it would be interesting to extend the current analysis to more sophisticated hierarchical approaches to RL such as MAXQ [Dietterich, 2000]. A Optimal average reward in discrete and continuous SMDPs: existence and computation

In this section we prove Proposition 2 and Lemma 1. Since extended value iteration is run on SMDP M + k with continuous actions (the choice of the transition probability), in the following we consider both the continuous and discrete case at the same time. In order to have a more rigorous treatment of SMDPs, we introduce further notations from [START_REF] Puterman | Markov Decision Processes: Discrete Stochastic Dynamic Programming[END_REF].

A decision rule is a function d : H → ∆(A) where H is the set of possible histories and ∆(A) is the set of probability distributions over A. and the subset of stationary deterministic policies will be denoted

Π SD M : Π SD M ⊂ Π HR M .
We also consider the more general case where the set of available actions may depend on the state, i.e., there exists a set A s for each s ∈ S.

A.1 Optimality criterion

We start by defining the optimality criterion in SMDPs. Unlike for MDPs, where the average reward of a fixed policy is uniquely defined, in SMDPs there are three different definitions that are usually encountered in the literature (see [START_REF] Schäl | On the second optimality equation for semimarkov decision models[END_REF], Federgruen et al. 1983, and Ros 1970). 6 Definition 3. Denote N (t) = sup n : n ∈ N, n i=1 τ i ≤ t the number of decision steps that occured before time t. For any π ∈ Π HR M and s ∈ S, we define:

ρ 1 π (s) = lim sup t→+∞ E π N (t) i=1 r i t s 0 = s , ρ 1 π (s) = lim inf t→+∞ E π N (t) i=1 r i t s 0 = s (10) ρ 2 π (s) = lim sup n→+∞ E π n i=1 r i s 0 = s E π n i=1 τ i s 0 = s , ρ 2 π (s) = lim inf n→+∞ E π n i=1 r i s 0 = s E π n i=1 τ i s 0 = s (11)
and for any d ∞ ∈ Π SD M and s ∈ S we define:

ρ d ∞ 3 (s) = ν(d) α=1 p d (α|s)g d (α), with g d (α) = s∈R d α µ d α (s)r(s, d(s)) s∈R d α µ d α (s)τ (s, d(s)) (12)
where ν(d) is the number of positive recurrent classes under d ∞ , p d (α|s) is the probability of entering positive recurrent class α starting from s and following policy d ∞ , R d α is the set of states of class α and µ d α is the stationary probability distribution of class α.

A.2 Proof of Proposition 2

We say that (d * ) ∞ is (3)-average-optimal if for all states s ∈ S and decision rules d ∈ D MD M , ρ

(d * ) ∞ 3 (s) ≥ ρ d ∞ 3 (s).
We say that π * is (1)-average-optimal (respectively (2)-average-optimal) if for all states s ∈ S and all

π ∈ Π HR M , ρ 1 π * (s) ≥ ρ 1 π (s) (respectively ρ 2 π * (s) ≥ ρ 2 π (s)).
We prove a slightly more general formulation than Proposition 2. Proposition 4. If M is communicating and the expected holding times and rewards are finite, then

• There exists a stationary policy π * = (d * ) ∞ which is (1,2,3)-average-optimal.

• All optimal values are equal and constant and we will denote this value by ρ * :

∀s ∈ S, ρ 1 (d * ) ∞ (s) = ρ 1 (d * ) ∞ (s) = ρ 2 (d * ) ∞ (s) = ρ 2 (d * ) ∞ (s) = ρ (d * ) ∞ 3 (s) = ρ * .
6 Notice that the definition we provide in Eq. 1 of Prop. 2 is ρ1.

Proof.

Step 1: Optimality equation of a communicating SMDP. We first recall the average reward optimality equations for a communicating SMDP (Eq. 2)

∀s ∈ S, u * (s) = max a∈As r(s, a) -ρ * τ (s, a) + s ′ ∈S p(s ′ |s, a)u * (s ′ ) (13)
where u * and ρ * are the bias (up to additive constant) and average reward respectively. Since we need to analyse both the case where A s is finite and the case where A s is continuous, we verify that it is appropriate to consider the max instead of sup in the previous expression. For the original SMDP M , A s is finite and the maximum is well-defined. For the extended SMDPs M + k considered while computing the optimistic SMDP, A + k,s compact and by Weierstrass theorem, we know that the maximum is reached (i.e., there exists a maximizer). As a result, Eq. 13 is well-defined and we can study the existence and properties of its solutions.

Step 2: Data-transformation (uniformization) of an SMDP. The structure of EVI is based on a datatransformation (also called "uniformization") which turns the initial SMDP M into an "equivalent" MDP M eq = S, A, p eq , r eq defined as in Eq. 4. As a result, we can just apply standard MDP theory to the equivalent MDP. The average optimality equation of M eq is [START_REF] Puterman | Markov Decision Processes: Discrete Stochastic Dynamic Programming[END_REF]

∀s ∈ S, v * (s) = max a∈As r(s, a) τ (s, a) -g * + τ τ (s, a) s ′ ∈S p(s ′ |s, a)v * (s ′ ) + 1 - τ τ (s, a) v * (s) (14)
Since τ < τ min , every Markov Chain induced by a stationary deterministic policy on M eq is necessarily aperiodic (for any action, the probability of any state to loop on itself is strictly positive). Moreover, since M is assumed to be communicating, M eq is also communicating. The same holds for M + k,eq (i.e., the MDP obtained from the extended SMDP M + k after data transformation). Under these conditions, Eq. 14 has a solution (v * , g * ) where g * is the optimal average reward of M eq (respectively M + k,eq ) and the (stationary deterministic) greedy policy w.r.t. v * is average-optimal. Moreover, standard value iteration is guaranteed to converge and it can be applied with the stopping condition in Eq. 6 to obtain an ǫ-optimal policy in finitely many steps. This holds for both finite and compact A s with continuous r eq (s, a) and p eq (s ′ |s, a) (see for example [START_REF] Puterman | Markov Decision Processes: Discrete Stochastic Dynamic Programming[END_REF]Leizarowitz 2013). It is easy to show that EVI in Eq. 5 is exactly value iteration applied to M + k,eq . Finally, Lemma 2 of [Federgruen et al., 1983] (Prop. 3) shows the "equivalence" between M and M eq (respectively M + k and M + k,eq ): if (v * , g * ) is a solution to Eq. 14, then (τ -1 v * , g * ) is a solution to Eq. 13 and conversely. As a result, there exists a solution (u * , ρ * ) to Eq. 13 for both M and M + k .

Step 3: Existence of deterministic stationary optimal policy. We are now ready to prove the existence of a deterministic stationary policy that is (1,2,3)-optimal and that the corresponding optimal value is constant and equal in all three cases. We consider the case of finite and continuous A s separately.

Step 3a: For M (finite A s ). Since conditions (L), (F) and (R) of [START_REF] Schäl | On the second optimality equation for semimarkov decision models[END_REF] hold, we can apply their main theorem and obtain that 1. Any greedy policy

(d * ) ∞ w.r.t. u * is such that ρ 1 (d * ) ∞ (s) ≥ ρ 1 π (s) for any π ∈ Π HR M and any s ∈ S, 2. ∀s ∈ S, ρ 1 (d * ) ∞ (s) = ρ * ,
where (u * , ρ * ) is a solution of Eq. 13. Furthermore, from renewal theory (see e.g., Tij 2003 and[Ros, 1970]) we have that ∀d

∞ ∈ Π SD M , ρ 1 d ∞ = ρ 1 d ∞ = ρ d ∞

1

(i.e., the limit exists for deterministic stationary policies), thus we can conclude that (d * ) ∞ is (1)-optimal. Furthermore, by Lemma 2.7 of [START_REF] Schäl | On the second optimality equation for semimarkov decision models[END_REF]:

∀d ∞ ∈ Π SD M , ∀s ∈ S, ρ 1 d ∞ (s) = ρ d ∞ 3 (s) so d * is also necessarily (3)-optimal.
Finally, by Theorem 7.6 of [Ros, 1970], since (u * , ρ * ) is a solution of Eq. 13:

1. Any greedy policy (d * ) ∞ w.r.t. u * is such that ρ 2 (d * ) ∞ (s) ≥ ρ 2 π (s) for any π ∈ Π HR M and any s ∈ S, 2. ∀s ∈ S, ρ 2 (d * ) ∞ (s) = ρ * .
By Theorem 11.4.1 of [START_REF] Puterman | Markov Decision Processes: Discrete Stochastic Dynamic Programming[END_REF] we have ∀d

∞ ∈ Π SD M , ρ 2 = ρ 2 = ρ d ∞ 2
and thus d * is also (2)-optimal. This concludes the proof for the finite case, which proves the statement of Prop. 2.

Step 3b: For M + k (compact A + k,s with continuous rewards, holding times and transition probabilities). The proof is almost the same as with discrete action spaces. The only difference is that we can't apply the Theorem of [START_REF] Schäl | On the second optimality equation for semimarkov decision models[END_REF] because conditions (R) and (C*) do not hold in general. However, we can use Propositions 5.4 and 5.5 of [START_REF] Schäl | On the second optimality equation for semimarkov decision models[END_REF] and we have the same result as in the discrete case (assumptions (L), (C), (P) and (I) hold in our case and we know that the optimality equation 13 admits a solution (u * , ρ * ), see above). Since the state space is finite, the rest of the proof is rigorously the same (the Theorems and Lemmas still applies). This guarantees the same statement as Prop. 2 but for the optimistic SMDP M + k .

A.3 Proof of Lemma 1

Proof. From the proof of Prop. 2, we already have that EVI converges towards the optimal average reward of M + k,eq , which is also the optimal average reward of M + k . We also know that the stopping criterion is met in a finite number of steps and that the greedy policy when the stopping criterion holds is ǫ-optimal in the equivalent M + k,eq . Then, in order to prove Lemma 1, we only need to prove that this policy is also ǫ-optimal in the optimistic SMDP M + k . Tij [2003] shows that for any stationary deterministic policy

d ∞ ∈ Π SD M + k
, the (1)-average reward is the same in the SMDP and the MDP obtained by uniformization, that is

∀s ∈ S, ρ d ∞ 1 ( M + k ) = ρ d ∞ ( M + k,eq ).
Then it immediately follows that the policy returned by EVI is (1

)-ǫ-optimal in M + k and since ∀d ∞ ∈ Π SD M , ρ d ∞ 1 = ρ d ∞
3 , it is also (3)-ǫ-optimal. Note that for any deterministic stationary policy

d ∈ Π SD M + k defining a unichain Markov chain in M + k,eq (or equivalently in M + k ), we have: ∀s ∈ S, ρ d ∞ 1 (s) = ρ d ∞ 2 (s)
and this value is constant across states (see for example chapter 11 of [START_REF] Puterman | Markov Decision Processes: Discrete Stochastic Dynamic Programming[END_REF], Theorem 7.5 of [Ros, 1970] or [Liu and Zhao, 2004]). However, in the general case, this equality does not hold (see Example 2.1 of [Liu and Zhao, 2004]). Nevertheless, by Theorem 3.1 of [Liu and Zhao, 2004] we have

∀d ∞ ∈ Π SD M + k , ∀s ∈ S, ρ d ∞ 2 ( M + k , s) -ρ d ∞ ( M + k,eq , s) ≤ ρ d ∞ max ( M + k,eq ) -ρ d ∞ min ( M + k,eq )
where

ρ d ∞ max ( M + k,eq ) = max s∈S ρ d ∞ ( M + k,eq , s) and ρ d ∞ min ( M + k,eq ) = min s∈S ρ d ∞ ( M + k,eq , s). (15)
If we denote by d the policy returned by EVI and ρ * the optimal gain of M + k,eq and M + k we obtain

∀s ∈ S, ρ * -ρ d ∞ 2 ( M + k , s) = ρ d ∞ ( M + k,eq , s) -ρ d ∞ 2 ( M + k , s) + ρ * -ρ d ∞ ( M + k,eq , s) ≤ ρ d ∞ max ( M + k,eq ) -ρ d ∞ min ( M + k,eq ) + ǫ = ρ d ∞ max ( M + k,eq ) -ρ * + ρ * -ρ d ∞ min ( M + k,eq ) + ǫ ≤ 2ǫ.
For the first inequality we used Eq. 15 and the fact that d is ǫ-optimal in M + k,eq . For the second inequality, we used again that d is ǫ-optimal in M + k,eq and we also used the fact that ρ d ∞ max ( M + k,eq ) ≤ ρ * . In conclusion, the policy returned by EVI is (2)-2ǫ-optimal. The remaining part of Theorem 1 is thus proved for all optimality criteria. By Theorem 8.3.2 of [START_REF] Puterman | Markov Decision Processes: Discrete Stochastic Dynamic Programming[END_REF], we know that there exists an optimal policy d * of MDP M + k,eq that yields a unichain Markov Chain (i.e., a Markov Chain with a single positive recurrent class). The Markov Chain induced by d * in M + k is thus also unichain and moreover: ρ

( d * ) ∞ 1 ( M + k ) = ρ ( d * ) ∞ ( M + k,eq ) = ρ * ( M + k,eq ) = ρ * ( M + k ).

We have seen that for any policy

d ∈ Π SD M + k yielding a unichain Markov Chain ρ d ∞ 1 ( M + k ) = ρ d ∞ 2 ( M + k )
and so in particular, it is true for d * . Therefore, there exists a policy of M + k which yields a unichain Markov Chain and which is (1)-optimal, (2)-optimal and (3)-optimal. This explains why the optimal gain is the same for criteria (1) and ( 2) but EVI must be run with a different accuracy to insure ǫ-accuracy (the Markov Chain induced by the policy returned by EVI is not necessarily unichain).

B Analysis of SMDP-UCRL (proof of Theorem 1)

The proof follows the same steps as in [Jaksch et al., 2010]. Therefore, in the following we only emphasize the differences between SMDPs and MDPs and we refer to [Jaksch et al., 2010] for the parts of the proof which are similar.

B.1 Splitting into Episodes

We first recall the definition of sub-exponential random variables.

Definition 4 [START_REF] Wainwright | Course on Mathematical Statistics, chapter 2: Basic tail and concentration bounds[END_REF]). A random variable X with mean µ < +∞ is said to be sub-exponential, if one of the following equivalent conditions is satisfied:

1. (Laplace transform condition) There exists (σ, b) ∈ R + × R + * such that: E[e λ(X-µ) ] ≤ e σ 2 λ 2 2 for all |λ| < 1 b . ( 16
)
In this case, we say that X is sub-exponential of parameters σ, b and we denote it by X ∈ subExp(σ, b).

2. There exists c 0 > 0 such that E[e λ(X-µ) ] < +∞ for all |λ| ≤ c 0 .

In order to define the confidence intervals, we use the Bernstein concentration inequality for sub-exponential random variables.

Proposition 5 (Bernstein inequality, [START_REF] Wainwright | Course on Mathematical Statistics, chapter 2: Basic tail and concentration bounds[END_REF]). Let (X i ) 1≤i≤n be a collection of independent sub-Exponential random variables s.t. ∀i ∈ {1, ..., n}, X i ∈ subExp(σ i , b i ) and E[X i ] = µ i . We have the following concentration inequalities:

∀t ≥ 0, P n i=1 X i - n i=1 µ i ≥ t ≤ e -t 2 2nσ 2 , if 0 ≤ t ≤ σ 2 b e -t 2b , if t > σ 2 b P n i=1 X i + n i=1 µ i ≤ t ≤ e -t 2 2nσ 2 , if 0 ≤ t ≤ σ 2 b e -t 2b , if t > σ 2 b ( 17
)
where σ = Conditionally on knowing (N (s, a)) s,a , the previous sum is equal (in distribution) to a sum of independent random variables with mean s∈S a∈As N (s, a)r(s, a) and from Prop. 5 we have

P n i=1 r i ≤ s∈S a∈As N (s, a)r(s, a) -σ r 5 2 n log 13n δ (N (s, a)) s,a ≤ δ 13n 5/4 ≤ δ 24n 5/4 , if n ≥ 5b 2 r 2σ 2 r log 13n δ P n i=1 r i ≤ s∈S a∈As N (s, a)r(s, a) - 5 2 b r log 13n δ (N (s, a)) s,a ≤ δ 13n 5/4 ≤ δ 24n 5/4 , if n ≤ 5b 2 r 2σ 2 r log 13n δ
Similarly, the total holding time satisfies

P n i=1 τ i ≥ s∈S a∈As N (s, a)τ (s, a) + σ τ 5 2 n log 13n δ (N (s, a)) s,a ≤ δ 13n 5/4 ≤ δ 24n 5/4 , if n ≥ 5b 2 τ 2σ 2 τ log 13n δ P n i=1 τ i ≥ s∈S a∈As N (s, a)τ (s, a) + 5 2 b τ log 13n δ (N (s, a)) s,a ≤ δ 13n 5/4 ≤ δ 24n 5/4 , if n ≤ 5b 2 τ 2σ 2 τ log 13n δ
Lemma 4. The optimal average reward can be bounded as follows:

ρ * (M ) ≤ max s∈S,a∈As r(s, a) τ (s, a) ≤ R max .
Proof. In App. A we prove that ρ * (M ) = ρ * (M eq ) where ρ * (M eq ) is the optimal average reward of an MDP M eq with same state and action spaces as SMDP M and with average rewards of the form r(s,a) τ (s,a) . All the rewards of M eq are thus bounded by R max and so ρ * (M eq ) is necessarily bounded by R max as well and thus: ρ * (M ) ≤ R max .

We are now ready to split the regret over episodes. We define the per-episode regret as

∆ k = s∈S a∈As ν k (s, a) (τ (s, a)ρ * -r(s, a)).
Setting γ r = max 5 2 b r , 5 2 σ r and γ τ = max 5 2 b τ , 5 2 σ τ , and using a union bound on the previous inequalities we have that with probability at least 1 -δ

12n 5/4 ∆(M, A, s, n) ≤ n k=1 ∆ k + (γ r + γ τ R max ) log 13n δ √ n

B.2 Dealing with Failing Confidence Regions

Lemma 5. For any episode k ≥ 1, the probability that the true SMDP M is not contained in the set of plausible MDPs M k at step i is at most δ 15i 6 k , that is:

∀k ≥ 1, P (M ∈ M k ) < δ 15i 6 k (18)
Proof. This lemma is the SMDP-analogue of Lemma 17 in [Jaksch et al., 2010] and the proof is similar. Using an ℓ 1 -concentration inequality for discrete probability distributions we obtain

P p(•|s, a) -pk (•|s, a) 1 ≥ β p k (s, a) = P p(•|s, a) -pk (•|s, a) 1 ≥ 14S n log 2Ai k δ ≤ P p(•|s, a) -pk (•|s, a) 1 ≥ 2 n log 2 S 20SAi 7 k δ ≤ 2 S exp - n 2 × 2 n log 2 S 20SAi 7 k δ = δ 20i 7 k SA
In the inequalities above, it is implicitly assumed that the value N k (s, a) = n is fixed. To be more rigorous, we are bounding the probability of the intersection of event { p(•|s, a) -pk (•|s, a) 1 ≥ β p k (s, a)} with event {N k (s, a) = n} but we omitted the latter to simplify notations, and we will also omit it in the next inequalities. Using Bernstein inequality (Prop. 5) and noting that 240 ≤ 2 7 SA δ 6 for S, A ≥ 2 and δ ≤ 1, we have:

• If n ≥ 2b 2 r σ 2 r log 240SAi 7 k δ : P |r(s, a) -rk (s, a)| ≥ β r k (s, a) = P |r(s, a) -rk (s, a)| ≥ σ r 14 n log 2SAi k δ ≤ P |r(s, a) -rk (s, a)| ≥ σ r 2 n log 240SAi 7 k δ ≤ 2 exp - n 2σ 2 r × 2 n σ 2 r log 240SAi 7 k δ = δ 120i 7 k SA • If n < 2b 2 r σ 2 r log 240SAi 7 k δ : P |r(s, a) -rk (s, a)| ≥ β r k (s, a) = P |r(s, a) -rk (s, a)| ≥ 14b r n log 2SAi k δ ≤ P |r(s, a) -rk (s, a)| ≥ 2b r n log 240SAi 7 k δ ≤ 2 exp - n 2b r × 2 n b r log 240SAi 7 k δ = δ 120i 7 k SA
Similarly for holding times we have:

P |τ (s, a) -τk (s, a)| ≥ β τ k (s, a) ≤ δ 120i 7 k SA
Note that when there hasn't been any observation, the confidence intervals trivially hold with probability 1. Moreover, N k (s, a) < i k by the stopping condition of an episode. Taking a union bound over all possible values of N k (s, a) yields:

P |τ (s, a) -τk (s, a)| ≥ β τ k (s, a) ≤ δ 120i 6 k SA P |r(s, a) -rk (s, a)| ≥ β r k (s, a) ≤ δ 120i 6 k SA P p(•|s, a) -pk (•|s, a) 1 ≥ β p k (s, a) ≤ δ 20i 6 k SA
Summing over all state-action pairs:

P (M ∈ M k ) < δ 15i 6 k .
We now consider the regret of episodes in which the set of plausible SMDPs M k does not contain the true SMDP M :

m k=1 ∆ k 1 M ∈M k .
By the stopping criterion for episode k (except for episodes where ν k (s, a) = 1 and N k (s, a) = 0 for which s∈S a∈As ν k (s, a) = 1 ≤ i k ):

s∈S a∈As ν k (s, a) ≤ s∈S a∈As N k (s, a) = i k -1 (19)
We can thus bound this part of the regret:

m k=1 ∆ k 1 M ∈M k ≤ m k=1 s∈S a∈As ν k (s, a)τ (s, a)ρ * 1 M ∈M k ≤ τ max ρ * m k=1 i k 1 M ∈M k = τ max ρ * n i=1 i m k=1 1 i=i k ,M ∈M k ≤ τ max ρ *   ⌊n 1/4 ⌋ i=1 i + n i=⌊n 1/4 ⌋+1 i m k=1 1 i=i k ,M ∈M k   ≤ τ max ρ *   √ n + n i=⌊n 1/4 ⌋+1 i m k=1 1 i=i k ,M ∈M k  
where we defined: τ max = max s,a τ (s, a) < +∞. By Lemma 5, the probability that the second term in the right hand side of the above inequality is non-zero is bounded by

n i=⌊n 1/4 ⌋ δ 15i 6 ≤ δ 15n 6/4 + +∞ n 1/4 δ 15x 6 dx ≤ δ 12n 5/4 .
In other words, with probability at least 1 -δ 12n 5/4 :

m k=1 ∆ k 1 M ∈M k ≤ τ max R max √ n.

B.3 Episodes with M ∈ M k

Now we assume that M ∈ M k and we start by analysing the regret of a single episode k. By construction,

R max ≥ ρ k ≥ ρ * -Rmax √ i k hence: ∆ k = s∈S a∈As ν k (s, a) (τ (s, a)ρ * -r(s, a)) ≤ s∈S a∈As ν k (s, a) (τ (s, a) ρ k -r(s, a)) + R max s∈S a∈As ν k (s, a) √ i k τ (s, a) =⇒ ∆ k ≤ s∈S a∈As ν k (s, a) ( τ k (s, a) ρ k -r(s, a)) + R max s∈S a∈As ν k (s, a) (τ (s, a) -τ k (s, a)) + R max τ max s∈S a∈As ν k (s, a) √ i k
We now need two results about the extended value iteration algorithm.

Lemma 6. At any iteration i ≥ 0 of EVI (extended value iteration), the range of the state values is bounded as follows, ∀i ≥ 0, max

s∈S u i (s) -min s∈S u i (s) ≤ R max D(M ) τ , ( 20
)
where R max is an upper-bound on the per-step reward r(s, a)/τ (s, a), τ is the parameter used in the uniformization of the SMDP M and D(M ) is its diameter (Def. 2).

Proof. In Appendix A we show that EVI is value iteration applied to the equivalent MDP M + k,eq obtained by "uniformizing" the extended SMDP M + k . Thus, we focus on any SMDP M and its equivalent MDP M eq . Using the same argument as in section 4.3.1 of [Jaksch et al., 2010], we have that: ∀i ≥ 0, max s∈S u i (s)-min s∈S u i (s) ≤ R max D(M eq ) since all rewards of M eq are bounded by R max whenever the average reward in M is bounded by R max . Thus we need to find a relationship between D(M ) and D(M eq ). Let T (s ′ ) denote the first time at which state s ′ is reached in M or M eq , that is

In SMDP M : T (s ′ ) = inf n i=1 τ i : n ∈ N, s n = s ′ In MDP M eq : T (s ′ ) = inf n : n ∈ N, s n = s ′ .
We prove that ∀s,

s ′ ∈ S, ∀π ∈ Π SD M = Π SD M ′ , E π M T (s ′ )|s 0 = s = τ E π M ′ T (s ′ )|s 0 = s .
We consider two cases:

1. If P π M T (s ′ ) = +∞|s 0 = s > 0 then necessarily E π M T (s ′ )|s 0 = s = +∞. Moreover: P π M T (s ′ ) = +∞|s 0 = s > 0 =⇒ P π Meq T (s ′ ) = +∞|s 0 = s > 0 and so E π Meq T (s ′ )|s 0 = s = +∞ = 1 τ E π M T (s ′ )|s 0 = s .
2. Conversely: P π M T (s ′ ) = +∞|s 0 = s = 0 =⇒ P π Meq T (s ′ ) = +∞|s 0 = s = 0 in which case both expectations are finite. To prove they are equal up to factor τ , we see the holding time as a "reward" (the true rewards are ignored here). Note that any policy π induces Markov chains with different dynamics on M and M eq (different transition probabilities). We call these Markov chains M C and M C eq respectively. Suppose we modify M C as follows: all states that are not reachable from s are ignored, all other states are unchanged except s ′ that is assumed to be absorbing (i.e., π(s ′ ) is an action that loops on s ′ with probability 1). Furthermore, we build a Markov reward process M R with the same dynamics as M C and such that all transitions (s, π(s)) have an expected reward equal to τ (s, π(s)) except (s ′ , π(s ′ )) which has a reward of zero. The total expected reward of this Markov reward process (MRP denoted M R) starting from s trivially equals E π M T (s ′ )|s 0 = s . Since we assumed that E π M T (s ′ )|s 0 = s is finite, and because all states of M R are reachable from s (the other states were ignored), s ′ is reached with probability 1 no matter which starting state s of M R is chosen (or in other words, even though we ignored some states, the transition matrix of M R is stochastic -and not sub-stochastic-and has a single recurrent class consisting of the absorbing state s ′ ). By [START_REF] Puterman | Markov Decision Processes: Discrete Stochastic Dynamic Programming[END_REF], the vector T (s) s∈S = E π M T (s ′ )|s 0 = s s∈S is the unique solution to the system of equations ∀s, T (s) = τ (s, d(s)) + s p( s|s, d(s))T ( s).

Applying the same transformation to M C eq and assigning a reward of 1 to all transitions but (s ′ , π(s ′ )) (which has reward 0) in order to build M R eq , we deduce that the vector T eq (s) s∈S = E π Meq T (s ′ )|s 0 = s s∈S is the unique solution to the system of equations ∀s, T eq (s

) = 1 + τ τ (s, d(s)) s p( s|s, d(s))T eq ( s) + 1 - τ τ (s, d(s)) T eq (s)
⇐⇒ ∀s, τ T eq (s) = τ (s, d(s))

+ s p( s|s, d(s)) τ T eq ( s)
.

By uniqueness of the solution: τ T eq = T =⇒ τ D(M eq ) = D(M ).

Lemma 7. If the convergence criterion of EVI hold at iteration i, then:

∀s ∈ S, u i+1 (s) -u i (s) -ρ k ≤ 1 √ i k (21)
Proof. We introduce the following quantities

M i = max s∈S {u i+1 (s) -u i (s)}, m i = min s∈S {u i+1 (s) -u i (s)}, ǫ = 1 √ i k .
Since EVI is just value iteration applied to MDP M ′ k , Theorem 8.5.6 of [START_REF] Puterman | Markov Decision Processes: Discrete Stochastic Dynamic Programming[END_REF] hold and we have:

1 2 (M i + m i ) ≥ ρ k - ǫ 2 ⇐⇒ m i ≥ ρ k - ǫ 2 - 1 2 (M i -m i ) =⇒ m i ≥ ρ k -ǫ 1 2 (M i + m i ) -ρ k ≤ ǫ 2 ⇐⇒ M i ≤ ρ k + ǫ 2 + 1 2 (M i -m i ) =⇒ M i ≤ ρ k + ǫ.
In conclusion:

∀s ∈ S, -1 √ i k ≤ u i+1 (s) -u i (s) -ρ k ≤ 1 √ i k .
Based on Lemma 7, Eq. 21, and optimiality equation Eq. 14, we have:

∀s ∈ S, ρ k - r k (s, π k (s)) τ k (s, π k (s)) - s ′ ∈S p k (s ′ |s, π k (s))u i (s ′ ) -u i (s) τ τ k (s, π k (s)) ≤ 1 √ i k (22)
Setting r k = r k (s, π k (s)) s∈S to be the column vector of rewards under policy π k , P k = p k (s ′ |s, π k (s)) s,s ′ ∈S the transition matrix and v k = ν k (s, π k (s)) s∈S the row vector of visit counts for each state and the corresponding action chosen by π k . We will use the fact that a

= π k (s) =⇒ ν k (s, a) = 0. ∆ k ≤ s,a ν k (s, a) ( τ k (s, a) ρ k -r(s, a)) + R max s,a ν k (s, a) (τ (s, a) -τ k (s, a)) + R max τ max s,a ν k (s, a) √ i k = s,a ν k (s, a) ( τ k (s, a) ρ k -r k (s, a)) + s,a ν k (s, a) ( r k (s, a) -r(s, a)) + R max τ max s,a ν k (s, a) √ i k + R max s,a ν k (s, a) (τ (s, a) -τ k (s, a))
We will now upper-bound the four terms of the right-hand side of the above inequality. Setting c r = max{14b r , √ 14σ r } and c τ = max{14b τ , √ 14σ τ } we have:

r k (s, a) -r(s, a) ≤ r k (s, a) -rk (s, a) + rk (s, a) -r(s, a) ≤ 2β r k (s, a) ≤ 2c r log(2SAi k /δ) max{1, N k (s, a)} τ (s, a) -τ k (s, a) ≤ τ k (s, a) -τk (s, a) + τk (s, a) -τ (s, a) ≤ 2β τ k (s, a) ≤ 2c τ log(2SAi k /δ) max{1, N k (s, a)}
Finally, using 22 and noting that τ k (s, a) ≤ τ max (by construction) we obtain:

τ k (s, a) ρ k -r k (s, a) ≤ R max τ max √ i k + τ s ′ ∈S p k (s ′ |s, π k (s))u i (s ′ ) -u i (s) , if a = π k (s) =⇒ s,a ν k (s, a) ( τ k (s, a) ρ k -r k (s, a)) ≤ R max τ max s,a ν k (s, a) √ i k + τ v k P k -I u i
where i is the iteration at which the stopping condition of EVI holds. Defining the column vector w k by:

w k (s) = u i (s) - min s∈S u i (s) + max s∈S u i (s) 2
and since the rows of P k sum to one, we have:

v k P k -I u i = v k P k -I w k . Moreover, by Lemma 6: w k ∞ ≤ RmaxD 2τ
. Noting that max{1, N k (s, a)} ≤ i k ≤ n we get:

∆ k ≤ τ v k P k -I w k + 2 R max τ max + (c r + R max c τ ) log 2SAn δ s,a ν k (s, a) max{1, N k (s, a)}
Using exactly the same arguments as in Jaksch et al. [2010], it is trivial to prove that with probability at least 1 -δ 12n 5/4 : Jaksch et al., 2010].

m k=1 v k P k -I w k 1 M∈M k ≤ R max D τ 14S log 2An δ m k=1 s,a ν k (s, a) max{1, N k (s, a)} + 5 2 n log 8n δ +SA log 2 8n SA Lemma 8. Consider a sequence of positive reals (z k ) k and define: ∀k, Z k = max{1, k i=1 z i }. Assuming that 0 ≤ z k ≤ Z k-1 we have: ∀n ≥ 1, n k=1 z k Z k-1 ≤ √ 2 + 1 Z n Proof. See Appendix C.3 of [
Using Lemma 8 we get:

m k=1 s,a ν k (s, a) max{1, N k (s, a)} ≤ √ 2 + 1 s,a N (s, a)
By Jensen's inequality we thus have:

m k=1 s,a ν k (s, a) max{1, N k (s, a)} ≤ √ 2 + 1 √ SAn
In conclusion, when M ∈ M k , with probability at least 1 -δ 12n 5/4 :

m k=1 ∆ k 1 M∈M k ≤ R max D 5 2 n log 8n δ + R max DSA log 2 8n SA + ( √ 2 + 1) 2R max τ max +2(c r + R max c τ ) log 2SAn δ + R max D 14S log 2An δ √ SAn

B.4 Computing the final bound

Gathering all previous inequalities, we have that with probability at least 1 -3δ 12n 5/4 = 1 -δ 4n 5/4 :

∆(M, A, s, n) ≤ (γ r + γ τ R max ) log 13n δ √ n + τ max R max √ n + R max D 5 2 n log 8n δ + ( √ 2 + 1) 2τ max + 2(c r + R max c τ ) log 2SAn δ + R max D 14S log 2An δ √ SAn + R max DSA log 2 8n SA
In [Jaksch et al., 2010]

n 2 δ 2 ≥ nS log n δ δ ≥ nS δ =⇒ n 2 A 2 δ 2 ≥ 2SAn δ =⇒ 4 log n δ ≥ 2 log An δ ≥ log 2SAn δ =⇒ ∆(M, A, s, n) = O D √ S + τ max + C r R max + C τ log n δ R max SAn log n δ
where C r = max{b r , σ r } and C τ = max{b τ , σ τ }.

Note that if n ≤ 34A log n δ then we trivially have:

m k=1 ∆ k ≤ τ max R max n = τ max R max ( √ n) 2 ≤ 34τ max R max An log n δ and if n ≤ S log n δ : m k=1 ∆ k ≤ τ max R max n = τ max R max ( √ n) 2 ≤ τ max R max Sn log n δ
and thus the previous bound on the whole regret still holds. Taking a union bound over all possible values of n ≥ 1 we have that with probability at least 1 -δ:

∀n ≥ 1, ∆(M, A, s, n) = O D √ S + τ max + C r R max + C τ log n δ R max SAn log n δ .
The derivation for the case of bounded holding times is exactly the same with different concentration inequalities applied to estimates τ (s, a). Note that all the terms in the upper bound are very similar to those appearing in the derivation of the upper bound for MDPs, thus the constants in the big O are very close. This justifies the analysis of the ratio between the two upper bounds in Sect. 5.

C The Lower Bound (Theorem 2)

C.1 Lower Bound for SMDPs

We will derive the lower bound by applying the same techniques as in the proof of the lower bound for MDPs (section 6 of [Jaksch et al., 2010]). We first consider the two-state SMDP M ′ depicted in Fig. 4. Since by assumption D 12 > T min and Tmax 3 > T min , let τ ∈ T min , min D 12 , Tmax

3

. Define p = τ Tmax and δ = 4τ D . By definition of τ we have: p, δ ≤ 1 3 . There are A ′ = ⌊ A-1 2 ⌋ actions available in each state of M ′ . We assume that ∀(s, a, s ′ ) ∈ S × A s × S and ∀i ≥ 0, r i (s, a, s ′ ) and τ i (s, a, s ′ ) are independent. We also assume that ∀i ≥ 0, τ i (s i-1 , a i , s i ) and r i (s i-1 , a i , s i ) are independent of the next state s i and we write: τ i (s i-1 , a i ) and r i (s i-1 , a i ).

For each action a in A s0 , r(s 0 , a) = 0 and τ (s, a) ∼ τ where τ is a r.v. defined in Table 1. Moreover, for all actions a but a specific action a * 0 , p(s 1 |s 0 , a) = δ whereas p(s 1 |s 0 , a * 0 ) = δ + ǫ for some 0 < ǫ < δ specified later in the proof. For all actions a in A s1 , p(s 0 |s 1 , a) = δ and τ (s 1 , a) ∼ τ . Finally, r(s 1 , a) ∼ r for all actions a except a * 1 for which r(s 1 , a * 1 ) ∼ r * , where r and r * are r.v. defined in Table 1 where 0 < η < p will be defined later in the proof. Note that since η < τ Tmax , we have: r ≤ τ R max and r * ≤ τ R max which satisfies the definition of R max given in assumption 1. We denote E[•|s] the expectation conditionally on starting in state s.

Let's define T (s 1 ) = inf{t : we have:

s t = s 1 } the first time in which s 1 is encountered. ∀d ∞ ∈ Π SD M ′ such that d(s 0 ) = a * s 0 s 1 1 -δ, τ, 0 δ, τ, r δ, τ, 0 1 -δ, τ, r δ + ǫ, τ, 0 δ, τ, r * 1 -δ -ǫ, τ, 0 1 -δ, τ, r *
E d ∞ [T (s 1 )|s 0 ] = E d ∞   +∞ n=1   n i=1 τ i (s i-1 , a i , s i )   n-1 j=0 1 sj =s0   1 sn=s1   s 0   = +∞ n=1 E d ∞   n i=1 τ i (s 0 , d(s 0 ))   n-1 j=0 1 sj =s0   1 sn=s1 s 0   = +∞ n=1 E d ∞ n i=1 τ i (s 0 , d(s 0 )) s 0 E d ∞     n-1 j=0 1 sj =s0   1 sn=s1 s 0   = +∞ n=1 nτ × δ(1 -δ) n-1 = τ δ
We used the fact that τ i is independent of the next state s i and that τ

= E[τ ]. We can compute E d ∞ [T (s 1 )|s 0 ] with d(s 0 ) = a * 0 and E d ∞ [T (s 0 )|s 1 ] (for both d(s 0 ) = a * 0 and d(s 0 ) = a * 0 )
similarly. The diameter of SMDP M ′ is thus:

D ′ = max min τ δ , τ δ + ǫ , min τ δ , τ δ = max τ δ + ǫ , τ δ = τ δ
Any policy d ∞ ∈ Π SD M ′ induces a recurrent Markov Chain on M ′ . Let's denote by P * d the limiting matrix of this Markov Chain. We know (see [START_REF] Puterman | Markov Decision Processes: Discrete Stochastic Dynamic Programming[END_REF]

) that P * d = eµ ⊺ d where µ d = (1 -p d , p d ) ⊺ is
ρ d = p d X (1 -p d )τ + p d τ = p d X τ
where X = r if and only if d(s 1 ) = a * 1 , and X = r * if and only if d(s 1 ) = a * 1 . Since r * > r, the optimal decision rule d * must satisfy: d * (s 1 ) = a * 1 . Similarly, since δ+ǫ 2δ+ǫ > 1 2 we must have: d * (s 0 ) = a * 0 . The optimal gain is thus:

ρ * = R max 2 × (δ + ǫ) (τ + ηT max ) (2δ + ǫ) τ
The actual SMDP M that we will use to prove the lower bound is built by considering k = ⌊ S 2 ⌋ copies of the two-state SMDP M ′ , where only one of the copies has such "good" actions a * 0 and a * 1 (all the other copies have the exact same number of actions as M ′ , but all actions are identical). A ′ + 1 additional actions with deterministic transitions are introduced in every s 0 -state. The reward for each of those actions is zero and the

R.v. X X min X max P(X = X min ) P(X = X max ) E[X] τ T min T max > 0 > 0 τ r 0 1 2 R max T max 1 -p p 1 2 τ R max r * 0 1 2 R max T max 1 -p -η p + η 1 2 (τ R max + ηT max R max )
Table 1: Definition of random variables τ , r and r * .

holding time is T min . These actions connect the s 0 -states of the k copies in a A ′ -ary tree structure on the s 0 states: one action goes toward the root and A ′ actions goes toward the leaves (the same structure is described in section 6 of [Jaksch et al., 2010], see Figure 6 for a representation of the A ′ -ary tree). The diameter of such an SMDP M is at most

2 D 4 + T min ⌈log A ′ k⌉ ≤ D. All holding times of M are in [T min , T max ]
, and all rewards are in [0, 1 2 R max T max ]. For all (s, a) ∈ S × A s we have: r(s, a) ≤ τ (s, a)R max . Moreover, M has at most S states and A actions per state.

For the analysis, we will study the simpler-to-learn SMDP M ′′ where all s 0 -states are merged together as well as all s 1 -states. The "merged" s 0 -state is set to be the initial state. M ′′ is thus equivalent to the two-state SMDP M ′ with kA ′ available actions in both s 0 and s 1 . Let's assume that the learning algorithm A used is fixed. The probability distribution of the stochastic process (s 0 , a 0 , τ 0 , r 0 , s 1 , ...) is denoted:

• P a0,a1 when (a 0 , a 1 ) are the best actions in respectively s 0 and s 1 , • P * when the pair (a 0 , a 1 ) identifying the best actions is first chosen uniformly at random from {1, ..., kA ′ } × {1, ..., kA ′ } before algorithm A starts, • P unif0,a1 when the pair a 1 is the best action in s 1 and ǫ = 0 (no-optimal actions in s 0 ), • P a0,unif1 when the pair a 0 is the best action in s 0 and η = 0 (no-optimal actions in s 1 ).

By construction, it is trivial to see that:

E * [∆(M, A, s, n)] ≥ E * [∆(M ′′ , A, s, n)] (M ′′ is easier to learn). We will show that E * [∆(M ′′ , A, s 0 , n)] = Ω √ D ′ + √ T max R max √ kA ′
n and the same result can be proved with initial state s 1 using similar arguments. This will necessarily imply that there exists at least one choice of pair (a 0 , a 1 ) for which, for all states s we have:

E a0,a1 [∆(M, A, s, n)] = Ω √ D + √ T max R max √ SAn .
As already argued by [Jaksch et al., 2010], for the analysis it is sufficient to consider algorithms with deterministic strategies for choosing actions.

We assume algorithm A is run for n decision steps, which means that n + 1 states are visited in total (including the last state in which no action is taken). Let's denote by N 0 and N 1 the number of visits in states s 0 and s 1 respectively, last state excluded. For any (a, a) ∈ A s0 × A s1 , let's denote by N a 0 and N a 1 the respective number of times actions a and a are taken. Finally, let's denote by N * 0 and N * 1 the respective number of times best actions in s 0 and s 1 are taken. The SMDP M ′′ has the same transition probabilities as the MDP considered by [Jaksch et al., 2010] and we can use their proof to show that for any choice of best actions (a 0 , a 1 ):

E unif0,a1 [N 1 ] ≥ n 2 - 1 2δ = n 2 - D ′ 2τ E a0,a1 [N 1 ] ≤ n 2 + E a0,a1 [N * 0 ]ǫ δ + 1 2δ = n 2 + E a0,a1 [N a0 0 ]ǫD ′ 2τ + D ′ 2τ
The regret is defined as:

E * [∆(M ′′ , A, s 0 , n)] = E * n i=1 τ i (s i-1 , a i , s i ) ρ * -E * n i=1 r i (s i-1 , a i , s i )
where the total duration is simply:

E * n i=1 τ i (s i-1 , a i , s i ) = n i=1 E * [τ i (s i-1 , a i )] = nτ
Exploration-Exploitation in MDPs with Options and the cumulated reward is given by:

E * n i=1 r i (s i-1 , a i , s i ) = n i=1 E * r i (s 1 , a * 1 )1 si-1=s1,ai=a * 1 + r i (s 1 , a i = a * 1 )1 si-1=s1,ai =a * 1 = E * r * n-1 i=0 1 si=s1,ai+1=a * 1 + r n-1 i=0 1 si=s1,ai+1 =a * 1 = E * [r (N 1 -N * 1 ) + r * N * 1 ] = E * [rN 1 + (r * -r)N * 1 ] = R max 2 τ E * [N 1 ] + η R max 2 T max E * [N * 1 ]
hence the formula:

E * [∆(M ′′ , A, s 0 , n)] = τ nρ * - R max 2 E * [N 1 ] -η R max 2 T max E * [N * 1 ] (23) Lemma 9. Let f : {s 0 , s 1 } n+1 × {T min , T max } n × {0, 1 2 R max T max } n → [0, M ] be any function defined on state/reward sequence (s n+1 , τ n , r n ) ∈ {s 0 , s 1 } n+1 × {T min , T max } n × {0, 1
2 R max T max } n observed in the SMDP M ′′ . Then for any n ≥ 1, any 0 ≤ δ ≤ 1 2 , any 0 ≤ ǫ ≤ 1 -2δ, any 0 ≤ p ≤ 1 2 , any 0 ≤ η ≤ 1 -2p, and any (a 0 , a 1 ) ∈ {1, ..., kA ′ } × {1, ..., kA ′ }:

E a0,a1 f (s n+1 , τ n , r n ) -E unif0,a1 f (s n+1 , τ n , r n ) ≤ M 2 ǫ √ δ 2E unif0,a1 [N a0 0 ] E a0,a1 f (s n+1 , τ n , r n ) -E a0,unif1 f (s n+1 , τ n , r n ) ≤ M 2 η √ p 2E a0,unif1 [N a1 1 ]
Proof. We refer the reader to Appendix E of [Jaksch et al., 2010] where a similar Lemma is proved for the MDPanalogue of SMDP M ′′ . In the following, we will only stress the main difference with the proof in [Jaksch et al., 2010]. We know from information theory that:

E a0,a1 f (s n+1 , τ n , r n ) -E unif0,a1 f (s n+1 , τ n , r n ) ≤ M 2
2 log(2)KL (P unif0,a1 P a0,a1 ) 2)KL (P a0,unif1 P a0,a1 )

E a0,a1 f (s n+1 , τ n , r n ) -E a0,unif1 f (s n+1 , τ n , r n ) ≤ M 2 2 log(
By the chain rule of Kullback-Leibler divergences, it holds that: KL (P a0,unif1 P a0,a1 ) = n i=1 KL P a0,unif1 (s i , τ i , r i |s i-1 , τ i-1 , r i-1 ) P a0,a1 (s i , τ i , r i |s i-1 , τ i-1 , r i-1 )

where KL P(s i , τ i , r i |s i-1 , τ i-1 , r i-1 ) Q(s i , τ i , r i |s i-1 , τ i-1 , r i-1 ) = s i ∈S i ,τ i ∈T ,r i ∈R i P(s i , τ i-1 , r i ) log 2 P(s i , τ i , r i |s i-1 , τ i-1 , r i-1 ) Q(s i , τ i , r i |s i-1 , τ i-1 , r i-1 )
with S = {s 0 , s 1 }, T = {T min , T max } and R = {0, 1 2 R max T max }. The same holds for P unif0,a1 . Similarly to [Jaksch et al., 2010] and using the independence between s i , τ i and r i , we obtain: KL P unif0,a1 (s i , τ i , r i |s i-1 , τ i-1 , r i-1 ) P a0,a1 (s i , τ i , r i |s i-1 , τ i-1 , r i-1 ) = P unif0,a1 (s i-1 = s 0 , a i = a 0 ) s ′ ∈S,τ ′ ∈T ,r ′ ∈R P unif0,a1 (s ′ , τ ′ , r ′ |s 0 , a 0 ) log 2 P unif0,a1 (s ′ , τ ′ , r ′ |s 0 , a 0 ) P a0,a1 (s ′ , τ ′ , r ′ |s 0 , a 0 ) = P unif0,a1 (s i-1 = s 0 , a i = a 0 )

s ′ ∈S P unif0,a1 (s ′ |s 0 , a 0 ) log 2 P unif0,a1 (s ′ |s 0 , a 0 ) P a0,a1 (s ′ |s 0 , a 0 )

= P unif0,a1 (s i-1 = s 0 , a i = a 0 ) δ log 2 δ δ + ǫ + (1 -δ) log 2 1 -δ 1 -δ -ǫ KL P a0,unif1 (s i , τ i , r i |s i-1 , τ i-1 , r i-1 ) P a0,a1 (s i , τ i , r i |s i-1 , τ i-1 , r i-1 ) = P a0,unif1 (s i-1 = s 1 , a i = a 1 )
s ′ ∈S,τ ′ ∈T ,r ′ ∈R P a0,unif1 (s ′ , τ ′ , r ′ |s 1 , a 1 ) log 2 P a0,unif1 (s ′ , τ ′ , r ′ |s 1 , a 1 ) P a0,a1 (s ′ , τ ′ , r ′ |s 1 , a 1 ) = P a0,unif1 (s i-1 = s 1 , a i = a 1 ) r ′ ∈R P a0,unif1 (r ′ |s 1 , a 1 ) log 2 P a0,unif1 (r ′ |s 1 , a 1 ) P a0,a1 (r ′ |s 1 , a 1 )

= P a0,unif1 (s i-1 = s 1 , a i = a 1 ) p log 2 p p + η + (1 -p) log 2 1 -p 1 -p -η
Using Lemma 20 of [Jaksch et al., 2010] we have that under conditions 0 ≤ δ ≤ 1 2 , 0 ≤ ǫ ≤ 1 -2δ, 0 ≤ p ≤ 1 2 , and 0 ≤ η ≤ 1 -2p the following inequalities hold:

δ log 2 δ δ + ǫ + (1 -δ) log 2 1 -δ 1 -δ -ǫ ≤ ǫ 2 δ log(2) and p log 2 p p + η + (1 -p) log 2 1 -p 1 -p -η ≤ η 2 p log(2)
which concludes the proof.

Note that by assumption: ǫ ≤ δ ≤ 1 3 ≤ 1 -2δ and η ≤ p ≤ 1 3 ≤ 1 -2p. We can bound E * [N 1 ] using Lemma 9 as is done in [Jaksch et al., 2010]. This is because N 1 can be written as a function of (s n+1 , τ n , r n ). Since the computations are rigorously the same except that δ = τ D ′ instead of 1 D ′ , we give the results without any further details:

E * [N 1 ] ≤ n 2 + D ′ 2τ + ǫnD ′ 2τ kA ′ + ǫD ′2 2τ 2 kA ′ + ǫ 2 nD ′ 2τ kA ′ D ′ kA ′ n τ + ǫ 2 nD ′2 2τ 2 kA ′ √ kA ′
Taking into account the fact that by assumption n ≥ DSA ≥ 16D ′ kA ′ we get:

E * [N 1 ] ≤ n 2 + D ′ 2τ + ǫnD ′ τ 1 2kA ′ + 1 32τ k 2 A ′2 + ǫ 2 nD ′ τ kA ′ D ′ kA ′ n τ 1 2 + 1 8 √ kA ′ (24)
Given that δ ≥ ǫ ≥ 0 we have the following inequality:

ρ * - R max 4 = R max 2 × ǫτ + (δ + ǫ)ηT max 2(2δ + ǫ)τ ≥ R max 2 × ǫD ′ 6τ + ηT max 6τ (25)
Applying Lemma 9 (N * 1 is a function of (s n+1 , τ n , r n )) and Jensen's inequality we get ∀a 0 ∈ {1, ..., kA ′ }:

E * [N * 1 ] = 1 kA ′ kA ′ a1=1 E a0,a1 [N a1 1 ] ≤ E a0,unif1 [N 1 ] kA ′ + n 2kA ′ η 2kA ′ T max τ E a0,unif1 [N 1 ]
We will now derive an upper-bound on E a0,unif1 [N 1 ].

Lemma 10. Let (u n ) n∈N ∈ R N be any real sequence satisfying the following arithmetico-geometric recurrence relation:

∀n ∈ N, u n+1 ≥ qu n + r where (q, r) ∈ R \ {1} × R
Then we have that:

∀n ∈ N, u n ≥ u 0 - r 1 -q α n + r 1 -q
Exploration-Exploitation in MDPs with Options Proof. Defining sequence v n = u n -r 1-q , we have:

∀n ∈ N, v n+1 = u n+1 - r 1 -q ≥ qu n + r - r 1 -q = q u n - r 1 -q = qv n
By trivial induction we get: ∀n ∈ N, v n ≥ v 0 q n . The result follows by replacing v n by u n -r 1-q .

By the law of total probability and since P a0,unif1 (s i = s 0 ) + P a0,unif1 (s i = s 1 ) = 1 we have:

∀i ≥ 0, P a0,unif1 (s i+1 = s 0 ) =P a0,unif1 (s i+1 = s 0 |s i = s 0 ) P a0,unif1 (s i = s 0 )

+ P a0,unif1 (s i+1 = s 0 |s i = s 1 ) P a0,unif1 (s i = s 1 ) =P a0,unif1 (s i = s 0 ) P a0,unif1 (s i+1 = s 0 |s i = s 0 )

-P a0,unif1 (s i+1 = s 0 |s i = s 1 ) + P a0,unif1 (s i+1 = s 0 |s i = s 1 )

≥P a0,unif1 (s i = s 0 ) (1 -2δ -ǫ) + δ
Since the initial state is s 0 and 2δ + ǫ ≤ 3δ we have by Lemma 10:

∀i ≥ 0, P a0,unif1 (s i = s 0 ) ≥ 1 - δ 2δ + ǫ (1 -2δ -ǫ) i + δ 2δ + ǫ ≥ 1 3 =⇒ E a0,unif1 [N 0 ] = n i=0 P a0,unif1 (s i = s 0 ) ≥ n 3 =⇒ E a0,unif1 [N 1 ] ≤ 2n 3 =⇒ E * [N * 1 ] ≤ 2n 3kA ′ + nη kA ′ T max nkA ′ 3τ
Hence the bound:

ηT max E * [N * 1 ] ≤ 2nηT max 3kA ′ + nη 2 T max kA ′ T max nkA ′ 3τ (26)
By setting ǫ = c kA ′ nD ′ and η = κ kA ′ nTmax and incorporating inequalities 24, 25 and 26 into inequality 23 we obtain:

E * [∆(M ′′ , A, s 0 , n)] ≥ c 6 - c 2kA ′ - c 32k 2 A ′2 τ - c 2 2 √ τ - c 2 8 √ kA ′ τ - 1 8kA ′ R max 2 √ D ′ kA ′ n + κ 6 - 2κ 3kA ′ - κ 2 √ 3τ R max 2 T max kA ′ n ≥ c 6 - c 2kA ′ - c 32k 2 A ′2 - c 2 2 - c 2 8 √ kA ′ - 1 8kA ′ R max 2 √ D ′ kA ′ n + κ 6 - 2κ 3kA ′ - κ 2 √ 3 R max 2 T max kA ′ n
For the second inequality, we used the fact that τ > T min ≥ 1 (by assumption). If c and κ are sufficiently small, then the conditions of lemma 9 are indeed satisfied and the above polynomials in c and κ are non-negative. For example, if c = κ = 1 5 :

n ≥ DSA ≥ 16D ′ kA ′ =⇒ ǫ = 1 5 kA ′ nD ′ ≤ δ 20 < δ n ≥ T max SA ≥ 4T max kA ′ =⇒ η = 1 5 kA ′ nT max ≤ p 10 < p and E * [∆(M ′′ , A, s 0 , n)] ≥ 0.0015 × √ D ′ + T max R max √ kA ′ n s 0 s 1 1 -δ, τ, 0 δ, τ, r δ, τ, 0 1 -δ, τ, r δ + ǫ, τ, 0 δ, τ * , r * 1 -δ -ǫ, τ, 0 1 -δ, τ * , r *

C.2 Lower Bound for MDPs with options

We first note that SMDP M ′ depicted in Fig. 4 cannot be converted into an MDP with options. This is due to the fact that τ i (s i-1 , a i , s i ) and r i (s i-1 , a i , s i ) were assumed to be independent and the fact that P(r * = 1 2 R max T max ) > P(τ = T max ). However, it is possible to prove a slightly smaller lower bound for a family of SMDPs that can be transformed into an equivalent MDP with options. We will first present the SMDPs and the lower bound and then we will describe how to transform them into an MDP with options.

The family of SMDPs is constructed in the same way as previously except that we use a slightly different SMDP M ′ , represented on Fig. 5 with the random variables given in Table 2. We take: p = 1 2(Tmax-Tmin) and δ = 4τ D . By assumption p < 1 3 and δ < 1 2 . As before, we assume that for all i, τ i (s i-1 , a i , s i ) and r i (s i-1 , a i , s i ) are independent of the next state s i . But the main difference with the previous lower bound is that we assume that r i and τ i are strongly correlated, namely: r i (s i-1 , a i , s i ) = R max 1 {si-1=s1} τ i (s i-1 , a i ). We assume ǫ ≤ δ and η ≤ 1 -2p. The optimal gain of M ′ is reached when a * 0 and a * 1 are chosen in s 0 and s 1 respectively and is equal to:

ρ * = R max × (δ + ǫ) (τ + η(T max -T min )) (2δ + ǫ) τ + (δ + ǫ) (T max -T min )
By adapting the proof of the lower bound for general SMDPs, we can obtain the following result:

E * [∆(M ′′ , A, s 0 , n)] ≥ c 6 - c 2kA ′ - c 32k 2 A ′2 τ - c 2 2 √ τ - c 2 8 √ kA ′ τ - 1 8kA ′ R max √ D ′ kA ′ n + κ 6 - 2κ 3kA ′ - κ 2 3/2 R max (T max -T min )kA ′ n ≥ c 6 - c 2kA ′ - c 32k 2 A ′2 - c 2 2 - c 2 8 √ kA ′ - 1 8kA ′ R max √ D ′ kA ′ n + κ 6 - 2κ 3kA ′ - κ 2 3/2 R max (T max -T min )kA ′ n by setting ǫ = c kA ′ nD ′ and η = κ kA ′
n(Tmax-Tmin) . It is then possible to tune c and κ so that ǫ and η satisfy the constraints and:

E * [∆(M ′′ , A, s 0 , n)] = Ω √ D ′ + T max -T min R max √ kA ′ n
SMDPs M ′ and M ′′ can be transformed into equivalent MDPs with options. We illustrate this transformation on Fig. 6 for an action a 1 ∈ A s1 different than a * 1 . The same method can be applied for the other actions. The idea consists in adding new states (blank states in Fig. 6) and primitive actions between those states. Note that the states added are just "hidden" states from which no option can be started. Thus, they should not be counted in the number of states for the lower bound. In our example it is sufficient to consider primitive actions with constant (i.e., deterministic) reward. On Fig. 6 we give the probabilities of each primitive action when a

1 ∈ A s1 \ {a * 1 } is executed. R.v. X X min X max P(X = X min ) P(X = X max ) E[X] τ T min T max 1 -p p τ = T min + p(T max -T min ) τ * T min T max 1 -p -η p + η τ + η(T max -T min ) r R max T min R max T max 1 -p p τ R max r * R max T min R max T max 1 -p -η p + η τ R max + ηR max (T max -T min )
Table 2: Definition of random variables τ , τ * , r and r * . We denote by R + and R + * the set of positive and non-negative reals respectively. For the definition of subexponential random variables, we refer to Def. 4, while sub-Gaussian random variables are defined as follows.

s 0 s 1 (1 -p)δ, r = R max p(1 -δ), r = R max 1, r = R max 1, r = R max pδ, r = R max 1, r = R max 1, r = R max (1 -p)(1 -δ), r = R max
Definition 5 [START_REF] Wainwright | Course on Mathematical Statistics, chapter 2: Basic tail and concentration bounds[END_REF]). A random variable X with mean µ < +∞ is said to be sub-Gaussian if and only if there exists σ ∈ R + such that:

E[e λ(X-µ) ] ≤ e σ 2 λ 2 2 for all λ ∈ R. (27)
A finite7 Markov option can be seen as an absorbing Markov Chain together with a reward process (i.e., a finite Markov option can be seen as an absorbing Markov Reward Process). To see this we add a new state s for every state s for which β o (s) > 0. We then add a transitions from s to s with probability β o (s) > 0 and reward 0, and we add a self-loop on s with probability 1 and reward 0 ( s is an absorbing state). The Markov Reward Process obtained is indeed absorbing since we assumed the option to be a.s. finite, and it is equivalent to the original option (same reward and holding time). Let's denote by P the transition matrix of the Markov Chain.

In canonical form we have:

P = Q R 0 I r
where r is the number of absorbing states, I r is the identity matrix of dimension r, Q is the transition matrix between non-absorbing states and R the transition matrix from non-absorbing to absorbing states. If the option is a.s. finite then Q is necessarily (strictly) sub-stochastic (Qe ≤ e where e = (1, ..., 1) ⊺ and ∃j s.t. (Qe) j < 1) and irreducible (no recurrent class). It is well-known that such a matrix has a spectral radius strictly smaller than 1 (ρ(Q) < 1) and thus I -Q is invertible (where I is the identity matrix). The holding time τ (s, o, s ′ ) of any option o is defined as the first time absorbing state s ′ is reached starting from state s: inf{n ≥ 1 : s n = s ′ with s 0 = s} where (s n ) n is the sequence of states in the absorbing Markov Chain defined by o. It is well-known in the literature [START_REF] Felko | Input Modeling with Phase-Type Distributions and Markov Models, chapter Phase-Type Distributions[END_REF]] that this type of stopping times have Discrete Phase-Type distributions, with probability mass function given by:

∀k ∈ N * , P(τ (s, a, s ′ ) = k) = e ⊺ s Q k-1 Re s ′
where e s = (0, 0, ...0, 1, 0, ..., 0) ⊺ is a vector of all zeros except in state s where it equals 1. These distributions generalize the geometric distribution (defined in dimension 1) to higher dimensions. The Laplace transform can be computed as follows (we simplify notations and denote: τ

← τ (s, o, s ′ ) and τ ← τ (s, o, s ′ ) = E[τ (s, o, s ′ )]): E e λ(τ -τ ) = ∞ k=1 e λ(k-τ ) e ⊺ s Q k-1 Re s ′ = e λ(1-τ ) e ⊺ s ∞ k=0 e λ Q k Re s ′
The term ∞ k=0 e λ Q k is finite if and only if e λ ρ(Q) < 1, in which case we have:

E e λ(τ -τ ) = e λ(1-τ ) e ⊺ s I -e λ Q -1 Re s ′
and otherwise: E e λ(τ -τ) = +∞. Note that e λ ρ(Q) < 1 if and only if either λ < -log (ρ(Q)) or ρ(Q) = 0. We will now analyse the two cases separately:

1. ρ(Q) = 0 if and only if all the eigenvalues of Q in C are 0, if and only if Q is nilpotent (∃n > 0 s.t. Q n = 0). This is because Q can always be triangularized in C: Q = U T U -1
where T is upper-triangular with the eigenvalues of Q on the diagonal that is, only zeros if ρ(Q) = 0. This implies that ∃n > 0 s.t. 2. In the case where ρ(Q) > 0: it is clear that E e λ(τ -τ ) can not be bounded by a function of the form

T n = U -1 Q n U = 0 =⇒ Q n = 0 hence Q is nilpotent. The reverse is obviously true: if Q is nilpotent then ρ(Q) = 0, (otherwise there would exist λ = 0, v = 0 and n > 0 s.t. Q n = 0 and Qv = λv =⇒ Q n v = λ n v = 0,
λ → e σ 2 λ 2 2
for λ ≥ -log (ρ(Q)) so τ (s, o, s ′ ) is not sub-Gaussian (Definition 5). However, since ρ(Q) < 1 we can choose 0 < c 0 < -log (ρ(Q)) and we have E e λ(τ -τ ) < +∞ for all |λ| < c 0 , which implies that τ (s, o, s ′ ) is sub-exponential (Definition 4).

In conclusion, either option o contains inner-loops (some states are visited several times with non-zero probability) in which case the distribution of τ (s, o, s ′ ) is sub-Exponential but not sub-Gaussian, or o has no inner-loop in which case o is bounded (and thus sub-Gaussian). There is no other alternative.

The distribution of rewards r(s, o, s ′ ) is not as simple: the reward of an option is the sum of all micro-rewards obtained at every time step before the option ends, and every micro-reward earned at each time step can have a different distribution. The only constraint is that all micro-rewards should be (a.s.) bounded between 0 and R max . As a result, if τ (s, o, s ′ ) is a.s. bounded (by let's say T max ) then r(s, o, s ′ ) is also a.s. bounded (by R max T max ). But if τ (s, o, s ′ ) is unbounded then r(s, o, s ′ ) may still be bounded if for example, all micro-rewards are 0. If however all micro-rewards are equal to R max then r(s, o, s ′ ) has a discrete phase-type distribution just like τ (s, o, s ′ ). r(s, o, s ′ ) can thus be unbounded (and even not sub-Gaussian). However, we will show that r(s, o, s ′ ) is always sub-Exponential. Using the law of total expectations and the fact that P (r ≤ R max τ ) = 1 we have:

∀λ > 0, E e λ(r-r) = ∞ k=1 E e λ(r-r) τ = k P(τ = k) ≤ ∞ k=1 E e λ(Rmaxτ -r) τ = k P(τ = k) = ∞ k=1 E e λ(Rmaxk-r) τ = k P(τ = k) = ∞ k=1 e λ(Rmaxk-r) P(τ = k) = e λ(Rmax-τ ) e ⊺ s ∞ k=0 e λRmax Q k Re s ′
We can now conclude as we did for τ (s, o, s ′ ): let 0 < c 0 < -log(ρ(Q))

Rmax , for all 0 < λ < c 0 the quantity E e λ(r-r) is finite. Note that for λ ≤ 0: E e λr ≤ 1 so E e λ(r-r) < +∞. By Definition 4, r(s, o, s ′ ) is sub-Exponential.

E Equivalent policies in an MDP with options and the induced SMDP (Lem. 2)

We consider the original MDP M and the SMDP M O induced by the set of options O. By definition of M O , the reward of an option is equal to the sum of the rewards of all the primitive actions taken until the option terminates (when the option is executed in M ). Therefore

The second part of Lem. 2 is thus proved. We now define the (finite-time) average reward in the two processes

∀T ∈ N * , ρ π (M, s, T ) = E π M T t=1 r t T s 0 = s ∀T ′ ∈ R + * , ρ πO (M O , s, T ′ ) = E πO MO N (T ′ ) i=1 r i O T ′ s 0 = s .
The limit lim n→+∞ T n = +∞ since the sequence (T n ) n∈N * is strictly increasing and unbounded (at least one primitive action is executed before the option ends: ∀n ≥ 1, T n+1 ≥ T n + 1). Moreover, lim T ′ →+∞ ρ πO (M O , s, T ′ ) exists since π O is stationary and deterministic (see appendix A) and by composition of the limit we have

lim n→+∞ ρ πO (M O , s, T n ) = lim T ′ →+∞ ρ πO (M O , s, T ′ ) = ρ πO (M O , s)
The limit lim T →+∞ ρ π (M, s, T ) also exists. To see this, we can build an augmented MDP equivalent to M where the state and actions encountered in two different options are duplicated (see section 3 of [Levy and Shimkin, 2012]). The equivalence between the original and augmented MDPs is in the strong sense: for any optional policy, the corresponding policy in the augmented MDP yields exactly the same reward for any finite horizon.

In the augmented MDP, policy π is stationary deterministic and we know from MDP theory [START_REF] Puterman | Markov Decision Processes: Discrete Stochastic Dynamic Programming[END_REF] that the corresponding average reward exists. We also have: The first part of Lem. 2 is thus proved. Finally, we know from the literature [START_REF] Puterman | Markov Decision Processes: Discrete Stochastic Dynamic Programming[END_REF] that there exists a stationary deterministic optimal policy in the augmented MDP and thus there also exists a stationary deterministic optional policy (a policy using only options in O) in the original MDP. As a result, ρ * (M O ) is the maximal average reward achievable in M using only options in O. In conclusion, the linear term T n (ρ * (M ) -ρ * (M O )) in equation 28 is the minimal asymptotic regret incurred if the learning agent decides to only use options. This linear loss is unavoidable.

F Details of the illustrative experiments

In this section we will detail the experiments described in section 6.

Terminating Condition Let's denote the current state by s 0 and for all k ∈ {1...m}, denote by s k the state which is k steps on the left to s 0 . Assume option LEFT is taken in s 0 . By definition, once s k is reached, the probability of ending the option is given by β o (s k ) = 1/(m -k + 1). Since all transitions in the MDP have probability 1 (except at the target), the probability of ending in exactly k steps can be computed as follows:

P(τ = k) = k-1 i=1 (1 -β o (s i )) × β o (s k ) = k-1 i=1 1 - 1 m -i + 1 × 1 m -k + 1 = k-1 i=1 m -i m -i + 1 × 1 m -k + 1 = 1 m
By symmetry, the other options (RIGHT, UP and DOWN ) have the same holding time.

Expected Holding Time Based on the previous result, we can easily compute the expected holding time:

E[τ ] = m k=1 k • P(τ = k) = 1 m m k=1 k = m + 1 2
Diameter Let s and s ′ be two distinct states in the grid. With the options defined above, the expected shortest path from s to s ′ is obtained if in each visited state on the way to s ′ , we choose an option that goes in the direction of s ′ . For example, if s is the state located in the top left corner of the grid and s ′ is the target, the expected shortest path is obtained when either RIGHT or DOWN is taken in every state. With this policy, the expected time to get m-close to s ′ both horizontally and vertically is trivially bounded by D (red path on Fig. 7).

Once we are m-close to s ′ (green square on Fig. 7, m = 3 on this example), we will potentially start cycling until we reach s ′ . On options end after at most m time steps, once we are m-close to s ′ , we stay m-close with the chosen policy. The expected time it takes to reach s ′ once we are m-close to it is m(m + 1)/2 both horizontally and vertically. To prove this, we need to solve a linear system. For all i ∈ {1...m -1}, denote by τ i the time it takes to go from s to the i-th state to the left (respectively right, up or down) when the option chosen is left (respectively right, up or down). The value is the same in all directions by symmetry. We can express the τ i as follows:

τ 1 = 1 m + 1 m (2 + τ 1 ) + • • • + 1 m (m + τ m-1 ) τ 2 = 1 m × 2 + 1 m (1 + τ 1 ) + 1 m (3 + τ 1 ) + • • • + 1 m (m + τ m-2 ) τ 3 = 1 m × 3 + 1 m (1 + τ 2 ) + 1 m (2 + τ 1 ) + 1 m (4 + τ 1 ) + • • • + 1 m (m + τ m-3 )
. . .

τ i = m + 1 2 + 1 m i-1 j=1 τ j + 1 m m-i j=1 τ j (29)
With probability 1/m, the next state after executing the option is 1 step to the left of s and the value of τ 1 is then 1 . With probability 1/m the next state is 2 steps to the left of s and so s ′ is now located 1 step to the right of the new state: the value of τ 1 is thus 2 + τ 1 . With probability 1/m the next state is 3 steps to the left of s and and so s ′ is now located 2 steps to the right of the new state: the value of τ 1 is thus 3 + τ 2 . And so on and so forth. What we used here is basically the law of total expectations where the partition of events is the set of all possible states reached after executing the option only once. The same thing can be done for τ 2 . . . τ m-1 . It is trivial to verify that the only solution of the linear system in equation 29 is: τ i = m(m + 1)/2, ∀i ∈ {1...m -1}. This results is rather intuitive: m corresponds to the expected number of times the option needs to be executed to end up in the desired state s ′ whereas (m+ 1)/2 is the expected duration at every decision step. The simplicity of this result comes from the symmetry of the problem: every time an option is executed, we stay m-close to s ′ and the probability to exactly reach s ′ is always 1/m. So in this sense, we have i.i.d. Bernoulli trials where the probability of success is 1/m. The expected time to reach s ′ when we start in an m-close state both horizontally and vertically is thus 2 × m(m + 1)/2 = m(m + 1). Therefore, the expected time to go from s to s ′ is always bounded by D + m(m + 1).

On Fig. 9 we illustrate what happens when the options are deterministic i.e., when they terminate after exactly m time steps. On this example we chose m = 3. If we start from state s 0 , only the green states can be reached without resorting to the restart triggered by the target state, whereas if we start from s 1 only the blue states can be reached8 (and similarly for the white states). Let's assume that we want to go from a green state to a blue state. The only way to do so is to go to the target and "hope" to end up in one of the blue states after the restart (we recall that the restart state is chosen randomly with equi-probability). The shortest path to go from any state to the target is bounded by D and the probability to restart in a state with the desired colour is 1/m (1/m 2 in dimension 2). We can thus upper bound the diameter of the SMDP M O by the expected time needed to go from s 0 to s 1 in the SMDP of Fig. 10, that is:

D O ≤ D(1 + m 2
). This bound is tight (up to a

  For any MDP M and a set of options O, the resulting decision process is an SMDP M O = S O , O, p O , r O , τ O , where S O ⊆ S is the set of states where options can start and end, S O = ∪ o∈O I o ∪ o∈O {s : β o (s) > 0} , O is the set of available actions, p O (s, o, s ′ ) is the probability of transition from s to s ′ by taking the policy π o associated to option o, i.e., p O (s, o, s ′ ) = ∞ k=1 p(s k = s ′ |s, π o )β o (s ′ ), where p(s k = s ′ |s, π o ) is the probability of reaching state s ′ after exactly k steps following policy π o , r O (s, o, s ′ ) is the distribution of the cumulative reward obtained by executing option o from state s until interruption at s ′ , and τ O (s, o, s ′ ) is the distribution of the holding time (i.e., number of primitive steps executed to go from s to s ′ by following π o ).

Figure 1 :

 1 Figure 1: UCRL-SMDP a ∈ A, a reward r k (s, a), a holding time τ k (s, a) and a transition probability p k (• | s, a) in the confidence intervals. When a + is executed in M + k , the probability, the expected reward and the expected holding time of the transition are respectively p k (• | s, a), r k (s, a) and τ k (s, a). Finally, π *k is executed until the number of samples for a state-action pair is doubled. Since the structure is similar to UCRL's, we focus on the elements that need to be rederived for the specific SMDP case: the confidence intervals construction and the extended value iteration algorithm.

Figure 2 :

 2 Figure 2: Navigation problem.

Figure 3 :

 3 Figure 3: (a) Ratio of the regrets with and without options for different values of T max ; (b) Regret as a function of T n for a 20x20 grid; (c) Evolution of T n /n for a 20x20 grid.

  For an SMDP M , we will denote by D HR M the set of history-dependent randomized decision rules and D MD M the subset of Markovian deterministic decision rules (D MD M ⊂ D HR M ). A history-dependent randomized policy is a sequence of elements of D HR M indexed by the decision steps, i.e., π = (d 1 , d 2 , ...) ∈ (D HR M ) N , while a stationary deterministic policy is a constant sequence of elements of D MD M : π = (d, d, ...) = d ∞ . The set of history-dependent randomized policies will be denoted Π HR M

  r(s, a), τ (s, a) and p(• | s, a) are continuous in A + k,s by the very definition of M + k . The function r(s, a) -ρ * τ (s, a) + s ′ ∈S p(s ′ |s, a)u * (s ′ ) is thus continuous on A +

  max 1≤i≤n {b i }.Denoting by N (s, a) the state-action counts we have

Figure 4 :

 4 Figure 4: The two-state SMDP M ′ for the lower-bound on SMDPs. The two special actions a * 0 and a * 1 are shown as dashed lines.

  the stationary distribution of the recurrent Markov Chain. The probability p d can take only two different values: p d = 1 2 if and only if d(s 0 ) = a * 0 , and p d = δ+ǫ 2δ+ǫ if and only if d(s 0 ) = a * 0 . Using criterion 3 of Definition 3, the gain yielded by d ∞ has the form:

Figure 5 :

 5 Figure 5: The two-state SMDP M ′ for the lower-bound on MDPs with options. The two special actions a * 0 and a * 1 are shown as dashed lines.

Figure 6 :

 6 Figure 6: Decomposition of an action a 1 ∈ A s1 \ {a * 1 } into a set of primitive actions in an MDP. In this example, T max = 3 and T min = 1.

=

  A, s, T n ) = T n ρ * (M ) -T n ρ * (M ′ ) + T n (ρ * (M ) -ρ * (M O )) -M O , A, s, n) + T n (ρ * (M ) -ρ * (M O ))

  s =⇒ ρ πO (M O , s) = lim n→+∞ ρ π (M, s, T n ) = lim T →+∞ ρ π (M, s, T ) = ρ π (M, s)

Figure 7 :•

 7 Figure 7: Upper bound on the diameter of the SMDP used in the experiments.

Figure 8 :

 8 Figure 8: Behaviour of the agent in m-close states.

Figure 11 :

 11 Figure 11: (a) Theoretical ratios of the regrets with and without options for different values of T max ; (b) Empirical ratios of the regrets with and without options for different values of T max .

  empirically validate

		1.10		1.00
	Ratio of regrets R	0.80 0.85 0.90 0.95 1.00 1.05	20x20 Grid 30x30 Grid 25x25 Grid	0.75 0.80 0.85 0.90 0.95
		1 Maximal duration of options T max 2 3 4 5 6 7 8 0.75	0.70	1.4	1.6	1.8	2.0 Duration T n 2.2 2.4	2.6	2.8	×10 7 3.0
			(a)

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

	References
	Applied Probability Models with Optimization Applications,
	chapter 7: Semi Markov Decision Processes. Dover Pub-lications, INC., New York, 1970.
	A First Course in Stochastic Models, chapter 7: Semi Markov Decision Processes. Wiley, 2003.
	Pierre-Luc Bacon and Doina Precup. The option-critic ar-chitecture. In NIPS'15 Deep Reinforcement Learning Workshop, 2015.
	Emma Brunskill and Lihong Li. PAC-inspired Option Dis-covery in Lifelong Reinforcement Learning. In Proceed-
	ings of the 31st International Conference on Machine
	Learning, volume 32 of JMLR Proceedings, pages 316-324. JMLR.org, 2014.
	Pablo Samuel Castro and Doina Precup. Automatic con-struction of temporally extended actions for mdps using bisimulation metrics. In Proceedings of the 9th Euro-
	pean Conference on Recent Advances in Reinforcement
	Learning, EWRL'11, pages 140-152, Berlin, Heidelberg, 2012. Springer-Verlag. ISBN 978-3-642-29945-2. doi: 10.1007/978-3-642-29946-9_16.
	A. Federgruen, P.J. Schweitzer, and H.C. Tijms. Denu-merable undiscounted semi-markov decision processes with unbounded rewards. Mathematics of Operations Research, 1983.
	Thomas Jaksch, Ronald Ortner, and Peter Auer. Near-optimal regret bounds for reinforcement learning. J. Mach. Learn. Res., 11:1563-1600, August 2010.
	Nicholas K. Jong, Todd Hester, and Peter Stone. The utility of temporal abstraction in reinforcement learn-ing. In The Seventh International Joint Conference on Autonomous Agents and Multiagent Systems, May 2008.
	Arie Leizarowitz. Decision and Control in Management
	Science: Essays in Honor of Alain Haurie, chapter 5: On Optimal Policies of Multichain Finite State Compact Action Markov Decision Processes. Springer Science and Business Media, 2013.
	Kfir Y. Levy and Nahum Shimkin. Unified inter and intra options learning using policy gradient methods. In Scott Sanner and Marcus Hutter, editors, EWRL, volume 7188 of Lecture Notes in Computer Science, pages 153-164. Springer, 2011. ISBN 978-3-642-29945-2.
	Kfir Y. Levy and Nahum Shimkin. Recent Advances in Re-
	inforcement Learning: 9th European Workshop, EWRL
	2011, chapter Unified Inter and Intra Options Learning Using Policy Gradient Methods, pages 153-164. Springer Berlin Heidelberg, 2012.

Özgür Şimşek and Andrew G. Barto. Using relative novelty to identify useful temporal abstractions in reinforcement learning. In Proceedings of the Twenty-first International Conference on Machine Learning, ICML '04, 2004. Thomas G. Dietterich. Hierarchical reinforcement learning with the maxq value function decomposition. Journal of Artificial Intelligence Research, 13:227-303, 2000. Jianyong Liu and Xiaobo Zhao. On average reward semimarkov decision processes with a general multichain structure. Math. Oper. Res., 29(2):339-352, 2004. Timothy A. Mann and Shie Mannor. Scaling up approximate value iteration with options: Better policies with

  (see Appendix C.4), it is shown that when n > 34A log n δ :

	DSA log 2	8n SA	<	2 34	DS An log	n δ	, and log	2An δ	≤ 2 log	n δ
	and moreover if n > S log n δ and A ≥ 2 (if A = 1 the regret is zero):

  which is absurd). By definition, matrix Q is nilpotent of order n if and only if the Markov Chain reaches an absorbing state in at most n steps (a.s.). In conclusion, ρ(Q) = 0 if and only if the option is almost surely bounded. This happens if and only if there is no cycle in the option (with probability 1, every non-absorbing state is visited at most once).

Notice that decision steps are discrete points in time in which an action is started, while the (possibly continuous) holding time is determined by the distribution τ .

In this expectation, N (t) is a r.v. depending on π * .

In the MDP literature, the term Bounded Parameter MDPs (BPMDPs)[START_REF] Tewari | Bounded Parameter Markov Decision Processes with Average Reward Criterion[END_REF] is often used for "extended" MDPs built using confidence intervals on rewards and transition probabilities.

We denote max{a, b} = a ∨ b.

Note that if at least one option is not (almost surely) finite, the learning agent can potentially be stuck executing that option forever and the problem is ill-posed.

Here we slightly simplified the problem. In reality, due to the truncation operated by the walls and if we assume s0 to be the leftmost state, it is possible to go from s1 to s0 in one time step by executing LEF T . But for m ≥ 3 there will always be pairs of states that cannot be reached from each other without a restart. If s0 is the leftmost state, this is the case for s1 and the white state adjacent to it on Fig.

So the proof remains valid.

Target

Starting State s 0 s 1 constant factor) since the average time to go from any state chosen at random with equi-probability to the target is exactly D/2 in the 2-dimensional grid.

Optimality Since the target state is located in a corner of the grid, the shortest path to go from any state to the target is equally long in the original MDP and the MDP with options. As a result, the optimal average rewards are also equal (i.e., there exists an optimal policy using only options LEFT RIGHT, UP and DOWN which consists in applying only RIGHT or DOWN ).

Asymptotic behaviour We will now analyse the behaviour of the ratio n Tn using results on martingales. Theorem 3 (Martingale Strong Law of Large Numbers, [START_REF] Vovk | Algorithmic Learning in a Random World[END_REF]). Let X 1 , ..., X n be a martingale difference sequence w.r.t. a filtration F 0 , F 1 , ..., F n and let A 1 , ..., A n be an increasing predictable sequence w.r.t. the same filtration with A 1 > 0 and lim n→+∞ A n = +∞ almost surely. If:

Since (τ (s, a, s ′ )) s,a,s ′ are sub-Exponential, all moments are finite and it is well known from the literature that the variance is bounded by the sub-Exponential constant σ 2 τ hence:

If in addition we take A i = i then the conditions of Theorem 3 are satisfied and thus:

where

Exploration-Exploitation in MDPs with Options and so: lim inf n→+∞ Tn n ≥ τ min and lim sup n→+∞ Tn n ≤ τ max a.s. Finally:

In the general case of sub-Exponential rewards and holding times our results provide no theoretical evidence of the advantage of introducing options due to the fact that C(M ′ , n, δ) scales as log(n):

but if the rewards and holding times are bounded we have:

Note that τ min is a very loose upper-bound on lim inf n→+∞ Tn n and in practice the ratio Tn n can take much higher values if τ max is big and many options have a high expected holding time.

Tightness of the upper bounds On Fig. 11a, we plot the expected theoretical values taken by the ratio of the regrets according to our upper bounds (formula given in Sect. 6). On Fig. 11b however, we plot the empirical values of the ratios in our experiments (same graph as on Fig. 3a). We can see that the curves have similar shapes. In particular, they reach their respective minima for the same value of T max and the value of these minimum is below 1 (meaning that learning with options is more efficient than with primitive actions in this case). Moreover, the theoretical ratios are upper-bounding the empirical ones for all values of T max . We can conclude that the ratio of the upper bounds is a good proxy for the true ratio in this example.