Model-Based Reinforcement Learning with Value-Targeted Regression

Alex Ayoub, Zeyu Jia, Csaba Szepesvari, Mengdi Wang, Lin F. Yang

Introduction

Reinforcement learning (RL) enables learning to control complex environments through trial and error. It is a core problem in artificial intelligence (Russel & Norvig, 2003; Sutton & Barto, 2018) and recent years has witnessed phenomenal empirical advances in various areas such as: games, robotics and science (e.g., Mnih et al., 2015; Silver et al., 2017; AlQuraishi, 2019; Arulkumaran et al., 2019). In online RL, an agent has to learn to act in an unknown environment “from scratch”, collect data as she acts, and adapt the policy to maximize the reward collected. An important problem is to design algorithms that provably achieve sublinear regret in a large class of environments. Regret minimization for RL has received considerable attention in recent years (e.g., Jaksch et al. 2010; Osband et al. 2014; Azar et al. 2017; Dann et al. 2017, 2018; Agrawal & Jia 2017; Osband et al. 2017; Jin et al. 2018; Yang & Wang 2019a; Jin et al. 2019). While most of these existing works focus on the tabular or linear-factored MDP, only a handful of prior efforts have studied RL with general model classes. In particular, in a pioneering paper Strens (2000) proposed to use posterior sampling, which was later analyzed in the Bayesian setting by Osband & Van Roy (2014); Abbasi-Yadkori & Szepesvári (2015); Theocharous et al. (2017). The reader is referred to Section 5 for a discussion of these and other related works.

In this paper, we study episodic reinforcement learning in an environment where the unknown probability transition model is known to belong to a family of models, i.e., P∈PP\in\mathcal{P}. The model family P\mathcal{P} is a general set of models, and it may be either finitely parametrized or nonparametric. In particular, our approach accommodates working with smoothly parameterized models (e.g., Abbasi-Yadkori & Szepesvári, 2015), and can find use in both robotics (Kober et al., 2013) and queueing systems (Kovalenko, 1968). An illuminating special case is the case of linear parametrization when elements of P\mathcal{P} take the form Pθ=∑iθiPiP_{\theta}=\sum_{i}\theta_{i}P_{i} where P1,P2,…,PdP_{1},P_{2},\ldots,P_{d} are fixed, known basis models and θ=(θ1,…,θd)\theta=(\theta_{1},\dots,\theta_{d}) are unknown, real-valued parameters. Model PθP_{\theta} can be viewed as a mixture model that aggregates a finite family of known basic dynamical models (Modi et al., 2019). As an important special case, linear mixture models include the linear-factor MDP model of Yang & Wang (2019a), a model that allows the embedding of possible transition kernels into an appropriate space of finite matrices.

The main contribution of this paper is a model-based upper confidence RL algorithm where the main novelty is the criterion to select models that are deemed consistent with past data. As opposed to standard practice where the models are selected based on their ability to predict next states or raw observations there (cf. Jaksch et al. (2010); Yang & Wang (2019a) or (Strens, 2000; Osband & Van Roy, 2014; Abbasi-Yadkori & Szepesvári, 2015; Ouyang et al., 2017; Agrawal & Jia, 2017) in a Bayesian setting), we propose to evaluate models based on their ability to predict the values at next states as computed using the last value function estimate produced by our algorithm. In effect, the algorithm aims to select models based on their ability to produce small losses in a value-targeted regression problem.

Value-targeted regression is attractive for multiple reasons: (i) First and foremost, value-targeted regression holds the promise that model learning will focus on task-relevant aspects of the transition dynamics and can ignore aspects of the dynamics that are not relevant for the task. This is important as the dynamics can be quite complicated and modelling irrelevant aspects of the dynamics can draw valuable resources away from modelling task-relevant aspects. (ii) A related advantage is that building faithful probability models with high-dimensional state variables (or observations) can be challenging. Value-targeted regression sets up model learning as a real-valued regression problem, which intuitively feels easier than either building a model with maximum likelihood or setting up a vector-valued regression problem to model next state probabilities. (iii) Value-targeted regression aims at directly what matters in terms of the model accuracy or regret. Specifically the objective used in value-targeted is obtained from an expression that upper bounds the regret, hence it is natural to expect that minimizing this will lead to a small regret.

In addition, our approach is attractive as the algorithm has a modular structure and this allows any advances on components (optimistic planning, improvements in designing confidence sets) to be directly translated into a decreased regret. One may also question whether value-targeted regression is going “too far” in ignoring details of the dynamics. Principally, one may think that since the value function used in defining the regression targets is derived based on imperfect knowledge, the model may never be sufficiently refined in a way that allows the regret to be kept under control. Secondly, one may worry about that by ignoring the rich details of observations (in our simple model, the identity of the state), the approach advocated is ignoring information available in the data, which may slow down learning. To summarize, the main question, to which we seek an answer in this paper, is the following:

Is value-targeted regression sufficient and efficient for model-based online RL?

Based on the theoretical and the experimental evidence that we provide in this paper, our conclusion is that the answer is ‘yes’.

Firstly, the regret bounds we derive conclusively show that the despite the imperfection and non-stationarity of the value targets, the algorithm cannot get “stuck” (i.e., it enjoys sublinear regret). Our results also suggest that perhaps there is no performance degradation as compared to the performance of competing algorithms. We are careful here as this conclusion is based on comparing worst-case upper bounds, which cannot provide a definitive answer.

To complement the theoretical findings, our experiments also confirm that our algorithm is competitive. The experiments also allow us to conclude that it is value-targeted regression together with optimistic planning that is effective. In particular, if optimism is taken away (i.e., ϵ\epsilon-greedy is applied for the purpose of providing sufficient exploration), value-targeted regression performs worse than using a canonical approach to estimate the model. Similarly, if value-targeted regression is taken away, optimism together with the canonical model-estimation approach is less sample-efficient.

This still leaves open the possibility that certain combinations of value-targeted regression and canonical model building can be more effective than value-targeted regression. In fact, given the vast number of possibilities, we find this to be a quite plausible hypothesis. We note in passing that our proofs can be adjusted to deal with adding simultaneous alternative targets for constraining the set of data-consistent models. However, sadly, our current theoretical tools are unable to exhibit the tradeoffs that one expects to see here.

It is interesting to note that, in an independent and concurrent work, value-targeted regression has also been suggested as the main model building tool of the MuZero algorithm. The authors of this algorithm empirically evaluated MuZero on a number of RL benchmarks, such as the 57 Atari “games”, the game of “Go”, chess and shogi (Schrittwieser et al., 2019). In these benchmarks, despite the fact that MuZero does not use optimistic exploration or any other “smart” exploration technique, MuZero was found to be highly competitive with its state-of-the-art alternatives, which reinforces the conclusion that training models using value-targeted regression is indeed a good approach to build effective model-based RL algorithms. The good results of MuZero on these benchmark may seem to contradict our experimental findings that value-targeted regression is ineffective without an appropriate, ‘smart’ exploration component. However, there is no contradiction: Smart exploration may be optional in some environments; our experiments show that it is not optional on some environments. In short, for robust performance across a wide range of environments, smart exploration is necessary but smart exploration may be optional in some environments.

As to the organization of the rest of the paper, the next section (Section 2) introduces the formal problem definition. This is followed by the description of the new algorithm (Section 3) and the main theoretical results (Section 4). In particular, we first give a regret bound for the general case where the regret is expressed as a function of the “richness” of the model class P\mathcal{P}. This analysis is based on the Eluder dimension of an appropriately defined function class and its metric entropy at an appropriate scale. It is worth noting that the regret bound does not depend on either the size of the state or the size of the action space. To illustrate the strength of this general technique, we specialize the regret bound for the case of linear mixture models,

for which we prove that the expected cumulative regret is at most O(dH3T)O(d\sqrt{H^{3}T}), where HH is the episode length, dd is the number of model parameters and TT is the total number of steps that the RL algorithm interacts with its environment. To complement the upper bound, for the linear case we also provide a regret lower bound Ω(HdT)\Omega(\sqrt{HdT}) by adapting a lower bound that has been derived earlier for tabular RL. After these results, we discuss the connection of our work to prior art (Section 5). This is followed by the presentation of our empirical results (Section 6), where, as it was alluded to earlier, the aim is to explore how the various parts of the algorithm interact with each other. Section 7 concludes the paper.

Problem Formulation

We study episodic Markov decision processes (MDPs, for short), described by a tuple M=(S,A,P,r,H,s∘)M=(\mathcal{S},\mathcal{A},P,r,H,s_{\circ}). Here, S\mathcal{S} is the state space, A\mathcal{A} is the action space, PP is the transition kernel, rr is a reward function, H>0H>0 is the episode length, or horizon, and s∘∈Ss_{\circ}\in\mathcal{S} is the initial state. In the online RL problem, the learning agent is given S\mathcal{S}, A\mathcal{A}, HH and rr but does not know PP.Our results are easy to extend to the case when rr is not known. The agent interacts with its environment described by MM in episodes. Each episode begins at state s∘s_{\circ} and ends after the agent made HH decisions. At state s∈Ss\in\mathcal{S}, the agent, after observing the state ss, can choose an action a∈Aa\in\mathcal{A}. As a result, the immediate reward r(s,a)r(s,a) is incurred. Then the process transitions to a random next state s′∈Ss^{\prime}\in\mathcal{S} according to the transition law P(⋅∣s,a)P(\cdot|s,a). The precise definitions require measure-theoretic concepts (Bertsekas & Shreve, 1978), i.e., PP is a Markov kernel, mapping from S×A\mathcal{S}\times\mathcal{A} to distributions over S\mathcal{S}, hence, all these spaces need to be properly equipped with a measurability structure. For the sake of readability and also because they are well understood, we omit these technical details.

The agent’s goal is to maximize the total expected reward received over time.

If PP is known, the behavior that achieves this over any number of episodes can be described by applying a deterministic policy π\pi. Such a policy is a mapping from S×[H]\mathcal{S}\times[H] into A\mathcal{A}, where we use the convention that for a natural number nn, [n]={1,…,n}[n]=\{1,\dots,n\}. Following the policy means that the agent upon encountering state ss in stage hh will choose action π(s,h)\pi(s,h). In what follows, we will use πh(s)\pi_{h}(s) as an alternate notation, as this makes some of the formulae more readable. We will also follow this convention when it comes to other functions whose domain is S×[H]\mathcal{S}\times[H]. We will find it convenient to move the stage hh into the index. In particular, for policies, we will also write πh(s)\pi_{h}(s) for π(s,h)\pi(s,h) but we will use the same convention for other similar objects, like the value function, defined next.

In online RL, a good agent of course uses all past observations to come up with its decisions. The performance of such an agent is measured by its regret, which is the total reward the agent misses because they did not follow the optimal policy from the beginning. In particular, the total expected regret of an agent A\mathcal{A} across KK episodes is given by

where T=KHT=KH is the total number of time steps that the agent interacts with its environment, s1k=s∘s_{1}^{k}=s_{\circ} is the initial state at the start of the kk-th episode, and s11,a11,…,sHk,aHk,…,s1K,a1K,…,sHK,aHKs_{1}^{1},a_{1}^{1},\ldots,s_{H}^{k},a_{H}^{k},\ldots,s_{1}^{K},a_{1}^{K},\ldots,s_{H}^{K},a_{H}^{K} are the T=KHT=KH state-action pairs in the order that they are encountered by the agent. The regret is sublinear of R(T)/T→0R(T)/T\to 0 as T→∞T\to\infty. For a fixed TT, let R∗(T)R^{*}(T) denote the worst-case regret. As is well known, no matter the algorithm used, R∗(T)R^{*}(T), grows at least as fast as T\sqrt{T} (e.g., Jaksch et al., 2010).

In this paper, we aim to design a general model-based reinforcement learning algorithm, with a guaranteed sublinear regret, for any given family of transition models.

The unknown transition model PP belongs to a family of models P\mathcal{P} which is available to the learning agent. The elements of P\mathcal{P} are transition kernels mapping state-action pairs to signed distributions over S\mathcal{S}.

That we allow signed distributions increases the generality; this may be important when one is given a model class that can be compactly represented but only when it also includes non-probability kernels (see Pires & Szepesvári 2016 for a discussion of this).

An important special case is the class of linear mixture models:

for all (s,a)∈S×A(s,a)\in\mathcal{S}\times\mathcal{A}.

Parametric and nonparametric transition models are common in modelling complex stochastic controlled systems. For one example, robotic systems are often smoothly parameterized by unknown mechanical parameters such as friction, or just parameters that describe the geometry of the robot.

The linear mixture model can be viewed as a way of aggregating a number of known basis models as considered by Modi et al. (2019). We can view each Pj(⋅∣⋅)P_{j}(\cdot|\cdot) as a basis latent “mode” and the actual transition is a probabilistic mixture of these latent modes. For another example, consider large-scale queueing networks where the arrival rate and job processing speed for each queue is not known. By using a discrete-time Bernoulli approximation, the transition probability matrix from time tt to t+Δtt+\Delta t becomes increasingly close to linear with respect to the unknown arrival/processing rates as Δt→0\Delta t\to 0. In this case, it is common to model the discrete-time state transition as a linear aggregation of arrival/processing processes with unknown parameters Kovalenko (1968).

Another interesting special case is the linear-factored MDP model of Yang & Wang (2019a) where, assuming a discrete state space for a moment, PP takes the form

Upper Confidence RL with Value-Targeted Model Regression

Our algorithm can be viewed as a generalization of UCRL (Jaksch et al., 2010), following ideas of Osband & Van Roy (2014).

In particular, at the beginning of episode k=1,2,…,Kk=1,2,\dots,K, the algorithm first computes a subset BkB_{k} of the model class P\mathcal{P} that contains the set of models that are deemed to be consistent with all the data that has been collected in the past. The new idea, value-targeted regression is used in the construction of BkB_{k}. The details of how this is done are postponed to a later section.

Next, the algorithm needs to find the model that maximizes the optimal value, and the corresponding optimal policy. Denoting by VP∗V^{*}_{P} the optimal value function under a model PP, this amounts to finding the model P∈BkP\in B_{k} that maximizes the value VP,1∗(s1k)V^{*}_{P,1}(s_{1}^{k}). Given the model PkP_{k} that maximizes this value, an optimal policy is extracted from the model as described in the next section (this is standard dynamic programming). At the end of the episode, the data collected is used to refine the confidence set BkB_{k}. The pseudocode of the algorithm can be found in Algorithm 1.

Upper confidence methods are prominent in online learning. In our algorithm, we will maintain a confidence set BkB_{k} for the estimated transition model and use it for optimistic planning:

where s1ks_{1}^{k} is the initial state at the beginning of episode kk and we use VP′,1∗V^{*}_{P^{\prime},1} to denote the optimal value function of stage one, when the transition model is P′P^{\prime}. Given model PkP_{k}, the optimal policy for PkP_{k} can be computed using dynamic programming. In particular, for 1≤h≤H+11\leq h\leq H+1, define

where we with a measure μ\mu and function ff over the same domain, we use ⟨μ,f⟩\langle\mu,f\rangle to denote the integral of ff with respect to μ\mu. Then, taking the action at stage hh and state ss that maximizes Qh,k(s,⋅)Q_{h,k}(s,\cdot) gives an optimal policy for model PkP_{k}. As long as P∈BkP\in B_{k} with high probability, the preceding calculation gives an optimistic (that is, upper) estimate of value of an episode. Next we show how to construct the confidence set BkB_{k}.

2 Value-Targeted Regression for Confidence Set Construction

Every time we observe a transition (s,a,s′)(s,a,s^{\prime}) with s′∼P(⋅∣s,a)s^{\prime}\sim P(\cdot|s,a), we receive information about the model PP. Instead of regression onto fixed target like probabilities or raw states, we will refresh the model estimate by regression using the estimated value functions as target.

In the above regression procedure, the regret target keeps changing as the algorithm constructs increasingly accurate value estimates. This is in contrast to typical supervised learning for building models, where the regression targets are often fixed objects (such as raw observations, features or keypoints; e.g. Jaksch et al. (2010); Osband & Van Roy (2014); Abbasi-Yadkori & Szepesvári (2015); Xie et al. (2016); Agrawal & Jia (2017); Yang & Wang (2019a); Kaiser et al. (2019)).

For a confidence set construction, we get inspiration from Proposition 5 in the paper of Osband & Van Roy (2014). The set is centered at P^k+1\hat{P}_{k+1}.Define

and the value of βk\beta_{k} can be obtained using a calculation similar to that done in Proposition 5 of the paper of Osband & Van Roy (2014), which is based on the nonlinear least-squares confidence set construction from Russo & Van Roy (2014), which we describe in the appendix.

It is not hard to see that the confidence set can also be written in the alternative form

Note that the above formulation strongly exploits that the MDP is time-homogeneous: The same transition model is used at all stages of an episode. When the MDP is time-inhomogeneous, the construction can be easily modified to accommodate that the transition kernel may depend on the stage index.

3 Implementation of UCRL-VTR

Algorithm 1 gives a general and modular template for model-based RL that is compatible with regression methods/optimistic planners. While the algorithms is conceptually simple, and the optimization and evaluation of the loss in value-targeted regression appears to be at advantage in terms of computation as compared to standard losses typically used in model-based RL, the implementation of UCRL-VTR is nontrivial in general and for now it requires a case-by-base design.

Computation efficiency of the algorithm depends on the specific family of models chosen. For the linear-factor MDP model considered by Yang & Wang (2019a), the regression is linear and admits efficient implementation; further, optimistic planning for this model can be implemented in poly(d)\text{poly}(d) time by using Monte-Carlo simulation and sketching as argued in the cited paper. Other ideas include loosening the confidence set to come up with computationally tractable methods, or relaxing the requirement that the same model is used in all stages.

In the general case, optimistic planning is computationally intractable. However, we expect that randomized (eg Osband et al. (2017, 2014); Lu & Van Roy (2017)) and approximate dynamic programming methods (tree search, roll out, see eg Bertsekas & Tsitsiklis (1996)) will often lead to tractable and good approximations. As was mentioned above, in some special cases these have been rigorously shown to work. In similar settings, the approximation errors are known to mildly impact the regret Abbasi-Yadkori & Szepesvári (2015) and we expect the same will hold in our setting.

If we look beyond methods with rigorous guarantees, there are practical deep RL algorithms that implement parts of UCRL-VTR. As mentioned earlier, the Muzero algorithm of Schrittwieser et al. (2019) is a state-of-the-art algorithm on the Atari domain and this algorithm implements both value-targeted-regression to learn a model and Monte Carlo tree search for planning based on the learned model, although it does not incorporate optimistic planning.

Theoretical Analysis

We will need the concept of Eluder dimension. Let F\mathcal{F} be a set of real-valued functions with domain X\mathcal{X}. To measure the complexity of interactively identify an element of F\mathcal{F}, Russo & Van Roy (2014) defines the Eluder dimension of F\mathcal{F} at scale ϵ>0\epsilon>0. For f∈Ff\in\mathcal{F}, x1,…,xt∈Xx_{1},\dots,x_{t}\in\mathcal{X}, introduce the notation f∣(x1,…,xt)=(f(x1),…,f(xt))f|_{(x_{1},\dots,x_{t})}=(f(x_{1}),\dots,f(x_{t})). We say that x∈Xx\in\mathcal{X} is ϵ\epsilon-independent of x1,…,xt∈Xx_{1},\dots,x_{t}\in\mathcal{X} given F\mathcal{F} if there exists f,f′∈Ff,f^{\prime}\in\mathcal{F} such that ∥(f−f′)∣(x1,…,xt)∥2≤ϵ\|(f-f^{\prime})|_{(x_{1},\dots,x_{t})}\|_{2}\leq\epsilon while f(x)−f′(x)>ϵf(x)-f^{\prime}(x)>\epsilon.

The Eluder dimension dimE⁡(F,ϵ)\operatorname{dim_{\mathcal{E}}}(\mathcal{F},\epsilon) of F\mathcal{F} at scale ϵ\epsilon is the length of the longest sequence (x1,…,xn)(x_{1},\dots,x_{n}) in X\mathcal{X} such that for some ϵ′≥ϵ\epsilon^{\prime}\geq\epsilon, for any 2≤t≤n2\leq t\leq n, xtx_{t} is ϵ′\epsilon^{\prime}-independent of (x1,…,xt−1)(x_{1},\dots,x_{t-1}) given F\mathcal{F}.

Note that F⊂B(X,H)\mathcal{F}\subset\mathcal{B}(\mathcal{X},H). For a norm ∥⋅∥\|\cdot\| on F\mathcal{F} and α>0\alpha>0 let N(F,α,∥⋅∥)\mathcal{N}(\mathcal{F},\alpha,\|\cdot\|) denote the (α,∥⋅∥)(\alpha,\|\cdot\|)-covering number of F\mathcal{F}. That is, this if m=N(F,α,∥⋅∥)m=\mathcal{N}(\mathcal{F},\alpha,\|\cdot\|) then one can find mm points of F\mathcal{F} such that any point in F\mathcal{F} is at most α\alpha away from one of these points in norm ∥⋅∥\|\cdot\|. Denote by ∥⋅∥∞\|\cdot\|_{\infty} the supremum norm: ∥f∥∞=sup⁡x∈X∣f(x)∣\|f\|_{\infty}=\sup_{x\in\mathcal{X}}|f(x)|.

Now we analyze the regret of UCRL-VTR. Define the KK-episode pseudo-regret as

Let Assumption 1 hold and let α∈(0,1).\alpha\in(0,1). For k∈[K]k\in[K], let βk\beta_{k} be

where d=dimE⁡(F,α)d=\operatorname{dim_{\mathcal{E}}}(\mathcal{F},\alpha) is the Eluder dimension with F\mathcal{F} given by (5).

A typical choice of α\alpha is α=1/(KH)\alpha=1/(KH). In the special case of linear transition model, Theorem 1 implies a worst-case regret bound that depends linearly on the number of parameters.

We also provide a lower bound for the regret in our model. The proof is by reduction to a known lower bound and is left to Appendix B.

For any H≥1H\geq 1 and d≥8d\geq 8, there exist a state space S\mathcal{S} and action set A\mathcal{A}, a reward function r:S×A→r:\mathcal{S}\times\mathcal{A}\to, dd transition models P1,…,PdP_{1},\dots,P_{d} and a set Θ\Theta of diameter at most one such that for any algorithm there exists θ∈Θ\theta\in\Theta such that for sufficiently large number of episodes KK, the expected regret of the algorithm on the HH-horizon MDP with reward rr and transition model P=∑jθjPjP=\sum_{j}\theta_{j}P_{j} is at least Ω(HdK)\Omega(H\sqrt{dK}).

Rusmevichientong & Tsitsiklis (2010) gave a regret lower bound of Ω(dT)\Omega(d\sqrt{T}) for linearly parameterized bandit with actions on the unit sphere (see also Section 24.2 of Lattimore & Szepesvári (2020)). Our regret upper bound matches this bandit lower bound in d,Td,T. Whether the upper or lower bound is tight (or none of them) remains to be seen.

The theorems validate that, in the setting we consider, it is sufficient to use the predicted value functions as regression targets. That for the special case of linear mixture models the lower bound is close to the upper bound appears to suggest that little benefit if any can be derived from fitting the transition model to predict well future observations. We conjecture that this is in fact true when considering the worst-case regret. Of course, a conclusion that is concerned with the worst-case regret has no implication for the behavior of the respective methods on particular MDP instances.

We note in passing that by appropriately increasing βk\beta_{k}, the regret upper bounds can be extended to the so-called misspecified case when PP can be outside of P\mathcal{P} (for related results, see, e.g., Jin et al. 2019; Lattimore & Szepesvári 2019). However, the details of this are left for future work.

Related Work

A number of prior efforts have established efficient RL methods with provable regret bounds. For tabular MDPs with SS states and AA actions, building on the pioneering work of Jaksch et al. (2010) who studied the technically more challenging continuing setting, a number of works obtained results for the episodic setting, both with model-based (e.g., Osband et al. 2014; Azar et al. 2017; Dann et al. 2017, 2018; Agrawal & Jia 2017), and model-free methods (e.g., Jin et al. 2018; Russo 2019; Zhang et al. 2020), both for the time-homogeneous case (i.e., the same transition kernel governs the dynamics in all stages of the HH-horizon episode) and the time-inhomogeneous case. Results developed for the time-inhomogeneous case apply to the time-inhomogeneous case and since in this case the number of free parameters to learn is at least HH times larger than for the time-homogeneous case, the regret bounds are expected to be H\sqrt{H} larger.

As far as regret lower bounds are concerned, Jaksch et al. (2010) established a worst-case regret lower bound of Ω(DSAT)\Omega(\sqrt{DSAT}) for the continuing case for MDPs with diameter bounded by DD (see also Chapter 38 of Lattimore & Szepesvári 2020). This lower bound can be adapted to the episodic by setting D=HD=H. This way one obtains a lower bound of Ω(HSAT)\Omega(\sqrt{HSAT}) for the homogeneous, and Ω(H2SAT)\Omega(\sqrt{H^{2}SAT}) for the inhomogeneous case (because here the state space size is effectively HSHS). This lower bound, up to lower order terms, is matched by upper bounds both for the time-homogeneous case (Azar et al., 2017; Kakade et al., 2018) and the time inhomogeneous case (Dann et al., 2018; Zhang et al., 2020). Except the work of Zhang et al. (2020), these results are achieved by algorithms that estimate models. With a routine adjustment, the near-optimal model-based algorithms available for the homogeneous case are also expected to deliver near-optimal worst-case regret growth in the inhomogeneous case. A further variation is obtained by considering different scalings of the reward (Wang et al., 2020a).

As for RL with a general model class, the seminal paper Osband & Van Roy (2014) provided a general posterior sampling RL method that works for any given classes of reward and transition functions. It established a Bayesian regret upper bound O(dKdET)O(\sqrt{d_{K}d_{E}T}), where dKd_{K} and dEd_{E} are the Kolmogorov and the Eluder dimensions of the model class. In the case of linearly parametrized transition model (Assumption 2 of this paper), this Bayesian regret becomes O(dT)O(d\sqrt{T}), and our worst-case regret result matches with the Bayesian one. Abbasi-Yadkori & Szepesvári (2015); Theocharous et al. (2017) also considered the Bayesian regret and in particular Abbasi-Yadkori & Szepesvári (2015) considered a smooth parameterization with a somewhat unusual definition of smoothness. To the authors’ best knowledge, there are no prior works addressing the problem of designing low-regret algorithms for MDPs with a general model family. In particular, while Osband & Van Roy (2014) sketch the main ideas of an optimistic model-based optimistic algorithm for a general model class, they left out the details. When the details are filled based on their approach for the Bayesian case, unlike in the present work, the confidence sets would be constructed by losses that measure how well the model predict future observations and not by the value-targeted regression loss studied here. A preliminary version of the present paper appeared at L4DC 2020, which included results for the linear transition model only.

Numerical Experiments

The algorithms that we compare have a model-fitting objective which is either used to fit a nominal model or to calculate confidence sets. The objective is either to minimize mean-squared error of predicting next states (alternatively, maximize log-likelihood of observed data), which leads to standard frequency based model estimates, or it is based on minimizing the value targets as proposed in our paper. The other component of the algorithms is whether they implement optimistic planning, or planning with the nominal model and then implementing an ϵ\epsilon-greedy policy with respect to the estimated model (“dithering”). We also consider mixing value targets and next state targets. In the case of optimistic planning, the algorithm that uses mixed targets uses a union bound and takes the smallest value upper confidence bounds amongst the two bounds obtained with the two model-estimation methods. These leads to six algorithms, as shown in Table 1. Results for the “mixed” variants are very similar to the variant that uses value-targeted regression. As such, the results for the “mixed” variants are shown in the appendix only, as they would otherwise make the graphs overly cluttered.

In the experiments we use confidence bounds that are specialized to the linear case. For the details, see Appendix C. For ϵ\epsilon-greedy, we optimize the value of ϵ\epsilon in each environment to get the best results. This gives ϵ\epsilon-greedy an unfair advantage; but as we shall see despite this advantage, ϵ\epsilon-greedy will not fair particularly well in our experiments.

We compare these algorithms on the episodic RiverSwim environment due to Strehl & Littman (2008) and a novel finite horizon MDP we tentatively call WideTree. The RiverSwim environment, whose detailed description is given below in Section 6.3, is chosen because it is known that in this environment “dithering” type exploration methods (e.g., ϵ\epsilon-greedy) are ineffective. We vary the number of states in the RiverSwim environment in order to highlight some of the advantages and disadvantages of Value-Targeted Regression.

WideTree is designed in order it highlight the advantages of Value-Targeted Regression when compared with more tradition frequency based methods. In this environment, only one action effects the outcome thus the other actions are non-informative. The detailed description of WideTree is given in Section 6.4.

2 Measurements

We report the cumulative regret as a function of the number of episodes and the weighted model error to indicate how well the model is learned. The results are obtained from 3030 independent runs for the ϵ\epsilon-greedy algorithms and 1010 independent runs for the UC algorithms, The weighted model error reported is as follows. Given the model estimate P^\hat{P}, its weighted error is

where N(s,a)N(s,a) is the observation-count of the state-action pair (s,a)(s,a), N(s,a,s′)N(s,a,s^{\prime}) is the count of transitioning to s′s^{\prime} from (s,a)(s,a), and P∗(s′∣s,a)P^{*}(s^{\prime}\mid s,a) is the probability of s′s^{\prime} when action aa is chosen in state ss, according to the true model. Here, for the algorithms that use value-targeted regression the estimated model P^\hat{P} is the model obtained through Eq. (4). The weighting is introduced so that an algorithm that discards a state-action pair is not penalized. This is meant to prevent penalizing good exploration algorithms that may quickly discard some state-action pairs. We are interested in this error metric to monitor whether UCLR-VTR, which is not forced to model next-state distributions, will learn the proper next state distribution. In fact, we will see one example both for the case when this and also when this does not happen.

3 Results for RiverSwim

The schematic diagram of the RiverSwim environment is shown in Figure 1. RiverSwim consists of SS states arranged in a chain. The agent begins on the far left and has the choice of swimming left or right at each state. There is a current that makes swimming left much easier than swimming right. Swimming left with the current always succeeds in moving the agent left, but swimming right against the current sometimes moves the agent right (with a small probability of moving left as well), but more often than not leaves the agent in the current state. Thus smart exploration is a necessity to learn a good policy in this environment.

We experiment with small environments with S∈{3,4,5}S\in\{3,4,5\} states and set the horizon to 4S4S for each case. The optimal values of the initial state are 5.725.72, 5.665.66 and 5.65.6, respectively, in these cases. The initial state is the leftmost state (s1s_{1} in the diagram). The value that we found to work the best for ϵ\epsilon greedy is ϵ=0.01\epsilon=0.01.

Results are shown in Figure 2, except for UCRL-Mixed and EG-Mixed, whose results are given in Appendix D. As noted before, the results of these algorithms are very close to those of the VTR-versions, hence, they are not included here. The columns correspond to environments with S=3S=3, S=4S=4 and S=5S=5, respectively, which are increasingly more challenging. The first row shows the algorithm’s performance measured in terms of their respective cumulative regrets, the second row shows results for the weighted model error as defined above. The regret per episode for an algorithm that “does not learn” is expected to be in the same range as the respective optimal values. Based on this we see that 10510^{5} episodes is barely sufficient for the algorithms other than UCRL-VTR to learn a good policy. Looking at the model errors we see that EGRL-VTR is doing quite poorly, EG-Freq is also lacking (especially on the environment with 55 states), the others are doing reasonably well. That EG-Freq is not doing well is perhaps surprising. However, this is because EG-Freq visits more uniformly than the other methods the various state-action pairs.

The results clearly indicate that (i) fitting to the state-value function alone provides enough of a signal for learning as evident by UCRL-VTR obtaining low regret as predicted by our theoretical results, and that (ii) optimism is necessary when using value targeted regression to achieve good results, as evident by UCRL-VTR achieving significantly better regret than EGRL-VTR and even in the smaller RiverSwim environment where EG-Freq performed best.

It is also promising that value-targeted regression with optimistic exploration outperformed optimism based on the “canonical” model estimation procedure. We attribute this to the fact that value-targeted regression will learn a model faster that predicts the optimal values well than the canonical, frequency based approach.

That value-targeted regression also learns a model with small weighted error appears to be an accidental feature of this environment. Our next experiments are targeted at further exploring this effect.

4 WideTree

We introduce a novel tabular MDP we call WideTree. The WideTree environment has a fixed horizon H=2H=2 but can vary in the number of states. A visualization of an eleven state WideTree environment is shown in Figure 3.

In WideTree, an agent starts at the initial state s1s_{1}. The agent then progresses to one of the many bottom terminal states and collects a reward of either 0 or 1 depending on the action selected at state s1s_{1}. The only significant action is whether to transition from s1s_{1} to either s2s_{2} or s3s_{3}. Note that the model in the second layer is irrelevant for making a good decision: Once in s3s_{3}, all actions lead to a reward of one, and once in s2s_{2}, all actions lead to a reward of zero. We vary the number of bottom states reachable from states s2s_{2} and s3s_{3} while still maintaining a reward structure depending on whether the algorithm choose to transition to either s2s_{2} or s3s_{3} from the initial state s1s_{1}.

We set ϵ=0.1\epsilon=0.1 in this environment, though choosing smaller ϵ\epsilon but as long as ϵ>0\epsilon>0 then both EGRL-VTR and EG-Freq will incur linear regret dependent on the choice of ϵ\epsilon. One could also change the reward function in order to make learning for a given ϵ\epsilon hard.

The results are shown in Figure 4, except for UCRL-Mixed and EG-Mixed, whose results are given in Appendix D. Both UCRL-VTR and EG-VTR learn equally poor models (their graphs are ‘on the top of each other’). Yet, UCRL-VTR manages to quickly learn a good policy, as attested by its low regret.

EG-Freq and EG-VTR perform equally poorly and UC-MatrixRL is even slower as it keeps exploring the environment. These experiments clearly illustrate that UCRL-VTR is able to achieve good results without learning a good model – its focus on values makes pays off swiftly in this well-chosen environment.

Conclusions

Acknowledgements

Csaba Szepesvári gratefully acknowledges funding from the Canada CIFAR AI Chairs Program, Amii and NSERC.

References

Appendix A Proof of Theorem 1

In this section, we provide the regret analysis of the UCRL-VTR Algorithm (Algorithm 1). We will explain the motivation for our construction of confidence sets for general nonlinear squared estimation, and establish the regret bound for a general class of transition models, P\mathcal{P}.

Given any policy π\pi (which may or may not use the history), its value function is

where Eπ,δsE_{\pi,\delta_{s}} is the expectation operator underlying the probability measure Pπ,δsP_{\pi,\delta_{s}} induced over sequences of state-action pairs of length HH by executing policy π\pi starting at state ss in the MDP MM and shs_{h} is the state visited in stage hh and action aha_{h} is the action taken in that stage after visiting shs_{h}. For a nonstationary Markov policy π=(π1,…,πH)\pi=(\pi_{1},\dots,\pi_{H}), we also let

be the value function of π\pi from stage hh to HH. Here, πh:H\pi_{h:H} denotes the policy (πh,…,πH)(\pi_{h},\dots,\pi_{H}). The optimal value function V∗=(V1∗,…,VH∗)V^{*}=(V^{*}_{1},\dots,V^{*}_{H}) is defined via Vh∗(s)=max⁡πVhπ(s)V^{*}_{h}(s)=\max_{\pi}V^{\pi}_{h}(s), s∈Ss\in\mathcal{S}.

For simplicity assume that rr is known. To indicate the dependence of V∗V^{*} on the transition model PP, we will write VP∗=(VP,1∗,…,VP,H∗)V^{*}_{P}=(V^{*}_{P,1},\dots,V^{*}_{P,H}). For convenience, we define VP,H+1∗=0V^{*}_{P,H+1}=0.

Algorithm 1 is an instance of the following general model-based optimistic algorithm:

Specific instances of Algorithm 2 differ in terms of how Bk+1\mathcal{B}_{k+1} is constructed. In particular, UCRL-VTR uses the construction described in Section 3.2.

Recall that Vk=(V1,k,…,VH,k,VH+1,k)V_{k}=(V_{1,k},\dots,V_{H,k},V_{H+1,k}) (with VH+1,k=0V_{H+1,k}=0) in Algorithm 2. Let πk\pi_{k} be the nonstationary Markov policy chosen in episode kk by Algorithm 2. Let

be the pseudo-regret of Algorithm 1 for KK episodes. The following standard lemma bounds the kkth term of the expression on the right-hand side.

Assuming that P∈BkP\in\mathcal{B}_{k}, we have

Note that (ξ2,1,ξ3,1,…,ξH,1,ξ2,2,ξ3,2,…,ξH,2,ξ2,3,… )(\xi_{2,1},\xi_{3,1},\dots,\xi_{H,1},\xi_{2,2},\xi_{3,2},\dots,\xi_{H,2},\xi_{2,3},\dots) is a sequence of martingale differences.

Because P∈BkP\in\mathcal{B}_{k}, V1∗(s1k)≤V1,k(s1k)V_{1}^{*}(s_{1}^{k})\leq V_{1,k}(s_{1}^{k}) by the definition of the algorithm. Hence,

Fix h∈[H]h\in[H]. In what follows we bound Vh,k(shk)−Vhπk(shk)V_{h,k}(s_{h}^{k})-V_{h}^{\pi_{k}}(s_{h}^{k}). By the definition of πk\pi_{k}, PkP^{k} and ahka_{h}^{k}, we have

Therefore, by induction, noting that VH+1,k=0V_{H+1,k}=0, we get that

A.2 The confidence sets for Algorithm 1

The previous lemma suggests that at the end of the kkth episode, the model could be estimated using

For a confidence set construction, we get inspiration from Proposition 5 in the paper of Osband & Van Roy (2014). The set is centered at P^k\hat{P}_{k}:

Note that this is the same confidence set as described in Section 3.2. To obtain the value of βk\beta_{k}, we now consider the nonlinear least-squares confidence set construction from Russo & Van Roy (2014). The next section is devoted to this construction.

A.3 Confidence sets for general nonlinear least-squares

We have the following theorem, the proof of which is given in Section A.6.

The proof follows that of Proposition 6, Russo & Van Roy (2014), with minor improvements, which lead to a slightly better bound. In particular, with our notation, Russo & Van Roy stated their result with

While βt(δ,α)≤βtRvR(δ,α)\beta_{t}(\delta,\alpha)\leq\beta_{t}^{\text{RvR}}(\delta,\alpha), the improvement is only in terms of smaller constants.

To use this result in our RL problem recall that P\mathcal{P} is the set of transition probabilities parameterized by θ∈Θ\theta\in\Theta. We index time t=1,2,…t=1,2,\dots in a continuous fashion. Episode k=1,2,…k=1,2,\dots and stage h=1,…,H−1h=1,\dots,H-1 corresponds to time t=(k−1)(H−1)+ht=(k-1)(H-1)+h:

Note that the transitions at stage h=Hh=H are skipped and the time index at the end of episode k≥1k\geq 1 is k(H−1)k(H-1).

Let V(t)V_{(t)} be the value function used by Algorithm 1 at time tt (V(t)V_{(t)} is constant in periods of length H−1H-1), while let (s(t),a(t))(s_{(t)},a_{(t)}) be the state-action pair visited at time tt.

Let V\mathcal{V} be the set of optimal value functions under some model in P\mathcal{P}: V={VP′∗ : P′∈P}\mathcal{V}=\{V^{*}_{P^{\prime}}\,:\,P^{\prime}\in\mathcal{P}\}. Note that V⊂B(S,H)\mathcal{V}\subset\mathcal{B}(\mathcal{S},H), where B(S,H)\mathcal{B}(\mathcal{S},H) denotes the set of real-valued measurable functions with domain S\mathcal{S} that are bounded by HH. Note also that for all tt, V(t)∈VV_{(t)}\in\mathcal{V}. Define X=S×A×V\mathcal{X}=\mathcal{S}\times\mathcal{A}\times\mathcal{V}. We also let Xt=(s(t),a(t),V(t))X_{t}=(s_{(t)},a_{(t)},V_{(t)}), Yt=V(t)(s(t+1))Y_{t}=V_{(t)}(s_{(t+1)}) when t+1∉{H+1,2H+1,… }t+1\not\in\{H+1,2H+1,\dots\} and Yt=V(t)(sH+1k)Y_{t}=V_{(t)}(s_{H+1}^{k}), and choose

Note that F⊂B∞(X,H)\mathcal{F}\subset\mathcal{B}_{\infty}(\mathcal{X},H).

Let ϕ:P→F\phi:\mathcal{P}\to\mathcal{F} be the natural surjection to F\mathcal{F}: ϕ(P)=f\phi(P)=f where f(s,a,v)=∫Pa(ds′∣s)v(s′)f(s,a,v)=\int P_{a}(ds^{\prime}|s)v(s^{\prime}) for (s,a,v)∈X(s,a,v)\in\mathcal{X}. We know show that ϕ\phi is in fact a bijection. If P≠P′P\neq P^{\prime}, this means that for some (s,a)∈S×A(s,a)\in\mathcal{S}\times\mathcal{A} and U⊂SU\subset\mathcal{S} measurable, Pa(U∣s)≠Pa′(U∣s)P_{a}(U|s)\neq P_{a}^{\prime}(U|s). Choosing vv to be the indicator of UU, note that (s,a,v)∈X(s,a,v)\in\mathcal{X}. Hence, ϕ(P)(s,a,v)=Pa(U∣s)≠Pa′(U∣s)=ϕ(P′)(s,a,v)\phi(P)(s,a,v)=P_{a}(U|s)\neq P_{a}^{\prime}(U|s)=\phi(P^{\prime})(s,a,v), and hence ϕ(P)≠ϕ(P′)\phi(P)\neq\phi(P^{\prime}): ϕ\phi is indeed a bijection. For convenience and to reduce clutter, we will write fP=ϕ(P)f_{P}=\phi(P).

Let t=k(H−1)t=k(H-1) for some k≥1k\geq 1. Thus, this time step corresponds to finishing episode kk and thus V(t)=VkV_{(t)}=V_{k}. Furthermore, letting f^t=argmin⁡f∈F∑p=1t(f(Xp)−Yp)2\hat{f}_{t}=\operatorname{argmin}_{f\in\mathcal{F}}\sum_{p=1}^{t}(f(X_{p})-Y_{p})^{2}, since ϕ\phi is an injection, we see that f^t=fP^k\hat{f}_{t}=f_{\hat{P}_{k}} where P^k\hat{P}_{k} is defined using (8). For P′,P′′∈PP^{\prime},P^{\prime\prime}\in\mathcal{P}, we have Lk(P′,P′′)=∑p=1t(fP′(Xp)−fP′′(Xp))2L_{k}(P^{\prime},P^{\prime\prime})=\sum_{p=1}^{t}(f_{P^{\prime}}(X_{p})-f_{P^{\prime\prime}}(X_{p}))^{2} and thus

Then, with probability 1−δ1-\delta, for any k≥1k\geq 1, P∈BkP\in\mathcal{B}_{k} where Bk\mathcal{B}_{k} is defined by (9).

A.5 Regret of Algorithm 1

Let F⊂B∞(X,C)\mathcal{F}\subset B_{\infty}(\mathcal{X},C) be a set of functions bounded by C>0C>0, (Ft)t≥1(\mathcal{F}_{t})_{t\geq 1} and (xt)t≥1(x_{t})_{t\geq 1} be sequences such that Ft⊂F\mathcal{F}_{t}\subset\mathcal{F} and xt∈Xx_{t}\in\mathcal{X} hold for t≥1t\geq 1. Then, for any T≥1T\geq 1 and α>0\alpha>0 it holds that

where δT=max⁡1≤t≤Tdiam⁡(Ft∣x1:t)\delta_{T}=\max_{1\leq t\leq T}\operatorname{diam}(\mathcal{F}_{t}|_{x_{1:t}}) and d=dimE⁡(F,α)d=\operatorname{dim_{\mathcal{E}}}(\mathcal{F},\alpha).

Let α>0\alpha>0 and d=dimE⁡(F,α)d=\operatorname{dim_{\mathcal{E}}}(\mathcal{F},\alpha) where F\mathcal{F} is given by (10). Then, for any nondecreasing sequence (βk2)k=1K(\beta_{k}^{2})_{k=1}^{K}, on the event when P∈∩k∈[K]BkP\in\cap_{k\in[K]}\mathcal{B}_{k},

Note that for any k∈[K]k\in[K] and h∈[H−1]h\in[H-1], ξh+1,k∈[−H,H]\xi_{h+1},k\in[-H,H]. As noted beforehand, ξ2,1,ξ3,1\xi_{2,1},\xi_{3,1}, …,ξH,1,ξ2,2,ξ3,2,…,ξH,2,ξ2,3,…\dots,\xi_{H,1},\xi_{2,2},\xi_{3,2},\dots,\xi_{H,2},\xi_{2,3},\dots is a martingale difference sequence. Thus, with probability 1−δ1-\delta, ∑k=1K∑h=1H−1ξh+1,k≤H2K(H−1)log⁡(1/δ)\sum_{k=1}^{K}\sum_{h=1}^{H-1}\xi_{h+1,k}\leq H\sqrt{2K(H-1)\log(1/\delta)}. Consider the event when this inequality holds and when P∈∩k∈[K]BkP\in\cap_{k\in[K]}\mathcal{B}_{k}. By using Corollary 6 and a union bound, this event holds with probability at least 1−2δ1-2\delta. On this event, by (11) and Lemma 8, we obtain

Using α≤1\alpha\leq 1, which holds by assumption, finishes the proof. ∎

A.5.2 Proof of Corollary 2

For α>0\alpha>0 let N(P,α,∥⋅∥∞,1)\mathcal{N}(\mathcal{P},\alpha,\|\cdot\|_{\infty,1}) denote the (α,∥⋅∥∞,1)(\alpha,\|\cdot\|_{\infty,1})-covering number of P\mathcal{P}. Then we have

with some universal constant C>0C>0. Let f:(Θ,∥⋅∥)→(P,∥⋅∥∞,1)f:(\Theta,\|\cdot\|)\to(\mathcal{P},\|\cdot\|_{\infty,1}) be defined by θ↦∑jθjPj\theta\mapsto\sum_{j}\theta_{j}P_{j}. Note that ∥f(θ)−f(θ′)∥∞,1≤sup⁡s,a∑j∥(θj−θj′)Pj,a(s)∥1=∑j∣θj−θj′∣=∥θ−θ′∥1\|f(\theta)-f(\theta^{\prime})\|_{\infty,1}\leq\sup_{s,a}\sum_{j}\|(\theta_{j}-\theta_{j}^{\prime})P_{j,a}(s)\|_{1}=\sum_{j}|\theta_{j}-\theta_{j}^{\prime}|=\|\theta-\theta^{\prime}\|_{1}. Hence, any (ϵ,∥⋅∥1)(\epsilon,\|\cdot\|_{1}) covering of Θ\Theta induces an (ϵ,∥⋅∥∞,1)(\epsilon,\|\cdot\|_{\infty,1})-covering of P\mathcal{P} and so N(P,α/H,∥⋅∥∞,1)≤N(Θ,α/H,∥⋅∥1)≤C′(RH/α)d\mathcal{N}(\mathcal{P},\alpha/H,\|\cdot\|_{\infty,1})\leq\mathcal{N}(\Theta,\alpha/H,\|\cdot\|_{1})\leq C^{\prime}(RH/\alpha)^{d} with some universal constant C′>0C^{\prime}>0.

Now, choose 1/α=Klog⁡(KH/δ)1/\alpha=K\sqrt{\log(KH/\delta)}. Hence,

Suppressing log⁡\log factors (e.g., log⁡(RH)\log(RH)), log⁡log⁡\log\log terms and constants, we have βK=H2(d+log⁡(1/δ))\beta_{K}=H^{2}(d+\log(1/\delta)).

Plugging into Theorem 1 gives the desired result. ∎

A.6 Proof of Theorem 5

The proof of the next couple of statements is standard and is included only for completeness.

If XX is σ\sigma-subgaussian, then for any λ>0\lambda>0, with probability at least 1−δ1-\delta,

Choosing the λ\lambda that minimizes the right-hand side of the bound gives the usual form:

Suppose that XX is σ\sigma-subgaussian and X1X_{1} and X2X_{2} are independent and σ1\sigma_{1} and σ2\sigma_{2}-subgaussian, respectively, then:

X1+X2X_{1}+X_{2} is σ12+σ22\sqrt{\sigma_{1}^{2}+\sigma_{2}^{2}}-subgaussian.

A standard calculation gives that St=∑p=1tZpS_{t}=\sum_{p=1}^{t}Z_{p} is tσ\sqrt{t}\sigma-subgaussian (essentially, a refinement of the calculation that is need to show Part (3) of Lemma 10) and thus, in particular, for any t≥1t\geq 1 and λ>0\lambda>0, with probability 1−δ1-\delta,

In fact, by slightly strengthening the argument, one can show that the above inequality holds simultaneously for all t≥1t\geq 1:

Splitting ∥f∗−f∥t2\|f_{*}-f\|_{t}^{2} and rearranging gives

Recall that f^t=argmin⁡f∈F∥Y−f∥t2\hat{f}_{t}=\operatorname{argmin}_{f\in\mathcal{F}}\|Y-f\|_{t}^{2}. Plugging f^t\hat{f}_{t} into 15 in place of ff and using that thanks to f∗∈Ff_{*}\in\mathcal{F}, ∥Y−f^t∥t2≤∥Y−f∗∥t2\|Y-\hat{f}_{t}\|_{t}^{2}\leq\|Y-f_{*}\|_{t}^{2}, we get

Thus, it remains to bound E(f^t)E(\hat{f}_{t}). For this fix some α>0\alpha>0 to be chosen later and let G(α)⊂F\mathcal{G}(\alpha)\subset\mathcal{F} be an α\alpha-cover of F\mathcal{F} in ∥⋅∥∞\|\cdot\|_{\infty}. Let g∈G(α)g\in\mathcal{G}(\alpha) be a random function, also to be chosen later. We have

We start by bounding the last term above. A simple calculation gives that for any fixed f∈Ff\in\mathcal{F}, w.p. 1−δ1-\delta, 2⟨Z,f−f∗⟩t2\langle Z,f-f_{*}\rangle_{t} is 2σ∥f−f∗∥t2\sigma\|f-f_{*}\|_{t}-subgaussian. Hence, with probability 1−δ1-\delta, simultaneously for all t≥1t\geq 1,

where the equality follows by choosing λ=1/(4σ2)\lambda=1/(4\sigma^{2}) (which makes the first and last terms cancel). (Note how splitting ∥f−f∗∥t2\|f-f_{*}\|_{t}^{2} into two halves allowed us to bound the “error term” E(f)E(f) independently of tt.) Now, by a union bound, it follows that with probability at least 1−δ1-\delta, the second term is bounded by 4σ2log⁡(∣G(α)∣/δ)4\sigma^{2}\log(|\mathcal{G}(\alpha)|/\delta).

Let us now turn to bounding the first term. We calculate

It remains to bound ∥Z∥t\|Z\|_{t}. For this, we observe that with probability 1−δ1-\delta, simultaneously for all t≥1t\geq 1,

Indeed, this follows because with probability 1−δ1-\delta, simultaneously for any s≥1s\geq 1, ∣Zp∣2≤2σ2log⁡(2s(s+1)/δ)|Z_{p}|^{2}\leq 2\sigma^{2}\log(2s(s+1)/\delta) holds because of a union bound and Eq. (13). Therefore, for the above choice gg, with probability 1−δ1-\delta, simultaneously for all t≥1t\geq 1, it holds that

Merging this with Eqs. (16) and (17) and with another union bound, we get that with probability 1−δ1-\delta, for any t≥1t\geq 1,

where NαN_{\alpha} is the (α,∥⋅∥∞)(\alpha,\|\cdot\|_{\infty})-covering number of F\mathcal{F}. ∎

Appendix B Proof of Theorem 3

In this section we establish a regret lower bound by reduction to a known result for tabular MDP.

We assume without loss of generality that dd is a multiple of 4 and d≥8d\geq 8. We set S=2S=2 and A=d/4≥2A=d/4\geq 2. According to Azar et al. (2017), Osband & Van Roy (2016), there exists an MDP M(S,A,P,r,H)\mathcal{M}(\mathcal{S},\mathcal{A},P,r,H) with SS states, AA actions and horizon HH such that any algorithm has regret at least Ω(HSAT)\Omega(\sqrt{HSAT}). In this case, we have ∣S×A×S∣=d|\mathcal{S}\times\mathcal{A}\times\mathcal{S}|=d. We use σ(s,a,s′)\sigma(s,a,s^{\prime}) to denote the index of (s,a,s′)(s,a,s^{\prime}) in S×A×S\mathcal{S}\times\mathcal{A}\times\mathcal{S}. Letting

and θi=P(s′∣s,a)\theta^{i}=P(s^{\prime}|s,a) if σ(s,a,s′)=i\sigma(s,a,s^{\prime})=i, we will have P(s′∣s,a)=∑i=1dθiPi(s′∣s,a).P(s^{\prime}|s,a)=\sum_{i=1}^{d}\theta^{i}P_{i}(s^{\prime}|s,a). Therefore PP can be parametrized using (2). Therefore, the known lower bound Ω(HSAT)\Omega(\sqrt{HSAT}) implies a worst-case lower bound of Ω(H⋅d/2⋅T)=Ω(HdT)\Omega(\sqrt{H\cdot d/2\cdot T})=\Omega(\sqrt{HdT}) for our model.

Appendix C Implementation

In the implementation of UCRL-VTR used in Section 6, we used different confidence intervals then the ones stated in the paper. The confidence intervals used in our implementation are the ones introduced in Abbasi-Yadkori et al. (2011). These confidence intervals are much tighter in the linear setting than the ones introduced in Section 3 and thus have better practical performance. The purpose of this section is to formally introduce the confidence intervals used in our implementation of UCRL-VTR as well as show how these confidence intervals were adapted from the linear bandit setting to the linear MDP setting.

For our implementation of UCRL-VTR we used different confidence then was introduced in the paper. These are the tighter confidence bounds from the seminal work done by Abbasi-Yadkori et al. (2011) and further expanded upon in Chapter 20 of Lattimore & Szepesvári (2020). Now we will state some assumptions in the MDP setting, then we will state the equivalent assumptions from the linear bandit setting, and lastly we will make the connections between the two that allow us to use the confidence bounds from the linear bandit setting in the RL setting.

P∗(s′∣s,a)=∑i=1d(θ∗MDP)iPi(s′∣s,a)P^{*}(s^{\prime}\mid s,a)=\sum_{i=1}^{d}(\theta_{*}^{\textit{MDP}})_{i}P_{i}(s^{\prime}\mid s,a)

sh+1k∼P∗(⋅∣shk,ahk)s_{h+1}^{k}\sim P^{*}(\cdot\mid s_{h}^{k},a_{h}^{k})

where tt is defined in the table of A.4. Also note that in this section (⋅)∗(\cdot)_{*} denotes the true parameter or model, (⋅)MDP(\cdot)^{\textit{MDP}} denotes something derived or used in the linear MDP setting, and (⋅)LIN(\cdot)^{\textit{LIN}} denotes something derived or used in the linear bandit setting. Now, under 1-3 of C.1.1 we hope to construct a confidence set CtMDP\mathcal{C}_{t}^{\textit{MDP}} such that

with high probability. Now the choice of how to choose both CtMDP\mathcal{C}_{t}^{\textit{MDP}} and βt\beta_{t} comes from the linear bandit literature. We will introduce the necessary theorems and assumptions to derive both CtLIN\mathcal{C}_{t}^{\textit{LIN}} and βt\beta_{t} in the linear bandit setting and then adapt the results from the linear bandit setting to the linear MDP setting.

C.1.2 Tighter Confidence Bounds for Linear Bandits

where λ>0\lambda>0 is the regularizer. This loss function is minimized by

notice how this linear bandit problem is very similar to the linear MDP problem introduced in section 3 of our paper. In our linear MDP setting, it is convenient to think of MM and WW as serving equivalent purposes (storing rank one updates) thus it is also convenient to think of AtA_{t} and XtMDPX_{t}^{\textit{MDP}} as serving equivalent purposes (the features by which we use to make our predictions), where XtMDPX_{t}^{\textit{MDP}} is defined in section 3 of our paper with some added notation to distinguish it from the XtLINX_{t}^{\textit{LIN}} used here in the linear bandit setting. We will now build up some intuition by making some simplifying assumptions.

No regularization: λ=0\lambda=0 and WtW_{t} is invertible.

Independent subgaussian noise: (ηs)s(\eta_{s})_{s} are independent and σ\sigma-subgaussian

Fixed Design: A1,...,AtA_{1},...,A_{t} are deterministically chosen without the knowledge of X1LIN,...,XtLINX_{1}^{\textit{LIN}},...,X_{t}^{\textit{LIN}}

Since (ηs)s(\eta_{s})_{s} are independent and σ\sigma-subgaussian, by Lemma 5.4 and Theorem 5.3 (need to be stated),

A little linear algebra shows that ∑s=1t⟨x,Wt−1As⟩2=∥x∥Wt−12\sum_{s=1}^{t}\langle x,W_{t}^{-1}A_{s}\rangle^{2}=\|x\|_{W_{t}^{-1}}^{2} and so,

We now remove the limiting assumptions we stated above and use the newly stated assumptions for the rest of this section

The noise is conditionally σ\sigma-subgaussian:

where Ft−1\mathcal{F}_{t-1} is such that A1,X1LIN,...,At−1,Xt−1LINA_{1},X_{1}^{\textit{LIN}},...,A_{t-1},X_{t-1}^{\textit{LIN}} are Ft−1\mathcal{F}_{t-1}-measurable.

The inclusion of AtA_{t} in the definition of Ft−1\mathcal{F}_{t-1} allows the noise to depend on past choices, including the most recent action. Since we want exponentially decaying tail probabilities, one is tempted to try the Cramer-Chernoff method:

Sadly, we do not know how to bound this expectation. Can we still somehow use the Cramer–Chernoff method? We take inspiration from looking at the special case of λ=0\lambda=0 one last time, assuming that Wt=∑s=1tAsAs⊤W_{t}=\sum_{s=1}^{t}A_{s}A_{s}^{\top} is invertible. Let

Recall that θ^tLIN=Wt−1∑s=1tXsLINAs=θ∗LIN+Wt−1St\hat{\theta}_{t}^{\textit{LIN}}=W_{t}^{-1}\sum_{s=1}^{t}X_{s}^{\textit{LIN}}A_{s}=\theta_{*}^{\textit{LIN}}+W_{t}^{-1}S_{t}. Hence,

The next lemma shows that the exponential of the term inside the maximum is a supermartingale even when λ≥0\lambda\geq 0.

The proof for this Lemma can be found in Chapter 20 of the book by Lattimore & Szepesvári (2020). For simplicity, consider now again the case when λ=0\lambda=0. Combining the lemma and the linearisation idea almost works. The Cramer–Chernoff method leads to

The proof of Lemma 13 can, again, be found in Chapter 20 of the book by Lattimore & Szepesvári (2020). Now the following theorem is the key result from which the confidence set will be derived.

For all λ>0\lambda>0, and δ∈(0,1)\delta\in(0,1)

The proof of Theorem 14 can be found in Chapter 20 of the book by Lattimore & Szepesvári (2020).

C.1.3 Adaptation of the Confidence Bounds to our Linear MDP Setting

Now with the Lemmas and Theorems introduced in the previous section we are ready to derive the confidence bounds used in our implementation of UCRL-VTR. Now using the notation from the linear bandit setting we set

The target XtMDP=∫jVt(s′)Pj(ds′∣st,at)X_{t}^{\textit{MDP}}=\int_{j}V_{t}(s^{\prime})P_{j}(ds^{\prime}\mid s_{t},a_{t})

Ft−1=σ(s1,a1,...,st−1,at−1)\mathcal{F}_{t-1}=\sigma(s_{1},a_{1},...,s_{t-1},a_{t-1}), which just means the filtration is set to be the sigma-algebra generated by all past states and actions observed.

ηt=Yt−⟨XtMDP,θ∗MDP⟩=Vt(st+1)−∫jVt(s′)Pj∗(ds′∣st,at)\eta_{t}=Y_{t}-\langle X_{t}^{\textit{MDP}},\theta_{*}^{\textit{MDP}}\rangle=V_{t}(s_{t+1})-\int_{j}V_{t}(s^{\prime})P_{j}^{*}(ds^{\prime}\mid s_{t},a_{t}), since θ∗MDP\theta_{*}^{\textit{MDP}} is the true model of the MDP.

MtM_{t} in the linear MDP setting is defined equivalently to WtW_{t} in the linear bandit setting, i.e. they are both the sums of a regularizer term and a bunch of rank one updates.

The fundamental theorem of calculus yields

where here in the linear MDP setting MtM_{t} replaces WtW_{t} from the linear bandit setting and ∥θ∗MDP∥2≤m2\|\theta_{*}^{\textit{MDP}}\|_{2}\leq m_{2}. The justification of using these bounds in the linear MDP setting follow exactly from the justification given above for using these bounds in the linear bandit setting.

C.2 UCRL-VTR

In the proceeding subsections we discuss the implementation of the algorithms studied in Section 6 of the paper. The first algorithm we present is the algorithm used to generate the results for UCRL-VTR.

The iterative Q-update for Algorithm 3 is

C.3 EGRL-VTR

In this section we discuss the algorithm EGRL-VTR. This algorithm is very similar to UCRL-VTR expect it performs ε\varepsilon-greedy value iteration instead of optimistic value iteration and acts ε\varepsilon-greedy with respect to Qh,kQ_{h,k}.

The iterative value update for EGRL-VTR is

C.4 EG-Frequency

In this section we discuss the algorithm EG-Frequency. This algorithm is the ε\varepsilon-greedy version of UC-MatrixRL Yang & Wang (2019a).

The iterative Q-update for EG-Frequency is

Note that Ψ\mathbf{\Psi} is a ∣S∣×∣S∣|\mathcal{S}|\times|\mathcal{S}| whose rows are the features ψ(s′)\psi(s^{\prime}) and Φ\mathbf{\Phi} is a ∣S∣∣A∣×∣S∣∣A∣|\mathcal{S}||\mathcal{A}|\times|\mathcal{S}||\mathcal{A}| whose rows are the features ϕ(s,a)\phi(s,a). In the tabular RL setting both Ψ\mathbf{\Psi} and Φ\mathbf{\Phi} are the identity matrix which is what we used in our numerical experiments. In the tabular RL setting, EG-Frequency stores the counts of the number of times it transitioned to next state s′s^{\prime} from the state-action pair (s,a)(s,a) and fits the estimated model MkM_{k} accordingly.

In this section, we include some further details on how we implemented Algorithms 3, 4, and 5. All code was written in Python 3 and used the Numpy and Scipy libraries. All plots were generated using MatPlotLib. In Algorithm 3, Numpy’s logdet function was used to calculate the determinate in step 15 for numerical stability purposes. No matrix inversion was performed in our code, instead a Sherman-Morrison update was performed for each matrix in which a matrix inversion is performed at each (k,h)(k,h) in order to save on computation. To read more about the Sherman Morrison update in the context of RL, we refer to the reader to Eqn (9.22) of Sutton & Barto (2018). When computing the weighted L1-norm, we added a small constant to each summation in the denominator to avoid dividing by zero. Finally, when computing UC-MatrixRL we also used the self-normalize bounds introduced in the beginning of this section. Some pseudocode for using self-normalized bounds with UC-MatrixRL can be found in step 5 of Alg 6.

Appendix D Mixture Model

In this section, we introduce, analyze, and evaluate a Linear model-based RL algorithm that used both the canonical model and the VTR model for planning. We call this algorithm UCRL-MIX.

We are now using multiple models instead of a single model, we must adjust our confidence sets accordingly. By using a union bound we replace δ\delta with δ/2\delta/2 for our confidence parameter. This updated confidence parameter changes the term inside the logarithm. We now have log⁡(2/δ)\log(2/\delta) where as before we had log⁡(1/δ)\log(1/\delta).

D.2 Numerical Results

We will include the cumulative regret and the weighted L1 norm of UCRL-MIX on the RiverSwim environment as in Section 6. We also include a bar graph of the relative frequency with which the algorithm used the VTR-model for planning and the canonical model for planning.

If we compare the results of Figure 5 with the results of Figure 2 from Section 6.3 we see that the cumulative regret of UCRL-MIX is almost identical to the cumulative regret of UCRL-VTR. The model errors of both the VTR and the canonical models are almost identical to the model errors of UCRL-VTR and UC-MatrixRL respectively.

From Figure 6, we see that on the RiverSwim environment, UCRL-MIX almost always uses the VTR-model for planning. We calculate this frequency by counting the number of times Step 7 of Alg 6 was observed up until episode kk and by counting the number of times Step 9 of Alg 6 was observed up until episode kk. We then divide these counts by the sum of the counts to get a percentage. We believe the reason the algorithm overwhelming chose the VTR-model was due to the fact that the confidence intervals for the VTR-model shrink much faster than the confidence intervals for the canonical model. The canonical model is forced to explore much longer than the VTR-model as its objective is to learn a globally optimal model rather than a model that yields high reward. Thus, the canonical model is forced to explore all state-action-next state tuples, even ones that do not yield high reward, in order to meet its objective of learning a globally optimal model while the VTR-model is only forced to explore state-action-next state tuples that fall in-line with its objective of accumulating high reward. The set of all state-action-next state tuples is much larger then the set of state-action-next state tuples that yield high reward which means the confidence intervals for the canonical model shrink slower than the confidence sets of the VTR-model on the RiverSwim environment.