Adaptive Sampling for Best Policy Identification in Markov Decision Processes
Aymen Al Marjani, Alexandre Proutiere
INTRODUCTION
Reinforcement Learning (RL) algorithms are designed to interact with an unknown stochastic dynamical system, and through this interaction, to identify, as fast as possible, an optimal control policy. The efficiency of these algorithms is usually measured through their sample complexity, defined as the number of samples (the number of times the algorithm interacts with the system) required to identify an optimal policy with some prescribed levels of accuracy and certainty. This paper, as most related work in this field, focuses on systems and control objectives that are modelled as a standard discounted Markov Decision Processes (MDPs) with finite state and action spaces. Various interaction models have been investigated, but sample complexity analyses have been mainly conducted under the so-called generative model, where in each step, the algorithm may sample a transition and a reward from any given (state, action) pair. We also restrict our attention to this model.
We investigate the design of RL algorithms with minimal sample complexity. This problem has attracted a lot of attention over the last two decades. Most studies follow a minimax approach. For example, it is known Gheshlaghi Azar et al., (2013) that for the worst possible MDP, identifying an -optimal policy with probability requires at least samples, where and are the number of states and actions, respectively, and is the discount factor. Note that to obtain this sample complexity lower bound, one needs to design a very specific worst-case MDP (in particular, its transition probabilities must depend on and ). Since the aforementioned minimax lower bound appeared, most researchers have been aiming at devising algorithms matching this bound. In contrast, we are interested in analyzing the minimal problem-specific sample complexity. Specifically, we seek to understand the dependence of the sample complexity on the MDP that has to be learnt. Problem-specific performance metrics are much more informative than their minimax counterparts, because they encode and express the inherent hardness of the MDP. Minimax metrics just represent the hardness of the worst MDP. In particular, establishing that the sample complexity of an algorithm does not exceed the minimax lower bound just reveals that the algorithm performs well for this worst MDP. However, it does not indicate whether the algorithm adapts to the hardness of the MDP, i.e., whether the optimal policy of a very easy MDP would be learnt very quickly. As a matter of fact, an algorithm with sample complexity matching the minimax lower bound just consists in sampling (state, action) pairs uniformly at random, and is not adapting to the MDP.
The problem-specific sample complexity of identifying the best arm in stochastic Multi-Armed Bandit (MAB) problems is now well understood Garivier and Kaufmann, (2016). In this work, we explore whether the methodology used in Garivier and Kaufmann, (2016) for MAB problems can be extended to RL problems. This methodology consists in first deriving a problem-specific sample complexity lower bound. The latter should reveal the sample allocation leading to the minimal sample complexity. One may then devise a track-and-stop algorithm that (i) tracks the optimal sample allocation identified in the lower bound, and (ii) stops when the information gathered is judged sufficient to get the desired PAC guarantees. As it turns out, extending this methodology to RL problems raises fundamental issues, mainly due to the difficulty of computing the sample allocation leading to the minimal problem-specific sample complexity. We propose a set of tools to solve these issues. Our contributions are as follows:
1. We derive a problem-specific sample complexity lower bound for identifying an optimal policy in a given MDP . This bound is expressed as , where the characteristic time encodes the hardness of the MDP . is the value of a complex non-convex optimization problem. This complexity makes the design of a track-and-stop algorithm similar to that proposed in Garivier and Kaufmann, (2016) and achieving the sample complexity lower bound elusive. To circumvent this difficulty, we derive an explicit upper bound of . The advantage of is two-fold: (i) remains problem-specific, and explicitly depends on functionals of the MDP characterizing its hardness. (ii) corresponds to an explicit and simple sample allocation. This allows us to devise a procedure that tracks this allocation.
2. Based on our upper bound analysis, we devise KLB-TS (KL Ball Track-and-Stop), an algorithm whose sample complexity is at most . Our algorithm relies on a procedure tracking the sample allocation leading to , and a stopping rule that we refer to as KL Ball Stopping rule because of its analogy to the way we derive the upper bound .
3. We highlight the differences of our design approach compared to that leading to BESPOKE Zanette et al., (2019), a recently proposed adaptive algorithm. As it turns out, the adaptive part of BESPOKE is very limited in practice (see related work and Appendix H for details), and KLB-TS exhibits a much better performance numerically.
RELATED WORK
Most work on the best policy identification in MDPs with a generative model adopt a minimax approach Kearns and Singh, (1999), Kakade, (2003), even2006action, Gheshlaghi Azar et al., (2013), NIPS2018_7765, pmlr-v125-agarwal20b, Li et al., (2020). In the most recent of these papers Li et al., (2020), the authors propose an algorithm whose sample complexity achieves the minimax lower bound of Gheshlaghi Azar et al., (2013) for a wide range of values of , namely for . Refer to the appendix for a detailed account on the minimax framework.
PRELIMINARIES AND NOTATION
We investigate the optimal control of dynamical systems modelled as an infinite time-horizon MDP with finite state space and finite action spaces for any . Let . The MDP is defined by its kernels: , where captures the system dynamics and the random collected rewards. Specifically, denotes the probability of the system to be in state after taking the action in state . Let . or simply is the density of the distribution of the reward collected in state when action is selected, w.r.t. some positive measure with support included in $r_{\phi}(s,a)sar_{\phi}(s,a)=\int_{0}^{1}Rq_{\phi}(R|s,a)\lambda(dR)$.
Assumption 1. To simplify notation and the analysis, we assume that admits a unique optimal control policy denoted by . This means that .
2 Best-policy identification
Sampling rule. In round , the algorithm selects a (state, action) pair to explore, depending on past observations. is -measurable. observes the next state denoted by and a random reward . Note that any admissible (state, action) pair may be selected (we consider a generative model).
Stopping and decision rules. After gathering enough information, may decide to stop sampling and to return an estimated best policy. The algorithm stops after collecting samples, and is a stopping time w.r.t. the filtration . The estimated best policy is then -measurable. is referred to as the sample complexity of .
3 Additional notation
PROBLEM-SPECIFIC SAMPLE COMPLEXITY LOWER BOUND
To derive a problem-specific sample complexity lower bound, we use classical change-of-measure arguments as those leveraged towards regret and sample complexity lower bounds Lai and Robbins, (1985); Garivier and Kaufmann, (2016) in bandit problems. These arguments lead to constraints on the expected numbers of times each (state, action) pair should be explored under any -PAC algorithm.
Let be an alternative MDP and consider a -PAC algorithm. We denote by the set of observations made under the algorithm until it stops. Further consider the log-likelihood ratio of under the MDPs and . Using similar techniques as those used in the proof of Wald’s first lemma, we get (all proofs are detailed in the appendix):
From the above lemma, and using the same arguments as in Kaufmann et al., (2016), one may derive the following data processing inequality, valid for any -measurable event :
Combining the above constraints with the fact that , we obtain the following sample complexity lower bound.
The sample complexity of any -PAC algorithm satisfies: for any ,
In the above proposition, can be interpreted as the expected proportion of times the pair is explored under the algorithm. Taking the supremum over then corresponds to selecting an optimal sampling rule. In the following, is referred to as the allocation vector.
We now provide useful properties of the optimization problem (3). Additional properties of the problem are presented in Appendix B.
(i) The set of alternative MDPs. To simplify the notation we use instead of . Our first result concerns the set of alternative MDPs:
The above lemma states that an alternative MDP is such that , the optimal policy of , can be improved under locally at some state , by selecting in some previously sub-optimal action , instead of . Using this lemma, we can simplify the expression of the characteristic time appearing in Proposition 1. Indeed, (3) is equivalent to:
Next, we rewrite the problem in an analytic manner. To this aim, we parametrize by its transition probabilities and rewards and introduce the following notations: for all , and . Further define .
(ii) Non-convexity of the problem (3). The characteristic time , as well as the optimal sampling rule are characterized by the solution of (3) or that of (4). If we think of a track-and-stop algorithm to identify the best policy (as proposed in Garivier and Kaufmann, (2016) for the simple MAB problem), one would need to repeatedly solve these optimization problems. It is then important to be able to do it in a computationally efficient way. Unfortunately, these problems are probably very hard to solve. This is well illustrated by the fact that the following sub-problem is not convex:
Consider belonging to the class of MDPs specified in Fig. 1, each defined by the vector (all other parameters values are fixed as in the figure):
We use the analytic version (6) of the optimization problem that defines the sample complexity lower bound to derive a simple (but still problem-specific) upper bound of the characteristic time . The upper bound actually corresponds to a sampling rule that is explicit, i.e., we do not need to solve any optimization problem to get it. Using this upper bound and the corresponding sampling rule, we will be able to devise a simple track-and-stop algorithm with provable performance guarantees. In addition, the upper bound has the right dependence in the sub-optimality gaps, and we also prove that it remains smaller than existing minimax sample complexity lower bounds.
The proof of the theorem relies on writing each of the difference terms , , and involved in the constraint (5) as a proportion of the sub-optimality gap . Then, using classical f-divergences inequalities, as well as a variance inequality from Gheshlaghi Azar et al., (2013), we relate each difference term to the KL divergences appearing in the objective function of the problem (6). With this perspective in mind, the terms and can be interpreted as the sample complexity costs to learn the reward of (state,action) pair and the corresponding transition probabilities, respectively. Similarly, the terms and are interpreted as the sample complexity costs to estimate the future rewards collected from the next state and the transitions from the next state.
Let and . Then the solution of the problem (8) is given by the unique allocation vector defined by ( means proportional to): for all ,
This allocation yields the following upper bound:
In the previous corollary, is the optimal proportion of times should be sampled, and hence for , corresponds to the hardness of learning that is sub-optimal. It scales as the inverse of the square of the gap and is proportional to the variance of future rewards after taking .
We have:
ALGORITHM
In this section, we present KLB-TS (KL-Ball Track-and-Stop), an algorithm that selects the successive (state, action) pairs so as to track the allocation , the problem-specific allocation (14) that leads to the upper bound (15). The algorithm is a track-and-stop, whose stopping rule does not follow a generic Generalized Likelihood Ratio Test as that used Garivier and Kaufmann, (2016) for MAB problems (refer to Subsection 5.2 for detail).
The algorithm takes as input the confidence parameter and any black-box planner MDP-SOLVER. The latter takes as input an MDP , and returns an optimal policy . For practical implementations, we use the Policy Iteration algorithm.
KLB-TS starts exploring each (state, action) pair once, to construct an initial estimate of the true MDP . The algorithm maintains, after collected observations, an estimate of the true MDP. Based on this estimate, KLB-TS computes an estimate of the allocation , and selects the next (state, action) pair to track it. After each observation, the estimated MDP is updated. Finally, the algorithm checks if a stopping condition is satisfied, in which case the algorithm stops and returns the empirical optimal policy . The stopping condition is referred to as the KL-Ball stopping rule since it is inspired by the derivation of the upper bound of . There, the various terms involved in the exploration constraints are upper bounded by KL divergences, i.e., are in a KL ball.
The pseudo-code of KLB-TS is presented in Algorithm 12. Its sampling and stopping rule are described in detail in the next two sub-sections.
To build an algorithm with sample complexity matching the upper-bound of Corollary 15, the sampling proportions of (state,action) pairs should be as close as possible to the near-optimal weights defined in (14). To this aim, we simply use the C-tracking rule defined in Garivier and Kaufmann, (2016), which we recall below.
Define as the projection of onto Further define . Then the (state, action) pair to be sampled in round is defined as:
with ties broken arbitrarily. The projection onto forces a minimal amount of exploration so that no pair is left under-explored because of bad initial estimates. The same analysis of the sampling rule given in Garivier and Kaufmann, (2016) holds in the MDP case and guarantees that:
2 Stopping rule
(17) suggests that to design a PAC stopping condition, it is sufficient to check that the event
or equivalentlyHence the name KL-Ball stopping rule.:
We finally define , , , and . The KL-Ball stopping condition, which guarantees that the event above holds with probability , is:
SAMPLE COMPLEXITY ANALYSIS
Our main results take the form of asymptotic (when goes to 0) upper bounds on the sample complexity of KLB-TS. These bounds are proved as follows. First, the use of the C-tracking rule makes it possible to establish the convergence of the vector (the (state, action) pair visit frequencies) to the nearly-optimal allocation vector , as well as the convergence of the empirical MDP to the true MDP . Then, plugging these convergence results in the definition of the stopping rule (19), and combining the obtained results with the asymptotic shape of the threshold function , we obtain (refer to Appendix G for a detailed description of these arguments):
Finally, we show that the condition in the ’’ above holds as soon as (see Lemma 11). The above arguments lead to an upper bound of the sample complexity of KLB-TS, valid almost surely (Proposition 2) and in expectation (Theorem 3).
The proof of the theorem above is similar to that of Theorem 14 in Garivier and Kaufmann, (2016) with a few notable differences. First, we defined a distance on MDPs through the -norm of their reward and transition kernels. Then, we adapted Lemma 19 from Garivier and Kaufmann, (2016), which gives a concentration inequality of the empirical average-rewards in the MAB setting, to include the concentration of transition probabilities of the empirical MDP.
EXPERIMENTS
In this section, we run numerical experiments to compare the performances of KLB-TS and BESPOKE (these are so far the two algorithms with problem-specific sample complexity guarantees). We refer the reader to Appendix H for a detailed description of the differences between KLB-TS and BESPOKE, as well as a comparison of their theoretical guarantees. To compare the two algorithms, we generated two MDPs randomly: a first small MDP with two states and two actions, and a second larger and more realistic MDP with five states and ten actions per state. We used BESPOKE with an accuracy parameter (note that is revealed to BESPOKE). For each value of the confidence level , we run 10 simulations for the first MDP under both algorithms. To save computation time in the case of the second MDP, we run 5 simulations for each and only compare KLB-TS’s sample complexity with BESPOKE’s initial number of samples which, as noted in Appendix H, contributed for more than 99% of its sample complexity.
Figure 2 shows the mean sample complexity along with its 2-standard-deviations interval (which seems very small due to the use of a log-scale). The red curve (referred to as ’asymptotic bound’) shows the upper bound guaranteed by Theorem 3. Note that KLB-TS sample complexity is greater than for moderate values of and only matches it for . For both MDPs, KLB-TS clearly outperforms BESPOKE.
CONCLUSION
In this work, we have investigated the design of RL algorithms with minimal problem-specific sample complexity. To this aim, we first derived the information-theoretical sample complexity limit (a lower bound on the sample complexity satisfied by any algorithm) and the corresponding optimal sample allocation. Our hope was that, as for the MAB problem, this allocation would be easy to compute and could then lead to a simple and optimal track-and-stop algorithm. Unfortunately, for RL problems, it turns out that the optimal allocation solves an involved non-convex program. Approaching the fundamental sample complexity limit seems possible only if one could solve this program. To circumvent this issue, we derived a tight upper bound of the characteristic time. Remarkably, this bound corresponds to a sample allocation that is explicit, and hence can be easily plugged in into a track-and-stop algorithm. Based on this upper bound, we proposed KLB-TS, an algorithm whose sample complexity matches this upper bound.
This work opens up interesting research directions. First, the computational complexity of the sample complexity lower bound strongly suggests the existence of a fundamental trade-off between sample and computational complexities. Investigating this trade-off is intriguing. Then, we restricted our attention to the generative model, where one can sample any (state, action) pair at any step. In most practical cases however, one needs to learn an optimal policy by observing a single trajectory of the system. Hence, the numbers of times one observes the various (state, action) pairs are correlated, inducing some additional constraints in the optimization problem leading to the sample complexity lower bound. It is worth studying the impact of these navigation constraints on the sample complexity. Finally, we plan to extend our results to the framework of RL with function approximation.
Appendix A Related work: The minimax approach
Appendix B Additional Proprerties of the lower bound program
Most alternative MDPs. We refer to an MDP We use to denote the closure of a set . solving the problem (7) as most alternative, since for a given allocation , the sample complexity lower bound is determined by the number of samples needed to distinguish from .
This means that to design a most alternative MDP, one should change the rewards and transitions of optimal (state, action) pairs and only one sub-optimal pair and those changes should be just enough to fill sub-optimality gap . The next lemma formalizes these findings.
Denote by the set of optimal (state,action) pairs in the MDP and let solve (7). Then: (i) For all , or ; (ii) .
First we recall the following facts which we will make use of.
Fact 1. is Liptschitz w.r.t rewards and transitions (by simple bounds on Bellman operator):
Fact 2. If we change only the kernels of some sub-optimal (state, action) pair and the action doesn’t become strictly optimal , then the value function remains unchanged .
This is because there exists such that (where we recall that denotes the probability that selects in state ) which implies:
Fact 3: We can restrict our attention to allocation vectors with zero-null entries: .
In fact, any allocation vector such that is suboptimal. Indeed, consider obtained from by changing the kernels in so that they become equal to the kernels in , while keeping everything else unchanged. Then by definition of : . Furthermore one can easily show that which implies that .
By contradiction: Suppose there exists such that: and and . Combined together, the latter two conditions imply that:
We will use the following operator (-transform) where we move the rewards and transitions of at in the direction of by : where
Note that the objective function of the infimum problem takes a smaller value at than at :
where the first inequality stems from the convexity of KL-function and the second from the property . We will prove that there exists such that is the limit of a sequence of elements in , which clearly contradicts the optimality of (see equation 20).
Consider an optimal action at state in , ie such . Since (21), then for , we have: and . By continuity of w.r.t the rewards and transitions (Fact 1), there exists small enough such that:
This implies, by Fact 2 on and , that: . Since, we only changed kernels of at to obtain , then this also implies that for all :
Proof of (ii): 𝒪(ϕ)⊂𝒪(ψ)𝒪italic-ϕ𝒪𝜓\mathcal{O}(\phi)\subset\mathcal{O}(\psi)
We proceed in the same way, i.e., we suppose that there exists . Only this time, we consider where the product sign stands for composition of operators. It’s straightforward to show, using continuity of w.r.t rewards and transitions, that there exists such that is still not optimal: . Hence , which contradicts the optimality of . ∎
Let be a stopping time w.r.t. the filtration . The observations made up to the beginning of round are . Let denote the distribution of the first state. We have:
The log-likelihood ratio of the observations up to the end of round under and is then:
Next we study for a given pair . Introduce the following random variables: and denote the next state and the collected reward after the -th time has been visited. We can re-write as:
Summing over all pairs completes the proof. ∎
Appendix D Main properties of the problem (3)
To simplify the notation, we denote . First part: By contradiction: Suppose there exists such that . Since then the inequality is valid for all pairs:
Let be an optimal policy under . Then:
Using the Bellman operator of the policy under , we rewrite the inequalities above:
By monotonicity of Bellman operator, this implies that: \forall n\geq 1,\ \bigg{(}\mathcal{B}_{\psi}^{\pi_{\psi}^{\star}}\bigg{)}^{n}\ V_{\psi}^{\pi}\leq V_{\psi}^{\pi}. Hence:
i.e., the policy is optimal under . This is a contradiction.
Second part: By contradiction: Let and suppose there exists such that is optimal under . Define the modified policy as:
Then the fact that translates to:
where the equality comes from the assumption that is an optimal policy in . Therefore, by monotonicity of Bellman operator, we have:
Appendix E Upper bound U(ϕ)𝑈italic-ϕU(\phi) and the near-optimal sampling allocation ω¯¯𝜔\overline{\omega}
We will need the following technical lemma which relates the change in the future discounted rewards between and due to different transitions to the Kullback-Leibler divergence of the transition kernels as well as the variance and maximum-deviation of the next-state value.
Using the notations of Sections 4.1 and 4.2, we have:
where we have used and is the Hellinger distance between two probability distributions. Therefore:
We conclude the proof using Pinsker’s inequality along with the inequality (see Reiss, (1989)). ∎
E.2 Proof of Theorem 1
We fix and derive a lower bound of . To do so, we rewrite the condition (5) by expanding the expression of as follows:
We then write each of the four terms on the left-hand side as a ”fraction” of :
We use Pinsker’s inequality and Lemma 4 to lower bound each term.
term. By Pinsker’s inequality:
term. By Lemma 4, we have:
which, following the same reasoning as the first term, implies:
term (first bound). We have:
where . Hence:
term (second bound): We will now derive a second bound for the 4th term. Using Lemma 5, we get:
where . This means one of the three terms on the right-hand side is greater than , which implies:
Putting the individual lower bounds together: Summing up all inequalities from (24), (25), (26), (29) and (28), we deduce:
Notice that if verifies the inequalities above, and , then the vector whose entries are \displaystyle{\bigg{(}\frac{|\alpha_{i}|}{\sum_{j=1}^{4}|\alpha_{j}|}\bigg{)}}_{1\leq i\leq 4} also verifies these inequalities. Therefore we can restrict our attention to vectors in the simplex . In particular, we have . Furthermore, we lower bound by in the terms . This simplifies the bound to:
Solving the left-hand side problem above in , we get:
E.3 Second technical lemma: Contributions of transitions at optimal pairs to the sample complexity
Let us further develop the expression of :
Notice that the quantity is similar to the one that appears in Lemma 3 of Gheshlaghi Azar et al., (2013), with playing the role of in this case. We will try to relate it to the variances of the value function in the . Define:
Using Lemma 4 and , we can write: ,
where the last inequality comes from Total Variance theorem:
Denote . Then from (32) and (33), we deduce:
where the last inequality stems from Pinsker’s inequality. Next we recall a variance inequality from Gheshlaghi Azar et al., (2013):
(Lemma 8, Gheshlaghi Azar et al., (2013))
Summing up equations (34), (35) and Lemma 6, we get:
E.4 Third technical lemma: The minimum gap is smaller than 1
By contradiction, suppose , then:
This means that for all policies , we have:
Using Bellman operator, the above inequality becomes:
By induction, using that the monotonicity of Bellman operator:
We obtained a contradiction. Thus, . ∎
E.5 Proof of Corollary15
The solving the problem in the right-hand side of (8) clearly verifies:
The problem of Theorem 1 then rewrites as:
where and . We reformulate (38) as a convex program:
Using KKT conditions, one can easily derive the expression of the solution:
Appendix F PAC Guarantee:
First we recall two concentration inequalities and a technical lemma that we will be using. The first two lemmas are taken from Jonsson et al., (2020). The third lemma is immediate. Define the threshold function x(n,\delta,m)=\log(1/\delta)+(m-1)\log\bigg{(}e(1+n/(m-1))\bigg{)}
(Proposition 2, Jonsson et al., (2020)) For all distributions of mean supported on the unit interval, for all :
where we used as a shorthand for .
Recall the definition of the ”correctness” event:
Applying Lemma 10, we can simplify the event :
where the last equality stems from the fact that both and are decreasing as soon as , therefore reaching their maximum at the same point. From the proof of Theorem 1 (refer to Equations (24)-(25)-(26)-(29)-(28)), we have the following ”correctness’ property:
where stands for the complement of event . Therefore:
where in the second inequality we have used the concentration inequalities (44), (45), (46) and (47). We detail the derivation of this second inequality below:
First term. Using Lemma 8, for , we have:
Third term. Following the same reasoning as in the first term we get:
Fourth term. Following the same reasoning as in the second term we get:
Appendix G Sample complexity of KLB-TS
In the following, we use the notation: . Hence the threshold function can be rewritten as: .
We start this section by a technical lemma that is later used in the proof of Proposition 2 and Theorem 3.
where the last inequality comes from Corollary 15. ∎
where denotes the number of visits vector. Note that when the terms are bounded and , which we will soon establish, then we have .
Thus when , inequality (48) implies:
Combining (49) and (50), we have for , . Therefore:
Thus is finite on and we have:
Taking the limit when , we get:
G.2 Proof of Theorem 3
Based on this distance, we can define balls on the set of MDPs:
Let . By recursively bounding Bellman operator, one can prove that is Liptschitz w.r.t. rewards and transitions:
Thus, there exists such that:
We will be using the following technical lemmas. The first corresponds to Lemma 20 in Garivier and Kaufmann, (2016), which we reformulate in our case by replacing the number of arms of the bandit by the number of (state, action) pairs of the MDP.
There exists a constant such that for , it holds on , for C-Tracking:
The second lemma is a concentration inequality similar to that of Lemma 19 in Garivier and Kaufmann, (2016) (we defer its proof to the end of this appendix).
Denote by the complementary of the event . There exists two constants (that depend on and ) such that:
Recall inequality (48), which gives an upper bound of the left-hand-side of the stopping condition:
where is a continuous function in both arguments. Define:
For , on the event , we have: , and using Lemma 12, . Therefore, for the stopping condition to be satisfied, it is sufficient to have:
By Lemma 14, . Hence, we can define the following times :
It is easy to see that for , condition (51) is verified and consequently: . In other words, we just proved that:
Letting and go to zero, and noting that:
G.3 Second technical lemma
Let and let . Define:
Then, there exists such that: .
By continuity of the functionals in , there exists , such that for all , the supremums defined above are upper bounded by . Furthermore, if , then for all : . Summing up these inequalities we get, for small enough:
Since , and the maximums in (52) are taken over finite sets, then ∎
G.4 Proof of Lemma 13
Let be such that . Then for , we have . Therefore, using a union bound and Chernoff inequality, one can write:
Using the same reasoning, we can prove that:
Thus, for the following choice of constants
Appendix H Comparison of KLB-TS and BESPOKE:
As KLB-TS, BESPOKE is an algorithm that adapts its sampling strategy to the learnt MDP. The two algorithms have however different objectives: BESPOKE aims at returning an -optimal policy. BESPOKE starts with an intialization phase where each (state, action) pair is sampled times. After this first phase, the algorithm enters an inner loop. Each iteration of the loop aims at halving the sub-optimality gap of the empirical best policy. The algorithm iterates until the gap becomes smaller than . At the beginning of each iteration, the algorithm solves a convex program whose solution provides the numbers of times each (state, action) pair should be sampled in this iteration. The program minimizes a weighted sum of ”confidence intervals” of rewards and transitions estimates at each (state, action) pair, subject to a maximum budget constraint. This objective is known, thanks to the Simulation Lemmasee Lemma 2 in Zanette et al., (2019), to be an upper bound of the sub-optimality gap of the empirical optimal policy. BESPOKE uses a doubling trick to compute the maximum budget for each iteration (this budget is defined so that the gap is halved). We note the following important differences between KLB-TS and BESPOKE.
KLB-TS does not need to solve any convex program to update its sampling strategy, because given an estimate of the MDP, this strategy is explicit.
It is also worth noting that the initialization phase of BESPOKE is extremely long: samples must be gathered. During this phase, the algorithm is not adaptive at all. As we have shown in our numerical experiments, even with small state and action spaces, the initialization phase constitutes a very large proportion of the sample complexity – which makes the algorithm less adaptive than it seems, and really leads to poor performance. KLB-TS has a much smaller initialization phase and is really adaptive. On Figure 3, we see that BESPOKE’s large sample complexity is mainly due to the constant term corresponding to the minimum number of samples it allocates to each (state, action) pair in the initialization phase. Note that this minimum number of samples cannot be avoided as it is necessary to ensure that BESPOKE halves the accuracy of the empirical policy after each iterationsee Lemma 16 and the proof of Theorem 1 in Zanette et al., (2019).
BESPOKE’s stopping rule is suited to identify optimal policies. Unless it has access an oracle revealing , it cannot perform best policy identification.
H.2 Theoretical guarantees of BESPOKE and KLB-TS
In contrast, the sample complexity of KLB-TS scales as:
From the above upper bounds, we can make the following comments:
Both bounds depend on functionals of the particular MDP to be learnt, such as the minimum gap, the variance or maximum deviations of value functions. This means that BESPOKE and KLB-TS can adapt to the hardness of the problem, and in particular perform significantly better than minimax approaches when the MDP is easy (e.g. when the minimum gap is high or when the variances of the value function is low).
When the rewards have strictly positive variances, then the two upper bounds are very similar, except for the large constant term for BESPOKE which comes from its very long initialization phase. We believe that this constant term makes BESPOKE impractical.
While BESPOKE’s bound has the advantage of being non-asymptotic, it only holds with probability . In contrast, KLB-TS comes with an asymptotic bound on the expected sample complexity, which we also proved to be finite for all confidence levels .