Data-Efficient Hierarchical Reinforcement Learning

Ofir Nachum, Shixiang Gu, Honglak Lee, Sergey Levine

Introduction

Deep reinforcement learning (RL) has made significant progress on a range of continuous control tasks, such as locomotion skills , learning dexterous manipulation behaviors , and training robot arms for simple manipulation tasks . However, most of these behaviors are inherently atomic: they require performing some simple skill, either episodically or cyclically, and rarely involve complex multi-level reasoning, such as utilizing a variety of locomotion behaviors to accomplish complex goals that require movement, object interaction, and discrete decision-making.

Hierarchical reinforcement learning (HRL), in which multiple layers of policies are trained to perform decision-making and control at successively higher levels of temporal and behavioral abstraction, has long held the promise to learn such difficult tasks . By having a hierarchy of policies, of which only the lowest applies actions to the environment, one is able to train the higher levels to plan over a longer time scale. Moreover, if the high-level actions correspond to semantically different low-level behavior, standard exploration techniques may be applied to more appropriately explore a complex environment. Still, there is a large gap between the basic definition of HRL and the promise it holds to successfully solve complex environments. To achieve the benefits of HRL, there are a number of questions that one must suitably answer: How should one train the lower-level policy to induce semantically distinct behavior? How should the high-level policy actions be defined? How should the multiple policies be trained without incurring an inordinate amount of experience collection? Previous work has attempted to answer these questions in a variety of ways and has provided encouraging successes . However, many of these methods lack generality, requiring some degree of manual task-specific design, and often require expensive on-policy training that is unable to benefit from advances in off-policy model-free RL, which in recent years has drastically brought down sample complexity requirements .

For generality, we propose to take advantage of the state observation provided by the environment to the agent, which in locomotion tasks can include the position and orientation of the agent and its limbs. We let the high-level actions be goal states and reward the lower-level policy for performing actions which yield it an observation close to matching the desired goal. In this way, our HRL setup does not require a manual or multi-task design and is fully general.

This idea of a higher-level policy commanding a lower-level policy to match observations to a goal state has been proposed before . Unlike previous work, which represented goals and rewarded matching observations within a learned embedding space, we use the state observations in their raw form. This significantly simplifies the learning, and in our experiments, we observe substantial benefits for this simpler approach.

While these goal-proposing methods are very general, they require training with on-policy RL algorithms, which are generally less efficient than off-policy methods . On-policy training has been attractive in the past since, outside of discrete control, off-policy methods have been plagued with instability , which is amplified when training multiple policies jointly, as in HRL. Other than instability, off-policy training poses another challenge that is unique to HRL. Since the lower-level policy is changing underneath the higher-level policy, a sample observed for a certain high-level action in the past may not yield the same low-level behavior in the future, and thus not be a valid experience for training. This amounts to a non-stationary problem for the higher-level policy. We remedy this issue by introducing an off-policy correction, which re-labels an experience in the past with a high-level action chosen to maximize the probability of the past lower-level actions. In this way, we are able to use past experience for training the higher-level policy, taking advantage of progress made in recent years to provide stable, robust, and general off-policy RL methods .

In summary, we introduce a method to train a multi-level HRL agent that stands out from previous methods by being both generally applicable and data-efficient. Our method achieves generality by training the lower-level policy to reach goal states learned and instructed by the higher-levels. In contrast to prior work that operates in this goal-setting model, we use states as goals directly, which allows for simple and fast training of the lower layer. Moreover, by using off-policy training with our novel off-policy correction, our method is extremely sample-efficient. We evaluate our method on several difficult environments. These environments require the ability to perform exploratory navigation as well as complex sequences of interaction with objects in the environment (see Figure 1). While these tasks are unsolvable by existing non-HRL methods, we find that our HRL setup can learn successful policies. When compared to other published HRL methods, we also observe the superiority of our method, in terms of both final performance and speed of learning. In only a few million experience samples, our agents are able to adequately solve previously unapproachable tasks.

Background

Temporal difference learning is a powerful paradigm in RL, in which a policy may be learned efficiently from state-action-reward transition tuples (st,at,Rt,st+1)(s_{t},a_{t},R_{t},s_{t+1}) collected from interactions with the environment. In our HRL method, we utilize the TD3 learning algorithm , a variant of the popular DDPG algorithm for continuous control .

In DDPG, a deterministic neural network policy μϕ\mu_{\phi} is learned along with its corresponding state-action Q-function QθQ_{\theta} by performing gradient updates on parameter sets ϕ\phi and θ\theta. The Q-function represents the future value of taking a specific action ata_{t} starting from a state sts_{t}. Accordingly, it is trained to minimize the average Bellman error over all sampled transitions, which is given by

The policy is then trained to yield actions which maximize the Q-value at each state. That is, μϕ\mu_{\phi} is trained to maximize Qθ(st,μϕ(st))Q_{\theta}(s_{t},\mu_{\phi}(s_{t})) over all sts_{t} collected from interactions with the environment.

We note that although DDPG trains a deterministic policy μϕ\mu_{\phi}, its behavior policy, which is used to collect experience during training is augmented with Gaussian (or Ornstein-Uhlenbeck) noise . Therefore, actions are collected as at∼N(μϕ(st),σ)a_{t}\sim N(\mu_{\phi}(s_{t}),\sigma) for fixed standard deviation σ\sigma, which we will shorten as at∼μϕ(st)a_{t}\sim\mu_{\phi}(s_{t}). We will take advantage of the fact that the behavior policy is stochastic for the off-policy correction in our HRL method. TD3 makes several modifications to DDPG’s learning algorithm to yield a more robust and stable procedure. Its main modification is using an ensemble over Q-value models and adding noise to the policy when computing the target value in Equation 1.

General and Efficient Hierarchical Reinforcement Learning

In this section, we present our framework for learning hierarchical policies, HIRO: HIerarchical Reinforcement learning with Off-policy correction. We make use of parameterized reward functions to specify a potentially infinite set of lower-level policies, each of which is trained to match its observed states sts_{t} to a desired goal. The higher-level policy chooses these goals for temporally extended periods, and uses an off-policy correction to enable it to use past experience collected from previous, different instantiations of the lower-level policy.

The higher-level controller provides the lower-level with an intrinsic reward rt=r(st,gt,at,st+1)r_{t}=r(s_{t},g_{t},a_{t},s_{t+1}), using a fixed parameterized reward function rr. The lower-level policy will store the experience (st,gt,at,rt,st+1,h(st,gt,st+1))(s_{t},g_{t},a_{t},r_{t},s_{t+1},h(s_{t},g_{t},s_{t+1})) for off-policy training. The higher-level policy collects the environment rewards RtR_{t} and, every cc time steps, stores the higher-level transition (st:t+c−1,gt:t+c−1,at:t+c−1,Rt:t+c−1,st+c)(s_{t:t+c-1},g_{t:t+c-1},a_{t:t+c-1},R_{t:t+c-1},s_{t+c}) for off-policy training.

2 Parameterized Rewards

Our higher-level policy produces goals gtg_{t} indicating desired relative changes in state observations. That is, at step tt, the higher-level policy produces a goal gtg_{t}, indicating its desire for the lower-level agent to take actions that yield it an observation st+cs_{t+c} that is close to st+gts_{t}+g_{t}. Although some state dimensions (e.g., the position of the quadrupedal robot in Figure 3) are more natural as goal subspaces, we chose this more generic goal representation to make it broadly applicable, without any manual design of goal spaces, primitives, or controllable dimensions. This makes our method general and easy to apply to new problem settings. To maintain the same absolute position of the goal regardless of state change, the goal transition model hh is defined as

We define the intrinsic reward as a parameterized reward function based on the distance between the current observation and the goal observation:

This rewards the lower-level policy for taking actions that yield observations that are close to the desired value st+gts_{t}+g_{t}. In our evaluations on simulated ant locomotion, we use all positional observations as the representation for gtg_{t}, without distinguishing between the (x,y,z)(x,y,z) root position or the joints, making for a generic and broadly applicable choice of goal space. The reward rr and transition function hh are computed only with respect to these positional observations. See Figure 3 for an example of the goals gtg_{t} chosen during a successful navigation of a complex environment.

The lower-level policy may be trained using standard methods by simply incorporating gtg_{t} as an additional input into the value and policy models. For example, in DDPG, the equivalent objective to Equation 1 in terms of lower-level Q-value function QθloQ_{\theta}^{lo} is to minimize the error

for all transitions (st,gt,at,st+1,gt+1)(s_{t},g_{t},a_{t},s_{t+1},g_{t+1}). The policy μϕlo\mu_{\phi}^{lo} would be trained to maximize the Q-value Qθlo(st,gt,μϕlo(st,gt))Q_{\theta}^{lo}(s_{t},g_{t},\mu_{\phi}^{lo}(s_{t},g_{t})) for all sampled state-goal tuples (st,gt)(s_{t},g_{t}).

Parameterized rewards are not a new concept, and have been studied previously . They are a natural choice for a generally applicable HRL method and have therefore appeared as components of other HRL methods . A significant distinction between our method and these prior approaches is that we directly use the state observation as the goal, and changes in the state observation as the action space for the higher-level policy, in contrast to prior methods that must train the goal representation. This allows the lower-level policy to begin receiving reward signals immediately, even before the lower-level policy has figured out how to reach the goal and before the task’s extrinsic reward provides any meaningful supervision. In our experiments (Section 5), we find that this produces substantially better results.

3 Off-Policy Corrections for Higher-Level Training

While a number of prior works have proposed two-level HRL architectures that involve some sort of goal setting, such designs in previous work generally require on-policy training . This is because the changing behavior of the lower-level policy creates a non-stationary problem for the higher-level policy, and old off-policy experience may exhibit different transitions conditioned on the same goals. However, for HRL methods to be applicable to real-world settings, they must be sample-efficient, and off-policy algorithms (often based on some variant of Q-function learning) generally exhibit substantially better sample efficiency than on-policy actor-critic or policy gradient variants. In this section, we describe how we address the challenge of off-policy training of the higher-level policy.

We would like to take the higher-level transition tuples (st:t+c−1,gt:t+c−1,at:t+c−1,Rt:t+c−1,st+c)(s_{t:t+c-1},g_{t:t+c-1},a_{t:t+c-1},R_{t:t+c-1},s_{t+c}), where xt:t+c−1x_{t:t+c-1} denotes the sequence xt,…,xt+c−1x_{t},\dots,x_{t+c-1}, which are collected by the higher-level policy and convert them to state-action-reward transitions (st,gt,∑Rt:t+c−1,st+c)(s_{t},g_{t},\sum R_{t:t+c-1},s_{t+c}) that can be pushed into the replay buffer of any standard off-policy RL algorithm. However, since transitions obtained from past lower-level controllers do not accurately reflect the actions (and therefore resultant states st+1:t+cs_{t+1:t+c}) that would occur if the same goal were used with the current lower-level controller, we must introduce a correction that translates old transitions into ones that agree with the current lower-level controller.

Related Work

Discovering meaningful and effective hierarchies of policies is a long standing research problem in RL . Classically, the work on HRL focused on discrete state domains, where state visitation and transition statistics can be used to construct heuristic sub-goals for low-level policies . The options framework , a popular formulation for HRL, proposes a termination policy for each sub-policy (option). While the traditional options framework relies on prior knowledge for designing options, recently derived an actor-critic algorithm for learning them jointly with the higher-level policy. This option-critic architecture is an important step toward end-to-end HRL; however, such approaches are often prone to learning either a sub-policy that terminates every time step, or one effective sub-policy that runs through the whole episode. In practice, regularizers are essential to learn multiple effective and temporally abstracted sub-policies .

To guarantee learning useful sub-policies, recent work has studied approaches that provide auxiliary rewards for the low-level policies . These approaches rely on hand-crafted rewards based on prior domain knowledge or diversity-encouraging rewards like mutual information . A number of works have suggested that semantically distinct behavior can be induced by training on a set of diverse tasks, and have suggested pre-training the lower-level policy on such tasks , or training the multi-level hierarchical policy in a multi-task setup . However, having access to a collection of suitably similar tasks is a luxury which is not always available and may require hand-design. Our method uses a generic reward that is specified with respect to the state space, and therefore avoids designing various rewards or multiple tasks.

Another difference from most HRL work is that we use off-policy learning, leading to significant improvements in sample efficiency. In end-to-end HRL, off-policy RL creates a non-stationary problem for the higher-level policy, since the lower-level is constantly changing. We are aware of only one recent work which applies HRL in an off-policy setting . As in our work, the authors devise a hierarchical structure in which a lower-level policy is trained to reach observations directed by a higher-level policy. The multiple layers of policies are trained jointly in an off-policy manner, while ignoring the non-stationarity problem which we realize is a key issue for off-policy HRL. Accordingly, we derive and test an off-policy correction in the context of HRL, and empirically show that this technique is crucial to successfully train hierarchical policies on complex tasks.

Our work is related to FeUdal Networks (FuN) , originally inspired from feudal RL . FuN also makes use of goals and a parameterized lower-level reward. Unlike our method, FuN represents the goals and computes the rewards in terms of a learned state representation. In our experiments, we found this technique to under-perform compared to our approach, which uses the state in its raw form. We find that this has a number of benefits. For one, the lower-level policies can immediately begin receiving intrinsic rewards for reaching goals even before the higher-level policy receives a meaningful supervision signal from the task reward. Additionally, the representation is generic and simple to obtain. Goal-conditioned value functions are actively explored outside the context of HRL. Continued progress in this field may be used to further improve HRL methods.

Experiments

In our experiments, we compare HIRO method to prior techniques, and ablate the various components to understand their importance. Our experiments are conducted on a set of challenging environments that require a combination of locomotion and object manipulation. Visualizations of these environments are shown in Figure 1. See the Appendix for more details on each environment.

Ant Gather. The ant gather task is a standard task introduced in . A simulated ant must navigate to gather apples while avoiding bombs, which are randomly placed in the environment at the beginning of each episode. The ant receives a reward of 11 for each apple and a reward of −1-1 for each bomb.

Ant Maze. For the first difficult navigation task we adapted the maze environment introduced in . In this environment an ant must navigate to various locations in a ‘⊃\supset’-shaped corridor. We increase the default size of the maze so that the corridor is of width 88. In our evaluation, we assess the success rate of the policy when attempting to reach the end of the maze.

Ant Push. In this task we introduce a movable block which the agent can interact with. A greedy agent would move forward, unknowingly pushing the movable block until it blocks its path to the target. To successfully reach the target, the ant must first move to the left around the block and then push the block right, clearing the path towards the target location.

Ant Fall. This task extends the navigation to three dimensions. The ant is placed on a raised platform, with the target location directly in front of it but separated by a chasm which it cannot traverse by itself. Luckily, a movable block is provided on its right. To successfully reach the target, the ant must first walk to the right, push the block into the chasm, and then safely cross.

The primary comparisons to previous HRL methods are done with respect to FeUdal Networks (FuN) , stochastic neural networks for HRL (SNN4HRL) , and VIME (see Table 1, and Appendix for more details). As these algorithms often come with problem-specific design choices, we modify each for fairer comparisons. In terms of problem assumptions, our work is closest to that of FuN which is applicable to any single task without specific sub-policy reward engineering. MLSH is another promising recent work for HRL; however, since it relies on learning meaningful sub-policies through experiencing multiple, diverse, hand-designed tasks, we do not include explicit comparisons. We leave exploring our method in the context of multi-task learning for future work.

FeUdal Network (FuN). Unlike SNN4HRL or VIME, the official open-source code for FuN was not available at the time of submission, and therefore we aimed to replicate key design choices of FuN from our algorithm implementation. FuN primarily proposes four components: (1) transition policy gradient, (2) directional cosine similarity rewards, (3) goals specified with respect to a learned representation, and (4) dilated RNN. Since our tasks are low-dimensional and fully observed, we do not include design choice (4). For each of (1), (2), and (3), we apply an equivalent modification of our HRL method and evaluate its performance on the same tasks. We also evaluate all modifications together as an approximation to the entire FuN paradigm. Results in Table 1 show that on our tasks, the FuN modifications do not learn well, and other than Ant Gather are significantly out-performed by HIRO. In particular, it is worth noting that the use of learned representations, rather than observation goals, leads to almost no improvement on the tasks. This suggests that the choice of using goal observations as lower-level goals significantly improves HRL performance, by providing a strong supervision signal to the lower-level policy right from the beginning of training.

Stochastic Neural Networks for HRL (SNN4HRL). SNN4HRL initially trains the low-level policy with a proxy reward to encourage learning useful diverse exploration policies, and then the high-level policy is trained in the tasks of interest while the low-level is fixed. While SNN4HRL can perform better than FuN, it is still far behind our proposed HRL method.

Variational Information Maximizing Exploration (VIME). VIME is not an HRL method but is used as a strong baseline in SNN4HRL. As discussed in and matched by our results, for the benchmark’s short horizon task of length 500, it performs approximately the same as SNN4HRL.

Option-Critic Architecture. We extended the option-critic architecture implementation for continuous actions and attempted a number of alternative variants besides the naïve modification of the original. No versions yielded reasonable performance in our tasks, and so we omit it from the results. This is possibly due to difficulty in continuous control tasks, but most importantly the option-critic sub-policies rely solely on the external reward, making learning gait policies difficult.

2 Ablative Analysis

In Figure 4 we present results of our proposed HRL method (“HIRO”) compared with a number of variants to understand the importance of various design choices:

With pre-training. In this variant we evaluate a simpler method to avoid the non-stationary issue in higher-level off-policy training. Rather than correct for past experiences, we instead pre-train the lower-level policy for 2M steps (using goals sampled from a Gaussian) before freezing it and training the higher-level policy alone (this variant also has the advantage of allowing the higher-level policy to learn with respect to a deterministic, non-exploratory lower-level policy). In the harder navigation tasks, we find that pre-training is detrimental. This is understandable, as these tasks require specialization in different low-level behavior for different stages of the navigation. By allowing the lower-level policy to continually learn as new parts of the environment are encountered, we are able to learn a lower-level policy which is better able to satisfy the desired goals of the higher-level. In contrast, in the simpler and mostly homogeneous Ant Gather task, the advantage of pre-training is significant. This suggests that our off-policy correction is still not perfect, and there is potentially significant benefit to be obtained by improving it.

No off-policy correction. We assess the advantage of including the off-policy correction compared to training off-policy naïvely, ignoring the non-stationary issue. Interestingly, training an HRL policy this way can do quite well. However, in the harder tasks (Ant Push, Ant Fall) the issue becomes difficult to ignore. Accordingly, we observe a significant benefit from using the off-policy correction.

No HRL. Finally, we evaluate the ability of a single non-HRL policy to learn in these environments. This variant makes almost no progress on the tasks compared to our HRL method.

Conclusion

We have presented a method for training a two-layer hierarchical policy. Our approach is general, using learned goals to pass instructions from the higher-level policy to the lower-level one. Moreover, we have described a method by which both polices may be trained in an off-policy manner concurrently for highly sample-efficient learning. Our experiments show that our method outperforms prior HRL algorithms and can solve exceedingly complex tasks that combine locomotion and rudimentary object interaction. We note that our results are still far from perfect, and there is much work left for future research to improve the stability and performance of HRL methods on these tasks.

Acknowledgments

We thank Ben Eysenbach and others on the Google Brain team for insightful comments and discussions.

References

Appendix A Discussion on Alternative Off-Policy Corrections for High-Level Actions

Through our experiments, we found that our proposed maximum likelihood-based action relabeling works well empirically; however, we also tried other variants of off-policy correction schemes. While none of the methods below worked as well as ours in the tested domains based on preliminary experiments, we summarize them below as a reference for further future work on off-policy correction for HRL.

The experience replay stores (st:t+c,at:t+c−1,gt:t+c−1,Rt:t+c−1,st+c)(s_{t:t+c},a_{t:t+c-1},g_{t:t+c-1},R_{t:t+c-1},s_{t+c}) sampled from following a low-level policy ai∼μβlo(ai∣si,gi)a_{i}\sim\mu_{\beta}^{lo}(a_{i}|s_{i},g_{i}). aia_{i} is low-level action and gig_{i} is high-level action (or goal for the low-level policy). We want to estimate the following objective for the current low-level policy μlo(a∣s,g)\mu^{lo}(a|s,g), where QhiQ^{hi} represents the target network,

We remind the reader that gig_{i} is computed using a deterministic dynamics from gtg_{t} using gi+1=h(st,gt,st+1)=si+gi−si+1g_{i+1}=h(s_{t},g_{t},s_{t+1})=s_{i}+g_{i}-s_{i+1} for i=t,t+1,…,t+c−2i=t,t+1,\dots,t+c-2.

Direct Importance Correction. A naïve approach is to directly use the unbiased estimator based on importance weighting defined by the expectation in Eq. 9,

For the continuous action domains in our paper, we found this estimator, while unbiased, has very high variance, and does not work well in practice.

The question is how to get phip^{hi} or pinvhip^{hi}_{inv}. While we can fit parametric functions on samples of data, this is often as difficult as fully model-based approach. We may instead make use of that fact that the low-level is trying to reach the given goal states. Assuming the low-level policy eventually gets to complete the given goals, we may use the following forms,

This resembles transition policy gradient in FuN , where the high-level policy is trained by assuming the low-level approximately completes the assigned goals. Empirically, we did not observe this outperformed our approach on the tested domains.

Appendix B Environment Details

Environments use the MuJoCo simulator with dt=0.02dt=0.02 and frame skip set to 55.

We use the Gather environment provided by Rllab with a simulated ant agent. The ant is equivalent to the standard Rllab Ant, except that its gear range is reduced from (−150,150)(-150,150) to (−30,30)(-30,30). In addition to observing qposqpos, qvelqvel, and the current time step tt, the agent also observes depth readings as defined by the standard Gather environment. We set the activity range to 1010 and the sensor span to 2π2\pi, which matches the settings in .

Each episode is terminated either when the ant falls or at 500 steps.

The reward used is the default reward (number of apples minus number of bombs).

B.2 Navigation

We devise three navigation tasks to evaluate our method. In each navigation task, we create an environment of 8×8×88\times 8\times 8 blocks, some movable and some with fixed position. We use the same ant agent used in Gather. The agent observes qposqpos, qvelqvel, the current time step tt, and the target location. Its actions correspond to torques applied to joints. At the beginning of each episode, the environment samples a target position (gx,gy)(g_{x},g_{y}) and the agent is provided a reward at each step corresponding to negative L2 distance from the target: −(gx−x)2+(gy−y)2-\sqrt{(g_{x}-x)^{2}+(g_{y}-y)^{2}}. In one of the navigation tasks (Falling), the L2 distance is measured with respect to 3 coordinates: x,yx,y, and zz. Each episode is 500 steps long (i.e., the episode does not terminate when the ant falls).

We describe the specifics of each navigation task below.

In this task, immovable blocks are placed to confine the agent to a “⊃\supset”-shaped corridor. That is, blocks are placed everywhere except at (0,0),(8,0),(16,0),(16,8),(16,16),(8,16),(0,16)(0,0),(8,0),(16,0),(16,8),(16,16),(8,16),(0,16). The agent is initialized at position (0,0)(0,0). At each episode, a target position is sampled uniformly at random from gx∼,gy∼g_{x}\sim,g_{y}\sim.

At evaluation time, we evaluate the agent only on its ability to reach (0,16)(0,16). We define a “success” as being within an L2 distance of 55 from the target on the ultimate step of the episode.

B.2.2 Push

In this task, immovable blocks are placed everywhere except at (0,0),(−8,0),(−8,8),(0,8),(8,8),(16,8),(0,16)(0,0),(-8,0),(-8,8),(0,8),(8,8),(16,8),(0,16). A movable block is placed at (0,8)(0,8). The agent is initialized at position (0,0)(0,0). At each episode, the target position is fixed to (gx,gy)=(0,19)(g_{x},g_{y})=(0,19). Therefore, the agent must first move to the left, the push the movable block to the right, and then navigate to the target unimpeded.

At evaluation time, we evaluate the agent on its ability to reach (0,19)(0,19). We define a “success” as being within an L2 distance of 55 from the target on the ultimate step of the episode.

B.2.3 Fall

In this task, the agent is initialized on a platform of height 44. Immovable blocks are placed everywhere except at (−8,0),(0,0),(−8,8),(0,8),(−8,16),(0,16),(−8,24),(0,24)(-8,0),(0,0),(-8,8),(0,8),(-8,16),(0,16),(-8,24),(0,24). The raised platform is absent in the region ×\times. A movable block is placed at (8,8)(8,8). The agent is initialized at position (0,0,4.5)(0,0,4.5). At each episode, the target position is fixed to (gx,gy,gz)=(0,27,4.5)(g_{x},g_{y},g_{z})=(0,27,4.5). Therefore, to cross the chasm, the agent must first push the movable block into the chasm and walk on top of it before navigating to the target.

At evaluation time, we evaluate the agent on its ability to reach (0,27,4.5)(0,27,4.5). We define a “success” as being within an L2 distance of 55 from the target on the ultimate step of the episode.

Appendix C Implementation Details

We use the same basic network structure as proposed by the TD3 algorithm , with the only difference being that we use layers of size (300,300)(300,300) rather than (400,300)(400,300).

The output of the lower-level actor network (activated by tanh⁡\tanh) is scaled to the range of the low-level actions, which is ±30\pm 30.

The output of the higher-level actor network is scaled to an approximated range of high-level actions: ±10\pm 10 for the desired relative x,yx,y; ±0.5\pm 0.5 for the desired relative zz; ±1\pm 1 for the desired relative torso orientations; and the remaining limb angle ranges are available from the ant.xml file.

C.2 Training Parameters

Discount γ=0.99\gamma=0.99 for both controllers.

Adam optimizer; actor learning rate 0.00010.0001; critic learning rate 0.0010.001.

Soft update targets τ=0.005\tau=0.005 for both controllers.

Replay buffer of size 200,000 for both controllers.

Lower-level train step and target update performed every 1 environment step.

Higher-level train step and target update performed every 10 environment steps.

Reward scaling of 1.01.0 for lower-level; 0.10.1 for higher-level.

Lower-level exploration is Gaussian noise with σ=1.0\sigma=1.0.

Higher-level exploration is Gaussian noise with σ=1.0\sigma=1.0.

C.3 Off-Policy Correction

C.4 Evaluation

Learned hierarchical policies are evaluated every 50,000 training steps by averaging performance over 50 random episodes.

Appendix D Benchmark Details

D.2 SNN4HRL

SNN4HRL trains the hierarchical policy stage-wise. It first uses a proxy reward with mutual information (MI) bonus to learn a mixture of low-level skills encouraging diverse movements, and then trains a high-level policy that controls switching among these skills to optimize for the task reward. We imported our additional environments to the official open-source codes with minimal modifications and followed the similar benchmark setup as in . All policies are trained with TRPO with step size 0.01 and discount 0.99. All neural networks (the SNN, the Latent Regressor Network and the Manager Network) have 2 layers of 32 hidden units as done in While the policy network sizes are significantly smaller than those used for our method, we observed no significant improvements with larger network sizes and this observation conforms with prior results that on-policy policy gradient methods can perform well on MuJoCo benchmark tasks with very small networks .. We report the final results averaged over 10 random seeds, where we ran the low-level training using 5 seeds, and ran the high-level training using 2 seeds per trained low-level policy.

For the skill training, the mesh density used to grid the (x, y) space and give the MI bonus is 10 divisions/unit, and the mutual information bonus coefficient αH\alpha_{H} is set to 1010. Bilinear integration is used for the SNN. The number of skills trained is 6. The batch size and the maximum path length for the pre-train task are 50,000 and 500 respectively. To guarantee learning effective skills, we trained the policy with 500 updates, or 25M transitions. The visualization of learned skill primitives is shown in Figure 6, where the learned 6 sub-policies successfully cover different exploration directions.

For the high-level policy learningIn both SNN4HRL and VIME , primarily the results are reported and compared on SwimmerMaze and SwimmerGather, and therefore the experimental results are different., we fixed the low-level policies as done in SNN4HRL and trained a policy that outputs a categorical action every 10 time steps that choose which skill to execute. For fair comparisons, we experimented with both sparse and dense rewards for the maze environments, and searched over batch sizes for (1e4,5e4,5e5)(1e4,5e4,5e5) transitions. We observed that the dense rewards did not help for SNN4HRL significantly, since the policy often quickly converge to local optimum. We found the batch size of 1e41e4 is too noisy, and the batch size of 5e55e5 is unnecessarily sample intensive, so the high-level policy is trained using batch size of 5e45e4, the default value in their paper, for 300 updates, or 15M transitions. The combined training sample size of 40M is generously more than 10M used for our methods; however, our method still outperforms these SNN4HRL results substantially.

D.3 Variational Information Maximizing Exploration

Variational Information Maximizing Exploration (VIME) , while not a HRL algorithm, exhibits good performance on prior benchmark maze and gather tasks, and is also used as a strong baseline in SNN4HRL . We ran the algorithm using the default settings in the official open-source implementation. Batch size of 50,000 is used. We report the average performance across 5 seeds after running the algorithm for 300 updates, or 15M transitions. Only the Gather task required more samples to converge to the final performance, and required 25M+ transitions to reach the same performance as what our method reached in a few million transitions.

D.4 Option-Critic Architecture

We also experimented with continuous-action variants of the option-critic architecture . The option-policy πω,θ(a∣s)\pi_{\omega,\theta}(a|s) for option ω\omega is parameterized as a Gaussian, whose mean is output from a neural network taking in ss and ω\omega, and variance is chosen to be global and diagonal. We first tested naively extending the official open-source implementation for continuous action, and then tried modifying the learning procedure such that the critic learns the state-option-action value function QU(s,ω,a)Q_{U}(s,\omega,a) instead of the state-option value function QΩ(s,ω)Q_{\Omega}(s,\omega) in the original implementation. This creates slight changes for the value and policy training objectives, while the loss for termination policy βω,ν(s)\beta_{\omega,\nu}(s) is basically kept the same. Concretely, for the first variant, we trained QΩ(s,ω)Q_{\Omega}(s,\omega) and the option-policy πω,θ(a∣s)\pi_{\omega,\theta}(a|s) with the following gradients,

where Q′Q^{\prime} represents the target network, and β\beta and π\pi represent using off-policy and on-policy transition samples respectively. For simplicity of explanation, we assumed that the reward only depends on states, but similar arguments can be made for the general case. There are two pragmatic problems for this objective. First, the policy gradient, which relies on a score function estimate, could be high variance especially with respect to a continuous policy πω,θ\pi_{\omega,\theta}. We experimented with several choices of baselines btb_{t}, including QΩ(st,ωt)Q_{\Omega}(s_{t},\omega_{t}) and Q;(st,ωt)Q;(s_{t},\omega_{t}). The second problem is that the off-policy learning for QΩ(st,ωt)Q_{\Omega}(s_{t},\omega_{t}) does not use the action ata_{t} taken and only relies on ωt\omega_{t}. This effectively creates the same non-stationarity problem with respect to the high-level policy as our method, since it ignores that for the same ωt\omega_{t} and sts_{t}, the next state st+1s_{t+1} can be different due to changing πω,θ\pi_{\omega,\theta}. To counter both problems, we also explored another variant of the option-critic implementation at the expense of potentially more computation and network parameters, which conforms more closely with the policy gradient theorems in the original paper. Specifically, we trained QU(s,ω,a)Q_{U}(s,\omega,a) and the option-policy πω,θ(a∣s)\pi_{\omega,\theta}(a|s) with the following gradients,

In this implementation, we observe that the off-policy learning for QU(s,ω,a)Q_{U}(s,\omega,a) can effectively utilize both ωt\omega_{t} and ata_{t}, removing the non-stationarity problem, and the policy gradient can be estimated with lower variance using reparametrization trick through the critic directly. Furthermore, since the policy gradient no longer requires next state estimate, off-policy state samples may also be used along with enumeration over all ω\omega,

Making similar approximations for the termination policy, this enables a fully off-policy actor-critic algorithm like DDPG for the option-critic architecture.

While we tried these modifications, we could not make the option-critic implementation work reasonably on our domains. The main difficulty is likely because the low-level option-policies are learned using only the external task reward, a limitation in a direct end-to-end hierarchical policy structure. While in our experiments we could not show substantial successes, the algorithm may work better with more sophisticated modifications to the policy evaluation or policy improvement routines based on recent advances , and we leave further comparisons for future work.