Unifying PAC and Regret: Uniform PAC Bounds for Episodic Reinforcement Learning
Christoph Dann, Tor Lattimore, Emma Brunskill
Introduction
The recent empirical successes of deep reinforcement learning (RL) are tremendously exciting, but the performance of these approaches still varies significantly across domains, each of which requires the user to solve a new tuning problem . Ultimately we would like reinforcement learning algorithms that simultaneously perform well empirically and have strong theoretical guarantees. Such algorithms are especially important for high stakes domains like health care, education and customer service, where non-expert users demand excellent outcomes.
We propose a new framework for measuring the performance of reinforcement learning algorithms called Uniform-PAC. Briefly, an algorithm is Uniform-PAC if with high probability it simultaneously for all selects an -optimal policy on all episodes except for a number that scales polynomially with . Algorithms that are Uniform-PAC converge to an optimal policy with high probability and immediately yield both PAC and high probability regret bounds, which makes them superior to algorithms that come with only PAC or regret guarantees. Indeed,
Neither PAC nor regret guarantees imply convergence to optimal policies with high probability;
-PAC algorithms may be -suboptimal in every episode;
Algorithms with small regret may be maximally suboptimal infinitely often.
Uniform-PAC algorithms suffer none of these drawbacks. One could hope that existing algorithms with PAC or regret guarantees might be Uniform-PAC already, with only the analysis missing. Unfortunately this is not the case and modification is required to adapt these approaches to satisfy the new performance metric. The key insight for obtaining Uniform-PAC guarantees is to leverage time-uniform concentration bounds such as the finite-time versions of the law of iterated logarithm, which obviates the need for horizon-dependent confidence levels.
We provide a new optimistic algorithm for episodic RL called UBEV that is Uniform PAC. Unlike its predecessors, UBEV uses confidence intervals based on the law of iterated logarithm (LIL) which hold uniformly over time. They allow us to more tightly control the probability of failure events in which the algorithm behaves poorly. Our analysis is nearly optimal according to the traditional metrics, with a linear dependence on the state space for the PAC setting and square root dependence for the regret. Therefore UBEV is a Uniform PAC algorithm with PAC bounds and high probability regret bounds that are near optimal in the dependence on the length of the episodes (horizon) and optimal in the state and action spaces cardinality as well as the number of episodes. To our knowledge UBEV is the first algorithm with both near-optimal PAC and regret guarantees.
We consider episodic fixed-horizon MDPs with time-dependent dynamics, which can be formalized as a tuple . The statespace and the actionspace are finite sets with cardinality and . The agent interacts with the MDP in episodes of time steps each. At the beginning of each time-step the agent observes a state and chooses an action based on a policy that may depend on the within-episode time step (). The next state is sampled from the th transition kernel and the initial state from . The agent then receives a reward drawn from a distribution which can depend on and with mean determined by the reward function. The reward distribution is supported on $t\pi$ is defined as
and the optimal value function is denoted by . In any fixed episode, the quality of a policy is evaluated by the total expected reward or return
Uniform PAC and Existing Learning Frameworks
We briefly summarize the most common performance measures used in the literature.
-PAC: There exists a polynomial function such that
High Probability Regret: There exists a function such that
Uniform High Probability Regret: There exists a function such that
In all definitions the function should be polynomial in all arguments. For notational conciseness we often omit some of the parameters of where the context is clear. The different performance guarantees are widely used (e.g. PAC: , (uniform) high-probability regret: ; expected regret: ). Due to space constraints, we will not discuss Bayesian-style performance guarantees that only hold in expectation with respect to a distribution over problem instances. We will shortly discuss the limitations of the frameworks listed above, but first formally define the Uniform-PAC criteria
An algorithm is Uniform-PAC for if
where is polynomial in all arguments.
Since regret guarantees only bound the integral of over , it does not distinguish between making a few severe mistakes and many small mistakes. In fact, since regret bounds provably grow with the number of episodes , an algorithm that achieves optimal regret may still make infinitely many mistakes (of arbitrary quality, see proof of Theorem 2 below). This is highly undesirable in high-stakes scenarios. For example in drug treatment optimization in healthcare, we would like to distinguish between infrequent severe complications (few large ) and frequent minor side effects (many small ). In fact, even with an optimal regret bound, we could still serve infinitely patients with the worst possible treatment.
Limitations of PAC.
PAC bounds limit the number of mistakes for a given accuracy level , but is otherwise non-restrictive. That means an algorithm with for all almost surely might still be -PAC. Worse, many algorithms designed to be -PAC actually exhibit this behavior because they explicitly halt learning once an -optimal policy has been found. The less widely used TCE (total cost of exploration) bounds and KWIK guarantees suffer from the same issueand for conciseness are not discussed in detail.
Advantages of Uniform-PAC.
The new criterion overcomes the limitations of PAC and regret guarantees by measuring the number of -errors at every level simultaneously. By definition, algorithms that are Uniform-PAC for a are -PAC for all . We will soon see that an algorithm with a non-trivial Uniform-PAC guarantee also has small regret with high probability. Furthermore, there is no loss in the reduction so that an algorithm with optimal Uniform-PAC guarantees also has optimal regret, at least in the episodic RL setting. In this sense Uniform-PAC is the missing bridge between regret and PAC. Finally, for algorithms based on confidence bounds, Uniform-PAC guarantees are usually obtained without much additional work by replacing standard concentration bounds with versions that hold uniformly over episodes (e.g. using the law of the iterated logarithms). In this sense we think Uniform-PAC is the new ‘gold-standard’ of theoretical guarantees for RL algorithms.
1 Relationships between Performance Guarantees
Existing theoretical analyses usually focus exclusively on either the regret or PAC framework. Besides occasional heuristic translations, Proposition 4 in and Corollary 3 in are the only results relating a notion of PAC and regret, we are aware of. Yet the guarantees there are not widely usedThe average per-step regret in is superficially a PAC bound, but does not hold over infinitely many time-steps and exhibits the limitations of a conventional regret bound. The translation to average loss in comes at additional costs due to the discounted infinite horizon setting. unlike the definitions given above which we now formally relate to each other. A simplified overview of the relations discussed below is shown in Figure 1.
a sub-linear expected regret bound for all and
a finite -PAC bound for a small enough
simultaneously for all two-armed multi-armed bandits with Bernoulli reward distributions. This implies that such guarantees also cannot be satisfied simultaneously for all episodic MDPs.
A full proof is in Appendix A.1, but the intuition is simple. Suppose a two-armed Bernoulli bandit has mean rewards and respectively and the second arm is chosen at most times with probability at least , then one can easily show that in an alternative bandit with mean rewards and there is a non-zero probability that the second arm is played finitely often and in this bandit the expected regret will be linear. Therefore, sub-linear expected regret is only possible if each arm is pulled infinitely often almost surely.
The following statements hold for performance guarantees in episodic MDPs:
If an algorithm satisfies a -PAC bound with then it satisfies for a specific a bound. Further, there is an MDP and algorithm that satisfies the -PAC bound on that MDP and has regret on that MDP for any . That means a -PAC bound with can only be converted to a high-probability regret bound with .
For any chosen and , there is an MDP and algorithm that satisfies the -PAC bound on that MDP and has regret on that MDP. That means a -PAC bound cannot be converted to a sub-linear uniform high-probability regret bound.
For any with as , there is an algorithm that satisfies that uniform high-probability regret bound on some MDP but makes infinitely many mistakes for any sufficiently small accuracy level for that MDP. Therefore, a high-probability regret bound (uniform or not) cannot be converted to a finite -PAC bound.
For most interesting RL problems including episodic MDPs the worst-case expected regret grows with . The theorem shows that establishing an optimal high probability regret bound does not imply any finite PAC bound. While PAC bounds may be converted to regret bounds, the resulting bounds are necessarily severely suboptimal with a rate of . The next theorem formalises the claim that Uniform-PAC is stronger than both the PAC and high-probability regret criteria.
is -PAC with bound for all .
Observe that stronger uniform PAC bounds lead to stronger regret bounds and for RL in episodic MDPs, an optimal uniform-PAC bound implies a uniform regret bound. To our knowledge, there are no existing approaches with PAC or regret guarantees that are Uniform-PAC. PAC methods such as MBIE, MoRMax, UCRL-, UCFH, Delayed Q-Learning or Median-PAC all depend on advance knowledge of and eventually stop improving their policies. Even when disabling the stopping condition, these methods are not uniform-PAC as their confidence bounds only hold for finitely many episodes and are eventually violated according to the law of iterated logarithms. Existing algorithms with uniform high-probability regret bounds such as UCRL2 or UCBVI also do not satisfy uniform-PAC bounds since they use upper confidence bounds with width where is the number of observed episodes and is the number of observations for a specific state and action. The presence of causes the algorithm to try each action in each state infinitely often. One might begin to wonder if uniform-PAC is too good to be true. Can any algorithm meet the requirements? We demonstrate in Section 4 that the answer is yes by showing that UBEV has meaningful Uniform-PAC bounds. A key technique that allows us to prove these bounds is the use of finite-time law of iterated logarithm confidence bounds which decrease at rate .
The UBEV Algorithm
where is short for and
is the width of a confidence bound with and are the empirical transition probabilities and the empirical immediate rewards (both at the beginning of the th episode). Our algorithm is conceptually similar to other algorithms based on the optimism principle such as MBIE , UCFH , UCRL2 or UCRL- but there are several key differences:
Instead of using confidence intervals over the transition kernel by itself, we incorporate the value function directly into the concentration analysis. Ultimately this saves a factor of in the sample complexity, but the price is a more difficult analysis. Previously MoRMax also used the idea of directly bounding the transition and value function, but in a very different algorithm that required discarding data and had a less tight bound. A similar technique has been used by Azar et al. .
Many algorithms update their policy less and less frequently (usually when the number of samples doubles), and only finitely often in total. Instead, we update the policy after every episode, which means that UBEV immediately leverages new observations.
Confidence bounds in existing algorithms that keep improving the policy (e.g. Jaksch et al. , Azar et al. ) scale at a rate where is the number of episodes played so far and is the number of times the specific () has been observed. As the results of a brief empirical comparison in Figure 2 indicate, this leads to slow learning (compare UCBVI_1 and UBEV’s performance which differ essentially only by their use of different rate bounds). Instead the width of UBEV’s confidence bounds scales at rate which is the best achievable rate and results in significantly faster learning.
Uniform PAC Analysis
We now discuss the Uniform-PAC analysis of UBEV which results in the following Uniform-PAC and regret guarantee.
Let be the policy of UBEV in the th episode. Then with probability at least for all jointly the number of episodes where the expected return from the start state is not -optimal (that is ) is at most
Therefore, with probability at least UBEV converges to optimal policies and for all episodes has regret
Here is a function that can be bounded by a polynomial of logarithm, that is, . In Appendix C we provide a lower bound on the sample complexity that shows that if , the Uniform-PAC bound is tight up to log-factors and a factor of . To our knowledge, UBEV is the first algorithm with both near-tight (up to factors) high probability regret and PAC bounds as well as the first algorithm with any nontrivial uniform-PAC bound.
Using Theorem 3 the convergence and regret bound follows immediately from the uniform PAC bound. After a discussion of the different confidence bounds allowing us to prove uniform-PAC bounds, we will provide a short proof sketch of the uniform PAC bound.
To have a PAC bound for all jointly, it is critical that UBEV continually make use of new experience. If UBEV stopped leveraging new observations after some fixed number, it would not be able to distinguish with high probability among which of the remaining possible MDPs do or do not have optimal policies that are sufficiently optimal in the other MDPs. The algorithm therefore could potentially follow a policy that is not at least -optimal for infinitely many episodes for a sufficiently small . To enable UBEV to incorporate all new observations, the confidence bounds in UBEV must hold for an infinite number of updates. We therefore require a proof that the total probability of all possible failure events (of the high confidence bounds not holding) is bounded by , in order to obtain high probability guarantees. In contrast to prior -PAC proofs that only consider a finite number of failure events (which is enabled by requiring an RL algorithm to stop using additional data), we must bound the probability of an infinite set of possible failure events.
Some choices of confidence bounds will hold uniformly across all sample sizes but are not sufficiently tight for uniform PAC results. For example, the recent work by Azar et al. uses confidence intervals that shrink at a rate of , where is the number of episodes, and is the number of samples of a pair at a particular time step. This confidence interval will hold for all episodes, but these intervals do not shrink sufficiently quickly and can even increase. One simple approach for constructing confidence intervals that is sufficient for uniform PAC guarantees is to combine bounds for fixed number of samples with a union bound allocating failure probability to the failure case with samples. This results in confidence intervals that shrink at rate . Interestingly we know of no algorithms that do such in our setting.
We follow a similarly simple but much stronger approach of using law-of-iterated logarithm (LIL) bounds that shrink at the better rate of . Such bounds have sparked recent interest in sequential decision making but to the best of our knowledge we are the first to leverage them for RL. We prove several general LIL bounds in Appendix F and explain how we use these results in our analysis in Appendix E.2. These LIL bounds are both sufficient to ensure uniform PAC bounds, and much tighter (and therefore will lead to much better performance) than bounds. Indeed, LIL have the tightest possible rate dependence on the number of samples for a bound that holds for all timesteps (though they are not tight with respect to constants).
2 Proof Sketch
where is the value of and the value of right before episode . Further we decompose
where the second inequality follows from a standard concentration bound used in the definition of the failure event (see below). Substituting this and (8) into (7) leads to
On it also holds that and so on nice episodes where each with significant probability also had significant probability in the past, i.e., , it holds that . Substituting this into (10), we can use a careful pidgeon-hole argument laid out it Lemma E.3 in the appendix to show that this term is bounded by on all but nice episodes. Again using a pidgeon-hole argument, one can show that all but at most episodes are nice. Combining both bounds, we get that on the optimality gap is at most except for at most episodes.
We decompose the failure event into multiple components. In addition to the events that a triple has been observed few times compared to its visitation probabilities in the past, i.e., as well as a conditional version of this statement, the failure event contains events where empirical estimates of the immediate rewards, the expected optimal value of the successor states and the individual transition probabilites are far from their true expectations. For the full definition of see Appendix E.2. also contains event we used in Eq. (9) defined as
With a more refined analysis that avoids the use of Hölder’s inequality in (9) and a stronger notion of nice episodes called friendly episodes we obtain the bound with the first term in the . However, since a similar analysis has been recently released , we defer this discussion to the appendix.
3 Discussion of UBEV Bound
Comparing UBEV’s regret bound to the ones of UCRL2 and REGAL requires care because (a) we measure the regret over entire episodes and (b) our transition dynamics are time-dependent within each episode, which effectively increases the state-space by a factor of . Converting the bounds for UCRL2/REGAL to our setting yields a regret bound of order . Here, the diameter is , the state space increases by due to time-dependent transition dynamics and an additional is gained by stating the regret in terms of episodes instead of time steps. Hence, UBEV’s bounds are better by a factor of . Our bound matches the recent regret bound for episodic RL by Azar et al. in the , and terms but not in . Azar et al. has regret bounds that are optimal in but their algorithm is not uniform PAC, due to the characteristics we outlined in Section 2.
Conclusion
The Uniform-PAC framework strengthens and unifies the PAC and high-probability regret performance criteria for reinforcement learning in episodic MDPs. The newly proposed algorithm is Uniform-PAC, which as a side-effect means it is the first algorithm that is both PAC and has sub-linear (and nearly optimal) regret. Besides this, the use of law-of-the-iterated-logarithm confidence bounds in RL algorithms for MDPs provides a practical and theoretical boost at no cost in terms of computation or implementation complexity.
This work opens up several immediate research questions for future work. The definition of Uniform-PAC and the relations to other PAC and regret notions directly apply to multi-armed bandits and contextual bandits as special cases of episodic RL, but not to infinite horizon reinforcement learning. An extension to these non-episodic RL settings is highly desirable. Similarly, a version of the UBEV algorithm for infinite-horizon RL with linear state-space sample complexity would be of interest. More broadly, if theory is ever to say something useful about practical algorithms for large-scale reinforcement learning, then it will have to deal with the unrealizable function approximation setup (unlike the tabular function representation setting considered here), which is a major long-standing open challenge. Acknowledgements. We appreciate the support of a NSF CAREER award and a gift from Yahoo.
References
Appendix A Framework Relation Proofs
We will use two episodic MDPs, and , which are essentially 2-armed bandits and hard to distinguish to prove this statement. Both MDPs have one state, horizon , and two actions . For a fixed , the rewards are Bernoulli() distributed for actions in both MDPs. Playing action in gives Bernoulli() rewards and action in gives Bernoulli() rewards.
the likelihood ratio of is upper bounded by if the second action has been chosen at most times. Hence
A.2 Proof of Theorem 2
PAC Bound to high-probability regret bound: Consider a fixed and PAC bound with . Then there is a such that the following algorithm satisfies the PAC bound. The algorithm uses the worst possible policy with optimality gap in all episodes on some event and in the first episodes on the complimentary event . For the remaining episodes on it follows a policy with optimality gap . The probability of is . The regret of the algorithm on is and on it is . For , on any event the regret of this algorithm is at least
takes its minimum at with a positive value and hence . Therefore a PAC bound with rate implies at best a high-probability regret bound of order and is only tight at . Furthermore, by looking at Equation (15), we see that for any fixed , there is an algorithm that has uniform high-probability regret that is .
PAC Bound to uniform high-probability regret bound: Consider a fixed and and a PAC bound that evaluates to some value for parameter . The algorithm uses the worst possible policy with optimality gap in all episodes on some event and in the first episodes on the complimentary event . For the remaining episodes on it follows a policy with optimality gap . The probability of is . The regret of the algorithm on is and on it is . For , on any event the regret of this algorithm is at least
Uniform high-probability regret bound to PAC bound: Consider an MDP such that at least one suboptimal policy exists with optimality gap . Further let be a nondecreasing function with and as . Then the algorithm plays the optimal policy except for episodes where . This algorithm satisfies the regret bound but makes infinitely many -mistakes with probability .
A.3 Proof of Theorem 3
Convergence to optimal policies: The convergence to the set of optimal policies follows directly by using the definition of limits on the sequence for each outcome in the high-probability event where the bound holds. -PAC: Due to sub-additivity of probabilities, we have
High-Probability Regret Bound: This part is proved separately in Theorem A.1 below. ∎
Assume on some event an algorithm follows for all an -optimal policy , i.e., , on all but at most
episodes where and and do not depend on . Then this algorithm has on this event a regret of
The mistake bound is monotonically decreasing for . For a given large enough, we can therefore find an such that for all . The regret of the algorithm can then be bounded as follows
This bound assumes the worst case where first the algorithm makes the worst mistakes possible with regret and subsequently less and less severe mistakes controlled by the mistake bound. For a better intuition, see Figure 3.
We first find a suitable . Define then since is monotonically decreasing, it is sufficient to find a with . That is equivalent to for which
and then use the choice of from above to look at each of the terms in this bound individually. In the following bounds we extensively use the fact for all and that which holds for all .
where the first inequality follows from the fact that . Hence, we can bound
As a result we can conclude that . ∎
Appendix B Experimental Details
We generated the MDPs with states, actions and timesteps as follows: The transition probabilities were sampled independently from and the rewards were all deterministic with their value set to with probability and set uniformly at random in $$ otherwise. This construction results in MDPs that have concentrated but non-deterministic transition probabilities and sparse rewards.
Since some algorithms have been proposed assuming the rewards are known and we aim for a fair comparison, we assumed for all algorithms that the immediate rewards are known and adapted the algorithms accordingly. For example, in UBEV, the term was replaced by the true known rewards and the parameter in was scaled by accordingly since the concentration result for immediate rewards is not necessary in this case. We used for all algorithms and if they require to know beforehand.
We adapted MoRMax, UCRL2, UCFH, MBIE, MedianPAC, Delayed Q-Learning and OIM to the episodic MDP setting with time-dependent transition dynamics by using allowing them to learn time-dependent dynamics and use finite-horizon planning. We did adapt the confidence intervals and but did not re-derive the constants for each algorithm. When in doubt we opted for smaller constants typically resulting better performance of the competitors. We further replaced the range of the value function by the observed range of the optimistic next state values in the confidence bounds. We also reduced the number of episodes used in the delays by a factor of for MoRMax and Delayed Q-Learning and by for UCFH because they would otherwise not have performed a single policy update even for within the 10 million episodes we considered. This scaling violates their theoretical guarantees but at least shows that the methods work in principle.
The performance reported in Figure 2 are the expected return of the current policy of each algorithm averaged over episodes. The figure shows a single run of the same randomly generated MDP but the results are representative. We reran this experiments with different random seeds and consistently obtained qualitatively similar results.
Source code for the experiments including concise but efficient implementations of the algorithms is available at https://github.com/chrodan/FiniteEpisodicRL.jl.
Appendix C PAC Lower Bound
There exist positive constants , , such that for every , and for every algorithm A that and there is a fixed-horizon episodic MDP with time-dependent transition probabilities and states and actions so that returning an -optimal policy after episodes is at most . That implies that no algorithm can have a PAC guarantee better than for sufficiently small .
Note that this lower bound on the sample complexity of any method in episodic MDPs with time-dependent dynamics applies to the arbitrary but fixed PAC bound and therefore immediately to the stronger uniform-PAC bounds. This theorem can be proved in the same way as Theorem 5 by Jiang et al. , which itself is a standard construction involving a careful layering of difficult instances of the multi-armed bandit problem.We here only use timesteps for bandits and the remaining time steps to accumulate a reward of for each bandit For simplicity, we omitted the dependency on the failure probability , but using the techniques in the proof of Theorem 26 by Strehl et al. , a lower bound of order can be obtained. The lower bound shows for small the sample complexity of UBEV given in Theorem 4 is optimal except for a factor of and logarithmic terms.
Appendix D Planning Problem of UBEV
The policy update in Lines 1–1 of Algorithm 1 finds an optimal solution to the optimization problem
where is a confidence bound and are the empirical transition probabilities and the empirical average rewards.
Hence, UBEV computes an optimal solution to this problem. ∎
Appendix E Details of PAC Analysis
In the following, we provide the formal proof for Theorem 4 and then present all necessary lemmas:
Corollary E.5 ensures that the failure event has probability at most . Outside the failure event Lemma E.2 ensures that all but at most episodes are friendly. Finally, Lemma E.8 shows that all friendly episodes except at most are -optimal. The second bound follows from replacing by in the second term. Furthermore, outside the failure event Lemma E.2 ensures that all but at most episodes are nice. Finally, Lemma E.7 shows that all nice episodes except at most are -optimal.
E.2 Failure Events and Their Probabilities
We now bound the probability of each type of failure event individually:
We can therefore apply Lemma F.1 and conclude that
Applying the union bound over all and , we obtain the desired statement for . In complete analogy using the same filtration, we can show the statement for . ∎
Consider first a fix , and . Let denote the number of times the triple was encountered in total during the run of the algorithm. Define the random sequence as follows. For , let be the indicator of whether was the next state when was encountered the th time and for , let be drawn i.i.d. By construction this is a sequence of i.i.d. Bernoulli random variables with mean . Further the event
whose probability can be bounded by using Lemma F.2. The statement now follows by applying the union bound. ∎
Using the same argument as in the proof of Corollary E.2 the statement follows from Lemma F.3. ∎
Statement follows directly from Corollary E.1, Corollary E.2, Corollary E.3, Corollary E.4 and the union bound. ∎
E.3 Nice and Friendly Episodes
We now define the notion of nice and the stronger friendly episodes. In nice episodes, all states either have low probability of occuring or the sum of probability of occuring in the previous episodes is large enough so that outside the failure event we can guarantee that
This allows us to then bound the number of nice episodes by the number of times terms of the form
can exceed a chosen threshold (see Lemma E.3 below). In the next section, we will bound the optimality gap of an episode by terms of such form and use the results derived here to bound the number of nice episodes where the algorithm can follow a -suboptimal policy. Together with a bound on the number of non-nice episodes, we obtain the sample complexity of UBEV shown in Theorem 4.
Similarly, we use a more refined analysis of the optimality gap of friendly episodes together with Lemma E.4 below to obtain the tighter sample complexity linear-polylog in .
An episode is nice if and only if for all , and the following two conditions hold:
An episode is friendly if and only if it is nice and for all , and with the following two conditions hold:
If an episode is nice, i.e., , then on (outside the failure event) for all , and with the following statement holds:
If an episode is friendly, i.e., , then on (outside the failure event) for all , and with the above statement holds as well as
Since we consider the event , it holds for all triples with
for Further, since we only consider the event ,we have for all , , with and
for . If then holds trivially. Otherwise and therefore
On the good event , the number of episodes that are not friendly is at most
and the number episodes that are not nice is at most
If an episode is not nice, then there is with and . Since the sum on the left-hand side of this inequality increases by at least when this happens and the right hand side stays constant, this situation can occur at most
times in total. If an episode is not friendly, it is either not nice or there is and with and and . Since the sum on the left-hand side of this inequality increases by at least each time this happens while the right hand side stays constant, this can happen at most times in total. Therefore, there can only be at most
Let fix and which can depend polynomially on the relevant quantities and and let which can depend poly-logarithmically on the relevant quantities. Then
Using the property in Lemma E.1 of nice episodes as well as the fact that and , we bound
The function is monotonically decreasing in since (see Lemma E.6). This allows us to bound
Assume now . In this case the right-hand side of the inequality above is also larger than and there is at least one with and
Let us denote . Since is monotonically decreasing and satisfies , we know that if then the above condition cannot be satisfied for . Since each time the condition is satisfied, it holds that and so increases by at least , it can happen at most
times that . Define and we know that . Now we consider the sum
Since each element in has to contribute at least to this bound, we can conclude that
Since is , the proof is complete. ∎
Let fix and which can depend polynomially on the relevant quantities and and let which can depend poly-logarithmically on the relevant quantities. Further is a subset of time-indices with for all . Then
The proof follows mainly the structure of Lemma E.3. For the sake of completeness, we still present all steps here. Define
Using the property in Lemma E.1 of friendly episodes as well as the fact that and , we bound
The function is monotonically decreasing in since (see Lemma E.6). This allows us to bound
where for the last line we used the first and last property in Lemma E.6. For notational convenience, we will use . Assume now . In this case the right-hand side of the inequality above is also larger than and there is at least one with and
Let us denote . Since is monotonically decreasing and satisfies , we know that if then the above condition cannot be satisfied for . Since each time the condition is satisfied, it holds that and so increases by at least , it can happen at most
times that . Define and we know that . Now we consider the sum
Since each element in has to contribute at least to this bound, we can conclude that
Since is , the proof is complete. ∎
Let be a sequence taking values in with and , then
Let be a step-function taking value on for all . We have . By the fundamental theorem of Calculus, we can bound
where the inequality follows from and . ∎
is continuous and nondecreasing.
for all .
For we have and for we have which is continuous and monotonically increasing and .
The denominator is always positive in this range so is monotonically decreasing if and only if . Using , we have .
First note that for we have and therfore the statement holds for .
Then consider the case that and where and . The function is continuous and differentiable with and . Therefore, attains its minimum on at . Since , the statement also holds for .
Finally consider the case where . Then . Due to symmetry this also holds for .
E.4 Decomposition of Optimality Gap
In this section we decompose the optimality gap and then bound each term individually. Finally, both rate lemmas presented in the previous section are used to determine a bound on the number of nice / friendly episodes where the optimality gap can be larger than . The decomposition in the following lemma is a the simpler version bounding the number of -suboptimal nice episodes and eventually lead to the first bound in Theorem 4.
On the good event it holds that on all nice episodes except at most
Using optimism of the algorithm shown in Lemma E.16, we can bound
The first term is bounded by . We now can use Lemma E.9, Lemma E.10 to bound the other terms by
We can then apply Lemma E.3 with , , ( for any nontrivial setting) and to bound this term by on all nice episodes except at most
Hence holds on all nice episodes except those. ∎
The lemma below is a refined version of the bound above and uses the stronger concept of friendly episodes to eventually lead to the second bound in Theorem 4.
On the good event it holds that on all friendly episodes except at most
episodes if .
We can further decompose the optimality gap bound in Equation (147) in the proof of Lemma E.7 as
The second term can be bounded using Lemmas E.11, E.10 and E.9 by
which we bound by using Lemma E.3 with , , and on all friendly episodes except at most
Finally, we apply Lemma E.12 bound to bound the last term in Equation 156 by on all friendly epsiodes but at most
It hence follows that on all friendly episodes but at most
It holds for all and
Using the definition of the constraint in the planning step of the algorithm shown in Lemma D.1 we can bound
On the good event it holds for all and
On the good event we have using Hölder’s inequality
On the good event it holds for all and
Since we consider the event , we can bound
Assume . On the good event on all friendly episodes except at most it holds that
where we used . We now bound the first term using Lemma E.3 with on all but friendly episodes by .
Applying Lemma E.3 with and , we can bound the second term by on all but friendly episodes. Hence, it holds
episodes. Since , this simplifies to
failure episodes in . We can finally bound the failure episodes by
On the good event for any , and with it holds
where on all friendly episodes except for at most
Define and where and . Using Lemma E.14, we bound
on all friendly episodes except at most . Define now . We apply Lemma E.4 with and to
on all but at most friendly episodes. Similarly, we bound
on all but at most friendly episodes. Hence on all friendly episodes except those failure episodes, we get
Consider a fix and , and the good event . On all but at most
where .
For any , and we use Lemma E.15 to write the value difference as
Let be the set of state-action pairs for which the conditional probability of observing is sufficiently large. Then we can bound the low-probability differences as
For the other terms with significant conditional probability, we can leverage the fact that we only consider events in and to bound
where we use Cauchy Schwarz for the last inequality. Combining these individual bounds, we can upper-bound the value difference as
We now apply Lemma E.4 with and and get that the second term above is bounded by
episodes. We apply Lemma E.4 again to the final term in Equation (218) above with and . Then the final term is bounded by . on all friendly episodes but
many. Combining these bounds, we arrive at
where we bounded by since it is decreasing in and we therefore can simply use (entire bound holds trivially for ). ∎
E.5 Useful Lemmas
For any two MDPs and with rewards and and transition probabilities and , the difference in values with respect to the same policy can be written as
For the statement is trivially true. We assume now it holds for and show it holds also for . Using only this induction hypothesis and basic algebra, we can write
where the last equality follows from law of total expectation ∎
On the good event it holds that for all episodes , , that
The first inequality follows simply from the definition of the optimal value function .
Appendix F General Concentration Bounds
Let . Then
We now consider for which is a nonnegative sub-martingale and use the short-hand . Then by Doob’s maximal inequality for nonnegative submartingales
Choosing the optimal we obtain the bound
Plugging this back in the bound from above, we get
For the other side, the argument follows completely analogously with
Let be a sequence of Bernoulli random variables with bias . Then for all
Let and . Further define and which is by construction a nonnegative submartingale. Applying Doob’s maximal inequality for nonnegative submartingales, we bound
and using Corollary 2.11 by Boucheron et al. (see also note below proof of Corollary 2.11) bound that by
We now argue that this quantity can be upper-bounded by . This is equivalent to
For the other direction, we proceed analogously to above and arrive at
Let be a sequence of i.i.d. categorical variables on with distribution . Then for all
where is the empirical distribution based on samples .
We use the identity which holds for all distributions defined on the finite set to bound
is a supermartingale. It hence holds by Markov’s inequality