Ronan Fruit
email: <ronan.fruit@inria.fr>.

Matteo Pirotta

Alessandro Lazaric

Ronald Ortner

Efficient Bias-Span-Constrained Exploration-Exploitation in Reinforcement Learning

We introduce SCAL, an algorithm designed to perform efficient exploration-exploitation in any unknown weakly-communicating Markov decision process (MDP) for which an upper bound c on the span of the optimal bias function is known. For an MDP with S states, A actions and Γ ≤ S possible next states, we prove a regret bound of O(c √ ΓSAT ), which significantly improves over existing algorithms (e.g., UCRL and PSRL), whose regret scales linearly with the MDP diameter D. In fact, the optimal bias span is finite and often much smaller than D (e.g., D = ∞ in non-communicating MDPs). A similar result was originally derived by Bartlett and Tewari (2009) for REGAL.C, for which no tractable algorithm is available. In this paper, we relax the optimization problem at the core of REGAL.C, we carefully analyze its properties, and we provide the first computationally efficient algorithm to solve it. Finally, we report numerical simulations supporting our theoretical findings and showing how SCAL significantly outperforms UCRL in MDPs with large diameter and small span.

Introduction

While learning in an unknown environment, a reinforcement learning (RL) agent must trade off the exploration needed to collect information about the dynamics and reward, and the exploitation of the experience gathered so far to gain as much reward as possible. In this paper, we focus on the regret framework (Jaksch et al., 2010), which evaluates the exploration-exploitation performance by comparing the rewards accumulated by the agent and an optimal policy. A common approach to the exploration-exploitation dilemma is the optimism in face of uncertainty (OFU) principle: the agent maintains optimistic estimates of the value function Proceedings of the 35 th International Conference on Machine Learning, Stockholm, Sweden, PMLR 80, 2018. Copyright 2018 by the author(s). and, at each step, it executes the policy with highest optimistic value (e.g., Brafman and Tennenholtz, 2002;Jaksch et al., 2010;Bartlett and Tewari, 2009). An alternative approach is posterior sampling (Thompson, 1933), which maintains a Bayesian distribution over MDPs (i.e., dynamics and expected reward) and, at each step, samples an MDP and executes the corresponding optimal policy (e.g., Osband et al., 2013;[START_REF] Abbasi | Bayesian optimal control of smoothly parameterized systems[END_REF]Osband and Roy, 2017;Ouyang et al., 2017;[START_REF] Agrawal | Optimistic posterior sampling for reinforcement learning: worst-case regret bounds[END_REF].

Given a finite MDP with S states, A actions, and diameter D (i.e., the time needed to connect any two states), Jaksch et al. (2010) proved that no algorithm can achieve regret smaller than Ω( √ DSAT ). While recent work successfully closed the gap between upper and lower bounds w.r.t. the dependency on the number of states (e.g., [START_REF] Agrawal | Optimistic posterior sampling for reinforcement learning: worst-case regret bounds[END_REF]Azar et al., 2017), relatively little attention has been devoted to the dependency on D. While the diameter quantifies the number of steps needed to "recover" from a bad state in the worst case, the actual regret incurred while "recovering" is related to the difference in potential reward between "bad" and "good" states, which is accurately measured by the span (i.e., the range) sp {h * } of the optimal bias function h * . While the diameter is an upper bound on the bias span, it could be arbitrarily larger (e.g., weakly-communicating MDPs may have finite span and infinite diameter) thus suggesting that algorithms whose regret scales with the span may perform significantly better. 1 Building on the idea that the OFU principle should be mitigated by the bias span of the optimistic solution, Bartlett and Tewari (2009) proposed three different algorithms (referred to as REGAL) achieving regret scaling with sp {h * } instead of D. The first algorithm defines a span regularized problem, where the regularization constant needs to be carefully tuned depending on the state-action pairs visited in the future, which makes it unfeasible in practice. Alternatively, they propose a constrained variant, called REGAL.C, where the regularized problem is replaced by a constraint on the span. Assuming that an upper-bound c on the bias span of the optimal policy is known (i.e., sp {h * } ≤ c), REGAL.C achieves regret upperbounded by O(min{D, c}S √ AT ). Unfortunately, they do not propose any computationally tractable algorithm solving the constrained optimization problem, which may even be ill-posed in some cases. Finally, REGAL.D avoids the need of knowing the future visits by using a doubling trick, but still requires solving a regularized problem, for which no computationally tractable algorithm is known.

In this paper, we build on REGAL.C and propose a constrained optimization problem for which we derive a computationally efficient algorithm, called SCOPT. We identify conditions under which SCOPT converges to the optimal solution and propose a suitable stopping criterion to achieve an ε-optimal policy. Finally, we show that using a slightly modified optimistic argument, the convergence conditions are always satisfied and the learning algorithm obtained by integrating SCOPT into a UCRL-like scheme (resulting into SCAL) achieves regret scaling as O(min{D, c} √ ΓSAT ) when an upper-bound c on the optimal bias span is available, thus providing the first computationally tractable algorithm that can solve weakly-communicating MDPs.

Preliminaries

We consider a finite weakly-communicating Markov decision process (Puterman, 1994, Sec. 8.3) M = S, A, r, p with a set of states S and a set of actions A = s∈S A s . Each state-action pair (s, a) ∈ S × A s is characterized by a reward distribution with mean r(s, a) and support in [0, r max ] as well as a transition probability distribution p(•|s, a) over next states. We denote by S = |S| and A = max s∈S |A s | the number of states and actions, and by Γ the maximum support of all transition probabilities. A Markov randomized decision rule d : S → P(A) maps states to distributions over actions. The corresponding set is denoted by D MR , while the subset of Markov deterministic decision rules is D MD . A stationary policy π = (d, d, . . .) =: d ∞ repeatedly applies the same decision rule d over time. The set of stationary policies defined by Markov randomized (resp. deterministic) decision rules is denoted by Π SR (M ) (resp. Π SD (M )). The long-term average reward (or gain) of a policy π ∈ Π SR (M ) starting from s ∈ S is

g π M (s) := lim T →+∞ E Q 1 T T t=1
r(s t , a t ) ,

where Q := P (•|a t ∼ π(s t ); s 0 = s; M ). Any stationary policy π ∈ Π SR has an associated bias function defined as

h π M (s) := C-lim T →+∞ E Q T t=1
r(s t , a t )g π M (s t ) , that measures the expected total difference between the reward and the stationary reward in Cesaro-limit 2 (de-2 For policies with an aperiodic chain, the standard limit exists.

noted C-lim). Accordingly, the difference of bias values h π M (s)h π M (s ) quantifies the (dis-)advantage of starting in state s rather than s . In the following, we drop the dependency on M whenever clear from the context and denote by sp {h π } := max s h π (s)min s h π (s) the span of the bias function. In weakly communicating MDPs, any optimal policy π * ∈ arg max π g π (s) has constant gain, i.e., g π * (s) = g * for all s ∈ S. Let P d ∈ R S×S and r d ∈ R S be the transition matrix and reward vector associated with decision rule d ∈ D MR . We denote by L d and L the Bellman operator associated with d and optimal Bellman operator ∀v ∈ R S , L d v := r d + P d v; Lv := max

d∈D MR r d + P d v .
For any policy π = d ∞ ∈ Π SR , the gain g π and bias h π satisfy the following system of evaluation equations

g π = P d g π ; h π = L d h π -g π .
(1)

Moreover, there exists a policy π * ∈ arg max π g π (s) for which (g * , h * ) = (g π * , h π * ) satisfy the optimality equation

h * = Lh * -g * e
, where e = (1, . . . , 1) .

(2)

Finally, we denote by D := max (s,s )∈S×S,s =s {τ M (s → s )} the diameter of M , where τ M (s → s ) is the minimal expected number of steps needed to reach s from s in M .

Learning problem. Let M * be the true unknown MDP. We consider the learning problem where S, A and r max are known, while rewards r and transition probabilities p are unknown and need to be estimated on-line. We evaluate the performance of a learning algorithm A after T time steps by its cumulative regret ∆(A, T ) = T g * -T t=1 r t (s t , a t ).

Optimistic Exploration-Exploitation

Since our proposed algorithm SCAL (Sec. 6) is a tractable variant of REGAL.C and thus a modification of UCRL, we first recall their common structure summarized in Fig. 1.

Upper-Confidence Reinforcement Learning

UCRL proceeds through episodes k = 1, 2 . . . At the beginning of each episode k, UCRL computes a set of plausible MDPs defined as M k = M = S, A, r, p : r(s, a) ∈ B k r (s, a), p(s |s, a) ∈ B k p (s, a, s ), s p(s |s, a) = 1 , where B k r and B k p are high-probability confidence intervals on the rewards and transition probabilities of the true MDP M * , which guarantees that M * ∈ M k w.h.p. We use confidence intervals constructed using empirical Bernstein's inequality [START_REF] Audibert | Tuning bandit algorithms in stochastic environments[END_REF]Maurer and Pontil, 2009) β sa r,k :=

where N k (s, a) is the number of visits in (s, a) before episode k, σ 2 r,k (s, a) and σ 2 p,k (s |s, a) are the empirical variances of r(s, a) and p(s |s, a) and b k,δ = ln(2SAt k /δ). Given the empirical averages r k (s, a Once M k has been computed, UCRL finds an approximate solution ( M * k , π * k ) to the optimization problem

( M * k , π * k ) ∈ arg max M ∈M k ,π∈Π SD (M )
g π M .

(3)

Since M * ∈ M k w.h.p., it holds that g * M k

≥ g * M * . As noticed by Jaksch et al. (2010), problem (3) is equivalent to finding µ * ∈ arg max

µ∈Π SD ( M k ) g µ M k
where M k is the extended MDP (sometimes called bounded-parameter MDP) implicitly defined by M k . More precisely, in M k the (finite) action space A is "extended" to a compact action space A k by considering every possible value of the confidence intervals B k r (s, a) and B k p (s, a, s ) as fictitious actions. The equivalence between the two problems comes from the fact that for each µ ∈ Π SD ( M k ) there exists a pair ( M , π) such that the policies π and µ induce the same Markov reward process on respectively M and M k , and conversely. Consequently, (3) can be solved by running so-called extended value iteration (EVI): starting from an initial vector u 0 = 0, EVI recursively computes

u n+1 (s) = max a, r, p r(s, a) + p(•|s, a) T u n = Lu n (s), (4)
where L is the optimistic optimal Bellman operator associated to M k . If EVI is stopped when sp {u n+1u n } ≤ ε k , then the greedy policy µ k w.r.t. u n is guaranteed to be ε koptimal, i.e., g

µ k M k ≥ g * M k -ε k ≥ g * M * -ε k .
Therefore, the policy π k associated to µ k is an optimistic ε k -optimal policy, and UCRL executes π k until the end of episode k.

A first relaxation of REGAL.C

REGAL.C follows the same steps as UCRL but instead of solving problem (3), it tries to find the best optimistic model M * RC ∈ M RC having constrained optimal bias span i.e.,

( M * RC , π * RC ) = arg max M ∈MRC,π∈Π SD (M ) g π M , (5)
where M RC := {M ∈ M k : sp {h * M } ≤ c} is the set of plausible MDPs with bias span of the optimal policy bounded by c. Under the assumption that sp {h * M * } ≤ c, REGAL.C discards any MDP M ∈ M k whose optimal policy has a span larger than c (i.e., sp {h * M } > c) and otherwise looks for the MDP with highest optimal gain g * (M ). Unfortunately, there is no guarantee that all MDPs in M RC are weakly communicating and thus have constant gain. As a result, we suspect this problem to be ill-posed (i.e., the maximum is most likely not well-defined). Moreover, even if it is well-posed, searching the space M RC seems to be computationally intractable. Finally, for any M ∈ M k , there may be several optimal policies with different bias spans and some of them may not satisfy the optimality equation (2) and are thus difficult to compute.

In this paper, we slightly modify problem (5) as follows:

( M * c , π * c ) ∈ arg max M ∈M k ,π∈Πc(M ) g π M , (6)
where the search space of policies is defined as

Π c (M ) := π ∈ Π SR : sp {h π M } ≤ c ∧ sp {g π M } = 0 , and max π∈Πc(M ) {g π M } = -∞ if Π c (M ) = ∅. Sim- ilarly to (3), problem (6) is equivalent to solving µ * c ∈ arg max µ∈Πc( M k ) g µ M k
. Unlike (5), for every MDP in M k (not just those in M RC ), (6) considers all (stationary) policies with constant gain satisfying the span constraint (not just the deterministic optimal policies).

Since g π M and sp {h π M } are in general non-continuous functions of (M , π), the argmax in ( 5) and ( 6) may not exist. Nevertheless, by reasoning in terms of supremum value, we can show that ( 6) is always a relaxation of (5) (where we enforce the additional constraint of constant gain).

Proposition 1. Define the following restricted set of MDPs

E k = M RC ∩ {M ∈ M k : sp {g * M } = 0}. Then sup M ∈E k ,π∈Π SD g π M ≤ sup M ∈M k ,π∈Πc(M ) g π M .
Proof. The result follows from the fact that

E k ⊆ M k and ∀M ∈ E k , arg max π∈Π SD {g π M } ⊆ Π c (M ).
As a result, the optimism principle is preserved when moving from ( 5) to (6) and since the set of admissible MDPs M k is the same, any algorithm solving (6) would enjoy the same regret guarantees as REGAL.C. In the following we further characterise problem (6), introduce a truncated value iteration algorithm to solve it, and finally integrate it into a UCRL-like scheme to recover REGAL.C regret guarantees.

The Optimization Problem

In this section we analyze some properties of the following optimization problem, of which ( 6) is an instance,

sup π∈Πc(M ) {g π M } , ( 7
)
where M is any MDP (with discrete or compact action space) s.t. Π c (M ) = ∅. Problem (7) aims at finding a policy that maximizes the gain g π M within the set of randomized policies with constant gain (i.e., sp {g π M } = 0) and bias span smaller than c (i.e., sp {h π M } ≤ c). Since g π M ∈ [0, r max ] the supremum always exists and we denote it by g * c (M ). The set of maximizers is denoted by

Π * c (M ) ⊆ Π c (M ), with elements π * c (M ) (if Π * c (M ) is non-empty).
In order to give some intuition about the solutions of problem (7), we introduce the following illustrative MDP.

Example 1. Consider the two-states MDP depicted in Fig. 2. For a generic stationary policy π ∈ Π SR with decision rule d ∈ D MR we have that

d = x 1 -x y 1 -y ; P d = 1 -x x y 1 -y , r d = 1-x 2 1 -y .
We can compute the gain g = [g 1 , g 2 ] and the bias h = [h 1 , h 2 ] by solving the linear system (1). For any x > 0 or y > 0, we obtain

g 1 = g 2 = 1 2 + x 1 -3y 2(x + y) ; h 2 -h 1 = 1 2 + 1 -3y 2(x + y) ,
while for x = 0, y = 0, we have g 1 = 1/2 and g 2 = 1, with h 2 = h 1 = 0. Note that 0 ≤ sp {h π } ≤ 1 for any π ∈ Π SR . In the following, we will use this example choosing particular values for x, y, and c to illustrate some important properties of optimization problem (7).

Randomized policies. The following lemma shows that, unlike in unconstrained gain maximization where there always exists an optimal deterministic policy, the solution of (7) may indeed be a randomized policy.

Lemma 2. There exists an MDP M and a scalar c ≥ 0,

such that Π * c (M ) = ∅ and Π * c (M ) ∩ Π SD (M ) = ∅.
Proof. Consider Ex. 1 with constraint 1/2 < c < 1. The only deterministic policy π D with constant gain and bias span smaller than c is defined by the decision rule with x = 0 and y = 1, which leads to g π D = 1/2 and sp {h π D } = 1/2. On the other hand, a randomized policy π R can satisfy the constraint and maximize the gain by taking x = 1 and y = (1c)/(1 + c), which gives sp {h π R } = c and g π R = c > g π D , thus proving the statement.

Constant gain. The following lemma shows that if we consider non-constant gain policies, the supremum in (7) may not be well defined, as no dominating policy exists. A policy π ∈ Π SR is dominating if for any policy π ∈ Π SR , g π (s) ≥ g π (s) in all states s ∈ S.

Lemma 3. There exists an MDP M and a scalar c ≥ 0, such that there exists no dominating policy π in Π SR with constrained bias span (i.e., sp {h π } ≤ c).

Proof. Consider Ex. 1 with constraint 1/2 < c < 1. As shown in the proof of Lem. 2, the optimal stationary policy π R with constant gain has g * c = [c, c]. On the other hand, the only policy π with non-constant gain is x = 0, y = 0, which has sp {h π } = 0 < c and g π (s 0 ) = 1/2 < c = g * c and g π (s 1 ) = 1 > c = g * c , thus proving the statement.

On the other hand, when the search space is restricted to policies with constant gain, the optimization problem is well posed. Whether problem (7) always admits a maximizer is left as an open question. The main difficulty comes from the fact that, in general, π → g π is not a continuous map and Π c is not a closed set. For instance in Ex. 1, although the maximum is attained, the point x = 0, y = 0 does not belong to Π c (i.e., Π c is not closed) and g π is not continuous at this point. Notice that when the MDP is unichain (Puterman, 1994, Sec. 8.3), Π c is compact, g π is continuous, and we can prove the following lemma (see App. A):

Lemma 4. If M is unichain then Π * c (M ) = ∅.
We will later show that for the specific instances of (7) that are encountered by our algorithm SCAL, Lem. 4 holds.

Planning with SCOPT

In this section, we introduce SCOPT and derive sufficient conditions for its convergence to the solution of (7). In the next section, we will show that these assumptions always hold when SCOPT is carefully integrated into UCRL (while in App. B we show that they may not hold in general).

Span-constrained value and policy operators

SCOPT is a version of (relative) value iteration (Puterman, 1994;Bertsekas, 1995), where the optimal Bellman operator is modified to return value functions with span bounded by c, and the stopping condition is tailored to return a constrained greedy policy with near-optimal gain. We first introduce a constrained version of the optimal Bellman operator L.

Input: Initial vector v0 ∈ R S , reference state s ∈ S, contractive factor γ ∈ (0, 1), accuracy ε ∈ (0, +∞) Definition 1. Given v ∈ R S and c ≥ 0, we define the value operator T c : R S → R S as

Output: Vector vn ∈ R S , policy πn = (Gcvn) ∞ 1. Initialize n = 0 and v1 = Tcv0 -(Tcv0)(s)e, 2. While sp {vn+1 -vn} + 2γ n 1-γ sp {v1 -v0} > ε do (a) n += 1. (b) vn+1 = Tcvn -(Tcvn)(s)e.
T c v = Lv(s) ∀s ∈ S(c, v), c + min s {Lv(s)} ∀s ∈ S \ S(c, v), (8)
where S(c, v) = {s ∈ S|Lv(s) ≤ min s {Lv(s)} + c}.

In other words, operator T c applies a span truncation to the one-step application of L, that is, for any state s ∈ S, T c v(s) = min{Lv(s), min x Lv(x) + c}, which guarantees that sp {T c v} ≤ c. Unlike L, operator T c is not always associated with a decision rule d s.t.

T c v = L d v (see App. B). We say that T c is feasible at v ∈ R S and s ∈ S if there exists a distribution δ + v (s) ∈ P(A) such that T c v(s) = a∈As δ + v (s, a) r(s, a) + p(•|s, a) T v . (9)
When a distribution δ + v (s) exists in all states, we say that T c is globally feasible at v, and δ + v is its associated decision rule, i.e., T c v = L δ + v v. In the following lemma, we identify sufficient and necessary conditions for (global) feasibility.

T c v = max δ∈D(c,v) L δ v, and δ + v ∈ arg max δ∈D(c,v) L δ v. ( 12
)
The last part of this lemma shows that when T c is globally feasible at v (i.e., D(c, v) = ∅), T c v = L δ + v v is the componentwise maximal value function of the form L δ v with decision rule δ ∈ D MR satisfying sp {L δ v} ≤ c. Surprisingly, even in the presence of a constraint on the one-step value span, such a componentwise maximum still exists (which is not as straightforward as in the case of the greedy operator L). Therefore, whenever D(c, v) = ∅, optimization problem (12) can be seen as an LP-problem (see App. A.2).

Definition 2. Given v ∈ R S and c ≥ 0, let S(c, v) be the set of states where T c v is feasible (condition (10)) with δ + v (s) be the associated decision rule (Eq. 9). We define the operator G c : R S → D MR as3

G c v =    δ + v (s) s ∈ S(C, v), arg min a∈As r(s, a) + p(•|s, a) T v s ∈ S \ S(C, v).
As a result, if T c is globally feasible at v, by definition

G c v = δ + v .
Note that computing δ + v is not significantly more difficult than computing a greedy policy (see App. C for an efficient implementation).

We are now ready to introduce SCOPT (Fig. 3). Given a vector v 0 ∈ R S and a reference state s, SCOPT implements relative value iteration where L is replaced by T c , i.e.,

v n+1 = T c v n -T c v n (s)e. ( 13
)
Notice that the term (T c v n )(s)e subtracted at any iteration n prevents v n from increasing linearly with n and thus avoids numerical instability. However, the subtraction can be dropped without affecting the convergence properties of SCOPT. If the stopping condition is met at iteration n, SCOPT returns policy

π n = d ∞ n where d n = G c v n .

Convergence and Optimality Guarantees

In order to derive convergence and optimality guarantees for SCOPT we need to analyze the properties of operator T c . We start by proving that T c preserves the one-step span contraction properties of L.

Assumption 6. The optimal Bellman operator L is a 1-step γ-span-contraction, i.e., there exists a γ < 1 such that for any vectors u, v ∈ R S , sp {Lu -Lv} ≤ γsp {u -v}.4

Lemma 7. Under Asm. 6, T c is a γ-span contraction.

The proof of Lemma 7 relies on the fact that the truncation of L in the definition of T c is non-expansive in span seminorm. Details are given in App. D, where it is also shown that T c preserves other properties of L such as monotonicity and linearity. It then follows that T c admits a fixed point solution to an optimality equation (similar to L) and thus SCOPT converges to the corresponding bias and gain, the latter being an upper-bound on the optimal solution of (7). We formally state these results in Lem. 8.

Lemma 8. Under Asm. 6, the following properties hold:

1. Optimality equation and uniqueness: There exists a solution (g + , h + ) ∈ R × R S to the optimality equation

T c h + = h + + g + e. ( 14
)
If (g, h) ∈ R × R S is another solution of (14), then g = g + and there exists λ ∈ R s.t. h = h + + λe.

2. Convergence: For any initial vector v 0 ∈ R S , the sequence (v n ) generated by SCOPT converges to a solution vector h + of the optimality equation ( 14), and

lim n→+∞ T n+1 c v 0 -T n c v 0 = g + e.
3. Dominance: The gain g + is an upper-bound on the supremum of (7), i.e., g + ≥ g * c .

A direct consequence of point 2 of Lem. 8 (convergence) is that SCOPT always stops after a finite number of iterations. Nonetheless, T c may not always be globally feasible at h + (see App. B) and thus there may be no policy associated to optimality equation ( 14). Furthermore, even when there is one, Lem. 8 provides no guarantee on the performance of the policy returned by SCOPT after a finite number of iterations. To overcome these limitations, we introduce an additional assumption, which leads to stronger performance guarantees for SCOPT. Assumption 9. Operator T c is globally feasible at any vector v ∈ R S such that sp {v} ≤ c. Theorem 10. Assume Asm. 6 and 9 hold and let γ denote the contractive factor of T c (Asm. 6). For any v 0 ∈ R S such that sp {v 0 } ≤ c, any s ∈ S and any ε > 0, the policy π n output by SCOPT(v 0 , s, γ, ε) is such that g + e-g πn ∞ ≤ ε. Furthermore, if in addition the policy π + = (G c h + ) ∞ is unichain, g + is the solution to optimization problem (7) i.e., g + = g * c and π + ∈ Π * c .

The first part of the theorem shows that the stopping condition used in Fig. 3 ensures that SCOPT returns an ε-optimal policy π n . Notice that while sp {h + } = sp {T c h + } ≤ c by definition of T c , in general when the policy π + = (G c h + ) ∞ associated to h + is not unichain, we might have sp {h + } < sp{h π + }. On the other hand, Corollary 8.2.7. of Puterman (1994) ensures that if π + is unichain then sp {h + } = sp{h π + }, hence the second part of the theorem. Notice also that even if π + is unichain, we cannot guarantee that π n satisfies the span constraint, i.e., sp {h πn } may be arbitrary larger than c. Nonetheless, in the next section, we show that the definition of T c and Thm. 10 are sufficient to derive regret bounds when SCOPT is integrated into UCRL.

Learning with SCAL

In this section we introduce SCAL, an optimistic online RL algorithm that employs SCOPT to compute policies that efficiently balance exploration and exploitation. We prove that the assumptions stated in Sec. 5.2 hold when SCOPT is integrated into the optimistic framework. Finally, we show that SCAL enjoys the same regret guarantees as REGAL.C, while being the first implementable and efficient algorithm to solve bias-span constrained exploration-exploitation.

Based on Def. 1, we define T c as the span truncation of the optimal Bellman operator L of the bounded-parameter MDP M k (see Sec. 3). Given the structure of problem (6), one might consider applying SCOPT (using T c ) to the extended MDP M k . Unfortunately, in general L does not satisfy Asm. 6 and 9 and thus T c may not enjoy the properties of Lem. 8 and Thm. 10. To overcome this problem, we slightly modify M k as described in Def. 3.

Definition 3. Let M be a bounded-parameter (extended) MDP. Let 1 ≥ η > 0 and s ∈ S an arbitrary state. We define the "modified" MDP M ‡ associated to M by5

B ‡ r (s, a) = [0, max{B r (s, a)}], B ‡ p (s, a, s ) = B p (s, a, s ) if s = s, B p (s, a, s) ∩ [η, 1] otherwise,
where we assume that η is small enough so that:

B p (s, a, s) ∩ [η, 1] = ∅, s ∈S min{B ‡
p (s, a, s )} ≤ 1, and s ∈S max{B ‡ p (s, a, s )} ≥ 1. We denote by L ‡ the optimal Bellman operator of M ‡ (cf. Eq. 4) and by T ‡ c the span truncation of L ‡ (cf. Def. 1).

By slightly perturbing the confidence intervals B p of the transition probabilities, we enforce that the "attractive" state s is reached with non-zero probability from any state-action pair (s, a) implying that the ergodic coefficient of man, 1994, Thm. 6.6.6), i.e., Asm. 6 holds. Moreover, for any policy π ∈ Π SR ( M ‡ ), state s necessarily belongs to all recurrent classes of π implying that π is unichain and so M ‡ is unichain. As is shown in Thm. 11, the η-perturbation of B p introduces a small bias ηc in the final gain.

M ‡ γ = 1 - min s,u∈S, a,b∈A p, q∈B ‡ p      j∈S min { p(j|s, a), q(j|u, b)} ≥η if j=s      is smaller than 1 -η < 1, so that L ‡ is γ-contractive (Puter-
By augmenting (without perturbing) the confidence intervals B r of the rewards, we ensure two nice properties. First of all, for any vector v ∈ R S , Lv = L ‡ v and thus by definition

T c v = T ‡ c v.
Secondly, there exists a decision rule δ ∈ D MR ( M ‡ ) such that ∀s ∈ S, r ‡ δ (s) = 0 meaning that sp{ L ‡ δ v} = sp{ P ‡ δ v} ≤ sp {v} (Puterman, 1994, Proposition 6.6.1). Thus if sp {v} ≤ c then sp{ L ‡ δ v} ≤ c and so δ ∈ D ‡ (c, v) = ∅ which by Lem. 5 implies that T ‡ c is globally feasible at v. Therefore, Asm. 9 holds in M ‡ .

When combining both the perturbation of B p and the augmentation of B r we obtain Thm. 11 (proof in App. E).

Theorem 11. Let M be a bounded-parameter (extended) MDP and M ‡ its "modified" counterpart (see Def. 3). Then 1. L ‡ is a γ-span contraction with γ ≤ 1η < 1 (i.e., Asm. 6 holds) and thus Lem. 8 applies to T ‡ c . Denote by (g + , h + ) a solution to equation (14) for T ‡ c .

2. T ‡ c is globally feasible at any v ∈ R S s.t. sp {v} ≤ c (i.e., Asm. 9 holds) and M ‡ is unichain implying that π + = G c h + is unichain. Thus Thm. 10 applies to

T ‡ c . 3. ∀µ ∈ Π c ( M), g + = g * c ( M ‡ ) ≥ g µ ( M) -ηc.
SCAL (cf. Fig. 1) is a variant of UCRL that applies SCOPT (instead of EVI, see Eq. 4) on the bounded parameter MDP M ‡ k (instead of M k , cf. step 2 in Fig. 1) in each episode k to solve the optimization problem

max M ∈ M ‡ k ,π∈Πc(M ) g π M , ( 15
)
whose maximum is denoted by

g * c ( M ‡ k ). The intervals B ‡ p of M ‡ k are constructed using parameter 6 η k = r max /(c • t k
) and an arbitrary attractive state s ∈ S. SCOPT is run at step 3 in Fig. 1 with an initial value function v 0 = 0, the same reference state s used for the construction of B ‡ p , contraction factor γ k = 1η k , and accuracy

ε k = r max / √ t k .
SCOPT finally returns an optimistic (nearly) optimal policy satisfying the span constraint. This policy is executed until the end of the episode.

Thm. 11 ensures that the specific instance of problem (6) for SCAL (i.e., problem (15)) is well defined and admits a maximizer π * c ( M ‡ k ) that can be efficiently computed using SCOPT. Moreover, up to an accuracy

η k • c = r max /t k , pol- icy π * c ( M ‡ k ) is still optimistic w.r.t.
all policies in the set of constrained policies Π c ( M k ) for the initial extended MDP. Since the true (unknown) MDP M * belongs to M k with high probability, under the assumption that sp {h

* M * } ≤ c, g * c ( M ‡ k ) ≥ g * M * -r max /t k . As briefly mentioned in Sec. 5, in practice SCOPT can only output an approximation µ k of π * c ( M ‡ k )
and we have no guarantees on sp h µ k . However, the regret proof of SCAL only uses the fact that sp {v n } ≤ c and this is always satisfied by definition of T ‡ c . We are now ready to prove the following regret bound (see App. F).

Theorem 12. For any weakly communicating MDP M such that sp {h * M } ≤ c, with probability at least 1δ it holds that for any T ≥ 1, the regret of SCAL is bounded as

∆(SCAL, T ) = O max{r max , c} ΓSAT ln T δ ,
6 Notice that given that β sa p,k ≥ η k for all (s, a) ∈ S × A (see definition in Sec. 3), the assumptions of Def. 3 hold trivially.

where Γ = max s∈S,a∈A p(•|s, a) 0 ≤ S is the maximal number of states that can be reached from any state.

The previous bound shows that when c ≤ r max D, SCAL scales linearly with c, while UCRL scales linearly with r max D (all other terms being equal). Notice that the gap between sp {h * } and D can be arbitrarily large, and thus the improvement can be significant in many MDPs. As an extreme case, in weakly communicating MDPs the diameter can be infinite, leading UCRL to suffer linear regret, while SCAL is still able to achieve sub-linear regret. However when c > r max D, given that the true MDP M * may not belong to M ‡ k , we cannot guarantee that the span of the value function v n returned by SCOPT is bounded by r max D. Nevertheless, we can slightly modify SCAL to address this case: at the beginning of any episode k, we run both SCOPT (with the same inputs) and EVI (as in UCRL) in parallel and pick the policy associated to the value with smallest span. With this modification, SCAL enjoys the best of both worlds, i.e., the regret scales with min{max{r max , c}, r max D} instead of c. When c is wrongly chosen (c < sp {h * M * }), SCAL converges to a policy in Π * c (M * ) which can be arbitrarily worse than the true optimal policy in M * . For this reason we cannot prove a regret bound in this scenario. Finally, notice that the benefit of SCAL over UCRL comes at a negligible additional computational cost.

Numerical Experiments

In this section, we numerically validate our theoretical findings. The code is available on GitHub. In particular, we show that the regret of UCRL indeed scales linearly with the diameter, while SCAL achieves much smaller regret that only depends on the span. This result is even more extreme in the case of non-communicating MDPs, where D = ∞. Consider the simple but descriptive three-state domain shown in Fig. 4(a) (results in a more complex domain are reported in App. G). In this example, the learning agent only has to choose which action to play in state s 2 (in all other states there is only one action to play). The rewards are distributed as Bernoulli with parameters shown in Fig. 4(a) and r max = 1. The optimal policy π * is such that π * (s 2 ) = a 1 with gain g * = 2

3 and bias

h * = -2-δ 3(1-δ) , -1 1-δ , 0 . If δ is small, sp {h * } = 1 1-δ ≈ 1, while D ≈ 1 δ . Fig. 4(b)
shows that, as predicted by theory, the regret of UCRL (for a fixed horizon T ) grows linearly with 1 δ ≈ D. The optimal bias span however is roughly equal to 1. Therefore, we expect SCAL to clearly outperform UCRL on this example. In all the experiments, we noticed that perturbing the extended MDP was not necessary to ensure convergence of SCOPT and so we set η k = 0. We also set γ k = 0 to speed-up the execution of SCOPT (see stopping condition in Fig. 3).

Communicating MDPs. We first set δ = 0.005 > 0, giv- ing a communicating MDP. With such a small δ, visiting state s 1 is rather unlikely. Nonetheless, since UCRL is based on the OFU principle, it keeps trying to visit s 1 (i.e., play a 0 in s 2 ) until it collects enough samples to understand that s 1 is actually a bad state (before that, UCRL "optimistically" assumes that s 1 is a highly rewarding state). Therefore, UCRL plays a 0 in s 2 for a long time and suffers large regret. This problem is particularly challenging for any learning algorithm solely employing optimism like UCRL (cf. (Ortner, 2008) for a more detailed discussion on the intrinsic limitations of optimism in RL). In contrast, SCAL is able to mitigate this issue when an appropriate constraint c is used. More precisely, whenever s 1 is believed to be the most rewarding state, the value function (bias) is maximal in s 1 and SCOPT applies a "truncation" in that state and "mixes" deterministic actions. In other words, SCAL leverages on the prior knowledge of the optimal bias span to understand that s 1 cannot be as good as predicted (from optimism). The exploration of the MDP is greatly affected as SCAL quickly discovers that action a 0 in s 2 is suboptimal. Therefore, SCAL is always performing better than UCRL (Fig. 5(a)) and the smaller c, the better the regret. Surprisingly the actual policy played by SCAL in this particular MDP is always deterministic. SCOPT mixes actions in s 1 where only one true action is available but the mixing happens in the extended MDP M ‡ k where the action set is compact. The policy that SCOPT outputs is thus stochastic in the extended MDP but deterministic in the true MDP.

s 0 s 1 s 2 a0 δ 1 -δ a0 a0 δ 1 -δ a1 r = 0 r ∼ Be 1 3 r ∼ Be 2 3 r ∼ Be 2 3 (a)
Infinite Diameter. By selecting δ = 0 the diameter becomes infinite (D = +∞) but the MDP is still weakly communicating (with transient state s 1 ). UCRL is not able to handle this setting and suffers linear regret. On the contrary, SCAL is able to quickly recover the optimal policy (see Fig. 5(b) and App. G).

Conclusion

In this paper we introduced SCAL, a UCRL-like algorithm that is able to efficiently balance exploration and exploitation in any weakly communicating MDP for which a finite bound c on the optimal bias span sp {h * } is known. While UCRL exclusively relies on optimism and uses EVI to compute the exploratory policy, SCAL leverages the knowledge of c through the use of SCOPT, a new planning algorithm specifically designed to handle constraints on the bias span. We showed both theoretically and empirically that SCAL achieves smaller regret than UCRL. Although SCAL was inspired by REGAL.C, it is the only implementable approach so far. Therefore, this paper answers the long-standing open question of whether it is actually possible to design an algorithm that does not scale with the diameter D in the worst case. Moreover, SCAL paves the way for implementable algorithms able to learn in an MDP with continuous state space. Indeed, existing algorithms achieving regret guarantees in this framework (Ortner and Ryabko, 2012;Lakshmanan et al., 2015) all rely on REGAL.C. We also believe that our approach can easily be extended to optimistic PSRL [START_REF] Agrawal | Optimistic posterior sampling for reinforcement learning: worst-case regret bounds[END_REF]

Index of the Appendix

We start providing a brief recap of the content of the appendix:

• App. A -Proof of Lem. 4: If M is unichain then Π * c (M ) = ∅.
As a starting point the continuity of gain g and span h w.r.t. the policy is proved (see Lem. 13).

-The policy associated to T c v can be interpreted as a solution of an LP problem (see App. A.2)

• App. B
-Shows the limitations of SCOPT (T c ): non-feasibility B.1 and non-convergence B.2.

• App. C -We show how to compute the policy associated to the operator T c v when T c is feasible in v. We consider both MDPs and extended MDPs. • App G -We test SCAL and UCRL on a larger and more challenging domain (the knight quest)

A. Optimization with bias span constraint

A.1. Existence of gain optimal policies under bias-span constraint: the unichain case (proof of Lem. 4)

In this section we provide a formal proof of Lem. 4.

In unichain MDPs, all policies π ∈ Π SR have a constant gain g π (Puterman, 1994, section 8.4), thus the search space reduces to Π c = {π ∈ Π SR : sp {h π } ≤ c}. We assume that Π c = ∅. We first prove the following lemma. Lemma 13. In a unichain MDP, g : π → g π and h : π → h π are continuous maps from Π SR to R and Π SR to R S respectively.

Proof. Let's consider two stationary policies π = d ∞ ∈ Π SR and π = d ∞ ∈ Π SR . Denote by P and P the transition matrices associated to d and d respectively. Since the MDP is unichain by assumption, the Markov Chains characterized by P and P each have a unique stationary distribution µ and µ respectively. We express the gap µµ using the same decomposition as Seneta (1993) (µµ )(I -P + e µ ) = µ (P -P ) =⇒ (µµ ) = µ (P -P )H P where I is the identity matrix, e = (1 . . . , 1) is the vector of all 1's and H P = (I -P + e µ ) -1e µ is the Drazin inverse of I -P also known as the deviation matrix of P (always well-defined, see Appendix A of (Puterman, 1994)). The above equality implies that

µ -µ 1 ≤ µ 1 =1 P -P ∞,1 H P ∞,∞ = P -P ∞,1 H P ∞,∞ where A ∞,1 := max i j |A ij | and A ∞,∞ := max i,j |A ij |.
As a consequence of the above inequality, when P → P we have µ → µ. Moreover, when d → d we have P → P by linearity and thus by composition:

lim d→ d µ = µ
Denote by r and r the reward functions associated to d and d respectively. We have g π = µ r and g π = µ r and since r is linear (hence continuous) in d we conclude that lim π→ π g π = g π or in other words, g : π → g π is continuous at π and since π was chosen arbitrarily, g is continuous everywhere. Similarly, h π = H P r and P → H P is continuous in P (the computation of H P involves only continuous operations of P and µ like addition, multiplication and inversion of matrices) and therefore h π is continuous too.

Note that Lem. 13 does not hold in general when the MDP is not unichain (see Ex. 1 when x → 0 and y → 0).

Since sp {•} is a semi-norm, it is a continuous map from Π SR to R and so the function f : π → sp {h π } is continuous by composition. Since f is continuous, Π SR is compact and R is a Hausdorff space, we know from basic topology that f is a proper map i.e, the preimage of every compact set in R by f is compact in Π SR . Since we can express Π c as the preimage of the compact interval [0, c] by f i.e., Π c = f -1 ([0, c]), it is clear that Π c is compact. As a result, since g π is continuous in π and Π c is compact, by Weierstrass extreme value theorem the maximum of g π is attained in Π c and so Π * c = ∅.

A.2. Greedy policy under bias span constraint: LP formulation

In this section, we show that the policy associated to T c v can be interpreted as the solution of a Linear Programming (LP) problem.

As mentioned in Sec. 5.1, a consequence of Lem. 5 (see proof in App. D) is that whenever D(c, v) = ∅, there exists

δ + v ∈ D(c, v) such that L δ + v v ≥ L d v for all d ∈ D(c, v) component-wise, and moreover T c v = L δ + v v.
As a result, we can express δ + v as a maximizer of the following optimization problem max

d∈D(c,v) {(L d v) e} (16)
where e = (1 . . . 1) is the vector of all 1's. The maximum of ( 16) is then (T c v) e. Since d → r d and d → P d are linear maps, the function we maximize d → (L d v) e is also linear in d. Moreover, the set D(c, v) can be expressed as a set of S × (S -1) linear constraints in L d v:

L d v(s) -L d v(s ) ≤ c, ∀s = s
Therefore, optimization problem ( 16) can be formulated as an LP problem. But of course it is much easier to compute T c v using Def. 1. The policy δ + v associated to T c v can also be computed efficiently without solving (16) (see App. C for more details).

Remark. Recall that computing the maximal gain of an MDP can be done by solving the following primal LP problem (Puterman, 1994, Section 8.8)

min g∈R,h∈R S {g} s.t. g + h(s) - s ∈S p(s |s, a)h(s ) ≥ r(s, a), ∀s ∈ S, ∀a ∈ A s ( 17
)
One might wonder whether it is possible to reformulate optimization problem (7) presented in Sec. 4 by adapting the above primal formulation with the addition of S × (S -1) linear constraints in h (as we did above for

s 0 s 1 a 0 , r = 0 a 1 , r = 0 a 0 , r = 1 a 1 , r = 1
L d v): h(s) -h(s ) ≤ c, ∀s = s
Unfortunately it is not that simple. Indeed, the validity of LP problem (17) is a consequence of the following two properties (Puterman, 1994, Theorem 8.4.1):

1) ge + h -Lh ≥ 0 =⇒ g ≥ g * 2) ge + h -Lh = 0 =⇒ g = g *
In general, these properties no longer hold for operator T c and optimal bias-span-constrained gain g * c . Therefore, the LP approach fails (one can easily try to solve the constrained LP on a simple MDP and observe the solution is incorrect). Using the dual formulation is also tricky because the span constraint is not linear in the dual variables. Whether it is possible to formulate problem (7) as an LP problem is left as an open question.

B. Limitations of SCOPT

In this section, we illustrate the limitations of operator T c on some simple examples. For convenience, we introduce notation N c to denote the (value) operator associated to policy G c v as

N c v = L (Gcv) v. (18)
Trivially, if

T c v is globally feasible, then N c v = T c v and G c v = δ + v .

B.1. Non-feasibility of T c

The following example shows that operator T c may generate vectors that do not correspond to a one-step policy evaluation, i.e., there may not exists

δ + v ∈ D M R such that T c v = L δ + v v, even if sp {v} ≤ c and/or if Π c = ∅.
Example 2. Consider the simple MDP provided in Fig. 6. Let v = [0, 0] and c = 1/2. In this case the policy π playing a 0 in both states matches the constraint c (i.e., sp {h π } ≤ c =⇒ π ∈ Π c =⇒ Π c = ∅) and moreover sp {v} ≤ c, but clearly there exists no policy δ

+ v achieving L δ + v v = T c v and moreover T c v = [0, 1/2] = N c v = [0, 1]
The previous example shows that there may not exists a policy associated to the one-step application of operator T c . Instead, Ex. 3 shows that T c may also not be feasible at convergence. In particular, we show that, surprising as it may seem, SCOPT can sometimes converge to a value h + that is not associated to any policy, even when Π c = ∅ and even when Π * c = ∅.

Example 3. Consider the simple MDP M of Fig. 7 where we assume that β < δ < α and we set c = α + β. The MDP is unichain and all gains are equal to 0. The set of randomized decision rules can be parametrized by the probability p of playing a 1 in s 1 and the associated set of bias functions is

H =      α + (1 -p) • β + p • δ (1 -p) • β + p • δ 0   : p ∈ [0, 1]    .
Let's denote by h(p) the bias associated to a policy parameterized by p, then sp {h(p

)} = α + (1 -p) • β + p • δ > c for all p > 0.
So there exists only one policy π = d ∞ achieving the span constraint which plays a 0 in s 1 (i.e., p = 0) implying that

Π c (M ) = {d ∞ } = Π * c (M ) = ∅ =⇒ π * c = d ∞ .
It is easy to verify that:

Fixed point of T c : h + =   α + β δ 0   / ∈ H Fixed point of N c : h # =   α + δ δ 0   ∈ H but sp h # > c,
Although T c admits a fixed point h + , it is not globally feasible at h + . On the other hand, while N c is globally feasible at its fixed point h # by definition, h # does not satisfy the bias constraint. One might be tempted to think that the problem in this example arises from the fact that Π c (M ) is a singleton but it is actually more subtle than that. Indeed, if we assume that β > 0 and if we add an action a 2 in s 1 that goes to s 2 with probability 1 and gives a reward 0, we face the same problem but this time Π c (M ) contains an infinite number of policies (since we include stochastic policies). The problem is actually coming from the fact that the action played in the only state achieving maximum bias (i.e., s 0 ) is deterministic while the action played in state s 1 (which achieves a lower bias than s 0 ) is stochastic. T c is unable to converge to such policies: by definition, it can only converge to a policy that plays a stochastic action in the states with maximal bias (it can also converge to a bias that is not associated to any policy like in this example).

The issue presented in Ex. 3 can be overcome by duplicating all actions and adjusting the rewards of the duplicated actions. More formally, denote by a the action obtained by duplicating a. The probability of transition is not modified (i.e., p(•|s, a) = p(•|s, a)) but the reward is set to the minimal value (i.e., r(s, a) = r min = 0). Denote by M ↓ this "augmented" MDP. It is easy to verify that h + (M ↓ ) = h + (M ) = (α + β, β, 0) but unlike M , M ↓ admits a policy associated to h + (M ↓ ) (using duplicated actions). As this example shows, augmenting the MDP never modifies the fixed point of T c but always makes T c globally feasible at any vector v satisfying sp {v} ≤ c. Since by definition the fixed point h + of T c satisfies the span constraint, T c is globally feasible at h + . This example gives an intuition why SCAL uses a modified MDP M ‡ k with augmented rewards (the confidence intervals B k r are "augmented" by below).

B.2. Non-convergence of T n c

It is rather easy to design an MDP for which the stopping condition of SCOPT (i.e., sp {v n+1v n } ≤ ε) is never met although all policies are unichain and aperiodic and Π c = ∅. In contrast, for the optimal Bellman operator L, unichain and aperiodicity are sufficient conditions to ensure that the stopping condition sp {v n+1v n } ≤ ε is met after a finite number of iterations (Puterman, 1994, Theorem 8.5.7).

Example 4. Consider the simple MDP M provided in Fig. 8 where we assume that 1 > δ > 0 and 1/2 ≥ c > 0. There is only one action available in every state and thus there is only one decision rule d. In that case L = L d . The contraction condition of (Puterman, 1994, Theorem 8.5.3) holds for J = 2, i.e., L is a 2-stage span contraction. More precisely we have:

P d =   δ 1 -δ 0 0 0 1 1 0 0   =⇒ P 2 d =   δ 2 δ -δ 2 1 -δ 1 0 1 δ 1 -δ 0   =⇒ γ d def = 1 -min s,u∈S    j∈S min{P 2 d (j|s), P 2 d (j|u)}    = δ < 1
where γ d is the ergodic coefficient associated to Markov Chain P d . This implies that L is a 2-stage γ d -span contraction: sp L 2n+1 v -L 2n v ≤ γ n d sp {Lv -v} for any vector v and any integer n ≥ 0. On the other hand, the sequence T n c v 0 starting from v 0 = 0 proceeds as follows

v 0 =   0 0 0   , v 1 =   c 0 0   , v 2 =   c 0 c   , v 3 =   2c c c   = v 1 + ce, . . . , v 2n = v 2 + nce, v 2n+1 = v 1 + nce
where e = (1, . . . , 1) denotes the vector of all 1's. We see that unlike L n v 0 , (T c ) n v 0 is cycling with period 2 and the quantity sp {v 2n+1v 2n } = sp {v 2v 1 } does not converge to 0. Although Lem. 7 shows that when L is a J-stage span contraction with J = 1 then T c is also a span contraction (proof in App. D), surprisingly (T c ) n v 0 might not converge when J > 1. Note that in this example Π c (M ) = ∅ and so one might wonder whether when Π c (M ) = ∅ the sequence T n c v 0 converges in span semi-norm. Unfortunately, it is not the case. Take the same MDP, duplicate the action in s 0 and assign a reward of 0 to this new action (the new action loops on s 0 with probability δ and goes to s 1 with probability 1δ as the original action, but the reward is 0 instead of 1). In that case, Π c (M ) = ∅ for all c ≥ 0 but we still have L = L d where d plays the original action in s 0 . Therefore, we face exactly the same problem as before although Π c (M ) = ∅.

C. Policy δ +

v associated to T c v

In this section, we provide a detailed description on how to efficiently compute a policy δ + v associated to T c v when T c is feasible at v. As mentioned in Sec. 4, we say that T c is feasible at v ∈ R S and s ∈ S when there exists a distribution δ + v (s) ∈ P(A) such that

T c v(s) = a∈As δ + v (s, a) r(s, a) + p(•, s, a) T v . ( 19
)
We distinguish between two types of states:

• Greedy states. When Lv(s) ≤ min{Lv} + c i.e., s ∈ S(c, v) (see Def. 1), δ + v (s) plays a deterministic greedy action a ∈ arg max a∈As {r(s, a) + p(•|s, a) T v}.

• Truncated states. When Lv(s) > min{Lv} + c i.e., s / ∈ S(c, v) (see Def. 1), by definition of L there exists at least one action a (e.g., any greedy action) such that r(s, a) + p(•|s, a) T v > min{Lv} + c. In addition, under the assumption that T c is feasible at v and s, we know from condition (10) of Lem. 5 (proof in App. D) that there exists an action a such that r(s, a) + p(•|s, a) T v ≤ min{Lv} + c. By the intermediate value theorem, we know that there exists a convex combination δ + v (s) of actions a and a achieving exactly L δ + v v(s) = min{Lv} + c. Note that there may exist multiple policies achieving this value (e.g., when there are multiple actions achieving higher or smaller values than min{Lv}+c). However, to simplify the implementation, we can simply set δ + v (s) to play with non-zero probability only a greedy action a ∈ arg max a∈As {r(s, a) + p(•|s, a) T v} and a minimal action a ∈ arg min a∈As {r(s, a) + p(•|s, a) T v}. Formally, let v = min a∈As {r(s, a) + p(•|s, a) T v} and v = max a∈As {r(s, a) + p(•|s, a) T v} = Lv(s). Then, Then, a and a are the actions associated to Lv(s) and Lv(s), respectively. Given a and a, the policy δ + v (s) associated to T c v(s) is computed as in (20). The maximum and minimum of r for r ∈ B r (s, a) are easy to compute (they correspond to the extreme values of the closed interval B r (s, a)). The maximum of p T v for p(s ) ∈ B p (s, a, s ) can be computed in O(S) operations using the algorithm described in (Dann and Brunskill, 2015, Appendix A). To compute the minimum of p T v, the exact same algorithm can be used with input -v instead of v since min p { p v} =max p { p (-v)}.

δ + v (s, a) =      (v -min{Lv} -c)/(v -v) if a = a (min{Lv} + c -v)/(v -v) if a = a 0 otherwise (

D. Properties of operators T c and G c

D.1. Feasibility of T c (proof of Lemma 5)

In this section, we prove Lem. 5.

We start by proving that for any decision rule d ∈ D(c, v), we have T c v ≥ L d v component-wise. By definition of T c and the optimal Bellman operator L it holds that

∀s ∈ S(c, v), ∀d ∈ D(c, v), T c v(s) = Lv(s) ≥ L d v(s).
Moreover, let m := min s {Lv(s)}, then

∀s ∈ S \ S(c, v), ∀d ∈ D(c, v), T c v(s) = m + c (21) ≥ m + sp {L d v} (22) = m + max{L d v} -min{L d v} (23) ≥ m + L d v(s) -m = L d v(s), (24)
Inequality ( 22 If condition (10) holds, we can use the constructive procedure described in App. C to construct a stochastic action

δ + v (s) ∈ P(A) such that L δ + v v(s) = min s {Lv(s)} + c = T c v(s)
and thus T c is feasible at v and s. On the other hand, if condition (10) does not hold i.e., min a∈As {r(s, a) + p(•|s, a) T v} > min s {Lv(s)} + c then it is clear that any d(s) ∈ P(A) will be such that L d v(s) > min s {Lv(s)} + c and so T c is not feasible at v and s. By contraposition, if T c is feasible at v and s then condition (10) holds thus proving the equivalence.

sp {L δ v} ≤ c =⇒ L δ v(s) ≤ max s {L d v(s)} ≤ min s {L d v(s)} + c ≤ min s {Lv(s)} + c
where we used the definition of the span sp {u} := max{u} -min{u} and the fact that L d v ≤ Lv component-wise by definition of L implying that min s {L d v(s)} ≤ min s {Lv(s)}. Therefore, condition (10) must hold in every state. In conclusion, T c is globally feasible at v if and only D(c, v) = ∅.

D.2. Contraction property of T c (proof of Lemma 7)

The purpose of this section is to prove Lem. 7. We first reinterpret operator T c as the composition of a projection Γ c and the optimal Belmman operator L (T c = Γ c L) and we prove interesting properties for Γ c and T c .

Recall that T c can be seen as the truncation of the optimal Bellman operator i.e., T c v(s) = min{Lv(s), min x {Lv(x)} + c}.

The following lemma shows that the truncation step is actually a projection in span semi-norm. Let V c = {v : sp {v} ≤ c} be the "semi-ball" of span constrained value functions. For any vector v ∈ R S and any c ≥ 0, we define the truncation operator Γ c : R S → V c as Γ c v(s) = min {v(s), min x {v(x)} + c}. We prove the following useful properties for Γ c : Lemma 15. Let v and u be vectors in R S , then:

(a) Monotonicity v ≥ u =⇒ Γ c v ≥ Γ c u. (b) For any s ∈ S min{v -u} ≤ Γ c v(s) -Γ c u(s) ≤ max{v -u}. ( 25
) (c) Γ c is non-expansive in span semi-norm sp {Γ c v -Γ c u} ≤ sp {v -u} . (d) Γ c is non-expansive in ∞ -norm Γ c v -Γ c u ∞ ≤ v -u ∞ . (e) Linearity ∀λ ∈ R, Γ c (v + λe) = Γ c v + λe.
Proof. For any state s ∈ S, the difference Γ c v(s)-Γ c u(s) can only take four different values depending on the configuration of v(s) and u(s)

Γ c v(s) -Γ c u(s) =          v(s) -u(s) if u(s) ≤ min{u} + c and v(s) ≤ min{v} + c (26a) min{v} + c -u(s) if u(s) ≤ min{u} + c and v(s) > min{v} + c (26b) v(s) -min{u} -c if u(s) > min{u} + c and v(s) ≤ min{v} + c (26c) min{v} -min{u} if u(s) > min{u} + c and v(s) > min{v} + c (26d)
(a) We need to show that for all s ∈ S, the difference Γ c v(s) -Γ c u(s) is bigger or equal than zero in all four cases. Case (26a) follows directly from the assumption v ≥ u, while case (26d) is trivially proved since v ≥ u implies min{v} ≥ min{u}. Case (26c) follows from v(s)-min{u}-c > v(s)-u(s) ≥ 0 (by assumption u(s) > min{u}+c in this case). Finally, case (26b) reduces to case (26d) since we assume that u(s) ≤ min{u} + c implying that min{v} + cu(s) ≥ min{v} -min{u} ≥ 0.

(b) We treat all four cases separately as we did to prove (a).

• Case (26a): it is straightforward to see that min{v The other inequality trivially follows by noticing that v(s) -min{u}c > v(s)u(s) ≥ min{v -u}. • Case (26d): inequalities ( 25) is a consequence of inequalities ( 27) and ( 28).

-u} ≤ Γ c v(s) -Γ c u(s) = v(s) -u(s) ≤ max{v -u} • Case (
(c) This is easy to prove exploiting inequality (25) (property (b)):

sp {Γ c v -Γ c u} = max{Γ c v -Γ c u} -min{Γ c v -Γ c u} ≤ max{v -u} -min{v -u} = sp {v -u} (d)
We can again use inequality ( 25)

Γ c v -Γ c u ∞ = max s {|Γ c v(s) -Γ c u(s)|} = max max s {Γ c v(s) -Γ c u(s)}, max s {Γ c u(s) -Γ c v(s)} ≤ max max s {v(s) -u(s)}, max s {u(s) -v(s)} = v -u ∞
(e) By definition of Γ c , for any s ∈ S:

Γ c (v + λe)(s) = min {v(s) + λ, min{v + λe} + c} = min {v(s) + λ, min{v} + λ + c} = min {v(s), min{v} + c} + λ = Γ c v(s) + λ.
We are now ready to prove the following lemma:

Lemma 16. Let v and u be vectors in R S . Operator T c enjoys the following properties:

(a) Monotonicity v ≥ u =⇒ T c v ≥ T c u. (b) T c v ≤ Lv and if in addition sp {v} ≤ c and v ≤ Lv then v ≤ T c v. (c) Linearity ∀λ ∈ R, T c (v + λe) = T c v + λe. (d) T c is non-expansive both in span semi-norm and ∞ -norm sp {T c v -T c u} ≤ sp {v -u} and T c v -T c u ∞ ≤ v -u ∞ .
Moreover, if L is a γ-span contraction then T c is also a γ-span contraction (Lem. 7).

Proof. We rely on the properties proved in Lem. 15.

sp {T c v -T c u} = sp {Γ c Lv -Γ c Lu} ≤ sp {Lv -Lu} ≤ sp {v -u} and T c v -T c u ∞ = Γ c Lv -Γ c Lu ∞ ≤ Lv -Lu ∞ ≤ v -u ∞
If L is a γ-span contraction then:

sp {T c v -T c u} = sp {Γ c Lv -Γ c Lu} ≤ sp {Lv -Lu} ≤ γsp {v -u}
meaning that T c is also a γ-span contraction.

Lem. 7 immediately follows from property (d) of Lem. 16.

D.3. Convergence properties of T c (proof of Lemma 8)

In this section we provide a detailed proof of Lem. 8.

We assume that Asm. 6 holds which implies that T c is a γ-span contraction by Lem. 7.

1. Existence and uniqueness of the solution of optimality equation ( 14): Consider the quotient vector space W = R S /Span(e) where Span(e) is the linear span of vector e i.e., the intersection of all vector spaces containing e: Span(e) = {λe : λ ∈ R}. The quotient space W is a vector space with dimension S -1 (it is in bijection with R S-1 × {0}, where one coordinate is set to 0 and the others are free real variables). Since Span(e) is the null space of the semi-norm sp {•}, then sp {•} is indeed a norm on W and thus (W, sp {•}) is a normed vector space. The operator T c is well-defined also on (W, sp {•}) because of property (c) of Lem. 16 (linearity of T c ): ∀h ∈ R S , T c (h + λe) = T c h + λe implying that for any given w ∈ W , the vector T c w ∈ W is uniquely defined (i.e., there is no ambiguity in the definition of T c ). Moreover, if h ∈ R S maps to w ∈ W then T c h ∈ R S maps to T c w ∈ W . Since T c is a span contraction, then T c has a unique fixed point w + in W by Banach fixed-point theorem, which corresponds to the optimality equation T c w + = w + (in W ). Let h + ∈ R S be an arbitrary (bounded) vector in the original space that maps to w + ∈ W . Since T c h + ∈ R S maps to T c w + ∈ W and T c w + = w + we have that T c h + and h + differ only by a constant vector i.e., sp {T c h +h + } = 0 or in other words, there exists a constant g + ∈ R such that T c h + = h + + g + e which proves the existence of the solution of optimality equation ( 14). Any other solution h ∈ R S to this equation will necessarily map to w + ∈ W by uniqueness of the solution in W and so sp {h +h } = 0. As a result, the fixed point property of T c in W translates into a fixed point up to a constant vector in R S , which leads to the optimality equation T c h + = h + + g + e as in ( 14) where h + is defined up to a constant. Furthermore, let (g + 1 , h + 1 ) and (g + 2 , h + 2 ) be two solutions of ( 14). Since there exists a λ ∈ R such that h + 2 = h + 1 + λe we have

g + 2 e = T c h + 2 -h + 2 = T c (h + 1 + λe) -(h + 1 + λe) = T c h + 1 + λe -h + 1 -λe = T c h + 1 -h + 1 = g + 1 e
, where we used property (c) of Lemma 16, which leads to g + 1 = g + 2 and thus the uniqueness of g + in ( 14).

Convergence of (relative) value iteration:

Fix an arbitrary state s ∈ S and any initial vector v 0 = v ∈ R S , the relative value iteration algorithm implemented by SCOPT proceeds through iterations as

v n = T c v n-1 -(T c v n-1 )(s)e = T n c v -(T n c v) (s)e. ( 29
)
The last equality in (29) can be proved by induction on n ≥ 1: it is trivially true for n = 1 and assuming that for a given n ≥ 1 it holds that

v n = T n c v -(T n c v) (s)e, then v n+1 = T c v n -(T c v n )(s)e = T c (T n c v -(T n c v) (s)e) -(T c (T n c v -(T n c v) (s)e)) (s)e = T n+1 c v -(T n c v) (s)e -T n+1 c v (s)e + (T n c v) (s)e = T n+1 c v -T n+1 c v (s)e
where we used the linearity of T c (property (c) of Lem. 16).

Denote by q n = v n+1v n . Since v n+1 (s) = v n (s) = 0, then q n (s) = 0 and the absolute value of any component q n (s) can be upper-bounded by its span.8 As a result, we have

|q n (s)| ≤ q n ∞ ≤ sp {q n } .
Using the span contraction property of T c we have that

|v n+1 (s) -v n (s)| ≤ sp {v n+1 -v n } = sp {T c v n -(T c v n )e -T c v n-1 + (T c v n-1 )e} (a) = sp {T c v n -T c v n-1 } ≤ γsp {v n -v n-1 } = γsp {q n-1 } (b) ≤ γ n sp {T c v -v} ,
where (a) follows from the fact that sp {f } = sp {f + λe} for any λ ∈ R and (b) is obtained by iterating the first inequality. Since sp {T c v -v} is bounded and γ < 1, we can conclude that {v n+1v n } n is a convergent sequence. Now we show that {v n } n is a Cauchy sequence. Let m > n, then the following inequalities hold

|v m (s) -v n (s)| ≤ sp {v m -v n } = sp {v m -v m-1 + v m-1 -v m-2 + . . . + v n+1 -v n } (30) ≤ sp {v m -v m-1 } + sp {v m-1 -v m-2 } + . . . + sp {v n+1 -v n } (a) ≤ γ m-1 sp {T c v -v} + γ m-2 sp {T c v -v} + . . . + γ n sp {T c v -v} = γ n sp {T c v -v} m-n-1 k=0 γ k ≤ γ n sp {T c v -v} ∞ k=0 γ k = γ n 1 -γ sp {T c v -v} ,
where (a) is the application of the previous inequality sp {v n+1v n } ≤ γ n sp {T c v -v}. Since γ < 1, for any arbitrary ε > 0, there exists a N ε , so that for any

m > n > N ε , v m -v n ∞ ≤ ε.
As a result {v n } n is a Cauchy sequence and since (R S , • ∞ ) is a Banach space, v n converges to a vector that we denote by h(v, s). We now show that h(v, s) satisfies the optimality equation. Using property (c) in Lem. 16 and Eq. 29, we can write

T c v n = T c T n c v -(T n c v)(s)e = T n+1 c v -(T n c v)(s)e = v n+1 + T n+1 c v -T n c v (s)e. (31)
Then,

sp {T c v n -v n+1 } = sp T n+1 c v -T n c v) (s)e = 0. ( 32
)
By continuity of the semi-norm sp {•} and uniqueness of the limit this implies that

lim n→+∞ sp {T c v n -v n+1 } = sp {T c h(v, s) -h(v, s)} = 0,
where we used the fact that the sequences v n and v n+1 converge to h(v, s). Since T c h(v, s)h(v, s) has zero span, we conclude that there exists a constant value g ∈ R such that T c h(v, s) = h(v, s) + ge, which is indeed optimality equation ( 14) and by uniqueness of the solution, g = g + . This proves that relative value iteration using T c does converge to a solution of the optimality equation.

Alternatively, we can prove that standard value iteration converges in the sense that

lim n→+∞ T n+1 c v -T n c v = g + e.
Using the continuity of T c and the fact that lim n→+∞ v n = lim n→+∞ v n+1 = h(v, s), we can write

lim n→+∞ T c v n -v n+1 = T c h(v, s) -h(v, s) = g + e. ( 33
)
Using the definition of relative value iteration (v n = T n c v -T n c v(s)e) and the linearity of T c we have

T n+1 c v -T n c v = T c (v n + (T n c v)(s)e) -(v n + (T n c v)(s)e) = T c v n -v n = v n+1 -v n -→ n→+∞ 0 + T c v n -v n+1 -→ n→+∞ g + e -→ n→+∞ g + e,
where the limits rely on the convergence of v n and Eq. 33.

3. Dominance g + ≥ g * c :

Let π = d ∞ ∈ Π c be a policy with constant gain and bounded bias span. The evaluation Bellman equation gives L d h π = h π + g π e and sp {L d h π } = sp {h π } ≤ c. This implies that d ∈ D(c, h π ) = ∅ and so from Lemma 5 we have

T c h π ≥ h π + g π e.
By monotonicity and linearity of T c (properties (a) and (c)) of Lemma 16) we have

T c h π ≥ h π + g π e =⇒ T 2 c h π ≥ T c (h π + g π e) = T c h π + g π e ≥ h π + 2g π e,
As a result, we can iterate the inequality and obtain for all n ∈ N:

T n+1 c h π ≥ T n c h π + g π e =⇒ T n+1 c h π -T n c h π -→ n→+∞ g + e ≥ g π e =⇒ g + ≥ g π ,
where we used property 2. of Lem. 8 proved above. Since the inequality holds for any π ∈ Π c , it also holds for the supremum sup π∈Πc g π = g * c (solution to problem ( 7)) i.e., g + ≥ g * c .

D.4. Approximation guarantees of SCOPT (proof of Theorem 10)

In this section we prove a slightly more general statement than Thm. 10.

We use operators G c and N c defined in Def. 2 and App. B respectively. We recall that when T c is globally feasible at v, then

N c v = T c v and G c v = δ + v .
We first slightly relax Asm. 9 (Asm. 17 below) and then prove a generalisation of Thm. 10 (Thm. 18 below).

Assumption 17. Operator T c is globally feasible at h + , i.e., the decision rule

d + = G c h + is such that T c h + = L d + h + = N c h + = h + + g + e.
Theorem 18. Assume Asm. 6 and 17 hold and let

M + n = 2γ n 1 -γ sp {v 1 -v 0 } + max s {T c v n (s) -v n (s)} m + n = -2γ n 1 -γ sp {v 1 -v 0 } + min s {T c v n (s) -v n (s)} M n = max s {N c v n (s) -v n (s)} m n = min s {N c v n (s) -v n (s)} ,
and d n = G c v n be the decision rule computed after n iterations and π n = (d n ) ∞ the corresponding policy. Then we have

1) g πn - 1 2 (M n + m n ) e ∞ ≤ 1 2 (M n -m n ) = 1 2 sp {N c v n -v n } (34) 2) g + - 1 2 M + n + m + n ≤ 1 2 M + n -m + n = 2γ n 1 -γ sp {v 1 -v 0 } + 1 2 sp {T c v n -v n } (35) 3) g + e -g πn ∞ ≤ max M + n -m n , M n -m + n (36)
Moreover, if in addition π + = (d + ) ∞ is unichain then g + is the solution to optimization problem (7), i.e., g + = g * c and π + ∈ Π * c .

Proof. We first analyse the convergence error. Let π n be the policy associated to the decision rule d n = G c v n . We prove the three convergence statements of the theorem.

1. We recall that operator N c is such that

L dn v n = L Gcvn v n = N c v n .
By definition of the gain g πn , there exists a stationary transition matrix P * dn := C-lim k→+∞ (P dn ) k (Puterman, 1994, Appendix A) such that g πn = P * dn r dn . Furthermore, since P * dn P dn = P * dn , for any vector v n , g πn = P * dn (r

dn + P dn v n -v n ) = P * dn (L dn v n -v n ). Since min {L dn v n -v n } e ≤ L dn v n -v n ≤ max {L dn v n -v n }
e and by multiplying these two inequalities by P * dn (which is a stochastic matrix) we obtain m n e ≤ g πn ≤ M n e and the result holds.

2. Using Eq. 30 and letting m → ∞, we have h

+ -v n ∞ ≤ γ n 1-γ sp {v 1 -v 0 }.
Therefore by monotonicity and linearity of T c (property (a) and (c) of Lem. 16) and using optimality equation

T c h + = h + + g + e: - γ n 1 -γ sp {v 1 -v 0 } e + h + ≤ v n ≤ h + + γ n 1 -γ sp {v 1 -v 0 } e =⇒ - γ n 1 -γ sp {v 1 -v 0 } e + h + + g + e ≤ T c v n ≤ h + + g + e + γ n 1 -γ sp {v 1 -v 0 } e =⇒ - 2γ n 1 -γ sp {v 1 -v 0 } e + g + e ≤ T c v n -v n ≤ g + e + 2γ n 1 -γ sp {v 1 -v 0 } e =⇒ - 2γ n 1 -γ sp {v 1 -v 0 } e + T c v n -v n ≤ g + e ≤ T c v n -v n + 2γ n 1 -γ sp {v 1 -v 0 } e =⇒ m + n ≤ g + ≤ M + n
and the result holds.

3. The last inequality is a direct consequence of the two inequalities previously proved:

m n e ≤ g πn ≤ M n e and m + n ≤ g + ≤ M + n .
We now prove optimality. Under the global feasibility assumption at h + (Asm. 17), we have that there exists a decision rule d + and an associated policy π + = (d + ) ∞ such that

T c h + = L d + h + = h + + g + e, (37)
Since (g + , h + ) is a solution of the Bellman evaluation equations (1) associated to π + = (d + ) ∞ and since by assumption π + is unichain, Corollary 8.2.7. of Puterman (1994) holds and so g + = g π + and there exists λ ∈ R such that

h π + = h + + λe implying that sp h π + = sp h + + λe = sp h + = sp h + + g + e = sp T c h + ≤ c,
where we used the invariance of the span by translation, Eq. 37 and the definition of T c . As a result, π + ∈ Π c and by property 3. of Lem. 8 we can conclude that

g π + = g + ≥ g π , ∀π ∈ Π c ,
which implies that π + ∈ Π * c and g π + = g * c . Note that if π + is not unichain then we might have sp{h π + } > sp {h + } in which case it is possible that π + / ∈ Π c and so the result does not hold.

We now relate Asm. 17 and Thm. 18 to (respectively) Asm. 9 and Thm. 10. As we just showed in the proof of Thm. 18, we always have sp {h + } ≤ c and therefore, whenever Asm. 9 holds, Asm. 17 holds too. As a result, if Asm. 6 also holds then the first part of Thm. 18 holds too. Moreover, if sp {v 0 } ≤ c it is straightforward to see that sp {v n } ≤ c for any n ≥ 1 and so due to Asm. 9,

T c v n = N c v n for all n ≥ 1. This implies that max M + n -m n , M n -m + n = sp {T c v n -v n } + 2γ n 1 -γ sp {v 1 -v 0 } = sp {v n+1 -v n } + 2γ n 1 -γ sp {v 1 -v 0 }
and as a consequence Thm. 10 holds.

E. Modified bounded-parameter (extended) MDPs (Proof of Thm. 11)

In this section we prove Thm. 11.

We analyse separately the two modifications introduced in Def. 3 on the rewards and transition probabilities (transition "kernel"). For a given bounded-parameter (extended) MDP M, we denote by M η the perturbed bounded-parameter MDP whose transition kernel is an η-perturbation of the original one (see formal definition in Lem. 19 below), and by M ↓ the augmented bounded-parameter MDP whose reward intervals are extended from below compared to the original ones (the maximum is not changed while the lower bound of the interval is set to zero, see formal definition in Lem. 20 below). We first prove interesting properties for operators T η c associated to M η (Lem. 19) and T ↓ c associated to M ↓ (Lem. 20). We then consider the MDP M ↓ η that is both augmented and perturbed and we present the properties of the corresponding operator T η,↓ c in Thm. 21. Note that in Sec. 6 we called the augmented and perturbed MDP "modified MDP" for simplicity, and we used the notation M ‡ instead of M ↓ η for clarity. Thm. 11 in Sec. 6 is thus equivalent to Thm. 21 stated below. In the following, for any closed interval where S and A s are finite, B r (s, a) and B p (s, a, s ) are closed intervals of [0, r max ] and [0, 1] respectively. Let 1 ≥ η > 0 and s ∈ S and consider the "perturbed" bounded-parameter MDP M η defined ∀s, s ∈ S and ∀a ∈ A s by:

B η r (s, a) = B r (s, a) and B η p (s, a, s ) = B p (s, a, s ) if s = s and B p (s, a, s) ∩ [η, 1] if s = s
where we assume that η is small enough so that ∀s ∈ S and ∀a ∈ A s ,

1. B p (s, a, s) ∩ [η, 1] = ∅ 2. s ∈S min{B η p (s, a, s )} ≤ 1 and s ∈S max{B p (s, a, s )} ≥ 1
If L denotes the optimal Bellman operator of M and L η the optimal Bellman operator of M η , then ∀v ∈ R S :

Lv -L η v ∞ ≤ sp {v} η (38)
Moreover, L η is a γ-span contraction with γ ≤ 1η < 1 and M η unichain.

Proof. For all states s ∈ S and actions a ∈ A s we use the following notations r(s, a):= max{B r (s, a)} and p(•|s, a):= arg max 1. Assume without loss of generality that the coordinates of v are sorted in decreasing order:

p(s )∈Bp(s,a,s ) s ∈S p(s )v(s ) (39)
v(s 1 ) ≥ v(s 2 ) ≥ ... ≥ v(s n )
2. Initialise p 0 (s |s, a) = min{B p (s, a, s )}, ∆ 0 = 1s ∈S p 0 (s |s, a) for all s ∈ S, and i = 1

3. While ∆ i-1 > 0 do • δ i ← min ∆ i-1 ; max{B p (s, a, s i )} -p i-1 (s i |s, a) • p i (s i |s, a) ← p i-1 (s i |s, a) + δ i • ∆ i ← ∆ i-1 -δ i • i ← i + 1 4. Return p(•|s, a) = p i-1 (•|s, a)
Let's now show that at any iteration of the above procedure p(•|s, a) and p η (•|s, a) are at most 2η-far in 1 -norm. Notice that at the end of iteration i, the vector p i (•|s, a) differs from p i-1 (•|s, a) only in state s i . In the following we use index η to denote the quantities obtained when the above procedure is applied with B η p (s, a, s ) instead of B p (s, a, s ) (the output is then p η (•|s, a)). The conditions B p (s, a, s) ∩ [η, 1] = ∅, s ∈S min{B η p (s, a, s )} ≤ 1 and s ∈S max{B p (s, a, s )} ≥ 1 ensure that the procedure doesn't stop prematurely when B η p (s, a, s ) replaces B p (s, a, s ). Indeed, when they hold there exists a vector p satisfying s ∈S p(s ) = 1 and ∀s ∈ S, p(s ) ∈ B η p (s, a, s ).

• i = 0 (initialization): By definition, for any s = s, B η p (s, a, s ) = B p (s, a, s ) implying that p 0 (s |s, a) = p 0 η (s |s, a) and moreover η ≤ min{B η p (s, a, s)} ≤ η + min{B p (s, a, s)} implying that η ≤ p 0 η (s|s, a) ≤ η + p 0 (s|s, a) and thus

∆ 0 η + η ≥ ∆ 0 ≥ ∆ 0 η and p 0 (•|s, a) -p 0 η (•|s, a) 1 = | p 0 (s|s, a) -p 0 η (s|s, a)| ≤ η
When the procedure to compute p η (•|s, a) stops, there are only two possibilities: state s is updated either before or after ∆ η = 0. In the following we analyze separately the two cases.

• ∆ η = 0 occurs first: i.e., ∆ i η = 0 and for k = 1, ..., i, s k = s and ∆ k-1 η > 0. As a consequence, we have that p η (•|s, a) = p i η (•|s, a) and by triangle inequality:

p(•|s, a) -p η (•|s, a) 1 ≤ p i (•|s, a) -p i η (•|s, a) 1 + p i (•|s, a) -p(•|s, a) 1 (40)
By assumption for k

= 1, ..., i -1, ∆ k-1 η > 0, we have that p k η (s k |s, a) = max{B η p (s, a, s k )} = max{B p (s, a, s k )}.
Moreover, for all k = 1, ..., i -1, s k = s and thus by trivial induction we have that

∆ k -∆ k η = ∆ 0 -∆ 0 η , ∆ k-1 ≥ ∆ k-1 η > 0 and p k (s k |s, a) = max{B p (s, a, s k )} = p k η (s k |s, a). Then: ∀k = 1, ..., i -1, p k (•|s, a) -p k η (•|s, a) 1 = ∆ 0 -∆ 0 η ≤ η and thus p i (•|s, a) -p i η (•|s, a) 1 = ∆ 0 -∆ 0 η + δ i -δ i η . Since p i (•|s, a) -p(•|s, a) 1 = ∆ i ,
after incorporating everything into (40) we obtain:

p(•|s, a) -p η (•|s, a) 1 ≤ ∆ 0 -∆ 0 η -δ i η + δ i + ∆ i =∆ i-1 = ∆ 0 -∆ 0 η + ∆ i-1 =∆ i-1 η +∆ 0 -∆ 0 η -δ i η = 2(∆ 0 -∆ 0 η ) + ∆ i-1 η -δ i η =∆ i η =0 = 2(∆ 0 -∆ 0 η ) ≤ 2η
• s is updated first: i.e., s i = s and for k = 1, ..., i -1, s k = s and ∆ k η > 0. By trivial induction we have that for all

k < i, ∆ k -∆ k η = ∆ 0 -∆ 0 η and p k (s k |s, a) = max{B p (s, a, s k )} = max{B η p (s, a, s k )} = p k η (s k |s, a). Since δ i η
is defined as the minimum between two values, there are only two possible cases:

- - In conclusion:

If δ i η = max{B η p (s, a, s i )} -p i-1 η (s i |s, a) ≤ ∆ i-1 η we have that max{B p (s, a, s i )} -p i-1 (s i |s, a) = max{B η p (s, a, s i )} -p i-1 η (s i |s, a) + ∆ 0 -∆ 0 η ≤ ∆ i-1 η + ∆ 0 -∆ 0 η = ∆ i-1 which implies δ i = max{B p (s, a, s i )} -p i-1 (s i |s, a).
If δ i η = ∆ i-1 η ≤ max{B η p (s, a, s i )} -p i-1 η (s i |s, a) we have that p i-1 η (s i |s, a) = p 0 η (s i |s, a) = p 0 η (s|s, a) = min{B η p (s, a, s)} = min{B p (s, a, s)} + ∆ 0 -∆ 0 η = p 0 (s|s, a) + ∆ 0 -∆ 0 η = p 0 (s i |s, a) + ∆ 0 -∆ 0 η = p i-1 (s i |s, a) + ∆ 0 -∆ 0 η implying that ∆ i-1 = ∆ i-1 η + ∆ 0 -∆ 0 η ≤ max{B η p (s, a, s i )} -p i-1 η (s i |s, a) + ∆ 0 -∆ 0 η = max{B p (s, a, s i )} -p i-1 (s i |s, a) which implies δ i = ∆ i-1 . As a consequence, * p i (s i |s, a) = p i-1 (s i |s, a) + δ i = p i-1 (s i |s, a) + ∆ 0 -∆ 0 η p i-1 η (s|s,a) +∆ i-1 η = p i η (s i |s, a) * ∆ i = ∆ i η = 0 Thus for k > i, p k (s k |s, a) = p k η (
max a∈As p(•|s, a) -p η (•|s, a) 1 ≤ 2η implying Lv -L η v ∞ ≤ sp {v} η.
From (Puterman, 1994, Theorem 6.6.6), we know that L η is Lipschitz continuous in span semi-norm with Lipschitz constant:

γ = 1 - min s∈S,
≥η            ≤ 1 -η < 1
Thus L η is a γ-span-contraction with γ ≤ 1η < 1. The term γ is often referred to as "ergodic coefficient" in the literature.

Finally, by definition of M η , for any decision rule d ∈ D MR and for any state s ∈ S: p(s|s, d(s)) > 0. Assume that the policy π = d ∞ associated to d has more than one recurrent class and pick s 1 , s 2 ∈ S belonging to two different recurrent classes. Since, p(s|s 1 , d(s 1 )) > 0 and p(s|s 2 , d(s 2 )) > 0, necessarily s must belong to both recurrent classes which is impossible as two distinct recurrent classes have disjoint state spaces by definition. Therefore π is unichain. Since π was chosen arbitrarily, M η is unichain which concludes the proof.

We now consider the perturbation of the reward intervals. Notice that the bounded-parameter MDP M ↓ is just augmented from below, i.e., the maximum value of the reward is not altered: ∀(s, a) ∈ S × A, r(s, a) = r ↓ (s, a). Moreover, by definition: ∀s, s ∈ S, ∀a ∈ A, p(s |s, a) = p ↓ (s |s, a). As a consequence, ∀v ∈ R S and ∀s ∈ S, Lv(s) = max a∈As r(s, a)

+ s ∈S p(s |s, a)v(s ) = L ↓ v(s). Since T c v = Γ c Lv and T ↓ c v = Γ c L ↓ v by definition, it follows that T c v = T ↓ c v
To prove the second statement, for any v ∈ R S we define δ v ∈ D MR ( M ↓ ) achieving the component-wise minimal value of

L ↓ d v for d ∈ D MR ( M ↓
). Formally:

δ v := arg min d∈D MR ( M ↓ ) L ↓ d v =⇒ ∀s ∈ S, L δv v(s) = min a∈As    r ↓ (s, a) =rmin + s ∈S p ↓ (s |s, a)v(s )    .
As a consequence, if v satisfies sp {v} ≤ c then:

sp L ↓ δv v = sp r min e + P ↓ δv v = sp P ↓ δv v ≤ sp {v} ≤ c
where we used (Puterman, 1994, Poposition 6.6.1) applied to the stochastic matrix P ↓ δv . Then,

δ v ∈ D ↓ (c, v) = ∅.
We can finally "merge" Lem. 19 and 20 and provide properties for operator T η,↓ c associated to the augmented and perturbed bounded-parameter MDP M ↓ η .

Theorem 21 (Equivalent to Thm. 11). Let M be a bounded-parameter MDP and M ↓ η be the associated both "augmented" and "perturbed" bounded-parameter MDP (see Lem. 19 and 20). Then, 1. Lem. 8 applies to T η,↓ c . Denote by (g + , h + ) a solution to equation (14) for T η,↓ c .

2. M ↓ η is unichain and Thm. 10 applies to T η,↓ c . Denote by π + ∈ Π SR ( M ↓ η ) any policy achieving:

L η,↓ π + h + = T η,↓ c h + = N η,↓ c h + = h + + g + e. 3. ∀µ ∈ Π c ( M), g + = g π + M ↓ η = g * c ( M ↓ η ) ≥ g µ ∞ M -ηc. Proof. Lem. 19 states that L η is a γ-span contraction (γ < 1). Since for any v ∈ R S , L ↓ η v = L η v (property 1. of Lem. 20), L ↓
η is also a γ-span contraction. As a consequence, Asm. 6 holds and so Lem. 8 applies to T η,↓ c thus proving the first statement.

To prove the second statement, notice that L ↓ η satisfies Asm. 9 due to property 2. of Lem. 20 and Lem. 5. Moreover, M ↓ η is unichain by Lem. 19 meaning that all policies (and in particular π + ) are unichain. Therefore, Thm. 10 applies to T η,↓ c . Finally, we prove the third statement. We first prove by induction that the two sequences (v n ) n∈N and ( v n ) n∈N defined by v 0 = v 0 such that sp {v 0 } ≤ c and for all n ∈ N,

v n+1 = T ↓ c v n and v n+1 = T η,↓ c v n , satisfy v n -v n ∞ ≤ nηc:
1. The result trivially holds for n = 0.

2. Assume the result holds for n ∈ N. Let's show that it is also true for n + 1:

v n+1 -v n+1 ∞ = T ↓ c v n -T η,↓ c v n ∞ = Γ c L ↓ v n -Γ c L ↓ η v n ∞ ≤ L ↓ v n -L ↓ η v n ∞ ≤ L ↓ v n -L ↓ η v n ∞ ≤sp{vn}η≤ηc + L ↓ η v n -L ↓ η v n ∞ ≤ vn-vn ∞ ≤nηc ≤ (n + 1)ηc
The first inequality comes from the fact that Γ c is non-expansive (property (d) of Lem. 15). The second inequality is just the triangle inequality. The last inequality follows from Lem. 19, the fact that sp {v n } ≤ c by definition, the fact that L η is non-expansive and the induction assumption. Let µ ∈ Π c ( M) and for simplicity denote by h µ (respectively g µ ) the bias h µ ∞ M associated to policy µ ∞ in M (respectively the gain g µ ∞

M

). Since sp {h µ } ≤ c by definition of Π c ( M), we can apply the result we just proved with v 0 = v 0 = h µ :

∀n ∈ N, ( T η,↓ c ) n h µ ≥ ( T ↓ c ) n h µ -nηce
where e = (1, . . . , 1) is the vector of all 1's and ( T η,↓ c ) n denotes n consecutive applications of operator T η,↓ c . By property 1 of Lem. 20 we have that (

T ↓ c ) n h µ = ( T c ) n h µ implying that: ∀n ∈ N, ( T η,↓ c ) n h µ ≥ ( T c ) n h µ -nηce (43)
Now using the Bellman evaluation equation of µ we have:

L µ h µ = h µ + g µ e =⇒ sp L µ h µ = sp {h µ } ≤ c =⇒ µ ∈ D(c, h µ )
Therefore, by Lem. 5 we have that T c h µ ≥ L µ h µ = h µ + g µ e and using the monotonicity of T c (property (a) of Lem. 16) we obtain by induction that:

∀n ∈ N, ( T c ) n h µ ≥ h µ + ng µ e (44)
Combining ( 43) and ( 44) we have that

∀n ≥ 1, 1 n n k=1 ( T η,↓ c ) k h µ -( T η,↓ c ) k-1 h µ = 1 n ( T η,↓ c ) n h µ -h µ ≥ (g µ -ηc)e (45)
The term on the left-hand side of ( 44) is the Cesaro mean of the sequence

( T η,↓ c ) n h µ -( T η,↓ c ) n-1 h µ n∈N
. By property 2.

of Lem. 8 we know that this sequence converges to g + and thus by Cesaro theorem we know that the Cesaro mean has the same limit. Therefore, taking the limit on both sides of the inequality in (44) yields:

g + ≥ g µ -ηc
which concludes the proof.

F. Regret Analysis of SCAL (Proof of Thm. 12)

We follow the proof structure in (Jaksch et al., 2010) and use similar notations. The main differences with Jaksch et al.

(2010)'s regret proof are the following:

1. We use empirical Bernstein confidence bounds for both the rewards and the transition probabilities and not Hoeffding bounds. 2. The actual confidence bounds used by extended value iteration needs to be adapted in order to insure both convergence of the algorithm and feasibility of the policy (the MDP is "modfied", see Def 3). 3. The policy returned by extended value iteration may be stochastic.

F.1. Splitting into episodes

The regret after T time steps is defined as:

∆(SCAL, T ) = T g * - T t=1 r t (s t , a t )
Define the filtration F t = σ(s 1 , a 1 , r 1 , . . . , s t+1 ) and the stochastic process X t = r t (s t , a t ) -a∈As t r(s t , a) π kt (s t , a) where k t is the episode at time t and π kt is the stochastic policy being executed at time t. Note that π kt is a random variable that is F t-1 -measurable. Moreover, (X t , F t ) t≥0 is a Martingale Difference Sequence (MDS) since |X t | ≤ r max and E[X t |F t-1 ] = 0. Using Azuma's inequality (see for example Jaksch et al. (2010, Lemma 10)):

P   T t=1 r t (s t , a t ) ≤ T t=1 a∈As t r(s t , a) π kt (s t , a) -r max 5 2 T ln 11T δ   ≤ δ 11T 5/4 < δ 20T 5/4
For any episode k, we denote by t k the starting time of that episode. Let's also denote by ν k (s) (resp. ν k (s, a)) the total number of visits in state s (resp. state-action pair (s, a)) during episode k (i.e., before time t k+1 , t k+1 not included, and after time t k , t k included):

ν k (s, a) := {t k ≤ τ < t k+1 : (s τ , a τ ) = (s, a)} ν k (s) := {t k ≤ τ < t k+1 : s τ = s} = a∈As ν k (s, a) Defining ∆ k = s∈S ν k (s) g * -a∈As t r(s, a) π k (s, a)
, it holds with probability at least 1 -δ 20T 5/4 that:

∆(SCAL, T ) ≤ T g * - T t=1 a∈As t r(s t , a) π kt (s t , a) + r max 5 2 T ln 11T δ = m k=1 s∈S ν k (s)g * - m k=1 s∈S ν k (s) a∈As r(s, a) π k (s, a) + r max 5 2 T ln 11T δ = m k=1 ∆ k + r max 5 2 T ln 11T δ (46)

F.2. Dealing with failing confidence regions

We start by bounding the term m k=1 ∆ k 1 M ∈ M k corresponding to the regret suffered in episodes where the true MDP M is not contained in the original set of plausible MDPs M k (and not the modified set M ‡ k ). We use exactly the same proof as in (Jaksch et al., 2010). k SA . Note that when N k (s, a) = 0 (i.e., there hasn't been any observation), the bound holds trivially with probability 1 both for rewards and transition probabilities. Recall the definitions of B k r (s, a) and B k p (s, a, s )

m k=1 ∆ k 1 M ∈M k ≤ r max m k=1 s ν k (s)1 M ∈M k = r max m k=1 s,a ν k (s, a)1 M ∈M k ≤ r max √ T + r max T t= T 1/4 +1 t1 {∃k≥1:t=t k and M ∈M k } Provided P(M ∈ M k ) ≤ δ
B k r (s, a) = [ r k (s, a) -β sa r,k , r k (s, a) + β sa r,k ] ∩ [0, r max ] and B k p (s, a, s ) = [ p k (s |s, a) -β sas p,k , p k (s |s, a) + β sas p,k ] ∩ [0, 1] Therefore it is clear that P r k (s, a) / ∈ B k r (s, a) ≤ δ 60t 7 k SA and P p k (s |s, a) / ∈ B k p (s, a, s ) ≤ δ 20t 7
k S 2 A By taking a union bound over all state-action pairs (s, a) and all possible values for N k (s, a) = 0, . . . , t k -1 we obtain

P(M ∈ M k ) ≤ s,a t k -1 N k (s,a)=1 δ 60t 7 k SA + s δ 20t 7 k S 2 A ≤ δ 15t 6 k F.3. Episodes whith M ∈ M k
Now we assume that M ∈ M k and we first bound ∆ k . Note that we do not assume that M belongs to the modified set of MDPs M ‡ k . Denote by

g k := 1/2(max{v n+1 -v n } + min{v n+1 -v n }) where v n is the value function returned by SCOPT(0, s, γ k , ε k ) (see Sec. 6). SCOPT recursively applies operator T ‡ c := T η k ,↓ c (see App. E) with a perturbation η k = 1/c
√ t k until the stopping condition is reached. Moreover, the stopping condition is such that when the algorithm stops, the accuracy of the gain g k with respect to g

* c ( M ‡ k ) is ε k = 1/ √ t k (see convergence guarantee 2) of Thm. 18
). Therefore, due to the fact that M ∈ M k and since by assumption there exists an optimal policy π * such that sp h π * (M ) ≤ c we can apply Thm. 11 which implies that

g k Thm. 18 ≥ g * c ( M ‡ k ) - ε k =rmax/ √ t k Thm. 11 ≥ g * c ( M k ) - c • r max c • t k =rmax/t k - r max √ t k M ∈M k ≥ g * - r max t k - r max √ t k ≥ g * - 2r max √ t k implying: ∆ k ≤ s∈S ν k (s) g k - a∈As r(s, a) π k (s, a) + 2r max s∈S ν k (s) √ t k F.4

. Extended Value Iteration

A direct consequence of Thm. 18 is that when the convergence criterion holds at iteration n then:

∀s ∈ S, |v n+1 (s) -v n (s) -g k | ≤ r max √ t k
As is shown in the proof of Thm. 21, operator T η k ,↓ c is feasible at v n for every n ∈ N (Asm. 9 holds) and we can expand

v n+1 as ∀s ∈ S, v n+1 (s) = a∈As r k (s, a) π k (s, a) + s ∈S a∈As p k (s |s, a) π k (s, a)v n (s ) implying: ∀s ∈ S, g k - a∈As r k (s, a) π k (s, a) - s ∈S a∈As p k (s |s, a) π k (s, a)v n (s ) -v n (s) ≤ r max √ t k (52)
Setting ν k := (ν k (s)) s∈S the row vector of visit counts for each state and P k := a∈As p k (s |s, a) π k (s, a) s,s ∈S the "optimistic" transition matrix of π k we obtain (using (52)):

∆ k ≤ s∈S ν k (s) g k - a∈As r(s, a) π k (s, a) + 2r max s∈S ν k (s) √ t k = s∈S ν k (s) g k - a∈As r k (s, a) π k (s, a) + s,a ν k (s) π k (s, a) r k (s, a) -r(s, a) + 2r max s∈S ν k (s) √ t k ≤ ν k ( P k -I)v n + s,a ν k (s) π k (s, a) r k (s, a) -r(s, a) + 3r max s∈S ν k (s) √ t k
Since the rows of P k sum to 1 (i.e., P k e = e), we can replace v n by w k where we set

w k := v n - max s v n (s) + min s v n (s) 2 e
In conclusion,

∆ k ≤ ν k ( P k -I)w k + s,a ν k (s) π k (s, a) r k (s, a) -r(s, a) + 3r max s∈S ν k (s) √ t k (53) By definition of operator T η k ,↓ c , we have that sp {w k } = sp {v n } = sp T η k ,↓ c v n-1 ≤ c and since w k is obtained by "recentering" v around 0 we have that w k ∞ = sp {w k } /2 ≤ c/2.

F.5. Bounding the reward

To guarantee the feasibility of operator T c we had to augment the MDP (see Lem. 20), i.e., allow the rewards r k to be as small as 0 even when r kβ r,k > 0. Nevertheless, the upper-bound of the reward was not modified (only the lower-bound) and so r k ≤ min {r max , r k + β r,k } ≤ r k + min {r max , β r,k }. Therefore: Define the filtration F t = σ(s 1 , a 1 , r 1 , . . . , s t+1 ) and the stochastic process

X t = a∈As t π kt (s t , a) min r max , β sta r,kt -min r max , β stat r,kt
Note that π kt is a random variable that is F

ν k ( P k -I)w k = ν k ( P k -P k )w k + ν k ( P k -P k )w k ν k ( P k -P k )w k +ν k (P k -I)w k
Since we assumed that M ∈ M k the difference P k -P k concentrates. Moreover, the perturbation η k > 0 applied by operator T η k ,↓ c to guarantee convergence (see Lem. 19) is only shrinking (and not expanding) the confidence intervals B k p (s, a, s ) and therefore by construction p k (s |s, a) ∈ B k p (s, a, s ) implying that the difference P k -P k also concentrates. More formally, we have the following bounds The stopping condition of episodes ensures that for all t ≥ 1, N t (s, a) ≤ 2N kt (s, a) where N t (s, a) is the total number of visits in (s, a) before time t, t not included:

ν k ( P k -P k )w k ≤ s,a ν k (s) π k (s, a) • p k (•|s, a) -p k (•|s, a) 1 • w k ∞ ≤ s,a ν k (s) π k (s, a) • min 2, β sa p,k • c 2 and ν k ( P k -P k )w k ≤ s,a ν k (s) π k (s, a) • p k (•|s, a) -p(•|s, a) 1 • w k ∞ ≤ s,a ν k (s) π k (s,
where ( 59) follows from the rate of divergence of an harmonic series and ( 60) is derived by applying Jensen's inequality to the concave function ln(•) in the penultimate inequality (with a normalization factor sa 1 {N T +1 (s,a)≥1} ≤ SA).

In conclusion, for T ≥ SA, with probability at least 1 -3δ 20T All the actions are deterministic when the knight does not own the armour. When the knight has the armour:

• The movement actions result in a normal (correct) transition with probability 0.5, otherwise the current position is kept;

• The CG action fails with probability 0.99, i.e., with probability 0.01 the gold level is increment by 1.

• Actions BK and BA are not modified.

Notice that when the knight is equipped with the armour it cannot be killed by the dragon (i.e., knight and dragon can occupy the same cell). However, due to the weight of the armour, knight's gait is unsteady. At the same time, the armour makes the collection of the goal very challenging (i.e., success probability is 0.01). You can imagine that mining with a metal armour can be very difficult!

The basic reward signal is -1 at each time step. Nevertheless, the knight receives a reward of -10 when he executes CG, BK or BA outside the designed location (i.e., mine and town). Finally, he obtains a reward of 20 when he reaches the princess with the key and -20 when he is killed by the dragon (i.e., knight and dragon are in the same cell and the knight does not have the armour). For the experiments, we have scaled the reward in the range [0, 1].

Finally, when the episode ends (i.e., the knight reaches the princess with the key or he is killed), the knight is reset at town location with no gold or object (g, o = 0) and the dragon position is randomly drawn (d ∼ U({0, 1, 2})).

Properties of the game. The state and action space size are S = 360 and A = 8, while the diameter of the MDP is D ≈ 250. The diameter is due to the following path: start from the town with no gold but the armour and reach the princess with one unit of gold, key and armour. However, the optimal strategy is simply to collect the gold, buy the magic key from the town and rescue the princess. 12 The optimal policy is such that g * ≈ 0.5, sp {h * } ≈ 3.28.

This game is challenging for OFU approaches since the policy suffering the diameter is orthogonal to the optimal one. This is due to the presence of actions that are not relevant to the final objective and simply mess up the navigability of the environment. We think that this characteristic is shared by common real-world applications where the agent can face several choices (actions) and most of them are useless. This property can be interpreted also as a hierarchical structure that has been proved to be at the core of many applications.

More practically, the high diameter induces UCRL to explore remote states that are seen as promising states (in contrast with the real importance). On contrary, SCAL can leverage on the knowledge of "simple" game (i.e., small span) in order to condition the exploration. Notice that the span constraint c can be interpreted as the difficulty of the game. This game becomes difficult only if I want reach extreme states that are nevertheless useless to the final goal (rescue the princess). By giving small c values to the algorithm, we are implicitly saying that the game is simple, do not trust states that are too promising (i.e., generate a high span).

Results. We have tested UCRL and SCAL with different constraints over an horizon T = 4 • 10 8 with Bernstein's bound.

The code is available on GitHub (https://github.com/RonanFR/UCRL). SCAL is run with the reward augmented but no perturbation of the transition matrix (η k = 0). For the terminal condition of SCOPT we set γ k = 0.13 In order to speed up the learning we have set α p = α r = 0.05 (see Eq. 49 and 48). This still guarantees that the confidence intervals at t 0 are still bigger than 1 and r max , respectively. Results are reported in Fig. 12. We can notice that SCAL is able to outperform UCRL by a big margin. It is interesting to notice that in the regret curves it is easy to identify the linear and logarithmic regimes, while the square-root one is almost absent. This is due to the fact that once the algorithms discover that visiting extreme states is not relevant they have almost perfectly learnt the dynamics under the optimal policy. 14 14 The actions executed by the optimal policy are deterministic. This means that by using Bernstein's bound we have the term involving the variance equal to zero and the second term scales linearly with the number of visits.

  ) and p k (s |s, a) of rewards and transitions, we define M k by B k r (s, a) := [ r k (s, a)-β sa r,k , r k (s, a)+β sa r,k ]∩[0, r max ] and B k p (s, a, s ) := [ p k (s |s, a)β sas p,k , p k (s |s, a) + β sas p,k ] ∩ [0, 1].

1.

  Set t k = t and episode counters ν k (s, a) = 0. 2. Compute estimates p k (s |s, a), r k (s, a) and a confidence set M k (UCRL, REGAL.C), resp. M ‡ k (SCAL). 3. Compute an rmax/ √ t k -approximation π k of the solution of Eq. 3 (UCRL), resp. Eq. 5 (REGAL.C), resp. Eq. 15 (SCAL). 4. Sample action at ∼ π k (•|st). 5. While ν k (st, at) ≤ max{1, N k (st, at)} do (a) Execute at, obtain reward rt, and observe next state st+1. (b) Set ν k (st, at) += 1. (c) Sample action at+1 ∼ π k (•|st+1) and set t += 1. 6. Set N k+1 (s, a) = N k (s, a) + ν k (s, a).

Figure 1 .

 1 Figure 1. The general structure of optimistic algorithms for RL.

Figure 2 .

 2 Figure 2. Toy example with deterministic transitions and reward for all actions.

Figure 3 .

 3 Figure 3. Algorithm SCOPT.

Lemma 5 .

 5 Operator T c is feasible at v ∈ R S and s ∈ S if and only if min a∈As {r(s, a) + p(•|s, a) T v} ≤ min s {Lv(s )} + c. (10) Furthermore, let D(c, v) := d ∈ D MR | sp {L d v} ≤ c (11) be the set of randomized decision rules d whose associated operator L d returns a span-constrained value function when applied to v. Then, T c v is globally feasible if and only if D(c, v) = ∅, in which case we have

  Figure 4. (upper) Simple three-state domain. (lower) Cumulative regret incurred by UCRL after T = 2.5 • 10 7 steps as a function of the diameter D ≈ 1/δ (averaged over 20 runs).

Figure 5 .

 5 Figure 5. Results in the three-states domain with δ = 0.005 (top) and δ = 0 (bottom). We report the span of the optimistic bias (left) and the cumulative regret (right) as a function of T . Results are averaged over 20 runs and 95% confidence intervals are shown.

Figure 6 .Figure 7 .Figure 8 .

 678 Figure 6. Example showing that Tc might not always be feasible even when Π * c = ∅.

  20) Bounded-Parameter MDP. When we consider a bounded-parameter MDP M, the only change is in the computation of the minimal and maximal actions. Define Lv(s) = max a∈As, r∈Br(s,a), p∈Bp(s,a) r + p T v Lv(s) = min a∈As, r∈Br(s,a), p∈Bp(s,a) r + p T v

  ) is a consequence of the fact that d ∈ D(c, v) ⇔ sp {L d v} ≤ c. Denote by ŝ ∈ arg max s {Lv(s)} any state achieving minimum value for Lv(s). Inequality (24) follows by noticing that m = Lv(ŝ) ≥ L d v(ŝ) ≥ min{L d v}. In conclusion, for any d ∈ D(c, v) and any s ∈ S, T c v(s) ≥ L d v(s). This immediately implies that whenever T c is globally feasible at v, T c v = max δ∈D(c,v) L δ v and δ + v ∈ arg max δ∈D(c,v) L δ v. Let's now prove the equivalence between the feasibility of T c at v ∈ R S and s ∈ S and condition (10) i.e., min a∈As {r(s, a) + p(•, s, a) T v} ≤ min s {Lv(s)} + c.

Finally,

  T c is globally feasible at v if and only condition (10) holds in every state s ∈ S. Trivially, if T c is globally feasible then sp {T c v} = sp L δ + v v ≤ c and so δ + v ∈ D(c, v) implying that D(c, v) = ∅. If D(c, v) = ∅ then there exists δ ∈ D MR such that sp {L δ v} ≤ c. Assume that condition (10) does not hold in at least one state s ∈ S meaning that min a∈As {r(s, a) + p(•|s, a) T v} > min s {Lv(s)} + c which implies that for any d ∈ D MR , L d v(s) > min s {Lv(s)} + c. This contradicts the fact that

Lemma 14 .

 14 For any vector v ∈ R S and c ≥ 0, Γ c v is the projection of v on the semi-ball V c in span semi-norm i.e., Γ c v = min z∈Vc sp {z -v} . Proof. Let w = Γ c v. If sp {v} ≤ c, then by definition of Γ c , w = Γ c v = v ∈ arg min z∈Vc sp {z -v}. Otherwise, using again the definition of Γ c we have that w ≤ v component-wise. As a result, we have max s {w(s)v(s)} = 0 Moreover, the difference between w and v is maximal in the states s ∈ arg max s v(s) and thus min s {w(s)v(s)} =max s {v(s)} + min s {v(s)} + c, Therefore: sp {w -v} = max{w -v} -min{w -v} = sp {v}c. Furthermore, by reverse triangle inequality 7 , for any vector z such that sp {z} ≤ c we have that sp {z -v} ≥ sp {v}sp {z} ≥ sp {v}c = sp {w -v} , thus proving the lemma.

  26b): we have that min{v} + cu(s) < v(s)u(s) ≤ max{v -s}. To prove the other inequality we start by noticing that min{v} + cu(s) > min{v} + c -min{u}c = min{v} -min{u}. Since moreover min s {v(s)u(s)} ≤ min s v(s)min s {u(s )} = min{v} -min{u}(27)the inequality holds.• Case (26c): by definition v(s) -min{u}c ≤ min{v} + c -min{u}c = min{v} -min{u}. Then:

  (a) The monotonicity of T c is a direct consequence of the monotonicity of both L (Puterman, 1994) and Γ c (property (a) of Lem. 15) and the fact that monotonicity is preserved by composition. (b) T c v = Γ c Lv ≤ Lv by definition of Γ c . If v ≤ Lv then using the fact that Γ c is monotone we have Γ c v ≤ Γ c Lv = T c v and if we assume that sp {v} ≤ c then v = Γ c v and so v ≤ T c v. (c) The linearity of T c is a direct consequence of the linearity of both L (Puterman, 1994) and Γ c (property (e) of Lem. 15) and the fact that linearity is preserved by composition. (d) Using the fact that L (Puterman, 1994) and Γ c (properties (c) and (d) of Lem. 15) are non-expansive both in span semi-norm and ∞ -norm we show the following:

  [a, b] ⊂ R we use the notations min{[a, b]} := a and max{[a, b]} := b. Lemma 19. Let M be a bounded-parameter MDP defined for all s, s ∈ S and all a ∈ A s by r(s, a) ∈ B r (s, a) and p(s |s, a) ∈ B p (s, a, s )

  and we define r η (s, a) and p η (•|s, a) similarly with B r (s, a) and B p (s, a, s ) replaced by B η r (s, a) and B η p (s, a, s ). ∀s ∈ S, |Lv(s) -L η v(s)| = max a∈As r(s, a) + s ∈S p(s |s, a)v(s )max a∈As r η (s, a) + s ∈S p η (s |s, a)v(s ) s |s, a)p η (s |s, a))v(s ) where we used the fact that | max x f (x)max x g(x)| ≤ max x |f (x)g(x)| and B η r (s, a) = B r (s, a) by definition. Since p(•|s, a) and p η (•|s, a) are probability distributions (i.e., sum to 1), for any real λ: s ∈S ( p(s |s, a)p η (s |s, a))v(s ) = s ∈S ( p(s |s, a)p η (s |s, a))(v(s ) + λ) Taking λ = -(max s v(s) + min s v(s))/2 we obtain: ∀s ∈ S, |Lv(s) -L η v(s)| ≤ max a∈As s ∈S | p(s |s, a)p η (s |s, a)| • max s {v(s) + λ} = max a∈As p(•|s, a)p η (•|s, a) 1 • (max s {v(s)} + λ) = max a∈As p(•|s, a)p η (•|s, a) 1 • sp {v} 2 We now need to upper-bound p(•|s, a)p η (•|s, a) 1 . p(•|s, a) and p η (•|s, a) can be computed using the following procedure (Dann and Brunskill, 2015, Appendix A):

  As a consequence, * p i (s i |s, a) = max{B p (s, a, s i )} = max{B η p (s, a, s i )} = p i η (s i |s, a) * ∆ i = ∆ i η Thus for k > i, p k (s k |s, a) = p k η (s k |s, a) and so p(•|s, a) = p η (•|s, a).

  s k |s, a) and so p(•|s, a) = p η (•|s, a).

  p η (j|s, a), p η (j|u, b) ≥0 + min p η (s|s, a), p η (s|u, b)

Lemma 20 .

 20 Let M be a bounded-parameter MDP defined ∀s, s ∈ S and ∀a ∈ A s by: r(s, a) ∈ B r (s, a) and p(s |s, a) ∈ B p (s, a, s ) where S and A s are finite, B r (s, a) and B p (s, a, s ) are closed intervals of [0, r max ] and [0, 1] respectively. Consider the "augmented" bounded-parameter MDP M ↓ defined ∀s, s ∈ S and ∀a ∈ A s by:B ↓ r (s, a) = [r min , max{B r (s, a)}] and B ↓ p (s, a, s ) = B p (s, a, s ) Let L d ( L) and L ↓ d ( L ↓) be the (optimal) Bellman operators of M and M ↓ , respectively. Then1. ∀v ∈ R S , Lv = L ↓ v and T c v = T ↓ c v. 2. ∀v ∈ R S s.t. sp {v} ≤ c, D ↓ (c, v) = {d ∈ D MR ( M ↓ ) | sp{ L ↓ d v} ≤ c} = ∅Proof. For all states s ∈ S and actions a ∈ A s we use the following notations r(s, a):= max{B r (s, a)} and p(•|s, a):= arg max p(s )∈Bp(s,a,s ) s ∈S p(s )v(s ) (41) r(s, a):= min{B r (s, a)} and p(•|s, a):= arg min p(s )∈Bp(s,a,s ) s ∈S p(s )v(s ) (42) and we define r ↓ (s, a), r ↓ (s, a) and p ↓ (•|s, a), p ↓ (s, a) similarly with B r (s, a) and B p (s, a, s ) replaced by B ↓ r (s, a) and B ↓ p (s, a, s ).

15t 6 k

 6 for all k ≥ 1 (see Thm. 22 below), we conclude as in Jaksch et al. (2010) that with probability at least 1 -δ 20T 5|p(s |s, a)p k (s |s, a)| ≥ β sas p

  s) π k (s, a) r k (s, a)r(s, a) ≤ s,a ν k (s) π k (s, a) min r max , β sa r,k + s,a ν k (s) π k (s, a) r k (s, a)r(s, a) Moreover, since we assumed that M ∈ M k the bound r k ≤ min {r max , r + β r,k } ≤ r + min {r max , β r,k } holds and thus s,a ν k (s) π k (s, a) r k (s, a)r(s, a) ≤ 2 s,a ν k (s) π k (s, a) min r max , β sa r,k Note that when summing over all episodes k ≥ 1, we can rewrite m k=1 s,a ν k (s) π k (s, a) min r max , β sa r,k = T t=1 a∈As t π kt (s t , a) min r max , β sta r,kt



  |s t , a) π k (s t , a)e st+1In conclusion, with probability at least 1 -δ 20T 5/4 :m k=1 ν k (P k -I)w k 1 M ∈M k ≤ c .2 of (Jaksch et al., 2010) it is proved that given the stopping condition used for episodes, when T ≥ SA we can bound m as m ≤ SA log 2 8T SA .F.7. Summing over episodes with M ∈ M kWe now gather inequalities (54), (55) and (56) into inequality (53) summed over all episodes k for which M ∈ M k which yields (after taking a union bound) that with probability at least 1 -3δ 20T 5/4 (for T ≥ SA) st,at)=(s,a)} max {1, N kt (s, a) -1}

N1

  t (s, a) = # {1 ≤ τ < t : (s τ , a τ ) = (s, a)} Therefore, similarly to what is done in (Ouyang et al., 2017, Proof of Lemma 5) m k=1 s,aν k (s, a) max {1, N k (s, a) -{N T +1 (s,a)≥1} + 1 {N T +1 (s,a)≥2} + N T +1 (s,a)-1 j=2 1 j -1 ≤1+ln(N T +1 (s,a))1 {N T +1 (s,a)≥1} (58) ≤ 6SA + 2 s,a ln (N T +1 (s, a)) 1 {N T +1 (s,a)≥1} (59) ≤ 6SA + 2SA ln s,a N T +1 (s, a)1 {N T +1 (s,a)≥1}s,a 1 {N T +1 (s,a)≥1}≤ 6SA + 2SA ln(T )

Figure 12 .

 12 Figure 12. Algorithm behaviour in the knight quest game. Figures show the span of the optimistic bias (right) and the cumulative regret (left) as a function of T . Results are averaged over 15 runs and 95% confidence intervals of the mean are shown for the regret.

  Proof of Lem. 8 i.e., existence and uniqueness of the optimality equation for T c , convergence of SCOPT and gain dominance (see App. D.3) -Proof of Thm. 10 i.e., stopping condition for SCOPT and approximation guarantees (see App. D.4). -A formal definition of perturbed extended MDP (see Lem. 19) and span contraction property for L in the perturbed MDP. -A formal definition of (reward) augmented extended MDP (see Lem. 20), equality of the operator in the original and augmented extend MDPs, and non-emptiness of D(c, v) in the augmented MDP when sp {v} ≤ c. -Proof of Thm. 11. We prove existence and uniqueness of the optimality equation for T c , convergence of SCOPT

	• App. E

• App. D -Proof of Lem. 5 i.e., when operator T c is feasible (see App. D.1).

-Proof of Lem. 7 i.e., that under Asm. 6, T c is a span contraction (see App. D.2).

and gain dominance for the perturbed and augmented extended MDP (i.e., M ‡ K ) (see Thm. 21). • App F -Proof of Thm. 12 i.e., the regret of SCOPT.

  t-1 -measurable. Moreover, (X t , F t ) t≥0 is an MDS since |X t | ≤ r max and E[X t |F t-1 ] = 0. Using Azuma's inequality:We denote by P k := ( a p(s |s, a) π k (s, a)) s,s ∈S the true transition matrix and P k ( a p k (s |s, a) π k (s, a)) s,s ∈S the estimated transition matrix. We do the following decomposition

	or in other words, with probability at least 1 -δ 20T 5/4 :
				m k=1 s,a	ν k (s) π k (s, a) min r max , β sa r,k ≤	m k=1 s,a	r,k ≤β sa ν k (s, a) min r max , β sa r,k	+r max	5 2	T ln	11T δ
	In conclusion, with probability at least 1 -δ 20T 5/4 :
				s,a	ν k (s) π k (s, a) r k (s, a) -r(s, a) ≤ 2	m k=1 s,a	ν k (s, a)β sa r,k + 2r max	5 2	T ln	11T δ	(54)
	F.6. Bounding the transition matrix
	P	 	T t=1	min r max , β stat r,kt	≤	T t=1 a∈As t	π kt (s t , a) min r max , β sta r,kt -r max	5 2	T ln	11T δ	  ≤	δ 11T	5/4	<	δ 20T 5/4

  = s ∈S β sas p,k . The term min 2, β sa p,k appears because p k (•|s, a), p k (•|s, a) and p(•|s, a) are probability distributions and any two probability distributions cannot be more than 2-far in 1 norm.Similarly to what we did for the reward, when summing over all episodes k ≥ 1, we can rewrite Define the filtration F t = σ(s 1 , a 1 , r 1 , . . . , s t+1 ) and the stochastic process Note that π kt is a random variable that isF t-1 -measurable. Moreover, (X t , F t ) t≥0 is an MDS since |X t | ≤ 2 and E[X t |F t-1 ] = 0. Using Azuma's inequality:or in other words, with probability at least 1 -δ 20T 5/4 : k (s) π k (s, a) min 2, β sa p,k ≤We now show that the remaining term ν k (P k -I)w k is an MDS. Let's denote by e i the unit row vector with i-th coordinate 1 and all other coordinates 0.ν k (P k -I)w k = X t + w k (s t k+1 )w k (s t k ) ≤sp{w k }≤c Since w k ∞ ≤ c 2 we have |X t | ≤ a∈As t p(•|s t , a) π k (s t , a) 1 + e st+1 1 • c 2 ≤ c.If we define the filtration F t = σ (s 1 , a 1 , r 1 , . . . , s t+1 ) then E[X t |F t-1 ] = 0 since π kt is F t-1 -measurable. Using Azuma's inequality:

				m k=1 s,a										m k=1 s,a	p,k ≤β sa ν k (s, a) min 2, β sa p,k	+2	5 2	T ln	11T δ
	In conclusion, with probability at least 1 -δ 20T 5/4 :
					m k=1	ν k ( P k -P k )w k ≤ c	m k=1 s,a	ν k (s, a)β sa p,k + 2c	5 2	T ln	11T δ	(55)
								t k+1 -1						
								t=t k		 a∈As t	p(•|s t , a) π k (s t , a) -e st	 w k
								t k+1 -1							t k+1 -1
					=	t=t k		 a∈As t	p(•|s t , a) π k (s t , a) -e st+1	 w k	+	t=t k	e st+1 -e st w k
														:=Xt
								t k+1 -1
					=
								t=t k
															a) • min 2, β sa p,k •	c 2
	where β sa p,k m												T
							ν k (s) π k (s, a) min 2, β sa p,k =	π kt (s t , a) min 2, β sta p,kt
				k=1 s,a											t=1 a∈As t
								X t =	a∈As t	π kt (s t , a) min 2, β sta p,kt -min 2, β stat p,kt
	P	 	T t=1	min 2, β stat p,kt	≤	T t=1 a∈As t	π kt (s t , a) min 2, β sta p,kt -2	5 2	T ln	11T δ	  ≤	δ 11T	5/4	<	δ 20T 5/4

ν

  BK ∧ (row t , col t ) = T ∧ g t = 1 =⇒ o t+1 = 1 if o t = 0 3 otherwise a t = BA ∧ (row t , col t ) = T ∧ g t = 1 =⇒ o t+1 = 2 if o t = 0 3 otherwise

	i.e.,
					a t =
														5/4
	m k=1	∆ k 1 M ∈M k ≤		√	28 +	√	14 c (Γ -1)SAT ln	2SAT δ	+	98 3	cS 2 A ln	2SAT δ	(3 + ln(T ))
			+ 2	√	28 +	√	14 r max SAT ln	2SAT δ	+	196 3	r max SA ln	2SAT δ	(3 + ln(T ))	(61)
			+ (3c + 2r max )	5 2	T ln	11T δ	+ cSA log 2	T SA	+ 3(	√	2 + 1)r max	√	SAT
	F.8. Completing the regret bound
	From (46) we have that with probability at least 1 -δ 20T 5/4
			∆(SCAL, T ) ≤	m k=1	∆ k 1 M ∈M k +	m k=1	∆ k 1 M ∈M k + r max	5 2	T ln	11T δ	(62)
	By gathering (47) and (61) into (62) (using a union bound) we have that with probability at least 1 -δ 20T 5/4 -3δ 20T 5/4 -δ 20T 4/5 = 1 -δ 4T 5/4 (for T ≥ SA)
	∆(SCAL, T ) ≤	√	28 +	√	14 c (Γ -1)SAT ln	2SAT δ	+	98 3	cS 2 A ln	2SAT δ	(3 + ln(T ))
			+ 2	√	28 +	√	14 r max SAT ln	2SAT δ	+	196 3	r max SA ln	2SAT δ	(3 + ln(T ))	(63)
			+ 3(c + r max )	5 2	T ln	11T δ	+ cSA log 2	8T SA	+ 3(	√	2 + 1)r max	√	SAT + r max	√	T

The proof of the lower bound relies on the construction of an MDP whose diameter actually coincides with the bias span (up to a multiplicative numerical constant), thus leaving the open question whether the "actual" lower bound depends on D or the bias span. See (Osband and Roy,

2016) for a more thorough discussion.

When there are several policies δ + v achieving Tcv(s) = L δ + v v(s) in state s ∈ S, Gc chooses an arbitrary decision rule.

In the undiscounted setting, if the MDP is unichain, L is a J-stage contraction with S ≥ J ≥ 1.

For any closed interval [a, b] ⊂ R, max{[a, b]} := b and min{[a, b]} := a

Since qn takes the value 0 in s, there are only three possible scenarios: 1) qn is non-negative (with 0 included) and then max{qn} = sp {qn}, 2) qn is non-positive (with 0 included) and then max{|qn|} = 0 -min{qn} = sp {qn}, 3) qn has both positive and negative values and then both its maximal and minimal value are smaller than the span.

Notice that there are deterministic strategies to the princess's location avoiding the dragon.

Note that in EVI and SCOPT the optimistic reward is truncated at rmax, i.e., max r { r(s, a)} = min {rmax, r(s, a) + max{B r (s, a)}}.

Acknowledgements

This research was supported in part by French Ministry of Higher Education and Research, Nord-Pas-de-Calais Regional Council and French National Research Agency (ANR) under project ExTra-Learn (n.ANR-14-CE24-0010-01). Furthermore, this work was supported in part by the Austrian Science Fund (FWF): I 3437-N33 in the framework of the CHIST-ERA ERA-NET (DELTA project).

We recall the upper confidence bounds used for the reward function and the transition kernel in the algorithm:

where for the theoretical analysis we set 9 α r = α p = 1 and the unbiased estimates of the variances are

Note that although the definition of the sample variance of the reward r involves a sum, it can be computed dynamically using the following well-known recurrence relation:

where n denotes the number of samples (N k (s, a) in our case), r n+1 is the (n+1)-th sample observed, and

are respectively the empirical average and sample variance obtained with the first n samples. The previous formula is subject to numerical unstability because the second term becomes negligible compared to the first term as n grows. A better approach for computing the variance is to exploit the following iterative scheme known as Welford's method (Knuth, 1997, p. 232):

for n ≥ 2, with r 1 = r 1 and S 1 = 0. This approach is less prone to numerical instability and its accuracy is comparable to the one of two-pass methods.

Theorem 22. For any k ≥ 1, the probability that the true MDP M is not contained in the set of plausible MDPs M k at time t k (as given by the confidence intervals in (48) and ( 49)

Proof. First note the following equality

9 αr and αp are coefficients used to shrink the confidence intervals in the implementation in order to speed up the learning in practice. However, to insure that M ∈ M k holds with high probability they should both be set equal to 1.

10 Also known as "Empirical Bernstein" concentration inequality.

The first and fourth terms appearing in the bound of Eq. 57 can be expanded as follows

and similarly using the fact that

•10 5 For T ≤ SA the regret can be bounded with probability 1 as

Finally, we take a union bound over all possible values of T and use the fact that

In conclusion, there exists a numerical constant α such that for any MDP M , with probability at least 1δ our algorithm SCAL has a regret bounded by

The second term of the upper-bound in Eq. 64 is negligible when T is big enough and so

G. Additional Experiments

In this section we provide clearer figures for the three-states domain and we present a more challenging domain: Knight Quest.

G.1. Three-States MDP

We simply restate the results presented in the main paper on bigger figures (see Fig. 9 and 10).

G.2. Knight Quest

The second environment takes inspiration from classical arcade games. The goal is to rescue a princess in the shortest time without being killed by the dragon. To achieve this task, the knight needs to collect gold, buy the magic key and reach the princess location. A representation of the environment is provided in Fig. 11.

The elements of the game are: I) the knight; II) the princess; III) a dragon patrolling the princess; IV) a gold mine and V) a town.

Town, Princess and Gold Mine. These elements are special states of the environment. The town (T) is the place where the knight can buy objects and where it is reset when he rescues the princess or he is killed by the dragon. The princess (P) is the terminal state, while the gold mine (G) is the place where the knight can collect gold.

Dragon. The dragon (D) is the enemy and it is randomly moving around the princess's location. Let's denote with Knight. The knight is the only player of the game. He moves in the environment using the four cardinal actions (i.e.,, right, down, left and up) plus an action to keep the current position (stay). We refer to these 5 actions as movement actions. Additionally, the knight can collect the gold (action CG), buy a key (action BK) or buy an armour (action BA).

State representation, action effect and reward. The state s t of the game is represented by the following elements:

• Knight position: coordinates of the grid (row, col), row, col ∈ 0, 1, 2, 3;

• Gold level: the amount of gold own by the knight, g ∈ {0, 1};

• Dragon position: d ∈ {0, 1, 2};

• Object identifier: the object(s) own by the knight, o = {0, 1, 2, 3} where 0 := nothing, 1 := key, 2 := armour and 3 := key and armour.

Now we can finally explain the effects of the actions, i.e., how states s t+1 is generated. The movement actions have the trivial effect of changing the knight position. The action CG changes the state only when the knight is at the mine. In this case the level of gold is incremented by one, formally g t+1 = min{1, g t + 1}. Actions BK and BA alter the state only when are executed in the town with gold-level equal to 1,