Title: PLAN ONLINE, LEARN OFFLINE: EFFICIENT LEARNING AND EXPLORATION VIA MODEL-BASED CONTROL

Abstract: We propose a "plan online and learn offline" framework for the setting where an agent, with an internal model, needs to continually act and learn in the world. Our work builds on the synergistic relationship between local model-based control, global value function learning, and exploration. We study how local trajectory optimization can cope with approximation errors in the value function, and can stabilize and accelerate value function learning. Conversely, we also study how approximate value functions can help reduce the planning horizon and allow for better policies beyond local solutions. Finally, we also demonstrate how trajectory optimization can be used to perform temporally coordinated exploration in conjunction with estimating uncertainty in value function approximation. This exploration is critical for fast and stable learning of the value function. Combining these components enable solutions to complex control tasks, like humanoid locomotion and dexterous in-hand manipulation, in the equivalent of a few minutes of experience in the real world.

1. INTRODUCTION:

We consider a setting where an agent with limited memory and computational resources is dropped into a world. The agent has to simultaneously act in the world and learn to become proficient in the tasks it encounters. Let us further consider a setting where the agent has some prior knowledge about the world in the form of a nominal dynamics model. However, the state space of the world could be very large and complex, and the set of possible tasks very diverse. This complexity and diversity, combined with limited computational capability, rules out the possibility of an omniscient agent that has experienced all situations and knows how to act optimally in all states, even if the agent knows the dynamics. Thus, the agent has to act in the world while learning to become competent.

Based on the knowledge of dynamics and its computational resources, the agent is imbued with a local search procedure in the form of trajectory optimization. While the agent would certainly benefit from the most powerful of trajectory optimization algorithms, it is plausible that very complex procedures are still insufficient or inadmissible due to the complexity or inherent unpredictability of the environment. Limited computational resources may also prevent these powerful methods from real-time operation. While the trajectory optimizer may be insufficient by itself, we show that it provides a powerful vehicle for the agent to explore and learn about the world.

Due to the limited capabilities of the agent, a natural expectation is for the agent to be moderately competent for new tasks that occur infrequently and skillful in situations that it encounters repeatedly by learning from experience. Based on this intuition, we propose the plan online and learn offline (POLO) framework for continual acting and learning. POLO is based on the tight synergistic coupling between local trajectory optimization, global value function learning, and exploration.

We will first provide intuitions for why there may be substantial performance degradation when acting greedily using an approximate value function. We also show that value function learning can be accelerated and stabilized by utilizing trajectory optimization integrally in the learning process, and that a trajectory optimization procedure in conjunction with an approximate value function can compute near optimal actions. In addition, exploration is critical to propagate global information in value function learning, and for trajectory optimization to escape local solutions and saddle Figure 1 : Examples of tasks solved with POLO. A 2D point agent navigating a maze without any directed reward signal, a complex 3D humanoid standing up from the floor, pushing a box, and inhand re-positioning of a cube to various orientations with a five-fingered hand. Video demonstration of our results can be found at: https://sites.google.com/view/polo-mpc.

points. In POLO, the agent forms hypotheses on potential reward regions, and executes temporally coordinated action sequences through trajectory optimization. This is in contrast to strategies like -greedy and Boltzmann exploration that explore at the granularity of individual timesteps. The use of trajectory optimization enables the agent to perform directed and efficient exploration, which in turn helps to find better global solutions.

The setting studied in the paper models many problems of interest in robotics and artificial intelligence. Local trajectory optimization becomes readily feasible when a nominal model and computational resources are available to an agent, and can accelerate learning of novel task instances. In this work, we study the case where the internal nominal dynamics model used by the agent is accurate. Nominal dynamics models based on knowledge of physics (Todorov et al., 2012) , or through learning (Ljung, 1987) , complements a growing body of work on successful simulation to reality transfer and system identification (Ross & Bagnell, 2012; Rajeswaran et al., 2016; Lowrey et al., 2018; OpenAI, 2018) . Combining the benefits of local trajectory optimization for fast improvement with generalization enabled by learning is critical for robotic agents that live in our physical world to continually learn and acquire a large repertoire of skills.

2. THE POLO FRAMEWORK:

The POLO framework combines three components: local trajectory optimization, global value function approximation, and an uncertainty and reward aware exploration strategy. We first present the motivation for each component, followed by the full POLO procedure.

2.1. DEFINITIONS, NOTATIONS, AND SETTING:

We model the world as an infinite horizon discounted Markov Decision Process (MDP), which is characterized by the tuple: M = {S, A, R, T , γ}. S ∈ R n and A ∈ R m represent the continuous (real-valued) state and action spaces respectively. R : S × A → R represents the reward function. T : S × A × S → R + represents the dynamics model, which in general could be stochastic, and γ ∈ [0, 1) is the discount factor. A policy π : S × A → R + describes a mapping from states to actions. The value of a policy at a state is the average discounted reward accumulated by following the policy from the state:

V π (s) = E[ ∞ t=0 γ t r(s t , π(s t )) | s 0 = s].

The overall performance of the policy over some start state distribution β is given by: J

β (π) = E s∼β [V π (s)].

For notational simplicity, we use s to denote the next state visited after (from) s.

As described earlier, we consider the setting where an agent is dropped into a complex world. The agent has access to an internal model of the world. However, the world can be complex and diverse, ruling out the possibility of an omniscient agent. To improve its behavior, the agent has to explore and understand relevant parts of the state space while it continues to act in the world. Due to the availability of the internal model, the agent can revisit states it experienced in the world and reason about alternate potential actions and their consequences to learn more efficiently.

2.2. VALUE FUNCTION APPROXIMATION:

The optimal value function describes the long term discounted reward the agent receives under the optimal policy. Defining the Bellman operator at state s as:

EQUATION

the optimal value function V * corresponds to the fixed point: V * (s) = BV * (s) ∀s ∈ S. For small, tabular MDPs, classical dynamic programming algorithms like value iteration can be used to obtain the optimal value function. The optimal policy can be recovered from the value function as: π * (s) = arg max a E[r(s, a) + γV * (s )]. For more complex MDPs, computing the optimal value function exactly is not tractable except in a few well known cases like the LQR ( Åström & Murray, 2004) and LMDPs (Todorov, 2006; Dvijotham & Todorov, 2011) . Thus, various approximate techniques have been considered in prior works. One popular approach is fitted value iteration (Bertsekas & Tsitsiklis, 1996; Munos & Szepesvári, 2008) , where a function approximator (e.g. neural network) is used to approximate the optimal value function. The core structure of fitted value iteration considers a collection of states (or a sampling distribution ν), and a parametric value function approximator Vθ . Inspired by value iteration, fitted value iteration updates parameters as:

θ i+1 = arg min θ E s∼ν Vθ (s) -B Vθi (s) 2 (2)

where B Vθi (s) are targets for the regression problem computed at the specific state s according to Eq. (1). After sufficient iterations of the procedure in Eq. ( 2) to get a good approximation, the policy is recovered as π(s) = arg max a E[r(s, a) + γ Vθ (s )]. The success and convergence of this overall procedure depends critically on at least two components: the capacity and structure of the function approximator (θ); and the sampling distribution (ν).

Lemma 1. (Bertsekas & Tsitsiklis, 1996) Let V be an approximate value function with ∞ error := max s | V (s) -V * (s)|. Let π(s) = arg max a E[r(s, a) + γ V (s )] be the induced greedy policy. For all MDPs and β, the bound in Eq. (3) holds. Furthermore, for any size of the state space, there exist MDPs and V for which the bound is tight (holds with equality).

EQUATION

Intuitively, this suggests that performance of π degrades with a dependence on effective problem horizon determined by γ. This can be understood as the policy paying a price of at every timestep. Due to the use of function approximation, errors may be inevitable. In practice, we are often interested in temporally extended tasks where γ ≈ 1, and hence this possibility is concerning. Furthermore, the arg max operation in π could inadvertently exploit approximation errors to produce a poor policy. The performance of fitted value iteration based methods also rely critically on the sampling distribution to propagate global information (Munos & Szepesvári, 2008) , especially in sparse reward settings. For some applications, it may be possible to specify good sampling distributions using apriori knowledge of where the optimal policy should visit (e.g. based on demonstration data). However, automatically generating such sampling distributions when faced with a new task may be difficult, and is analogous to the problem of exploration.

2.3. TRAJECTORY OPTIMIZATION AND MODEL PREDICTIVE CONTROL:

Trajectory optimization and model predictive control (MPC) have a long history in robotics and control systems (Garcia et al., 1989; Tassa et al., 2014) 1 . In MPC, starting from state s t and using the knowledge of the dynamics model, a locally optimal sequence of actions (or policies) up to a moving horizon of H is computed by solving the following optimization problem.

EQUATION

Here, we use x, u, π as dummy variables for states, actions, and policy to distinguish the "imagined" evolution of the MDP used for the trajectory optimization with the actual states (s) observed in the true evolution of the MDP. Here, r(x, u) represents the running reward which is the same as the MDP reward function, and r f (x t+H ) represents a terminal reward function. Let {π * k } be the local time-indexed policies obtained as the solution to the optimization problem in (4). After solving the optimization problem, the first local time-indexed policy is used as πMP

C (•|s t ) := π * t (•|x t ).

The entire procedure is repeated again in the next time step (t + 1). Note that we have defined the optimization problem over a sequence of feedback policies. However, if the dynamics is deterministic, a sequence of actions {u k } t+H k=t can be optimized and used instead without any loss in performance. See Appendix C for further discussions. This approach has led to tremendous success in a variety of control systems such as power grids, chemical process control (Qina & Badgwellb, 2003) , and more recently in robotics (Williams et al., 2016) . Since MPC looks forward only H steps, it is ultimately a local method unless coupled with a value function that propagates global information. In addition, we also provide intuitions for why MPC may help accelerate the learning of value functions. This synergistic effect between MPC and global value function forms a primary motivation for POLO.

Impact of approximation errors in the value function:

Lemma 2. Let V be an approximate value function with ∞ error := max s | V (s) -V * (s)|. Suppose the terminal reward in Eq. ( 4) is chosen as r f (s H ) = V (s H ), and let the MPC policy be πMP C (•|s t ) := π * t (•|x t ) (from Eq. 4). Then, for all MDPs and β, the performance of the MPC policy can be bounded as:

EQUATION

)

Proof. The proof is provided in Appendix C.

This suggests that MPC (with H > 1) is less susceptible to approximation errors than greedy action selection. Also, without a terminal value function, we have = O(r max /(1 -γ)) in the worst case, which adds an undesirable scaling with the problem horizon.

Accelerating convergence of the value function Furthermore, MPC can also enable faster convergence of the value function approximation. To motivate this, consider the H-step Bellman operator:

B H V (s) := max a 0:H-1 E[ H-1 t=0 γ t r t + γ H V (s H )]. In the tabular setting, for any V 1 and V 2 , it is easy to verify that |B H V 1 -B H V 2 | ∞ ≤ γ H |V 1 -V 2 | ∞ .

Intuitively, B H allows for propagation of global information for H steps, thereby accelerating the convergence due to faster mixing. Note that one way to realize B H is to simply apply B H times, with each step providing a contraction by γ. In the general setting, it is unknown if there exists alternate, cheaper ways to realize B H . However, for problems in continuous control, MPC based on local dynamic programming methods (Jacobson & Mayne, 1970; Todorov & Li, 2005) provide an efficient way to approximately realize B H , which can be used to accelerate and stabilize value function learning.

2.4. PLANNING TO EXPLORE:

The ability of an agent to explore the relevant parts of the state space is critical for the convergence of many RL algorithms. Typical exploration strategies like -greedy and Boltzmann take exploratory actions with some probability on a per time-step basis. Instead, by using MPC, the agent can explore in the space of trajectories. The agent can consider a hypothesis of potential reward regions in the state space, and then execute the optimal trajectory conditioned on this belief, resulting in a Algorithm 1 Plan Online and Learn Offline (POLO) 1: Inputs: planning horizon H, value function parameters θ 1 , θ 2 , . . . θ K , mini-batch size n, number of gradient steps G, update frequency Z 2: for t = 1 to ∞ do 3:

Select action a t according to MPC (Eq. 4) with terminal reward r f (s) ≡ V (s) from Eq. ( 7) 4:

Add the state experience s t to replay buffer D for G times do 7:

Sample n states from the replay buffer, and compute targets using Eq. ( 8) 8:

Update the value functions using Eq. ( 6) (see Section 2.5 for details) 9:

end for 10: end if 11: end for temporally coordinated sequence of actions. By executing such coordinated actions, the agent can cover the state space more rapidly and intentionally, and avoid back and forth wandering that can slow down the learning. We demonstrate this effect empirically in Section 3.1.

To generate the hypothesis of potentially rewarding regions, we take a Bayesian view and approximately track a posterior over value functions. Consider a motivating setting of regression, where we have a parametric function approximator f θ with prior P(θ). The dataset consists of input-output pairs: D = (x i , y i ) n i=1 , and we wish to approximate P(θ|D). In the Bayesian linear regression setting with Gaussian prior and noise models, the solution to the following problem generates samples from the posterior (Osband et al., 2016; Azizzadenesheli et al., 2018a; Osband et al., 2018) :

arg min θ ||ỹ i -f θ (x i ) -f θ (x i )|| 2 2 + σ 2 λ ||θ|| 2 2 (6)

where ỹi ∼ N (y i , σ 2 ) is a noisy version of the target and θ ∼ P(θ) is a sample from the prior. Based on this, Osband et al. (2018) demonstrate the benefits of uncertainty estimation for exploration. Similarly, we use this procedure to obtain samples from the posterior for value function approximation, and utilize them for temporally coordinated action selection using MPC. We consider K value function approximators Vθ with parameters θ 1 , θ 2 , . . . θ K independently trained based on Eq. ( 6). We consider the softmax of the different samples as the value at a state:

EQUATION

Since the above scheme approximates mean + variance for small κ > 0, this procedure encourages the agent to additionally explore parts of the state space where the disagreement between the function approximators is large. This corresponds to the broad notion of optimism in the face of uncertainty (Auer et al., 2002) which has been successful in a number of applications (Silver et al., 2016; Li et al., 2010) .

2.5. FINAL ALGORITHM:

To summarize, POLO utilizes a global value function approximation scheme, a local trajectory optimization subroutine, and an optimistic exploration scheme. POLO operates as follows: when acting in the world, the agent uses the internal model and always picks the optimal action suggested by MPC. Exploration is implicitly handled by tracking the value function uncertainties and the optimistic evaluation, as specified in Eq. ( 6) and ( 7). All the experience (visited states) from the world are stored into a replay buffer D, with old experiences discarded if the buffer becomes full.

After every Z steps of acting in the world and collecting experience, the value functions are updated by: (a) constructing the targets according to Eq. ( 8); (b) performing regression using the randomized prior scheme using Eq. ( 6) where f θ corresponds to the value function approximator. For state s in the buffer and value network k with parameters θ k , the targets are constructed as:

EQUATION

which corresponds to solving a N -step trajectory optimization problem starting from state s. As described earlier, using trajectory optimization to generate the targets for fitting the value approximation accelerates the convergence and makes the learning more stable, as verified experimentally in Section 3.3. The overall procedure is summarized in Algorithm 1.

3. EMPIRICAL RESULTS AND DISCUSSION:

Through empirical evaluation, we wish to answer the following questions:

1. Does trajectory optimization in conjunction with uncertainty estimation in value function approximation result in temporally coordinated exploration strategies?

2. Can the use of an approximate value function help reduce the planning horizon for MPC?

3. Does trajectory optimization enable faster and more stable value function learning?

Before answering the questions in detail, we first point out that POLO can scale up to complex high-dimensional agents like 3D humanoid and dexterous anthropomorphic hand (OpenAI, 2018; Rajeswaran et al., 2018) which are among the most complex control tasks studied in robot learning. Video demonstration can be found at: https://sites.google.com/view/polo-mpc

3.1. TRAJECTORY OPTIMIZATION FOR EXPLORATION:

Exploration is critical in tasks where immediate rewards are not well aligned with long-term objectives. As a representative problem, we consider a point mass agent in different 2D worlds illustrated in figure 2 : a simple finite size box with no obstacles and a maze. This domain serves to provide an intuitive understanding of the interaction between trajectory optimization and exploration while also enabling visualization of results. In the extreme case of no rewards in the world, an agent with only local information would need to continuously explore. We wish to understand how POLO, with its ensemble of value functions tracking uncertainties, uses MPC to perform temporally coordinated actions. Our baseline is an agent that employs random exploration on a per-time-step basis; MPC without a value function would not move due to lack of local extrinsic rewards. Second, we consider an agent that performs uncertainty estimation similar to POLO but selects actions greedily (i.e. POLO with a planning horizon of 1). Finally, we consider the POLO agent which tracks value uncertainties and selects actions using a 32-step MPC procedure. We observe that POLO achieves more region coverage in both point mass worlds compared to alternatives, as quantitatively illustrated in figure 2 (a). The ensemble value function in POLO allows the agent to recognize the true, low value of visited states, while preserving an optimistic value elsewhere. Temporally coordinated action is necessary in the maze world; POLO is able to navigate down all corridors. 

3.2. VALUE FUNCTION APPROXIMATION FOR TRAJECTORY OPTIMIZATION:

Next, we study if value learning helps to reduce the planning horizon for MPC. To this end, we consider two high dimensional tasks: humanoid getup where a 3D humanoid needs to learn to stand up from the ground, and in-hand manipulation where a five-fingered hand needs to re-orient a cube to a desired configuration that is randomized every 75 timesteps. For simplicity, we use the MPPI algorithm (Williams et al., 2016) for trajectory optimization. In Figure 3 , we consider MPC and the full POLO algorithm of the same horizon, and compare their performance after T steps of learning in the world. We find that POLO uniformly dominates MPC, indicating that the agent is consolidating experience from the world into the value function. With even the longest planning horizon, the humanoid getup task has a local solution where it can quickly sit up, but cannot discover a chain of actions required to stand upright. POLO's exploration allows the agent to escape the local solution, and consolidate the experiences to consistently stand up. To further test if the learned value function is task aligned, we take the value function trained with POLO, and use it with MPC without any intermediate rewards. Thus, the MPC is optimizing a trajectory of length H = 64 purely using the value function of the state after 64 steps. We observe, in Figure 3 , that even in this case, the humanoid is able to consistently increase its height from the floor indicating that the value function has captured task relevant details. We note that a greedy optimization procedure with this value function does not yield good results, indicating that the learned value function is only approximate and not good everywhere.

While the humanoid getup task presents temporal complexity requiring a large planning horizon, the in-hand manipulation task presents spatial complexity. A large number of time steps are not needed to manipulate the object, and a strong signal about progress is readily received. However, since the targets can change rapidly, the variance in gradient estimates can be very high for function approximation methods (Ghosh et al., 2018) . Trajectory optimization is particularly well suited for such types of problems, since it can efficiently compute near-optimal actions conditioned on the instance, facilitating function approximation. Note that the trajectory optimizer is unaware that the targets can change, and attempts to optimize a trajectory for a fixed instance of the task. The value function consolidates experience over multiple target changes, and learns to give high values to states that are not just immediately good but provide a large space of affordances for the possible upcoming tasks.

3.3. TRAJECTORY OPTIMIZATION FOR VALUE FUNCTION LEARNING:

Finally, we study if trajectory optimization can aid in accelerating and stabilizing value function learning. To do so, we again consider the humanoid getup task and study different variants of POLO.

In particular, we vary the horizon (N ) used for computing the value function targets in Eq. ( 8). We observe that as we increase N , the agent learns the value function with fewer interactions with the world, as indicated in Figure 4 (a). The benefit of using N -step returns for stable value function learning and actor-critic methods have been observed in numerous works (Mnih et al., 2016; Munos et al., 2016; Schulman et al., 2016) , and our experiments reinforce these observations. The use of N -step returns help to traverse the bias-variance trade-off. Furthermore, due to the discounting, the contribution of V (s N ) is made weaker and thus the targets are more stable. This mirrors ideas such as target networks (Mnih et al., 2015) commonly used to stabilize training. As discussed earlier, longer horizons make trajectory optimization more tolerant to errors in the value function.

To illustrate this, we take the value function trained with POLO on a nominal humanoid model, and perturb the model by changing the size of the head to model value function degradation. Figure 4(b) shows that a longer planning horizon can mitigate this degradation. This presents intriguing future possibility of using MPC to improve transfer learning between tasks or robot platforms.

4. RELATED WORK:

Planning and learning: Combining elements of planning and search with approximate value functions has been explored in discrete game domains (Silver et al., 2017; Anthony et al., 2017) where an MCTS planner is informed by the value function. Alternatively, using prior data to guide the search process in continuous MCTS without explicitly learning a value function has also been explored (Rajamäki & Hämäläinen, 2017) . Related to this, Atkeson (1993) uses an offline trajectory library for action selection in real-time, but do not explicitly consider learning parametric value functions. RTDP (Barto et al., 1995) considers learning value functions based on states visited by the agent, but does not explicitly employ the use of planning. Zhong et al. (2013) consider the setting of learning a value function to help MPC, and found the contribution of value functions to be weak for the relatively simple tasks considered in their work. Approaches such as cost shaping (Ng et al., 1999) can also be interpreted as hand specifying an approximate value function, and has been successfully employed with MPC (Tassa et al., 2012) . However, this often require careful human design and task specific expertise. An alternative set of approaches (Ross et al., 2011; Levine & Koltun, 2013; Mordatch & Todorov, 2014; Sun et al., 2018b) use local trajectory optimization to generate a dataset for training a global policy through imitation learning. These approaches do not use MPC at runtime, and hence may often require retraining for changes in tasks or environment. Furthermore, results from this line of work have been demonstrated primarily in settings where trajectory optimization alone can solve the task, or use human demonstration data. In contrast, through our exploration schemes, we are able to improve over the capabilities of MPC and solve tasks where MPC is unsuccessful.

Planning and exploration: Exploration is a well-studied and important problem in RL. The importance of having a wide and relevant state distribution has been pointed out in numerous prior works (Munos & Szepesvári, 2008; Bagnell et al., 2003; Rajeswaran et al., 2017) . Strategies such as -greedy or Gaussian exploration have recently been used to successfully solve a large number of dense reward problems. As the reward becomes sparse or heavily delayed, such strategies be-come intractable in high-dimensional settings. Critically, these approaches perform exploration on a per time-step basis, which can lead to back and forth wandering preventing efficient exploration. Parameter-space exploration (Plappert et al., 2017; Fortunato et al., 2017) methods do not explore at each time step, but rather generate correlated behaviors based on explored parameters at the start. However, such approaches do not consider exploration as an intentional act, but is rather a deviation from a well defined objective for the agent. Deep exploration strategies (Osband et al., 2013) sample a value function from the posterior and use it for greedy action selection. Approaches based on notions of intrinsic motivation and information gain (Chentanez et al., 2005; Stadie et al., 2015; Houthooft et al., 2016; Pathak et al., 2017; Bellemare et al., 2016 ) also explicitly introduce exploration bonuses into the agent's reward system. However, such approaches critically do not have the element of planning to explore; thus the agent may not actually reach regions of high predicted reward because it does not know how to get there. Our work is perhaps closest to the E3 framework of Kearns & Singh (2002) , which considers altered MDPs with different reward functions, and executes the optimal action under that MDP. However solving these altered MDPs is expensive and their solution is quickly discarded. MPC on the other hand can quickly solve for local instance-specific solutions in these MDPs.

Model-free RL: Our work investigates how much training times can be reduced over model-free methods when the internal model is an accurate representation of the world model. As a representative number, Schulman et al. (2015) report approximately 5 days of agent experience and 128 CPU core hours for solving tasks such as getting up from the ground. In contrast, POLO requires only 12 CPU core hours and 96 seconds of agent experience. Recently, policy gradient methods were also used for in-hand manipulation tasks (OpenAI, 2018) , where 3 years of simulated experience and 500 CPU hours were used for object reorientation tasks. For a similar task, POLO only required 1 CPU hour. Of course, model-free methods do not require an accurate internal model, but our results suggest that much less experience may be required for the control aspect of the problem. Our work can be viewed as a strong model-based baseline that model-free RL can strive to compete with, as well as a directly useful method for researchers studying simulation to reality transfer.

In an alternate line of work, internal models have been used for variance reduction purposes in model-free RL (Feinberg et al., 2018; Buckman et al., 2018) , in contrast to our use of MPC. Related to this, Azizzadenesheli et al. (2018b) consider learning an internal model for discrete action domains like ALE and use short horizon MCTS for planning. Similarly, Nagabandi et al. ( 2018) learn a dynamics model in simple continuous control tasks and use a random shooting MPC method for action selection. These lines of work consider the interplay between learning dynamics models and planning procedures, and try to improve the quality of internal models. As a consequence, they focus on domains where simple action selection procedures with accurate models obtain near-optimal performance. In our work, we show that we can learn value functions to help real-time action selection with MPC on some of the most high-dimensional continuous control tasks studied recently. Thus, the two lines of work are complementary, and combining POLO with model learning would make for an interesting line of future work.

control the box to the target.

R(s) =    -(1.25 -Root z ), if Root z ≤ 1.25 2.0 -||Box xy -Root xy || 2 , else if |Box xy -Root xy | 2 > 0.8 4.0 -2 * ||Box xy -T arget xy || 2 , otherwise

In this setup, the observation vector increases with the global position of the box, and the dimensionality of the system increase by 6. The box initially starts 1.5 meters in front of the humanoid, and needs to be navigated to a position 2.5 meters in front of the humanoid.

B APPENDIX: EXPERIMENTAL DETAILS, HAND MANIPULATION:

We use the Adroit hand model (Kumar, 2016) and build on top of the hand manipulation task suite of Rajeswaran et al. (2018) . The hand is position controlled and the dice is modeled as a free object with 3 translational degrees of freedom and a ball joint for three rotational degrees of freedom. The base of the hand is not actuated, and the agent controls only the fingers and wrist. The dice is presented to the hand initially in some randomized configuration, and the agent has to reorient the dice to the desired configuration. The desired configuration is randomized every 75 timesteps and the trajectory optimizer does not see this randomization. Thus the randomization can be interpreted as unmodelled external disturbances to the system. We use a simple reward function for the task: R(s) = -0.5 1 (x o , x g ) -0.05 quat (q o , q g ), where x o and x g are the Cartesian positions of the object (dice) and goal respectively. The goal location for the dice is a fixed position in space and is based on the initial location of the palm of the hand. 1 is the L1 norm. q o and q g are the orientation configurations of object and goal, respectively, and expressed as quaternions with quat being the quaternion difference.

We use 80 trajectories in MPPI with temperature of 10. We use an ensemble of 6 networks with 2 layers and 64 units each. The value function is updated every 25 steps of interaction with the world, and we take 16 gradient steps each with a batch size of 16. These numbers were arrived at after a coarse hyperparameter search, and we expect that better hyperparameter settings could exist.

C PROOF OF LEMMA 2 AND REMARKS:

Let τ and τ * represent the trajectories of length H that would be generated by applying πMP C and π * respectively on the MDP. Starting from some state s, we have:

V * (s) -V πMP C (s) = E τ * H-1 t=0 γ t r t + γ H V * (s H ) -E τ H-1 t=0 γ t r t + γ H V πMP C (s H ) (9)

Adding and subtracting, E τ [ t γ t r t + γ H V * (s H )], we have:

EQUATION

)

Since max s | V (s) -V * (s)| = , we have:

E τ * H-1 t=0 γ t r t + γ H V * (s H ) ≤ E τ * H-1 t=0 γ t r t + γ H V (s H ) + γ H (11) E τ H-1 t=0 γ t r t + γ H V * (s H ) ≥ E τ H-1 t=0 γ t r t + γ H V (s H ) -γ H (12)

Furthermore, since τ was generated by applying πMP C which optimizes the actions using V as the terminal value/reward function, we have:

EQUATION

using these bounds, we have:

V * (s) -V πMP C (s) ≤ γ H E τ V * (s H ) -V πMP C (s H ) + 2γ H ≤ 2γ H 1 + γ H + γ 2 H + . . . ≤ 2γ H 1 -γ H (14)

by recursively applying the first bound to V * (s H ) -V πMP C (s H ). This holds for all states, and hence for any distribution over states.

Notes and Remarks: For Eq. ( 13) to hold in general, and hence for the overall bound to hold, we require that the actions are optimized in closed loop. In other words, MPC has to optimize over the space of feedback policies as opposed to open loop actions. Many commonly used MPC algorithms like DDP and iLQG Jacobson & Mayne (1970) ; Todorov & Li (2005) have this property through the certainty equivalence principle for the case of Gaussian noise. For deterministic dynamics, which is the case for most common simulators like MuJoCo, Eq. ( 13) holds without the closed loop requirement. We summarize the different cases and potential ways to perform MPC below:

• In the case of deterministic dynamics, the optimal open loop trajectory and optimal local feedback policies have the same performance up to finite horizon H. Thus, any trajectory optimization algorithm, such as iLQG and MPPI can be used. • In the case of stochastic dynamics with additive Gaussian noise, local dynamic programming methods like iLQG and DDP Todorov & Li (2005) ; Jacobson & Mayne (1970) provide efficient ways to optimize trajectories. These approaches also provide local feedback policies around the trajectories which are optimal due to the certainty equivalence principle. • In the case of general stochastic systems, various stochastic optimal control algorithms like path integral control Theodorou et al. (2010) can be used for the optimization. These situations are extremely rare in robotic control.

Finally, we also note that Sun et al. Sun et al. (2018a) propose and arrive at a similar bound in the context of imitation learning and reward shaping. They however assume that a policy can simultaneously optimize the approximate value function over H steps, which may not be possible for a parametric policy class. Since we consider MPC which is a non-parametric method (in the global sense), MPC can indeed simultaneously optimize for H steps using V .

:

In this work, we use the terms trajectory optimization and MPC interchangeably

CONCLUSIONS AND FUTURE WORKIn this work we presented POLO, which combines the strengths of trajectory optimization and value function learning. In addition, we studied the benefits of planning for exploration in settings where we track uncertainties in the value function. Together, these components enabled control of complex agents like 3D humanoid and five-fingered hand. In this work, we assumed access to an accurate internal dynamics model. A natural next step is to study the influence of approximation errors in the internal model and improving it over time using the real world interaction data.

Figures and Tables:

Figure 2: 2D point mass navigation task in a world with no rewards. Fig. (a) describes the percentage of an occupancy grid covered by the agent, averaged over 10 random seeds. Fig. (b) depicts an agent over 1000 timesteps; red indicates regions of high value (uncertainty) while blue denotes low. The value function learns to assign the true, low values to regions visited and preserves high values to unexplored regions; uncertainty and long horizons are observed to be critical for exploration.

Figure 3: Performance as a function of planning horizon for the humanoid getup (left), and inhand manipulation task (middle). POLO was trained for 12000 and 2500 environment timesteps, respectively. We test POLO with the learned terminal value function against pure MPC and compare average reward obtained over 3 trials in the getup task and 1000 steps in the manipulation task. On the right, a value function trained with POLO is used by MPC without per-time-step rewards. The agent's height increases, indicating a task-relevant value function. For comparison, we also include the trace of POLO with dense rewards and multiple trials (dashed vertical lines)

Figure 4: Usefulness of trajectory optimization for value function learning. (a) illustrates that N -step trajectory optimization accelerates the learning of the value function. N =1 corresponds to trajectory centric fitted value iteration. A difference of 0.2 reward to MPC amounts to approximately 50% performance improvement. (b) value function trained for the nominal model (head size of 1.0) used with MPC for models with larger sizes.

Peer review (iclr2019):
 This paper was a joy to read. The description and motivation of the POLO framework was clear, smart, and sensible. The fundamental idea is to explore the interplay between value-function estimation and model-predictive control and demonstrate how they benefit one another. None of these ideas is fundamentally new, but the descriptions and their combination is very nice. As I finished the paper, though, I was left with a lingering lack of understanding of the exact problem setting that is being addressed. The name is cute but didn*t help clarify. As I understand it: - we have a correct dynamics model (I*m assuming that*s what "nominal dynamics model" means) and a good trajectory optimization algorithm - the agent has limited online cognitive capacity - there is no opportunity for offline computation If offline computation time were available, then we could run this algorithm (or your favorite other RL algorithm) in the agent*s head before taking any actions in the actual world. That does not seem to be the setting here, although it does seem to me that you might be able to show that POLO is a good algorithm for finding a value function, offline, with no actual interaction with the world. So, fundamentally, this paper is about action under computational time constraints. One strategy would be for the robot to use 7 of its cores to run your favorite approximate DP / RL algorithm in parallel with 1 core that*s used for action selection. Why is that worse than your algorithm 1? Setting this question aside, I had some other comments: - It is better *not* to use "trajectory optimization" and "model-predictive control" interchangeably. I can use traj opt in other circumstances (e.g. with open loop trajectory following) and could use other planners for MPC. - Some version of lemma 2 probably (almost certainly) already exists somewhere in the literature; I*m sorry, though, that I can*t point you to a concrete reference. - The argument about MPC letting us approximate H Bellman backups is plausible, but seems somewhat subtle; it would be good to elaborate it in some more detail. - The set of assertions and experiments is very nice. - Why are no variances shown in figure 3? Why does performance seem to degrade after a certain horizon. This paper doesn*t seem really to be about learning representations. I don*t know if that*s important to the ICLR decision-making.