Title: BOOTSTRAPPING THE EXPRESSIVITY WITH MODEL-BASED PLANNING

Abstract: We compare the model-free reinforcement learning with the model-based approaches through the lens of the expressive power of neural networks for policies, Q-functions, and dynamics. We show, theoretically and empirically, that even for one-dimensional continuous state space, there are many MDPs whose optimal Q-functions and policies are much more complex than the dynamics. We hypothesize many real-world MDPs also have a similar property. For these MDPs, model-based planning is a favorable algorithm, because the resulting policies can approximate the optimal policy significantly better than a neural network parameterization can, and model-free or model-based policy optimization rely on policy parameterization. Motivated by the theory, we apply a simple multi-step model-based bootstrapping planner (BOOTS) to bootstrap a weak Q-function into a stronger policy. Empirical results show that applying BOOTS on top of modelbased or model-free policy optimization algorithms at the test time improves the performance on MuJoCo benchmark tasks.

1. INTRODUCTION:

Model-based deep reinforcement learning (RL) algorithms offer a lot of potentials in achieving significantly better sample efficiency than the model-free algorithms for continuous control tasks. We can largely categorize the model-based deep RL algorithms into two types: 1. model-based policy optimization algorithms which learn policies or Q-functions, parameterized by neural networks, on the estimated dynamics, using off-the-shelf model-free algorithms or their variants (Luo et al., 2019; Janner et al., 2019; Kaiser et al., 2019; Kurutach et al., 2018; Feinberg et al., 2018; Buckman et al., 2018) , and 2. model-based planning algorithms, which plan with the estimated dynamics Nagabandi et al. (2018) ; Chua et al. (2018) ; Wang & Ba (2019) .

A deeper theoretical understanding of the pros and cons of model-based and the model-free algorithms in the continuous state space case will provide guiding principles for designing and applying new sample-efficient methods. The prior work on the comparisons of model-based and model-free algorithms mostly focuses on their sample efficiency gap, in the case of tabular MDPs (Zanette & Brunskill, 2019; Jin et al., 2018) , linear quadratic regulator (Tu & Recht, 2018) , and contextual decision process with sparse reward (Sun et al., 2019) .

In this paper, we theoretically compare model-based RL and model-free RL in the continuous state space through the lens of approximability by neural networks, and then use the insight to design practical algorithms. What is the representation power of neural networks for expressing the Qfunction, the policy, and the dynamics? How do the model-based and model-free algorithms utilize the expressivity of neural networks?

Our main finding is that even for the case of one-dimensional continuous state space, there can be a massive gap between the approximability of Q-function and the policy and that of the dynamics:

The optimal Q-function and policy can be significantly more complex than the dynamics.

We construct environments where the dynamics are simply piecewise linear functions with constant pieces, but the optimal Q-functions and the optimal policy require an exponential (in the horizon) Right: The corresponding Q-functions which are more complex than the dynamics (more details in Section 4.3). number of linear pieces, or exponentially wide neural networks, to approximate. 1 The approximability gap can also be observed empirically on (semi-) randomly generated piecewise linear dynamics with a decent chance. (See Figure 1 for two examples.)

When the approximability gap occurs, any deep RL algorithms with policies parameterized by neural networks will suffer from a sub-optimal performance. These algorithms include both model-free algorithms such as DQN (Mnih et al., 2015) and SAC (Haarnoja et al., 2018) , and model-based policy optimization algorithms such as SLBO (Luo et al., 2019) and MBPO (Janner et al., 2019) . To validate the intuition, we empirically apply these algorithms to the constructed or the randomly generated MDPs. Indeed, they fail to converge to the optimal rewards even with sufficient samples, which suggests that they suffer from the lack of expressivity.

However, in such cases, model-based planning algorithms should not suffer from the lack of expressivity, because they only use the learned, parameterized dynamics, which are easy to express. The policy obtained from the planning is the maximizer of the total future reward on the learned dynamics, and can have an exponential (in the horizon) number of pieces even if the dynamics has only a constant number of pieces. In fact, even a partial planner can help improve the expressivity of the policy. If we plan for k steps and then resort to some Q-function for estimating the total reward of the remaining steps, we can obtain a policy with 2 k more pieces than what Q-function has.

We hypothesize that the real-world continuous control tasks also have a more complex optimal Qfunction and a policy than the dynamics. The theoretical analysis of the synthetic dynamics suggests that a model-based few-steps planner on top of a parameterized Q-function will outperform the original Q-function because of the addtional expressivity introduced by the planning. We empirically verify the intuition on MuJoCo benchmark tasks. We show that applying a model-based planner on top of Q-functions learned from model-based or model-free policy optimization algorithms in the test time leads to significant gains over the original Q-function or policy.

In summary, our contributions are:

1. We construct continuous state space MDPs whose Q-functions and policies are proved to be more complex than the dynamics (Sections 4.1 and 4.2.) 2. We empirically show that with a decent chance, (semi-)randomly generated piecewise linear MDPs also have complex Q-functions (Section 4.3.) 3. We show theoretically and empirically that the model-free RL or model-based policy optimization algorithms suffer from the lack of expressivity for the constructed MDPs (Sections 4.3), whereas model-based planning solve the problem efficiently (Section 5.2.) 4. Inspired by the theory, we propose a simple model-based bootstrapping planner (BOOTS), which can be applied on top of any model-free or model-based Q-learning algorithms at the test time. Empirical results show that BOOTS improves the performance on MuJoCo benchmark tasks, and outperforms previous state-of-the-art on MuJoCo humanoid environment.

2. ADDITIONAL RELATED WORK:

Comparisons with Prior Theoretical Work. Model-based RL has been extensively studied in the tabular case (see (Zanette & Brunskill, 2019; Azar et al., 2017) and the references therein), but much less so in the context of deep neural networks approximators and continuous state space. (Luo et al., 2019) give sample complexity and convergence guarantees suing principle of optimism in the face of uncertainty for non-linear dynamics.

Below we review several prior results regarding model-based versus model-free dichotomy in various settings. We note that our work focuses on the angle of expressivity, whereas the work below focuses on the sample efficiency.

Tabular MDPs. The extensive study in tabular MDP setting leaves little gap in their sample complexity of model-based and model-free algorithms, whereas the space complexity seems to be the main difference. (Strehl et al., 2006) . Contextual Decision Process (with function approximator). Sun et al. (2019) prove an exponential information-theoretical gap between mode-based and model-free algorithms in the factored MDP setting. Their definition of model-free algorithms requires an exact parameterization: the value-function hypothesis class should be exactly the family of optimal value-functions induced by the MDP family. This limits the application to deep reinforcement learning where overparameterized neural networks are frequently used. Moreover, a crucial reason for the failure of the model-free algorithms is that the reward is designed to be sparse.

Related Empirical Work.:

A large family of model-based RL algorithms uses existing model-free algorithms of its variant on the learned dynamics. MBPO (Janner et al., 2019) , STEVE (Buckman et al., 2018) , and MVE (Feinberg et al., 2018) are model-based Q-learning-based policy optimization algorithms, which can be viewed as modern extensions and improvements of the early model-based Q-learning framework, Dyna (Sutton, 1990) . SLBO (Luo et al., 2019 ) is a model-based policy optimization algorithm using TRPO as the algorithm in the learned environment.

Another way to exploit the dynamics is to use it to perform model-based planning. Racanière et al. (2017) and Du & Narasimhan (2019) use the model to generated additional extra data to do planning implicitly. Chua et al. (2018) study how to combine an ensemble of probabilistic models and planning, which is followed by Wang & Ba (2019) , which introduces a policy network to distill knowledge from a planner and provides a prior for the planner. Piché et al. (2018) uses methods in Sequential Monte Carlo in the context of control as inference. Oh et al. (2017) trains a Q-function and then perform lookahead planning. Nagabandi et al. (2018) uses random shooting as the planning algorithm. Lowrey et al. (2018) uses the dynamics to improve the performance of model-free algorithms. Heess et al. (2015) backprops through a stochastic computation graph with a stochastic gradient to optimize the policy under the learned dynamics. Levine & Koltun (2013) distills a policy from trajectory optimization. Rajeswaran et al. (2016) trains a policy adversarially robust to the worst dynamics in the ensemble. Clavera et al. (2018) reformulates the problem as a meta-learning problem and using meta-learning algorithms. Predictron (Silver et al., 2017) learns a dynamics and value function and then use them to predict the future reward sequences.

Another line of work focus on how to improve the learned dynamics model. Many of them use an ensemble of models (Kurutach et al., 2018; Rajeswaran et al., 2016; Clavera et al., 2018) , which are further extended to an ensemble of probabilistic models (Chua et al., 2018; Wang & Ba, 2019) . Luo et al. (2019) designs a discrepancy bound for learning the dynamics model. Talvitie (2014) augments the data for model training in a way that the model can output a real observation from its own prediction. Malik et al. (2019) calibrates the model's uncertainty so that the model's output distribution should match the frequency of predicted states. Oh et al. (2017) learns a representation of states by predicting rewards and future returns using representation.

3. PRELIMINARIES:

Markov Decision Process. A Markov Decision Process (MDP) is a tuple S, A, f, r, γ , where S is the state space, A the action space, f : S × A → ∆(S) the transition dynamics that maps a state action pair to a probability distribution of the next state, γ the discount factor, and r ∈ R S×A the reward function. Throughout this paper, we will consider deterministic dynamics, which, with slight abuse of notation, will be denoted by f : S × A → S.

A deterministic policy π : S → A maps a state to an action. The value function for the policy is defined as is defined

V π (s) def = ∞ h=1 γ h-1 r(s h , a h ). where a h = π(s h ), s 1 = s and s h+1 = f (s h , a h ).

An RL agent aims to find a policy π that maximizes the expected total reward defined as

η(π) def = E s1∼µ [V π (s 1 )] ,

where µ is the distribution of the initial state.

Bellman Equation. Let π be the optimal policy, and V the optimal value function (that is, the value function for policy π ). The value function V π for policy π and optimal value function V satisfy the Bellman equation and Bellman optimality equation, respectively. Let Q π and Q defines the state-action value function for policy π and optimal state-action value function. Then, for a deterministic dynamics f , we have

EQUATION

EQUATION

Denote the Bellman operator for dynamics f by B f :

(B f [Q]) (s, a) = r(s, a) + max a γQ(f (s, a), a ).

Neural Networks. We focus on fully-connected neural nets with ReLU function as activations. A one-dimensional input and one-dimensional output ReLU neural net represents a piecewise linear function. A two-layer ReLU neural net with d hidden neurons represents a piecewise linear function with at most (d + 1) pieces. Similarly, an H-layer neural net with d hidden neurons in each layer represents a piecewise linear function with at most (d + 1) H pieces (Pascanu et al., 2013) .

Problem Setting and Notations. In this paper, we focus on continuous state space, discrete action space MDPs with S ⊂ R. We assume the dynamics is deterministic (that is, s t+1 = f (s t , a t )), and the reward is known to the agent. Let x denote the floor function of x, that is, the greatest integer less than or equal to x. We use I[•] to denote the indicator function.

4. APPROXIMABILITY OF Q-FUNCTIONS AND DYNAMICS:

We show that there exist MDPs in one-dimensional continuous state space that have simple dynamics but complex Q-functions and policies. Moreover, any polynomial-size neural network function approximator of the Q-function or policy will result in a sub-optimal expected total reward, and learning Q-functions parameterized by neural networks requires fundamentally an exponential number of samples (Section 4.2). Section 4.3 illustrates the phenomena that Q-function is more complex than the dynamics occurring frequently and naturally even with random MDP, beyond the theoretical construction. Recall that we consider the infinite horizon case and 0 < γ < 1 is the discount factor. Let H = (1 -γ) -1 be the "effective horizon" -the rewards after H steps become negligible due to the discount factor. For simplicity, we assume that H > 3 and it is an integer. (Otherwise we take just take H = (1 -γ) -1 .) Throughout this section, we assume that the state space S = [0, 1) and the action space A = {0, 1}. Definition 4.1. Given the effective horizon H = (1 -γ) -1 , we define an MDP M H as follows. Let κ = 2 -H . The dynamics f by the following piecewise linear functions with at most three pieces.

f (s, 0) = 2s if s < 1/2 2s -1 if s ≥ 1/2 f (s, 1) = 2s + κ if s < (1 -κ)/2 2s + κ -1 if (1 -κ)/2 ≤ s ≤ (2 -κ)/2 2s + κ -2 otherwise.

The reward function is defined as

r(s, 0) = I[1/2 ≤ s < 1] r(s, 1) = I[1/2 ≤ s < 1] -2(γ H-1 -γ H )

The initial state distribution µ is uniform distribution over the state space [0, 1).

The dynamics and the reward function for H = 4 are visualized in Figures 2a, 2b . Note that by the definition, the transition function for a fixed action a is a piecewise linear function with at most 3 pieces. Our construction can be modified so that the dynamics is Lipschitz and the same conclusion holds (see Appendix C).

Attentive readers may also realize that the dynamics can be also be written succinctly as f (s, 0) = 2s mod 1 and f (s, 1) = 2s + κ mod 12 , which are key properties that we use in the proof of Theorem 4.2 below.

Optimal Q-function Q and the optimal policy π . Even though the dynamics of the MDP constructed in Definition 4.1 has only a constant number of pieces, the Q-function and policy are very complex: (1) the policy is a piecewise linear function with exponentially number of pieces, (2) the optimal Q-function Q and the optimal value function V are actually fractals that are not continuous anywhere. These are formalized in the theorem below.

Theorem 4.2. For s ∈ [0, 1), let s (k) denotes the k-th bit of s in the binary representation. 3 The optimal policy π for the MDP defined in Definition 4.1 has 2 H+1 number of pieces. In particular,

EQUATION

And the optimal value function is a fractal with the expression:

V (s) = H h=1 γ h-1 s (h) + ∞ h=H+1 γ h-1 1 + 2(s (h+1) -s (h) ) + γ H-1 2s (H+1) -2 . (3)

The close-form expression of Q can be computed by Q (s, a) = r(s, a) + V (f (s, a)), which is also a fractal.

We approximate the optimal Q-function by truncating the infinite sum to 2H terms, and visualize it in Figure 2c . We discuss the main intuitions behind the construction in the following proof sketch of the Theorem. A rigorous proof of Theorem 4.2) is deferred to Appendix B.1.

Proof Sketch. The key observation is that the dynamics f essentially shift the binary representation of the states with some addition. We can verify that the dynamics satisfies f (s, 0) = 2s mod 1 and f (s, 1) = 2s + κ mod 1 where κ = 2 -H . In other words, suppose s = 0.s (1) s (2) • • • is the binary representation of s, and let left-shift(s

) = 0.s (2) s (3) • • • . f (s, 0) = left-shift(s) (4) f (s, 1) = (left-shift(s) + 2 -H ) mod 1 (5)

Moreover, the reward function is approximately equal to the first bit of the binary representation

EQUATION

(Here the small negative drift of reward for action a = 1, -2(γ H-1 -γ H ), is only mostly designed for the convenience of the proof, and casual readers can ignore it for simplicity.) Ignoring carries, the policy pretty much can only affect the H-th bit of the next state s = f (s, a): the H-th bit of s is either equal to (H + 1)-th bit of s when action is 0, or equal its flip when action is 1. Because the bits will eventually be shifted left and the reward is higher if the first bit of a future state is 1, towards getting higher future reward, the policy should aim to create more 1's. Therefore, the optimal policy should choose action 0 if the (H + 1)-th bit of s is already 1, and otherwise choose to flip the (H + 1)-th bit by taking action 1.

A more delicate calculation that addresses the carries properly would lead us to the form of the optimal policy (Equation (2).) Computing the total reward by executing the optimal policy will lead us to the form of the optimal value function (equation (3).) (This step does require some elementary but sophisticated algebraic manipulation.)

With the form of the V , a shortcut to a formal, rigorous proof would be to verify that it satisfies the Bellman equation, and verify π is consistent with it. We follow this route in the formal proof of Theorem 4.2) in Appendix B.1.

4.2. THE APPROXIMABILITY OF Q-FUNCTION:

A priori, the complexity of Q or π does not rule out the possibility that there exists an approximation of them that do an equally good job in terms of maximizing the rewards. However, we show that in this section, indeed, there is no neural network approximation of Q or π with a polynomial width. We prove this by showing any piecewise linear function with a sub-exponential number of pieces cannot approximate either Q or π with a near-optimal total reward. Theorem 4.3. Let M H be the MDP constructed in Definition 4.1. Suppose a piecewise linear policy π has a near optimal reward in the sense that η(π) ≥ 0.92 • η(π ), then it has to have at least Ω (exp(cH)/H) pieces for some universal constant c > 0. As a corollary, no constant depth neural networks with polynomial width (in H) can approximate the optimal policy with near optimal rewards.

Consider a policy π induced by a value function Q, that is, π(s) = arg max a∈A Q(s, a). Then,when there are two actions, the number of pieces of the policy is bounded by twice the number of pieces of Q. This observation and the theorem above implies the following inapproximability result of Q . Corollary 4.4. In the setting of Theorem 4.3, let π be the policy induced by some Q. If π is nearoptimal in a sense that η(π) ≥ 0.92 • η(π ), then Q has at least Ω (exp(cH)/H) pieces for some universal constant c > 0.

The intuition behind the proof of Theorem 4.3 is as follows. Recall that the optimal policy has the form π (s) = I[s (H+1) = 0]. One can expect that any polynomial-pieces policy π behaves suboptimally in most of the states, which leads to the suboptimality of π. Detailed proof of Theorem 4.3 is deferred to Appendix B.2.

Beyond the expressivity lower bound, we also provide an exponential sample complexity lower bound for Q-learning algorithms parameterized with neural networks (see Appendix B.4).

4.3. THE APPROXIMABILITY OF Q-FUNCTIONS OF RANDOMLY GENERATED MDPS:

In this section, we show the phenomena that the Q-function not only occurs in the crafted cases as in the previous subsection, but also occurs more robustly with a decent chance for (semi-) randomly generated MDPs. (Mathematically, this says that the family of MDPs with such a property is not a degenerate measure-zero set.)

It is challenging and perhaps requires deep math to characterize the fractal structure of Q-functions for random dynamics, which is beyond the scope of this paper. Instead, we take an empirical approach here. We generate random piecewise linear and Lipschitz dynamics, and compute their Q-functions for the finite horizon, and then visualize the Q-functions or count the number of pieces in the Q-functions. We also use DQN algorithm (Mnih et al., 2015) with a finite-size neural network to learn the Q-function.

We set horizon H = 10 for simplicity and computational feasibility. The state and action space are [0, 1) and {0, 1} respectively. We design two methods to generate random or semi-random piecewise dynamics with at most four pieces. First, we have a uniformly random method, called RAND, where we independently generate two piecewise linear functions for f (s, 0) and f (s, 1), by generating random positions for the kinks, generating random outputs for the kinks, and connecting the kinks by linear lines (See Appendix D.1 for a detailed description.)

In the second method, called SEMI-RAND, we introduce a bit more structure in the generation process, towards increasing the chance to see the phenomenon. The functions f (s, 0) and f (s, 1) have 3 pieces with shared kinks. We also design the generating process of the outputs at the kinks so that the functions have more fluctuations. The reward for both of the two methods is r(s, a) = s, ∀a ∈ A. (See Appendix D.1 for a detailed description.)

Figure 1 illustrates the dynamics of the generated MDPs from SEMI-RAND. More details of empirical settings can be found in Appendix D.1. The optimal policy and Q can have a large number of pieces. Because the state space has one dimension, and the horizon is 10, we can compute the exact Q-functions by recursively applying Bellman operators, and count the number of pieces. We found that, 8.6% fraction of the 1000 MDPs independently generated from the RAND method has policies with more than 100 pieces, much larger than the number of pieces in the dynamics (which is 4). Using the SEMI-RAND method, a 68.7% fraction of the MDPs has polices with more than 10 3 pieces. In Section D.1, we plot the histogram of the number of pieces of the Q-functions. Figure 1 visualize the Q-functions and dynamics of two MDPs generated from RAND and SEMI-RAND method. These results suggest that the phenomenon that Q-function is more complex than dynamics is not a degenerate phenomenon and can occur with non-zero measure. For more empirical results, see Appendix D.2.

Model-based policy optimization methods also suffer from a lack of expressivity. As an implication of our theory in the previous section, when the Q-function or the policy are too complex to be approximated by a reasonable size neural network, both model-free algorithms or model-based policy optimization algorithms will suffer from the lack of expressivity, and as a consequence, the sub-optimal rewards. We verify this claim on the randomly generated MDPs discussed in Section 4.3, by running DQN (Mnih et al., 2015) , SLBO (Luo et al., 2019) , and MBPO (Janner et al., 2019) with various architecture size.

For the ease of exposition, we use the MDP visualized in the bottom half of Figure 1 . The optimal policy for this specific MDP has 765 pieces, and the optimal Q-function has about 4 × 10 4 number of pieces, and we can compute the optimal total rewards.

First, we apply DQN to this environment by using a two-layer neural network with various widths to parameterize the Q-function. The training curve is shown in Figure 3 (Left). Model-free algorithms The number after the acronym is the width of the neural network used in the parameterization of Q.

We see that even with sufficiently large neural networks and sufficiently many steps, these algorithms still suffers from bad approximability and cannot achieve optimal reward. (Right): Performance of BOOTS + DQN with various planning steps. A near-optimal reward is achieved with even k = 3, indicating that the bootstrapping with the learned dynamics improves the expressivity of the policy significantly.

Algorithm 1 Model-based Bootstrapping Planner (BOOTS) + RL Algorithm X 1: training: run Algorithm X, store the all samples in the set R, store the learned Q-function Q, and the learned dynamics f if it is available in Algorithm X. 2: testing:

3: if f is not available, learn f from the data in R 4:

execute the policy BOOTS(s) at every state s 5:

1: function BOOTS(s) 2:

Given: query oracle for function Q and f

3: Compute π boots k,Q, f (s) = arg max a max a1,...,a k r(s, a) + • • • + γ k-1 r(s k-1 , a k-1 ) + γ k Q(s k , a k )

using a zero-th order optimization algorithm (which only requires oracle query of the function value) such as cross-entropy method or random shooting.

can not find near-optimal policy even with 2 14 hidden neurons and 1M trajectories, which suggests that there is a fundamental approximation issue. This result is consistent with Fu et al. (2019) , in a sense that enlarging Q-network improves the performance of DQN algorithm at convergence.

Second, we apply SLBO and MBPO in the same environment. Because the policy network and Q-function in SLOBO and MBPO cannot approximate the optimal policy and value function, we see that they fail to achieve near-optimal rewards, as shown in Figure 3 (Left).

5. MODEL-BASED BOOTSTRAPPING PLANNER:

Our theory and experiments in Section 4.2 and 4.3 demonstrate that when the Q-function or the policy is complex, model-free or model-based policy optimization algorithms will suffer from the lack of expressivity. The intuition suggests that model-based planning algorithms will not suffer from the lack of expressivity because the final policy is not represented by a neural network. For the construction in Section 4.1, we can actually prove that even a few-steps planner can bootstrap the expressivity of the Q-function (formalized in Theorem 5.1 below).

Inspired the theoretical result, we apply a simple k-step model-based bootstrapping planner on top of existing Q-functions (trained from either model-based or model-free approach) in the test time, on either the one-dimensional MDPs considered in Section 4 or the continuous control benchmark tasks in MuJoCo. The bootstrapping planner is reminiscent of MCTS using in AlphaGo (Silver et al., 2016; 2018) . However, here, we use the learned dynamics and deal with the continuous state space. Particularly on the Humanoid environment, BOOTS improves the performance significantly. The test policies for MBSAC and SAC are the deterministic policy that takes the mean of the output of the policy network, because the deterministic policy performs better than the stochastic policy in the test time.

5.1. BOOTSTRAPPING THE Q-FUNCTION:

Given a function Q that is potentially not expressive enough to approximate the optimal Q-function, we can apply the Bellman operator with a learned dynamics f for k times to get a bootstrapped version of Q:

EQUATION

where s 0 = s, a 0 = a and s h+1 = f (s h , a h ).

Given the bootstrapped version, we can derive a greedy policy w.r.t it:

EQUATION

Algorithm 1, called BOOTS summarizes how to apply the planner on top of any RL algorithm with a Q-function (straightforwardly).

For the MDPs constructed in Section 4.1, we can prove that representing the optimal Q-function by B k f [Q] requires fewer pieces in Q than representing the optimal Q-function by Q directly. Theorem 5.1. Consider the MDP M H defined in Definition 4.1. There exists a constant-piece piecewise linear dynamics f and a 2 H-k+1 -piece piecewise linear function Q, such that the bootstrapped policy π boots k,Q, f (s) achieves the optimal total rewards. By contrast, recall that in Theorem 4.3, we show that approximating the optimal Q-function directly with a piecewise linear function requires ≈ 2 H piecewise. Thus we have a multiplicative factor of 2 k gain in the expressivity by using the bootstrapped policy. Here the exponential gain is only magnificent enough when k is close to H because the gap of approximability is huge. However, in more realistic settings -the randomly-generated MDPs and the MuJoCo environment -the bootstrapping planner improvs the performance significantly as shown in the next subsection.

5.2. EXPERIMENTS:

BOOTS on random piecewise linear MDPs. We implement BOOTS (Algorithm 1) with various steps of planning and with the learned dynamics. 4 . The planner is an exponential-time planner which enumerates all the possible future sequence of actions. We also implement bootstrapping with partial planner with varying planning horizon. As shown in Figure 3 , BOOTS + DQN not only has the best sample-efficiency, but also achieves the optimal reward. In the meantime, even a partial planner helps to improve both the sample-efficiency and performance. More details of this experiment are deferred to Appendix D.3. BOOTS on MuJoCo environments. We work with the OpenAI Gym environments (Brockman et al., 2016) based on the Mujoco simulator (Todorov et al., 2012) with maximum horizon 1000 and discount factor 1. We apply BOOTS on top of three algorithms: (a) SAC (Haarnoja et al., 2018) , the state-of-the-art model-free RL algorithm; (b) MBPO (Janner et al., 2019) , a model-based Qlearning algorithm, and an extension of Dyna (Sutton, 1990) ; (c) a computationally efficient variant of MBPO that we develop using ideas from SLBO (Luo et al., 2019) We use k = 4 steps of planning unless explicitly mentioned otherwise in the ablation study (Section A.2). In Figure 4 , we compare BOOTS+SAC with SAC, and BOOTS + MBSAC with MBSAC on Gym Ant and Humanoid environments, and demonstrate that BOOTS can be used on top of existing strong baselines. We found that BOOTS has little help for other simpler environments, and we suspect that those environments have much less complex Q-functions so that our theory and intuitions do not necessarily apply. (See Section A.2 for more ablation study.)

In Figure 5 , we compare BOOTS+MBSAC and BOOTS+MBPO with other MBPO, SAC, and STEVE (Buckman et al., 2018) 5 on the humanoid environment. We see a strong performance surpassing the previous state-of-the-art MBPO.

6. CONCLUSION:

Our study suggests that there exists a significant representation power gap of neural networks between for expressing Q-function, the policy, and the dynamics in both constructed examples and empirical benchmarking environments. We show that our model-based bootstrapping planner BOOTS helps to overcome the approximation issue and improves the performance in synthetic settings and in the difficult MuJoCo environments. We raise some interesting open questions.

• Can we theoretically generalize our results to high-dimensional state space, or continuous actions space? Can we theoretically analyze the number of pieces of the optimal Q-function of a stochastic dynamics? • In this paper, we measure the complexity by the size of the neural networks. It's conceivable that for real-life problems, the complexity of a neural network can be better measured by its weights norm. Could we build a more realistic theory with another measure of complexity? • The BOOTS planner comes with a cost of longer test time. How do we efficiently plan in high-dimensional dynamics with a long planning horizon? • The dynamics can also be more complex (perhaps in another sense) than the Q-function in certain cases. How do we efficiently identify the complexity of the optimal Q-function, policy, and the dynamics, and how do we deploy the best algorithms for problems with different characteristics?

A EXPERIMENT DETAILS IN SECTION 5.2

A.1 MODEL-BASED SAC (MBSAC)

Here we describe our MBSAC algorithm in Algorithm 2, which is a model-based policy optimization and is used in BOOTS-MBSAC. As mentioned in Section 5.2, the main difference from MBPO and other works such as (Wang & Ba, 2019; Kurutach et al., 2018 ) is that we don't use model ensemble. Instead, we occasionally optimize the dynamics by one step of Adam to introduce stochasticity in the dynamics, following the technique in SLBO (Luo et al., 2019) . As argued in (Luo et al., 2019) , the stochasticity in the dynamics can play a similar role as the model ensemble. Our algorithm is a few times faster than MBPO in wall-clock time. It performs similarlty to MBPO on Humanoid, but a bit worse than MBPO in other environments. In MBSAC, we use SAC to optimize the policy π β and the Q-function Q ϕ . We choose SAC due to its sample-efficiency, simplicity and off-policy nature. We mix the real data from the environment and the virtual data which are always fresh and are generated by our learned dynamics model fθ .6 

Algorithm 2 MBSAC 1: Parameterize the policy π β , dynamics fθ , and the Q-function Q ϕ by neural networks. Initialize replay buffer B with n init steps of interactions with the environments by a random policy, and pretrain the dynamics on the data in the replay buffer. 2: t ← 0, and sample s 0 from the initial state distribution. 3: for n iter iterations do 4:

Perform action a t ∼ π β (•|s t ) in the environment, obtain s as the next state from the environment.

5: s t+1 ← s , and add the transition (s t , a t , s t+1 , r t ) to B.

6::

t ← t + 1. If t = T or the trajectory is done, reset to t = 0 and sample s 0 from the initial state distribution.

7::

for n policy iterations do 8:

for n model iterations do 9:

Optimize fθ with a mini-batch of data from B by one step of Adam.

10::

Sample n real data B real and n start data B start from B.

11::

Perform q steps of virtual rollouts using fθ and policy π β starting from states in B start ; obtain B virtual .

12:

Update π β and Q ϕ using the mini-batch of data in B real ∪ B virtual by SAC.

For Ant, we modify the environment by adding the x and y axis to the observation space to make it possible to compute the reward from observations and actions. For Humanoid, we add the position of center of mass. We don't have any other modifications. All environments have maximum horizon 1000.

For the policy network, we use an MLP with ReLU activation function and two hidden layers, each of which contains 256 hidden units. For the dynamics model, we use a network with 2 Fixup blocks (Zhang et al., 2019) , with convolution layers replaced by a fully connected layer. We found out that with similar number of parameters, fixup blocks leads to a more accurate model in terms of validation loss. Each fixup block has 500 hidden units. We follow the model training algorithm in Luo et al. (2019) in which non-squared 2 loss is used instead of the standard MSE loss.

A.2 ABLATION STUDY:

Planning with oracle dynamics and more environments. We found that BOOTS has smaller improvements on top of MBSAC and SAC for the environment Cheetah and Walker. To diagnose the issue, we also plan with an oracle dynamics (the true dynamics). This tells us whether the lack of improvement comes from inaccurate learned dynamics. The results are presented in two ways in Figure 6 and Figure 7 . In Figure 6 , we plot the mean rewards and the standard deviation of various methods across the randomness of multiple seeds. However, the randomness from the seeds somewhat obscures the gains of BOOTS on each individual run. Therefore, for completeness, we also plot the relative gain of BOOTS on top of MBSAC and SAC, and the standard deviation of the gains in Figure 7 .

From Figure 7 we can see planning with the oracle dynamics improves the performance in most of the cases (but with various amount of improvements). However, the learned dynamics sometimes not always can give an improvement similar to the oracle dynamics. This suggests the learned dynamics is not perfect, but oftentimes can lead to good planning. This suggests the expressivity of the Q-functions varies depending on the particular environment. How and when to learn and use a learned dynamics for planning is a very interesting future open question. The effect of planning horizon. We experimented with different planning horizons in Figure 8 . By planning with a longer horizon, we can earn slightly higher total rewards for both MBSAC and SAC. Planning horizon k = 16, however, does not work well. We suspect that it's caused by the compounding effect of the errors in the dynamics.

B OMITTED PROOFS IN SECTION 4:

In this section we provide the proofs omitted in Section 4.

B.1 PROOF OF THEOREM 4.2:

Proof of Theorem 4.2. Since the solution to Bellman optimal equations is unique, we only need to verify that V and π defined in equation ( 1) satisfy the following,

EQUATION

)

Recall that s (i) is the i-th bit in the binary representation of s, that is, ) = 0], which ensures the H-bit of the next state is 1, we have

s (i) = 2 i s mod 2. Let ŝ = f (s, π (s)). Since π (s) = I[s (H+1

EQUATION

For simplicity, define ε = 2(γ H-1 -γ H ). The definition of r(s, a) implies that r(s, π (s)

) = I[1/2 ≤ s < 1] -I[π (s) = 1]ε = s (1) -1 -s (H+1) ε.

By elementary manipulation, Eq. ( 3) is equivalent to

EQUATION

Now, we verify Eq. ( 10) by plugging in the proposed solution (namely, Eq. ( 13)). As a result,

r(s, π (s)) + γV (ŝ) = s (1) -1 -s (H+1) ε + γ H i=1 γ i-1 I[ŝ (i) = 1] + γ ∞ i=H+1 γ i-1 -1 -ŝ(i) 2(γ i-2 -γ i-1 ) = s (1) -1 -s (H+1) ε + H i=2 γ i-1 s (i) + γ H + ∞ i=H+2 γ i-1 -1 -s (i) 2(γ i-2 -γ i-1 ) = H i=1 γ i-1 s (i) + ∞ i=H+1 γ i-1 -1 -s (i) 2(γ i-2 -γ i-1 ) = V (s),

which verifies Eq. ( 10).

In the following we verify Eq. ( 11). Consider any a = π (s). Let s = f (s, a) for shorthand. Note that s(i) = s (i+1) for i > H. As a result,

V (s) -γV (s) = H i=1 γ i-1 s (i) + ∞ i=H+1 γ i-1 -1 -s (i) 2(γ i-2 -γ i-1 ) - H i=1 γ i-1 s(i) - ∞ i=H+1 γ i-1 -1 -s(i) 2(γ i-2 -γ i-1 ) =s (1) + H-1 i=1 γ i s (i+1) -s(i) -γ H s(H) + γ H -2 1 -s (H+1) γ H-1 -γ H

For the case where s (H+1) = 0, we have π (s) = 1. For a = 0, s(i) = s (i+1) for all i ≥ 1.

Consequently, V (s) -γV (s) = s (1) + γ H -ε > s (1) = r(s, 0),

where the last inequality holds when γ H -ε > 0, or equivalently, γ > 2/3.

For the case where s (H+1) = 1, we have π (s) = 0. For a = 1, we have s (H+1) = 1 and s(H) = 0. Let p = max{i ≤ H : s (i) = 0}, where we define the max of an empty set is 0. The dynamics f (s, 1) implies that

s(i) =    s (i+1) , i + 1 < p or i > H, 1, i + 1 = p, 0, p < i + 1 ≤ H + 1.

Therefore,

V (s) -γV (s) = s (1) + γ H + H-1 i=1 γ i s (i+1) -s(i) > s (1) -ε = r(s, 1).

In both cases, we have V -γV (s) > r(s, a) for a = π (s), which proves Eq. ( 11).

B.2 PROOF OF THEOREM 4.3:

For a fixed parameter H, let z(π) be the number of pieces in π. For a policy π, define the state distribution when acting policy π at step h as µ π h . In order to prove Theorem 4.3, we show that if 1/2 -2Hz(π)/2 H < 0.3, then η(π) < 0.92η(π ). The proof is based on the advantage decomposition lemma. Lemma B.1 (Advantage Decomposition Lemma (Schulman et al., 2015; Kakade & Langford, 2002) ). Define A π (s, a) = r(s, a)

EQUATION

)

Corollary B.2. For any policy π, we have

EQUATION

)

Intuitively speaking, since π = I[s (H+1) = 0], the a policy π with polynomial pieces behaves suboptimally in most of the states. Lemma B.3 shows that the single-step suboptimality gap V (s)-Q (s, π(s)) is large for a constant portion of the states. On the other hand, Lemma B.4 proves that the state distribution µ π h is near uniform, which means that suboptimal states can not be avoided. Combining with Corollary B.2, the suboptimal gap of policy π is large.

The next lemma shows that, if π does not change its action for states from a certain interval, the average advantage term V (s) -Q (s, π(s)) in this interval is large. Proof of this lemma is deferred of Section B.3. 16) for H > 500.

EQUATION

Next lemma shows that when the number of pieces in π is not too large, the distribution µ π h is close to uniform distribution for step 1 ≤ h ≤ H. Proof of this lemma is deferred of Section B.3 Lemma B.4. Let z(π) be the number of pieces of policy π.

EQUATION

)

Now we present the proof for Theorem 4.3.

Proof of Theorem 4.3.

EQUATION

Let ν h (k) = inf s∈ k µ π h (s), then by advantage decomposition lemma (namely, Corollary B.2), we have

η(π ) -η(π) = ∞ h=1 γ h-1 s∈[0,1) (V * (s) -Q (s, π(s))) dµ π h (s) ≥ 10H h=1 γ h-1 k∈K s∈ k (V * (s) -Q (s, π(s))) dµ π h (s) ≥ 10H h=1 γ h-1 k∈K s∈ k ν h (k)(V * (s) -Q (s, π(s))) ds ≥ 10H h=1 γ h-1 k∈K 0.183 • 2 -H • ν h (k) .

By Lemma B.4 and union bound, we get

EQUATION

)

For the sake of contradiction, we assume z(π) = o (exp(cH)/H), then for large enough H we have,

1/2 - 20Hz(π) 2 H ≥ 0.49, which means that k∈K 2 -H • ν h (k) ≥ 0.

49 for all h ≤ 10H. Consequently, for H > 500, we have

η(π ) -η(π) ≥ 10H h=1 (0.183 × 0.49)γ h-1 ≥ 0.089 • 1 -γ 10H 1 -γ ≥ 0.088 1 -γ .

Now, since η(π ) ≤ 1/(1 -γ), we have η(π) < 0.92η(π ). Therefore for near-optimal policy π, z(π) = Ω (exp(cH)/H) .

B.3 PROOFS OF LEMMA B.3 AND LEMMA B.4:

In this section, we present the proofs of two lemmas used in Section B.1

Proof of Lemma B.3. Note that for any k ∈ K, s (H) = 1, ∀s ∈ k . Now fix a parameter k ∈ K. Suppose π(s) = a i for s ∈ k . Then for any s such that s (H+1) + i = 1, we have

V (s) -Q (s, π(s)) ≥ γ H -ε.

For H > 500, we have γ H -ε > 0.366. Therefore,

s∈ k (V (s)-Q (s, π(s))) ds ≥ s∈ k 0.366•I[s (H+1) = 1-i] ds ≥ 0.366•2 -H-1 = 0.183•2 -H .

Proof of Lemma B.4. Now let us fix a parameter H and policy π. For every h, we prove by induction that there exists a function ξ h (s), such that

(a) 0 ≤ ξ h (s) ≤ min{µ π h (s), 1}, (b) inf s∈ k ξ h (s) = sup s∈ k ξ h (s), ∀k ∈ [A H ], (c) s∈[0,1) dξ h (s) ≥ 1 -h • z(π)/2 H-1 .

For the base case h = 1, we define

ξ h (s) = µ π h (s) = 1 for all s ∈ [0, 1). Now we construct ξ h+1 from ξ h . For a fixed k ∈ [2 H ], define l k = k • 2 -H , r k = (k + 1) • 2 -H as the left and right endpoints of interval k . Let {x (i) k } 2

i=1 be the set of 2 solutions of equation

2x + 2 -H ≡ l k mod 1

where 0 ≤ x < 1, and we define y

EQUATION

k ) can reach states in interval k by a single transition. We define a set

I k = {i : 1 ≤ i ≤ 2, |{π(s) : s ∈ [x (i) k , y (i) k )}| = 1}.

That is, the intervals where policy π acts unanimously. Consequently, for i ∈ I k , the set {s : s ∈ [x

(i) k , y (i) k ), f (s, π(s)) ∈ k } is an interval of length 2 -H-1

, and has the form

EQUATION

Now, the density ξ h+1 (s) for s ∈ k is defined as,

ξ h+1 (s) def = i∈I k 1 2 • ξ h (x (i) k + w (i) k • 2 -H-1 )

The intuition of the construction is that, we discard those density that cause non-uniform behavior (that is, the density in intervals [x

EQUATION

k ) where i ∈ I k ). When the number of pieces of π is small, we can keep most of the density. Now, statement (b) is naturally satisfied by definition of ξ h+1 . We verify statement (a) and (c) below.

For any set B ⊆ k , let (T π )

-1 (B) = {s ∈ S : f (s, π(s)) ∈ B} be the inverse of Markov transition T π . Then we have,

(T π ξ h )(B) def = ξ h (T π ) -1 (B) = i∈{1,2} ξ h (T π ) -1 (B) ∩ [x (i) k , y (i) k ) ≥ i∈I k ξ h (T π ) -1 (B) ∩ [x (i) k , y (i) k ) = i∈I k (T π ) -1 (B) ∩ [x (i) k , y (i) k ) ξ h x (i) k + w (i) k • 2 -H-1

(By Eq. ( 20))

= i∈I k |B| 2 ξ h x (i) k + w (i) k • 2 -H-1 ,

where | • | is the shorthand for standard Lebesgue measure.

By definition, we have

ξ h+1 (B) = i∈I k |B| 2 ξ h x (i) k + w (i) k • 2 -H-1 ≤ (T π ξ h )(B) ≤ (T π µ π h )(B) = µ π h+1 (B),

which verifies statement (a).

For statement (c), recall that S = [0, 1) is the state space. Note that T π preserve the overall density.

That is (T π ξ h ) (S) = ξ h (S). We only need to prove that

EQUATION

and statement (c) follows by induction.

By definition of ξ h+1 (s) and the induction hypothesis that ξ h (s) ≤ 1, we have

(T π ξ h ) ( k ) -ξ h+1 ( k ) ≤ (2 -|I k |)2 -H .

On the other hand, for any s ∈ S, the set {k ∈ [2 H ] :

EQUATION

k )} has cardinality 2, which means that one intermittent point of π can correspond to at most 2 intervals that are not in I k for some k. Thus, we have

0≤k<2 H |I k | ≥ 2 H+1 - s:π -(s) =π + (s) {k ∈ [2 H ] : s ∈ ∪ 2 i=1 [x (i) k , y (i) k )} ≥ 2 H+1 -2 • z(π). Consequently (T π ξ h ) (S) -ξ h+1 (S) = 0≤k<2 H ((T π ξ h ) ( k ) -ξ h+1 ( k )) ≤ z(π)2 -H+1 ,

which proves statement (c).

B.4 SAMPLE COMPLEXITY LOWER BOUND OF Q-LEARNING:

Recall that corollary 4.4 says that in order to find a near-optimal policy by a Q-learning algorithm, an exponentially large Q-network is required. In this subsection, we show that even if an exponentially large Q-network is applied for Q learning, still we need to collect an exponentially large number of samples, ruling out the possibility of efficiently solving the constructed MDPs with Q-learning algorithms.

Towards proving the sample complexity lower bound, we consider a stronger family of Q-learning algorithm, Q-learning with Oracle (Algorithm 3). We assume that the algorithm has access to a Q-ORACLE, which returns the optimal Q-function upon querying any pair (s, a) during the training process. Q-learning with Oracle is conceptually a stronger computation model than the vanilla Q-learning algorithm, because it can directly fit the Q functions with supervised learning, without relying on the rollouts or the previous Q function to estimate the target Q value. Theorem B.5 proves a sample complexity lower bound for Q-learning algorithm on the constructed example. Query Q-ORACLE to get the function Q (s i , •).

5::

Apply any action a i (according to any rule) and sample s i+1 ∼ f (s i , a i ). 6: Learn the Q-function that fit all the data the best:

Q ← arg min Q∈Q 1 n n i=1 (Q(s i , a i ) -Q (s i , a i ))

2 + λR(Q)

7: Return the greedy policy according to Q.

Theorem B.5 (Informal Version of Theorem B.7). Suppose Q is an infinitely-wide two-layer neural networks, and R(Q) is 1 norm of the parameters and serves as a tiebreaker. Then, any instantiation of the Q-LEARNING WITH ORACLE algorithm requires exponentially many samples to find a policy π such that η(π) > 0.99η(π ). 

Recall that the Q-learning with oracle algorithm finds the solution by the following supervised learning problem,

EQUATION

)

Then, we present the formal version of theorem B.5. Theorem B.7. Let Q be the minimal 1 norm solution to Eq. ( 24), and π the greedy policy according to Q. When n = o(exp(cH)/H), we have η(π) < 0.99η(π ).

The proof of Theorem B.5 is by characterizing the minimal-norm solution, namely the sparsity of the minimal-norm solution as stated in the next lemma. Lemma B.8. The minimal-norm solution to Eq. (24) has at most 32n + 1 non-zero neurons. That is, |{i :

k i = 0}| ≤ 32n + 1.

We first present the proof of Theorem B.7, followed by the proof of Theorem B.8.

Proof of Theorem B.7. Recall that the policy is given by π(s) = arg max a∈A Q(s, a). For a Qfunction with 32n + 2 pieces, the greedy policy according to Q(s, a) has at most 64n + 4 pieces.

Combining with Theorem 4.3, in order to find a policy π such that η(π) > 0.99η(π ), n needs to be exponentially large (in effective horizon H).

Proof of Lemma B.8 is based on merging neurons. Let x i = -b i /k i , w i = (w i,1 , w i,2 ), and c = (c 1 , c 2 ). In vector form, neural net defined in Eq. ( 22) can be written as,

Q(s, •) = d i=1 w i [k i (s -x i )] + + c.

First we show that neurons with the same x i can be merged together. Lemma B.9. Consider the following two neurons,

k 1 [s -x 1 ] + w 1 , k 2 [s -x 2 ] + w 2 .

with k 1 > 0, k 2 > 0. If x 1 = x 2 , then we can replace them with one single neuron of the form k [x -x 1 ] + w without changing the output of the network. Furthermore, if w 1 = 0, w 2 = 0, the norm strictly decreases after replacement.

Proof. We set k = |k 1 w 1 + k 2 w 2 | 1 , and w = (k 1 w 1 + k 2 w 2 )/k , where |w| 1 represents the 1-norm of vector w. Then, for all s ∈ R,

k [x -x 1 ] + w = (k 1 w 1 + k 2 w 2 ) [s -x 1 ] + = k 1 [s -x 1 ] + w 1 + k 2 [s -x 1 ] + w 2 .

The norm of the new neuron is |k | + |w | 1 . By calculation we have,

|k | + |w | 1 = 2 |k 1 w 1 + k 2 w 2 | 1 ≤ 2 |k 1 w 1 | 1 + |k 2 w 2 | 1 (a) ≤ 2 |k 1 w 1 | 1 + |k 2 w 2 | 1 ≤ |k 1 | + |w 1 | 1 + |k 2 | + |w 2 | 1 .

Note that the inequality (a) is strictly less when |k 1 w 1 | 1 = 0 and |k 2 w 2 | 1 = 0.

Next we consider merging two neurons with different intercepts between two data points. Without loss of generality, assume the data points are listed in ascending order. That is, s i ≤ s i+1 . Lemma B.10. Consider two neurons

k 1 [s -x 0 ] + w 1 , k 2 [s -x 0 -δ] + w 2 .

with k 1 > 0, k 2 > 0. If s i ≤ x 0 < x 0 + δ ≤ s i+1 for some 1 ≤ i ≤ n, then the two neurons can replaced by a set of three neurons,

k [s -x 0 ] + w , k [s -s i ] + w, k [s -s i+1 ] + (-w)

such that for s ≤ s i or s ≥ s i+1 , the output of the network is unchanged. Furthermore, if δ ≤ (s i+1 -s i )/16 and |w 1 | 1 = 0, |w 2 | 1 = 0, the norm decreases strictly.

Proof. For simplicity, define ∆ = s i+1 -s i . We set

k = |k 1 w 1 + k 2 w 2 | 1 , w = (k 1 w 1 + k 2 w 2 )/k , k = |k 2 w 2 | 1 δ/∆, w = -k 2 w 2 δ/(∆ k).

Note that for s ≤ s i , all of the neurons are inactive. For s ≥ s i+1 , all of the neurons are active, and

k w (s -x 0 ) + k w(s -s i ) -k w(s -s i+1 ) = (k 1 w 1 + k 2 w 2 )(s -x 0 ) -k 2 w 2 δ = k 1 (s -x 0 )w 1 + k 2 (s -x 0 -δ)w 2 ,

which means that the output of the network is unchanged. Now consider the norm of the two networks. Without loss of generality, assume

|k 1 w 1 | 1 > |k 2 w 2 | 1 . The original network has norm |k 1 | + |w 1 | 1 + |k 2 | + |w 2 | 1 . And the new network has norm |k | + |w | 1 + 2| k| + 2| w| 1 = 2 |k 1 w 1 + k 2 w 2 | 1 + 4 |k 2 w 2 | 1 δ/∆ (a) ≤ |k 1 | + |w 1 | 1 + |k 2 | + |w 2 | 1 + 4 |k 2 w 2 | 1 δ/∆ - 1 2 (|k 2 | + |w 2 | 1 ) ,

where the inequality (a) is a result of Lemma E.1, and is strictly less when |w

1 | 1 = 0, |w 2 | 1 = 0. When δ/∆ < 1/16, we have 4 |k 2 w 2 | 1 δ/∆ -1 2 (|k 2 | + |w 2 | 1 ) < 0, which implies that |k | + |w | 1 + 2| k| + 2| w| 1 < |k 1 | + |w 1 | 1 + |k 2 | + |w 2 | 1 .

Similarly, two neurons with k 1 < 0 and k 2 < 0 can be merged together.

Now we are ready to prove Lemma B.8. As hinted by previous lemmas, we show that between two data points, there are at most 34 non-zero neurons in the minimal norm solution.

Proof of Lemma B.8. Consider the solution to Eq. ( 24). Without loss of generality, assume that s i ≤ s i+1 . In the minimal norm solution, it is obvious that |w i | 1 = 0 if and only if k i = 0. Therefore we only consider those neurons with k i = 0, denoted by index 1 ≤ i ≤ d .

Let B t = {-b i /k i : 1 ≤ i ≤ d , s t < -b i /k i < s t+1 , k i > 0}.

Next we prove that in the minimal norm solution, |B t | ≤ 15. For the sake of contradiction, suppse |B t | > 15. Then there exists i, j such that,

s t < -b i /k i < s t+1 , s t < -b j /k j < s t+1 , |b i /k i -b j /k j | < (s t+1 -s i )/16

, and k i > 0, k j > 0. By Lemma B.10, we can obtain a neural net with smaller norm by merging neurons i, j together without violating Eq. ( 24), which leads to contradiction.

By Lemma B.9, |B t | ≤ 15 implies that there are at most 15 non-zero neurons with s t < -b i /k i < s t+1 and k i > 0. For the same reason, there are at most 15 non-zero neurons with s t < -b i /k i < s t+1 and k i < 0.

On the other hand, there are at most 2 non-zero neurons with s t = -b i /k i for all t ≤ n, and there are at most 1 non-zero neurons with -b i /k i < s 1 . Therefore, we have d ≤ 32n + 1.

B.6 PROOF OF THEOREM 5.1

In this section we present the full proof of Theorem 5.1.

Proof. First we define the true trajectory estimator

η(s 0 , a 0 , a 1 , • • • , a k ) = k-1 j=0 γ j r(s j , a j ) + γ k Q (s k , a k ),

the true optimal action sequence a

0 , a 1 , • • • , a k = arg max a0,a1,••• ,a k η(s 0 , a 0 , a 1 , • • • , a k ),

and the true optimal trajectory

s 0 = s 0 , s j = f (s j-1 , a j-1 ), ∀j > 1.

It follows from the definition of optimal policy that, a j = π (s j ). Consequently we have

s k (H-k+1) = s k (H-k+2) = • • • = s k (H) = 1. Define the set G = {s : s (H-k+1) = s (H-k+2) = • • • = s (H) = 1}.

We claim that the following function satisfies the statement of Theorem 5.1

Q(s, a) = I[s ∈ G] • 2 1 -γ .

Since s k ∈ G, and s k ∈ G for s k generated by non-optimal action sequence, we have

Q(s k , a) > Q (s k , a) ≥ Q (s k , a) > Q(s k , a),

where the second inequality comes from the optimality of action sequence a h . As a consequence, for any (a 0 , a

1 , • • • , a k ) = (a 0 , a 1 , • • • , a k ) η(s 0 , a 0 , a 1 , • • • , a k ) > η(s 0 , a 0 , a 1 , • • • , a k ) ≥ η(s 0 , a 0 , a 1 , • • • , a k ) > η(s 0 , a 0 , a 1 , • • • , a k ). Therefore, (â 0 , â 1 , • • • , â k ) = (a 0 , a 1 , • • • , a k ). Let ŝ = f (s, π (s)). It follows from Bellman equation (1) that V (s) = r(s, π (s)) + γV (ŝ), Q (s, π(s)) = r(s, π(s)) + γV (0). Recall that we define = 2 γ H-1 -γ H . As a consequence, (V (s) -Q (s, π(s))) > r(s, π (s)) -r(s, π(s)) + γ(V (ŝ) -V (0)) ≥ -+ γ H i=1 γ i-1 ŝ(i) .

Plugging into Eq (27), we have

1 | k | s∈ k (V (s) -Q (s, π(s))) ds ≥ -+ 1 | k | s∈ k H i=1 γ i ŝ(i) ds ≥ -+ H i=1 γ i 1 | k | s∈ k ŝ(i) ds ≥ -+ γ H/2 -γ H 1 -γ .

Lemma 27 is proved by noticing for large enough H,

-+ γ H/2 -γ H 1 -γ > 0.1 1 -γ .

Let D = {0, 1} for simplicity. For any policy π, we define a transition operator T π , such that

T π µ (Z) = µ ({s : p(s, a) ∈ Z, f (s, π(s)) ∈ D) ,

and the distribution induced by it, defined recursively by μπ 1 (s) = 1, μπ h = T π µ π h-1 . We also define the density function for states that are truncated as follows,

ρπ h (s) = I[f (s, π(s)) ∈ D]μ π h (s) .

Following advantage decomposition lemma (Corollary B.2), the key step for proving Theorem C.3 is

EQUATION

Similar to Lemma B.4, the following lemma shows that the density for most of the small intervals is either uniformly clipped, or uniformly spread over this interval.

Lemma C.5. Let z(π) be the number of pieces of policy π. 

EQUATION

EQUATION

)

By Eq (28), Eq (30) and Lemma ( 27), we have

EQUATION

By Lemma C.5, we get

EQUATION

)

For the sake of contradiction, we assume z(π) = o (exp(cH)/H), then for large enough H we have, 1 -2 Hz(π) + 10 2 H/2 > 0.8.

Consequently,

EQUATION

Plugging in Eq (31), we get η(π ) -η(π)

≥ H h=1 0.075γ h-1   2 H/2 k=0 2 -H/2 ν h (k)   + H h=1 2 H/2 k=0 γ h • 2 -H/2 • ω h (k) • 0.1 1 -γ . ≥ H h=1 0.075γ h-1   0.8 - h-1 h =1 2 H/2 k=0 2 -H/2 • ω h (k)   + H h=1 2 H/2 k=0 γ h • 2 -H/2 • ω h (k) • 0.1 1 -γ ≥ 0.06 1 -γ H 1 -γ + H h=1 2 H/2 k=0 •2 -H/2 • ω h (k) 0.1γ h 1 -γ -0.075 H h =h γ h -1 ≥ 0.06 1 -γ H 1 -γ + H h=1 2 H/2 k=0 •2 -H/2 • ω h (k) γ h-1 1 -γ 0.1γ -0.075 1 -γ H-h

When γ > 1/4, we have 0.1γ -0.075(1 -γ H-h ) > 0. As a consequence, η(π ) -η(π) > 0.06 1 -γ H 1 -γ ≥ 0.01 1 -γ .

Now, since η(π ) ≤ 1/(1 -γ), we have η(π) < 0.99η(π ). Therefore for near-optimal policy π, z(π) = Ω (exp(cH)/H) .

D OMITTED DETAILS OF EMPIRICAL RESULTS IN THE TOY EXAMPLE D.1 TWO METHODS TO GENERATE MDPS:

In this section we present two methods of generating MDPs. In both methods, the dynamics p(s, a) has three pieces and is Lipschitz. The dynamics is generated by connecting kinks by linear lines.

RAND method. As stated in Section 4.3, the RAND method generates kinks {x i } and the corresponding values {x i } randomly. In this method, the generated MDPs are with less structure. The details are shown as follows.

• State space S = [0, 1).

• Action space A = {0, 1}.

• Number of pieces is fixed to 3. The positions of the kinks are generated by, x i ∼ U (0, 1) for i = 1, 2 and x 0 = 0, x 1 = 1. The values are generated by x i ∼ U (0, 1). • The reward function is given by r(s, a) = s, ∀s ∈ S, a ∈ A.

• The horizon is fixed as H = 10.

• Initial state distribution is U (0, 1).

Figure 1 visualizes one of the RAND-generated MDPs with complex Q-functions. SEMI-RAND method. In this method, we add some structures to the dynamics, resulting in a more significant probability that the optimal policy is complex. We generate dynamics with fix and shared kinks, generate the output at the kinks to make the functions fluctuating. The details are shown as follows. The histogram of number of pieces in optimal policy π is plotted. As shown in Figure 9 , even for horizon H = 10, the optimal policy tends to have much more pieces than the dynamics. • The Q-network is a fully connected neural net with one hidden-layer. The width of the hidden-layer is varying.

• The optimizer is SGD with learning rate 0.001 and momentum 0.9.

• The size of replay buffer is 10 4 .

• Target-net update frequency is 50.

• Batch size in policy optimization is 128.

• The behavior policy is greedy policy according to the current Q-network with -greedy. exponentially decays from 0.9 to 0.01. Specifically, = 0.01 + 0.89 exp(-t/200) at the t-th episode.

Implementation details of MBPO algorithm For the model-learning step, we use 2 loss to train our model, and we use Soft Actor-Critic (SAC) (Haarnoja et al., 2018) in the policy optimization step. The parameters are set as,

• number of hidden neurons in model-net: 32,

• number of hidden neurons in value-net: 512,

• optimizer for model-learning: Adam with learning rate 0.001.

• temperature: τ = 0.01,

• the model rollout steps: M = 5,

• the length of the rollout: k = 5,

• number of policy optimization step: G = 5.

Other hyper-parameters are kept the same as DQN algorithm.

Implementation details of TRPO algorithm For the model-learning step, we use 2 loss to train our model. Instead of TRPO (Schulman et al., 2015) , we use PPO (Schulman et al., 2017) as policy optimizer. The parameters are set as,

• number of hidden neurons in model-net: 32,

• number of hidden neurons in policy-net: 512,

• number of hidden neurons in value-net: 512,

• optimizer: Adam with learning rate 0.001,

• number of policy optimization step: 5.

• The behavior policy is -greedy policy according to the current policy network. exponential decays from 0.9 to 0.01. Specifically, = 0.01 + 0.89 exp(-t/20000) at the t-th episode.

:

In turn, the dynamics can also be much more complex than the Q-function. Consider the following situation: a subset of the coordinates of the state space can be arbitrarily difficult to express by neural networks, but the reward function can only depend on the rest of the coordinates and remain simple.

The mod function is defined as: x mod 1 x -x . More generally, for positive real k, we define x mod k x -k x/k .

Or more precisely, we define s (h) 2 h s mod 2.

Our code is available at https://github.com/roosephu/boots.

For STEVE, we use the official code at https://github.com/tensorflow/models/tree/ master/research/steve

In the paper of MBPO(Janner et al., 2019), the authors don't explicitly state their usage of real data in SAC; the released code seems to make such use of real data, though.

https://pytorch.org/tutorials/intermediate/reinforcement_q_learning. html

Figures and Tables:

Figure 1: Left: The dynamics of two randomly generated MDPs (from the RAND, and SEMI-RAND methods outlined in Section 4.3 and detailed in Appendix D.1). Right: The corresponding Q-functions which are more complex than the dynamics (more details in Section 4.3).

Figure 2: A visualization of the dynamics, the reward function in the MDP defined in Definition 4.1, and the approximation of its optimal Q-function for the effective horizon H = 4. We can also construct slightly more involved construction with Lipschitz dynamics and very similar properties. Please see Appendix C.

Figure 3: (Left): The performance of DQN, SLBO, and MBPO on the bottom dynamics in Figure 1.The number after the acronym is the width of the neural network used in the parameterization of Q. We see that even with sufficiently large neural networks and sufficiently many steps, these algorithms still suffers from bad approximability and cannot achieve optimal reward. (Right): Performance of BOOTS + DQN with various planning steps. A near-optimal reward is achieved with even k = 3, indicating that the bootstrapping with the learned dynamics improves the expressivity of the policy significantly.

Figure 4: Comparison of BOOTS-MBSAC vs MBSAC and BOOTS-SAC vs SAC on Ant and Humanoid.Particularly on the Humanoid environment, BOOTS improves the performance significantly. The test policies for MBSAC and SAC are the deterministic policy that takes the mean of the output of the policy network, because the deterministic policy performs better than the stochastic policy in the test time.

Figure 5: BOOTS-MBSAC or BOOTS-MBPO outperforms previous state-of-the-art algorithms on Humanoid. The results are averaged over 5 random seeds and shadow area indicates a single standard deviation from the mean.

Figure 6: BOOTS with oracle dynamics on top of SAC (top) and MBSAC (bottom) on HalfCheetah, Walker, Ant and Humanoid. The solid lines are average over 5 runs, and the shadow areas indicate the standard deviation.

Figure 7: The relative gains of BOOTS over SAC (top) and MBSAC (bottom) on HalfCheetah, Walker, Ant and Humanoid. The solid lines are average over 5 runs, and the shadow areas indicate the standard deviation.

Figure 8: Different BOOTS planning horizon k on top of SAC (left) and MBSAC (right) on Humanoid. The solid lines are average over 5 runs, and the shadow areas indicate the standard deviation.

proof of Theorem B.5 is given in Appendix B.5. The proof of Theorem B.5 is to exploit the sparsity of the solution found by minimal-norm tie-breaker. It can be proven that there are at most O(n) non-zero neurons in the minimal-norm solution, where n is the number of data points. The proof is completed by combining with Theorem 4.3.B.5 PROOF OF THEOREM B.5A two-layer ReLU neural net Q(s, •) with input s is of the following form,Q(s, a) = d i=1 w i,a [k i s + b i ] + + c a , (22)where d is the number of hidden neurons. w i,a , c a , k i , b i are parameters of this neural net, where c i,a , b i are bias terms. [x] + is a shorthand for ReLU activation I[x > 0]x. Now we define the norm of a neural net. Definition B.6 (Norm of a Neural Net). The norm of a two-layer ReLU neural net is defined as, d i=1 |w i,a | + |k i |.

State space S = [0, 1). • Action space A = {0, 1}. • Number of pieces is fixed to 3. The positions of the kinks are generated by, x i = i/3, ∀0 ≤ i ≤ 3. And the values are generated by x i ∼ 0.65 × I[i mod 2 = 0] + 0.35 × U (0, 1). • The reward function is r(s, a) = s for all a ∈ A. • The horizon is fixed as H = 10. • Initial state distribution is U (0, 1).

Figure 1 visualizes one of the MDPs generated by SEMI-RAND method.

Figure 9: The histogram of number of pieces in optimal policy π in random method (left) and semi-random method(right).

, which is called MBSAC. The main difference here from MBPO and other works such as(Wang & Ba, 2019;Kurutach et al., 2018) is that we don't use model ensemble. Instead, we occasionally optimize the dynamics by one step of Adam to introduce stochasticity in the dynamics, following the technique inSLBO Luo et al.  (2019). Our algorithm is a few times faster than MBPO in wall-clock time. It performs similarly to MBPO on Humanoid, but generally worse than MBPO on other environments. See Appendix A.1 for details.

Table content: <table/>

Algorithm 3 Q-LEARNING WITH ORACLE Require: A hypothesis space Q of Q-function parameterization. 1: Sample s 0 ∼ µ from the initial state distribution µ 2: for i = 1, 2, • • • , n do

Table content: <table><tr><td>3:</td><td>Decide whether to restart the trajectory by setting s i ∼ µ based on historical information</td></tr><tr><td>4:</td><td/></tr></table>

Proof of Theorem C.3. For any k ∈ [2 H/2 ], consider the interval k = [k/2 H/2 , (k + 1)/2 H/2 ).. If π does not change at interval k (that is, |{π(s) : s ∈ k }| = 1), by Lemma B.3 we have

Table content: <table><tr><td>s∈ k</td></tr></table>

Peer review (iclr2020):
The paper highlights an interesting issue regarding approximability of function approximators (neural networks). The paper provides cases where the action value function is difficult to approximate and is much more difficult than the dynamics of a model. The author conducts some experiments to claim that even with a large NN, DQN still finds a suboptimal policy. Theorems regarding the appoximability of the action value function are presented. Then the paper proposes that rollout-based search should be preferred for planning and conducts some experiments to verify this. Although the paper points out interesting issues of approximating action-value function, both the motivation and the suggestion regarding MBRL are not convincing. 1. In term of the motivation, those cases listed in the paper are interesting, but they are not representative. In fact, the Dynamics can be far more complicated and it is still an open problem regarding how to learn the Dynamics. Furthermore, the proposed method is to simply combine MCTS and bootstrap value estimates. The method itself is not novel and it basically down weights the bootstrap estimate. It is very intuitive that some appropriate combination between the two can yield better performance. However, in model-based setting, the reward sequence can be highly variant and non-stationary, there is no solid reason to believe this can be always better. The motivating experiments in figure 3 are not persuasive. There can be many reasons for a deep RL algorithm to find a suboptimal policy: boostrap target interference, overestimation, difficulty of optimization, etc. It is quite confusing which factor leads to suboptimal performance of DQN. 2. Theorem 4.3 does not make sense to me. What does it mean by “no constant depth NN can approximate the optimal policy with near optimal rewards?” Notice that, in machine learning community, people rarely pursue perfect approximation (equality). As long as the approximation error can be reasonably small, the approximator should be still useful. Does “no constant depth NN can approximate the optimal policy” mean the approximation error is unbounded? I believe we can still expect a large NN to approximate the action-value function very well. A minor issue. In page 2, the paper writes “model-free RL or MB policy optimization suffer from …, whereas MB planning … ”. MB planning is not a separate category of MB policy optimization. Such statement is not accurate.