Decoupling Dynamics and Reward

Decoupling Dynamics and Reward


Current reinforcement learning (RL) methods can successfully learn single tasks, but often generalize poorly to modest perturbations in task domain or training procedure. In this work we present a decoupled learning strategy for RL that creates a shared representation space where knowledge can be robustly transferred. We separate learning the task representation, the forward dynamics, the inverse dynamics and the reward function of the domain, and show that this decoupling improves performance within task, transfers well to changes in dynamics and reward, and can be effectively used for online planning. Empirical results show good performance in both continuous and discrete RL domains.


1 Introduction

Reinforcement Learning (RL) provides a sound decision-theoretic framework to optimize the behavior of learning agents in an interactive setting. However, application of RL to real-world tasks is limited by several factors. One challenge is the massive amounts of data required to learn an optimal behavior; this can be alleviated by using a high-fidelity simulator or game engine Brockman et al. (2016); Tian et al. (2017), but there are many real-world domains where this is not available Kober et al. (2013); S. M. Shortreed (2011). Furthermore, RL policies trained within a simulator tend to overfit to the task, and generalize poorly even to modest perturbations in environment or task domain Henderson et al. (2018).

The goal of our work is to design an RL model that can be efficiently trained on new tasks, and produce solutions that generalize well beyond the training environment. To do this, we adopt the framework of model-based RL Sutton (1990). We take particular inspiration from the work on Successor Features Dayan (1993), which decouples the value function representation into dynamics and rewards, and learns them separately. In our work, we take this further and explicitly decouple learning the state representation, the reward function, the forward dynamics, and the inverse dynamics of the environment. We posit that we can learn a representation space via this decoupling that makes downstream learning easier. There are several reasons to pursue a decoupled approach: (1) the modules can be learned separately enabling efficient reuse of common knowledge across tasks to quickly adapt to new tasks; (2) the modules can be optimized jointly leading to a representation space that is adapted to the policy and value function, rather than the only the observation space; (3) the dynamics model enables forward search and planning, in the usual model-based RL way. Our approach explicitly incorporates learning of inverse dynamics, and we show that this plays an important role in stabilizing learning. Empirical results confirm that learning in new domains can leverage this decomposition to achieve faster learning in a variety of domains, including continuous control MuJoCo tasks and discrete maze planning tasks.

2 Technical Background

Consider an RL agent deployed in a dynamic stationary environment. The environment is modeled as a Markov Decision Process (MDP), which is defined by a set of states , a set of actions , dynamics , and rewards . The behavior of the RL agent is defined by a policy , specifying an action to apply in each state. The goal is to learn an optimal policy, denoted , that maximizes the expected cumulative reward over trajectories. The value function and state-action value function are defined as usual in the RL literature Sutton & Barto (1998).

Because our work is concerned with the robustness and generalizability of reinforcement learning agents, we also consider a distribution over a family of tasks . We define to be the space of tasks that share and , but dynamics , and rewards can vary. We sample from at training time. When the agent is in a particular task , it collects a set of trajectories, , where .

We consider specifically the case of model-based RL, where the dynamics and reward are estimated directly, and the optimal policy is found by applying dynamic programming on those quantities Sutton (1990); Kaelbling et al. (1996). In the tabular (discrete state/action) case, the transition dynamics are estimated from state visitation counts and the reward function is estimated from expectation over training trajectories. In more complex domains, the transition and reward functions can be estimated from richer regression models (see Sec. 7).

3 Decoupling model-based RL

Our objective is to provide a modular framework for model-based RL, leveraging a decomposition of the learning problem to provide reusable components that can be bootstrapped to enable fast re-training following changes in dynamics and rewards. The learning is decomposed into two complementary objectives, one for learning the state dynamics model and the other for learning the reward function. Figures 12 give an overview of the proposed architecture. We define a learned representation space that we map to and from with an encoder and decoder. It is through that our modules interface.

Figure 1: Dynamics Module
Figure 2: Rewards Module. denotes the stop gradient operator, which doesn’t allow the gradients to propagate back.

3.1 A Modular Dynamics Model

The goal of this first module is to learn the dynamics of the environment . The main components of the dynamics module are an encoder and the forward model . We add an additional two components: a decoder and inverse model . These act as regularizers by enabling additional complementary training signals to be considered during learning. Since we are running our forward model in space, the decoder is necessary to evaluate our forward model. We also posit the inverse model is necessary as a constraint that causality is maintained in the representation space. Ablation experiments supporting these claims are in Section 6.3.

The encoder and decoder pair allows us to learn a mapping between state space and representation space :


The forward model predicts transition probability . The inverse model observes the current and next state , and aims to predict which action was taken to go from one to the other. This can be an ill-posed problem, since more than one action can explain an observed transition. Nonetheless we treat it as a supervised learning problem, since it is one component of a more complex optimization, and other terms restrict the solution space.

Traditionally, forward and inverse models map between state and action spaces , . In our model, we learn the forward and inverse models in the learned representation space . Therefore, our models are of the form:

By abstracting away the model of dynamics to a representation space , we have the freedom to encode more or less information than what exists in the given space . We show that this abstraction allows for easier learning and improved results across a variety of environments.

The forward model is learned using a recurrent architecture because we want the latent representation to incorporate temporal dependencies. In doing so, we are relaxing the Markov Assumption on the model in the state space. This is useful because the latent state does not encode the exact observed state, thus the recurrent model can keep track of necessary past information to prevent aliasing. This has also been empirically shown to produce better results with A3C + LSTM Mnih et al. (2016). The recurrent next-state prediction takes the form:

We instantiate with an LSTM Hochreiter & Schmidhuber (1997). Here denotes the hidden state of the recurrent model. Since we want the next latent state to generate the next observed state, we can use the reconstruction loss for the next state.

The total decoder loss, , includes the reconstruction loss between and (denoted ) as well as the next state prediction loss between (predicted next state output of the forward model) and (denoted ). This second term folds in the effect of the forward model.

The forward model loss is similarly defined as:

The inverse model formulation and loss are defined as:

(discrete case)
(continuous case)

We use a cross-entropy loss for domains with discrete action spaces, and mean square error in continuous action cases.

Let , then the final loss for the trajectory can be written as :


where , , are (constant) hyper-parameters.

Note that this module learns a dynamics model purely with respect to trajectories; it ignores tasks and rewards.

3.2 A Modular Reward Model

Assuming the dynamics model outline above learns a latent representation that captures the dynamics, the goal of the Reward Module is to learn the value function and policy over this representation space (rather than in the raw state space). The reward module is the primary decision-making module – it selects the next action and predicts the expected value. We use an Actor-Critic method Sutton et al. (2000) to learn the policy and value function simultaneously:

using TD learning with multi-step bootstraps Sutton (1988). Let be the estimated expected return, then the losses for the actor and critic are:


This can also be extended to multi-step actions as in A3C Mnih et al. (2016).

We can also have a recurrent formulation of actor-critic as:

Where is the combination of . Note that we do not necessarily need an LSTM for this module, but we believe that including history often stabilizes training and incorporates extra information to the policy that is useful, even if technically unnecessary, as empirically shown in Mnih et al. (2016).

The reward module is equivalent to classic actor-critic, except it learns the value function and policy in the representation space rather than in the state space . We introduce another hyper-parameter to calibrate the effect of the critic loss relative to the actor loss. Now our total loss for the reward module is


4 Inference in the Decoupled Model

Our model accommodates both offline and online model learning, as well as both off-policy and on-policy1. We also discuss how the dynamics model can be used for online planning.

4.1 Dynamics Learning

Offline, Off-policy. The dynamics module can be trained in a supervised manner and off-policy, since its goal is only to explore and learn the dynamics of the environment in a passive manner. For the offline off-policy training case, we generate samples with an exploratory policy (usually uniform random action selection) and train the dynamics module using the sampled trajectories. This is the most common mode of training the dynamics model, especially when task robustness and transfer are desired. All modules in the dynamics model (encoder, decoder, forward, inverse) are jointly trained with the same set of batch samples, as per Algorithm 1. The main advantage of this approach is that we can bootstrap data collected from previous tasks, and having a batch of data from an exploratory policy generally leads to more stable learning, compared to on-policy training. Assuming that the policy used to collect the data is sufficiently exploratory, we are able to learn a representation space that captures useful information for a family of tasks. Clearly there is a trade-off here: more exploration provides more robust information, but is less efficient than a narrowly targeted policy.

Offline, On-policy. Rather than using an exploratory policy, the dynamics model can be trained using the target policy. This setup is less common, since having a good dynamics model is usually a precursor to a good policy in model-based RL.

Online, On-policy. The dynamics module can also be trained with samples drawn from the rewards module. In this case the training happens online, through repeated interactions with the environment, and on-policy, through updates to the policy estimated in the reward module. This case is further detailed below in Sec. 4.2 since both modules are trained simultaneously.

Online, Off-policy. Finally, we can train the dynamics model online, but using a policy different than the one learned by the reward module. For example, we can inject exploratory noise into the policy of the actor. In this case we can improve training stability, at some extra cost in data acquisition.

  Initialize module parameters
  Initialize hidden state for LSTM-D
  Set dynamics hyper-parameters
  for  do
     for  do
        Encode to (Eq. 1)
        Decode to (Eq. 2)
        Compute (Eq. 3)
     end for
  end for
Algorithm 1 Dynamics Training Algorithm

Alg.1 notes: is the hidden state of the LSTM in the dynamics module (LSTM-D). is the number of epochs, is the number of training samples. We show the rollout 1 and batch size 1 case, but can be extended to longer rollouts where we see trajectories of length and compute and update in batches of size for speed.

  Initialize module parameters
  Initialize hidden state for LSTM-R
  Set reward hyper-parameter
     Clear gradients
     if episode done then
        Clear hidden states
        Reset environment
     end if
     Get state
        Sample from , get
     until terminal or 
     for  do
     end for
     Sum losses and perform asynchronous update on
Algorithm 2 Reward Training Algorithm

Alg.2 notes: is the total number of episodes across all threads. is the discount factor for reward. is the maximum number of steps per episode.

4.2 Rewards Learning

Online, On-policy. The rewards module is typically trained online and on-policy, using an actor-critic approach analogous to A3C Mnih et al. (2016), with the distinction that the actor and critic operate on the representation space built by the dynamics module. Algorithm 2 outlines the procedure. In this scenario the trajectories collected by the RL agent are fed to both the dynamics and reward modules through a shared encoder, and both modules are updated simultaneously. In this case there is a tight dependency between the two modules: the reward module depends on the dynamics module for the representation space, whereas the the dynamics module depends on the reward module for the policy. This type of training can lead to instability, due to the non-stationary data distribution (induced by changes in the policy and changes in the encoder model that is also training). The main advantage is that as the policy improves, sample efficiency may be better and the representation space learned by the encoder can be more compact and focused on the target task.

Mixed Online/Offline. We consider another case, where the representation space (encoder) is static while we train the reward module. In this case we first train the full dynamics module with sample trajectories collected offline (either off- or on-policy, as explained in Sec. 4.1) then freeze the encoder weights before training the reward module online from this fixed encoder.

4.3 Online Planning

A major advantage of learning the dynamics and rewards module is that at any time we can use them to perform planning in the representation space. We feed the observation from our environment through our encoder to get the hidden representation . We take an action , and feed the action together with through the forward model LSTM-D to get . We can repeat this forward sampling in the representation space to rollout full trajectories.

There are a few standard methods to choose the action during this procedure. (1) We can follow a fixed given policy . (2) We can exhaustively branch on the full action space, repeat to generate a tree of trajectories which terminate either at an end state or at a fixed depth. (3) We can use Monte Carlo Tree Search, which balances both exploration with efficiency to direct the tree expansion Coulom (2006). In the last two cases, after expanding the tree with forward rollouts, we select the path with the maximum mean estimated value function over the trajectory to determine the next action.

5 Modular Transfer Scenarios

In this section, we will discuss how our architecture handles transfer to different environments and reward functions.

5.1 Simple Generalization

The most basic case is to train both the dynamics and reward modules from scratch and test them in the same task or environment. In this case, we can still leverage an encoder-decoder pair learned in the same or a related task, using this as a prior on the representation space to ease sample complexity when learning the target models and policy.

5.2 Changes in Reward

In this scenario the reward function changes but the state dynamics remain the same as in training. The agent now needs to learn the value function and corresponding policy according to the new reward function. Since there is no change in the state dynamics, we don’t need to train the dynamics module again. We retrain the reward module in the same representation space. This is equivalent to the simple generalization case when using offline learning since the modules are decoupled. The dynamics module is already trained off-policy, so can transfer across different reward functions if dynamics stay the same.

5.3 Changes in Dynamics

Now, we consider the case where the reward function and corresponding value function remain the same but the underlying dynamics change. The state and action spaces are the same, but the mapping between them has changed. Where we previously had an environment with dynamics described by , we now have a new environment described by , where , and are the same for both environments. We explore specific types of dynamics transfer in Section 6.1. We need to retrain the forward model again but keep the encoder and decoder static, with the assumption that the representation learned for the prior task contains all the information necessary to transfer to the new dynamics.

6 Experiments

The goal of our experiments is to show that our proposed method, called DDR (Decoupled Dynamics and Reward) provides better transferability, increases ease and stability of training, and improves performance through the decoupling of dynamics and reward. We compare with the basic A3C method Mnih et al. (2016) trained from scratch for each environment as well as fine-tuned across multiple dynamics and reward functions; A3C is the most suitable baseline here due to the efficiency it achieves through parallelization, and because it can be readily applied to both continuous and discrete domains. The main trunk of our architecture is the same for our method and the baseline for fair comparison.

We evaluate transfer ability of our module in several different scenarios: transfer a pre-trained encoder and learn the dynamics and reward, fixed reward but change in dynamics, fixed dynamics but change in reward, and change in both reward and dynamics. We compare across fixed sample complexity with models trained from scratch.

6.1 Continuous Control

We consider the MuJoCo domain Todorov et al. (2012). Here the dynamics are defined over continuous state and action spaces. The dynamics module must learn an intuitive physics model in order to achieve goals. We explore multiple agents in this space—Swimmer, Hopper, Ant, and HalfCheetah—each with different dynamics. The state spaces for these agents contain information about joint angles, joint velocities, and coordinates of the center of mass. The reward functions are computed using the velocity of the agent and size of the action taken – the faster the velocity and smaller the magnitude of the action taken, the larger the reward. More detail about all the agents can be found in Duan et al. (2016).

The dynamics module for experiments in this domain is trained on 100K samples generated with a random policy. It is trained with batch size , learning rate for 1000 epochs with trajectories of length 20. The reward module is trained for 1M episodes, with a maximum episode length of 500 and gradient updates every 20 steps. We use two linear layers apiece for the encoder and decoder, interpolated with exponential linear units (ELUs) Clevert et al. (2015). Our encoder latent space is defined as , with . We also add an entropy coefficient as regularization J. Williams & Peng (1991) tuned for each environment, at either or .

Figure 3: Dynamics losses for AntEnv, HalfCheetahEnv, HopperEnv, and SwimmerEnv.
Figure 4: Rewards averaged over 5 runs for AntEnv, HalfCheetahEnv, HopperEnv, and SwimmerEnv. Red is DDR (our method), blue is A3C baseline.
\abovespace\belowspaceTask A3C DDR Prior DDR Online
\abovespaceSwimmer 55.4 68 19.8
Ant 24.3 508 54
Hopper 8 36 38
HalfCheetah 124.8 869 241
Table 1: MuJoCo domain. Reward averaged over 5 runs, evaluated over 100 trajectories, trained for 1M episodes. DDR Prior is the Simple Generalization case, using a pre-trained encoder-decoder.

We first consider the Simple Generalization case. Results are presented in Table 12. For the DDR Prior case, a dynamics model is trained offline and off-policy. We then use the frozen encoder as a prior and train the reward model from scratch. For the DDR Online case, both models are trained online and on-policy as detailed in Sections 4.1, 4.2, without pre-trained components. We observe significant performance gain from the representation transfer in 3 of the four domains; in the other case it is neutral. Our model-based approach (with or without prior) significantly outperforms standard A3C.

Next we evaluate dynamics and reward transfer. For the REWARD case, the task is modified by negating the reward given by the environment – instead of rewarding forward velocity we reward negative velocity and train the agent to move backwards. In Table 2, for reward transfer – the more negative the score, the better. We compare with a standard A3C baseline, and a variant where we fine-tune in the new environment with changed and/or on top of the A3C models trained in the default environments. Note that we are only training the reward module in the new environment – the representation space is fixed from pre-training on the original domain (with positive rewards).

For the DYNAMIC case, we increase density and damping on the joints; in this case higher reward is better. Again, the representation is pre-trained with the original domain, then we re-train the forward and inverse models in the new domain, transferring the encoder/decoder intact from the original.

Finally, we consider the case where BOTH the reward and dynamics change; once again lower reward is better. We would also like to note that the negative reward case is not symmetric to positive. The reward is computed as reward = forward_reward - ctrl_cost - contact_cost + survive_reward, so maximizing the negative reward is not so simple as merely maximizing negative velocity.

In all the transfer scenarios considered, the results in Table 2 show a consistent advantage for DDR which is able to leverage pre-trained modules for the components that do not change.

\abovespace\belowspaceModel Change in Change in Change in
Reward Dynamics Both
\abovespaceDDR -86.3 66.9 -65
A3C (f) 0.6 50.9 -5.1
A3C -4.6 48.8 -4.9
\abovespaceDDR -908 793 -366
A3C (f) -11.8 50 -50.8
A3C 2.2 35.2 -3.5
Table 2: MuJoCo Transfer Experiments. We investigate reward transfer, dynamics transfer, and both and compare with A3C finetuned with the same number of samples (A3C (f)), as well as A3C trained from scratch. Reward transfer in this case is negating the reward, so the more negative the better.

6.2 Maze Navigation

Next we consider the maze navigation domain, where the task is defined over discrete state and action sets, and requires longer planning than the Mujoco domains. In this case the agent needs to reach a goal in the least number of steps to receive maximum reward.

Environment. We consider a 2D grid maze based on MazeBase Sukhbaatar et al. (2015). An observation is represented as a binary vector, , where is the size of the grid and is the length of feature vector denoting the number of different maze elements. For the maze navigation experiments, we only have three kind of objects: Agent, Goal, and Walls. We generate the maze layout similar to the rooms domain Sutton et al. (1999), where the layout of the maze (position of walls) remains constant across different runs, but the agent’s and the goal’s location are randomly generated. The agent has primitive actions UP, DOWN, LEFT, RIGHT that move the agent by one block in the respective direction. The agent receives a time penalty of for each time-step and gets a reward of on reaching the goal, after which the episode terminates. The discount factor () is set to and the maximum episode length is set to time-steps after which the episode terminates.

Implementation Details. All the individual components are modeled using neural networks. The encoder () and decoder () are both single layer neural networks with ReLU non-linear activations Glorot et al. (2011), which map the input observation to latent space , with . Both the LSTM-D and LSTM-R have a hidden layer with 128 units each. The Inverse model,, consists of a linear layer of size with ReLU non-linearity followed by an output layer of size with the softmax activation defining a probability over actions. The forward model, , concatenates the hidden state of the LSTM-D with the one-hot encoding of the action, and passes it to a linear layer with size and tanh non-linearity. The actor and critic models, and , both consist of a single linear layer each.

Pre-training. The dynamics module is trained offline on 25K samples, each consisting of transitions, generated by following a random policy. The agent and goal location are initialized randomly at the start of each episode. The model was trained for epochs with batch size set to , learning rate to and loss coefficients , and respectively. The was annealed linearly from to over the course of training. The reward module is trained for episodes, with , entropy regularization coefficient of and parallel asynchronous agents.

Evaluation on unseen tasks. We generate two random tasks (Task 1 and Task 2 in Fig. 5), unseen by the dynamics module during training, and the goal is to learn the optimal behavior on these two tasks. We train a reward module on this new task, using the fixed pre-trained encoder to process observations and using the fixed pre-trained forward module to do online planning. Planning is instantiated using fixed-depth forward rollouts with full branching (we could use MCTS instead). Results in the top row of Fig 5 show that DDR with planning learns the new task much faster than standard A3C on both tasks. Here Task 1 is easier as the goal in the test scenario is in the same room (but different location) as in the pre-training tasks. For Task 2 we evaluate with a goal that is in a different room than the scenarios seen during pre-training of the dynamics model.

We further test the robustness of the learned dynamics module to changes in environment by introducing a stochasticity coefficient , where is the probability with which the environment disregards the action taken by the agent and executes a random action. Results in Fig. 5 show that even if the forward model learned is imperfect (it was trained from purely deterministic actions), it still helps the agent to learn the optimal behavior faster. We also observe that it is more stable in the stochastic setting compared to A3C which exhibits significant variance. We added a model based baseline for the planning experiments in AppendixC.

Figure 5: Expected reward over 5 runs on two unseen tasks with varying stochasticity in the maze domain. Red is DDR using forward search planning with depth=, green is DDR without any planning (depth=), blue is A3C baseline.

6.3 Ablation of the dynamics model

We postulate that all four components the dynamics model are necessary to learn a good representation . To verify this, we selectively ablate components of the dynamics model. Results in Table 3 show that, as expected, we observe a significant drop in performance when removing the forward model. Perhaps more surprisingly, we see an even greater drop in performance when removing the inverse model (but preserving the forward model). This suggests that the inverse model is essential for regularizing the dynamics problem in preventing degenerate solutions; an important finding of this work. An auto-encoder (removing both forward and inverse models) performs even worse. These results confirm that learning dynamics is crucial for a good representation space. Merely expanding out the state space creates a paradigm where it is even more difficult to learn, which is not surprising.

\abovespace\belowspaceAgent Full No F No I AE
\abovespaceSwimmer 68 25.9 4.48 -3.3
Ant 508 281 80.5 37.5
Maze Navigation 8.14 6.04 -0.86 -0.85
Table 3: Ablation results averaged over 5 runs. Full = All four losses, No F = No forward model, No I = No inverse model, AE = Autoencoder (no forward or inverse models).

7 Related Work

We combine ideas from many areas of previous research, especially those of successor features Dayan (1993); Barreto et al. (2016a); Machado et al. (2017), which also uses a decoupling mechanism in the value function to transfer across reward functions (but not dynamics) Barreto et al. (2016b); Kulkarni et al. (2016).

Other previous work in transfer learning includes feature sharing Argyriou et al. (2007); Walsh et al. (2006) and representation learning of dynamics of the environment via predictive state representation Littman & Sutton (2002); Liu et al. (2015); Downey et al. (2017). Finally, Taylor & Stone (2009) is a comprehensive review on transfer learning in reinforcement learning that details the various types of transfer and evaluation methods.

More specifically, we look at other model-based RL methods ?; ? that try to transfer and plan Banerjee & Stone (2007); Xie et al. (2015); ?. Jaderberg et al. (2016) proposes a state reconstruction loss and argue that having auxiliary costs help in faster learning. Oh et al. (2017) also performs planning strictly in the representation space. However, they do not decouple the reward function from the dynamics function of their environment and do not learn a policy. Weber et al. (2017) trains an environment model which learns dynamics and contains a recurrent model for imagining rollouts, but still operate in the state space.

?; ? also use an inverse model to regularize their forward model as an auxiliary task, but without decoupling, showing transfer in dynamics, and operates only in the state space. ? develops a transfer method specifically from simulation to real world through learning the inverse dynamics model. However, our method instead show how using both forward and inverse models as auxiliary tasks allow us to generalize and transfer with model-free policy optimization methods.

We would like to emphasize that our method is not a model-based one. We incorporate auxiliary model-based losses for learning a representation space, but do not actively use a model when training policies. This is a novel way of combining model-based and model-free methods.

? is also a semi-supervised learning method that incorporates unlabeled data, but infer labels for better generalization as opposed to transfer to different reward functions.

Our model shares some similarities to the stacked LSTM used in Wang et al. (2016), but our decoupling strategy enables more efficient training and more modular transfer.

8 Discussion

We present a decoupled model-based RL framework that offers efficient and modular reuse to pre-trained models and enables robust transfer across tasks. There are several key ingredients to this approach. By learning an encoder jointly with the dynamics we can focus representation on relevant information. The pre-training of a forward model, enables planning which leads to faster policy optimizing. The incorporation of an inverse model has an important stabilizing effect on the dynamics model. The modularity of the rewards model allows off- and on-policy learning. Finally, the approach can be used for both discrete and continuous domains.

Throughout our experiments we consistently observe that the offline, decoupled mode of training significantly outperforms that of online/on-policy training. One of the advantages of training modules in a decoupled manner is that the dynamics learning becomes a supervised learning task, and converges faster and more stably than when both modules are trained simultaneously. This leaves open the question of how to effectively train dynamics models in an on-policy setting that isn’t as volatile as the online version explored here. One possibility is to incorporate additional supervision (e.g. adding intrinsic motivation that is relevant to a specific family of tasks), another possibility is to explore mechanisms to directly stabilize the non-stationarity of the data distribution (e.g. as when using target networks in DQN Mnih et al. (2015)).

Our results also highlight the brittleness of standard A3C, which despite its popularity (due to fast training enabled by parallelization) performs poorly on several tasks. We provide results from our hyperparameter search on A3C in Appendix A. In many ways, our core contributions are orthogonal to the policy optimization method, and DDR could be extended to other policy optimization methods such as TRPO Schulman et al. (2015) or PPO Schulman et al. (2017), results for which are in Appendix B, where we would expect to still see large gains in performance and transferability due to the modularity of the architecture.


Thanks to Alessandro Lazaric and Ryan Lowe for helpful feedback.

Appendix A Hyperparameter Search for A3C

We did a hyperparameter search over learning rate, value coefficient, entropy regularization, and with and without generalized advantage estimation (GAE) for all MuJoCo environments with vanilla A3C and chose the hyperparameters that performed best. We then carried over those hyperparameters to DDR for the reward module and performed some tuning on the loss weights for the various auxiliary losses – forward loss, inverse loss, and decoder loss in the dynamics module.

Appendix B PPO Results

\abovespace\belowspaceTask PPO DDR Prior
\abovespaceSwimmer 49.22 76.22
Ant 85.12 312
Hopper 299.6 337.2
HalfCheetah 482.6 1902.8
Table 4: MuJoCo domain. Reward averaged over 5 runs, evaluated over 100 trajectories, trained for 1M episodes. DDR Prior is the Simple Generalization case, using a pre-trained encoder-decoder.

Appendix C Comparison with Model Based Baseline

We compare our approach with a model based baseline for the planning experiments, an asynchronous version of ATreeC ?, that combines model-free reinforcement learning with on-line planning. Results in Fig.6 show that both our method (DDR planning) and ATreeC achieve comparable performance and do better than A3C, especially in the stochastic environments. We use the same setting as in Section 6.2. We have tried to keep the comparison fair with equal capacity and designs, extensive hyper-parameter search, averaged over 5 runs and using the same depth for exhaustive search for the planning. However, ATreeC is not designed for representation transfer, which is one of the main advantages of our proposed DDR (highlighted in other experiments).

Figure 6: Expected reward over 5 runs on two unseen tasks with varying stochasticity in the 4-rooms maze domain. Both DDR and ATreeC use exhaustive forward search planning with depth=, blue is A3C baseline.


  1. See Kaelbling et al. (1996) for standard definitions of these terms.
  2. We set a maximum episode length of 500 for evaluation. Other work does not specify the episode length used for the same environments, so our results are not directly comparable.


  1. Agrawal, P., Nair, A., Abbeel, P., Malik, J., and Levine, S. Learning to Poke by Poking: Experiential Learning of Intuitive Physics. ArXiv e-prints, June 2016.
  2. Argyriou, Andreas, Evgeniou, Theodoros, and Pontil, Massimiliano. Multi-task feature learning. In Schölkopf, B., Platt, J. C., and Hoffman, T. (eds.), Advances in Neural Information Processing Systems 19, pp. 41–48. MIT Press, 2007. URL
  3. Banerjee, Bikramjit and Stone, Peter. General game learning using knowledge transfer. In The 20th International Joint Conference on Artificial Intelligence, pp. 672–677, January 2007.
  4. Barreto, André, Munos, Rémi, Schaul, Tom, and Silver, David. Successor features for transfer in reinforcement learning. CoRR, abs/1606.05312, 2016a. URL
  5. Barreto, André, Munos, Rémi, Schaul, Tom, and Silver, David. Successor features for transfer in reinforcement learning. CoRR, abs/1606.05312, 2016b. URL
  6. Brockman, Greg, Cheung, Vicki, Pettersson, Ludwig, Schneider, Jonas, Schulman, John, Tang, Jie, and Zaremba, Wojciech. Openai gym, 2016.
  7. Clevert, Djork-Arné, Unterthiner, Thomas, and Hochreiter, Sepp. Fast and accurate deep network learning by exponential linear units (elus). CoRR, abs/1511.07289, 2015. URL
  8. Coulom, Remi. Efficient selectivity and backup operators in monte-carlo tree search. In Proceedings of the 5th international conference on Computers and games, 2006.
  9. Dayan, Peter. Improving generalization for temporal difference learning: The successor representation. Neural Computation, 5(4):613–624, 1993.
  10. Downey, Carlton, Hefny, Ahmed, and Gordon, Geoffrey. Practical learning of predictive state representations. arXiv preprint arXiv:1702.04121, 2017.
  11. Duan, Y., Schulman, J., Chen, X., Bartlett, P. L., Sutskever, I., and Abbeel, P. RL: Fast Reinforcement Learning via Slow Reinforcement Learning. ArXiv e-prints, November 2016.
  12. Duan, Yan, Chen, Xi, Houthooft, Rein, Schulman, John, and Abbeel, Pieter. Benchmarking deep reinforcement learning for continuous control. CoRR, abs/1604.06778, 2016. URL
  13. Finn, Chelsea, Abbeel, Pieter, and Levine, Sergey. Model-agnostic meta-learning for fast adaptation of deep networks. CoRR, abs/1703.03400, 2017. URL
  14. Glorot, Xavier, Bordes, Antoine, and Bengio, Yoshua. Deep sparse rectifier neural networks. In Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, pp. 315–323, 2011.
  15. Henderson, Peter, Riashat Islam, Philip Bachman, Pineau, Joelle, Precup, Doina, and Meger, David. Deep reinforcement learning that matters. In AAAI, 2018.
  16. Hochreiter, Sepp and Schmidhuber, Jürgen. Long short-term memory. Neural Comput., 9(8):1735–1780, November 1997. ISSN 0899-7667. doi: 10.1162/neco.1997.9.8.1735. URL
  17. J. Williams, Ronald and Peng, Jing. Function optimization using connectionist reinforcement learning algorithms. 3:241–, 09 1991.
  18. Jaderberg, Max, Mnih, Volodymyr, Czarnecki, Wojciech Marian, Schaul, Tom, Leibo, Joel Z, Silver, David, and Kavukcuoglu, Koray. Reinforcement learning with unsupervised auxiliary tasks. arXiv preprint arXiv:1611.05397, 2016.
  19. Kaelbling, Leslie Pack, Littman, Michael L, and Moore, Andrew W. Reinforcement learning: A survey. Journal of artificial intelligence research, 4:237–285, 1996.
  20. Kober, Jens, Bagnell, J. Andrew, and Peters, Jan. Reinforcement learning in robotics: A survey. International Journal of Robotics Research, 32, 2013.
  21. Kulkarni, T. D., Saeedi, A., Gautam, S., and Gershman, S. J. Deep Successor Reinforcement Learning. ArXiv e-prints, June 2016.
  22. Littman, Michael L and Sutton, Richard S. Predictive representations of state. In Advances in neural information processing systems, pp. 1555–1561, 2002.
  23. Liu, Yunlong, Tang, Yun, and Zeng, Yifeng. Predictive state representations with state space partitioning. In Proceedings of the 2015 International Conference on Autonomous Agents and Multiagent Systems, pp. 1259–1266. International Foundation for Autonomous Agents and Multiagent Systems, 2015.
  24. Machado, Marlos C., Rosenbaum, Clemens, Guo, Xiaoxiao, Liu, Miao, Tesauro, Gerald, and Campbell, Murray. Eigenoption Discovery through the Deep Successor Representation. CoRR, abs/1710.11089, 2017. URL
  25. Mnih, Volodymyr, Kavukcuoglu, Koray, Silver, David, Rusu, Andrei A, Veness, Joel, Bellemare, Marc G, Graves, Alex, Riedmiller, Martin, Fidjeland, Andreas K, Ostrovski, Georg, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529, 2015.
  26. Mnih, Volodymyr, Badia, Adria Puigdomenech, Mirza, Mehdi, Graves, Alex, Lillicrap, Timothy, Harley, Tim, Silver, David, and Kavukcuoglu, Koray. Asynchronous methods for deep reinforcement learning. In International Conference on Machine Learning, pp. 1928–1937, 2016.
  27. Oh, J., Singh, S., and Lee, H. Value Prediction Network. ArXiv e-prints, July 2017.
  28. S. M. Shortreed, E. Laber, D. J. Lizotte S. Stroup J. Pineau S. Murphy. Informing sequential clinical decision-making through reinforcement learning: an empirical study. Machine Learning, 84, 2011.
  29. Schulman, John, Levine, Sergey, Moritz, Philipp, Jordan, Michael I., and Abbeel, Pieter. Trust region policy optimization. CoRR, abs/1502.05477, 2015. URL
  30. Schulman, John, Wolski, Filip, Dhariwal, Prafulla, Radford, Alec, and Klimov, Oleg. Proximal policy optimization algorithms. CoRR, abs/1707.06347, 2017. URL
  31. Sukhbaatar, Sainbayar, Szlam, Arthur, Synnaeve, Gabriel, Chintala, Soumith, and Fergus, Rob. Mazebase: A sandbox for learning from games. CoRR, abs/1511.07401, 2015. URL
  32. Sutton, Richard. Integrated architectures for learning, planning, and reacting based on approximating dynamic programming. In International Conference on Machine Learning, 1990.
  33. Sutton, Richard S. Learning to predict by the methods of temporal differences. Machine learning, 3(1):9–44, 1988.
  34. Sutton, Richard S and Barto, Andrew G. Reinforcement learning: An introduction, volume 1. MIT press Cambridge, 1998.
  35. Sutton, Richard S, Precup, Doina, and Singh, Satinder. Between mdps and semi-mdps: A framework for temporal abstraction in reinforcement learning. Artificial intelligence, 112(1-2):181–211, 1999.
  36. Sutton, Richard S, McAllester, David A, Singh, Satinder P, and Mansour, Yishay. Policy gradient methods for reinforcement learning with function approximation. In Advances in neural information processing systems, pp. 1057–1063, 2000.
  37. Taylor, Matthew E. and Stone, Peter. Transfer learning for reinforcement learning domains: A survey. J. Mach. Learn. Res., 10:1633–1685, December 2009. ISSN 1532-4435. URL
  38. Tian, Yuandong, Gong, Qucheng, Shang, Wenling, Wu, Yuxin, and Zitnick, C. Lawrence. Elf: An extensive, lightweight and flexible research platform for real-time strategy games. In NIPS, 2017.
  39. Todorov, Emanuel, Erez, Tom, and Tassa, Yuval. Mujoco: A physics engine for model-based control. In IROS, pp. 5026–5033. IEEE, 2012.
  40. Walsh, Thomas J., Li, Lihong, and Littman, Michael L. Transferring state abstractions between mdps. In In ICML Workshop on Structural Knowledge Transfer for Machine Learning, 2006.
  41. Wang, J. X, Kurth-Nelson, Z., Tirumala, D., Soyer, H., Leibo, J. Z, Munos, R., Blundell, C., Kumaran, D., and Botvinick, M. Learning to reinforcement learn. ArXiv e-prints, November 2016.
  42. Weber, Theophane, Racanière, Sébastien, Reichert, David P., Buesing, Lars, Guez, Arthur, Rezende, Danilo Jimenez, Badia, Adrià Puigdomènech, Vinyals, Oriol, Heess, Nicolas, Li, Yujia, Pascanu, Razvan, Battaglia, Peter, Silver, David, and Wierstra, Daan. Imagination-augmented agents for deep reinforcement learning. CoRR, abs/1707.06203, 2017. URL
  43. Xie, C., Patil, S., Moldovan, T., Levine, S., and Abbeel, P. Model-based Reinforcement Learning with Parametrized Physical Models and Optimism-Driven Exploration. ArXiv e-prints, September 2015.
Comments 4
Request Comment
The feedback must be of minimum 40 characters and the title a minimum of 5 characters
Add comment
Loading ...
This is a comment super asjknd jkasnjk adsnkj
The feedback must be of minumum 40 characters
The feedback must be of minumum 40 characters

You are asking your first question!
How to quickly get a good answer:
  • Keep your question short and to the point
  • Check for grammar or spelling errors.
  • Phrase it like a question
Test description