{"title": "Hierarchical Reinforcement Learning with Advantage-Based Auxiliary Rewards", "book": "Advances in Neural Information Processing Systems", "page_first": 1409, "page_last": 1419, "abstract": "Hierarchical Reinforcement Learning (HRL) is a promising approach to solving long-horizon problems with sparse and delayed rewards. Many existing HRL algorithms either use pre-trained low-level skills that are unadaptable, or require domain-specific information to define low-level rewards. In this paper, we aim to adapt low-level skills to downstream tasks while maintaining the generality of reward design. We propose an HRL framework which sets auxiliary rewards for low-level skill training based on the advantage function of the high-level policy. This auxiliary reward enables efficient, simultaneous learning of the high-level policy and low-level skills without using task-specific knowledge. In addition, we also theoretically prove that optimizing low-level skills with this auxiliary reward will increase the task return for the joint policy. Experimental results show that our algorithm dramatically outperforms other state-of-the-art HRL methods in Mujoco domains. We also find both low-level and high-level policies trained by our algorithm transferable.", "full_text": "Hierarchical Reinforcement Learning with\n\nAdvantage-Based Auxiliary Rewards\n\nSiyuan Li\u21e4\n\nIIIS, Tsinghua University\n\nsy-li17@mails.tsinghua.edu.cn\n\nRui Wang\u21e4\n\nTsinghua University\nrui1@stanford.edu\n\nMinxue Tang\n\nTsinghua University\n\ntangmx16@mails.tsinghua.edu.cn\n\nChongjie Zhang\n\nIIIS, Tsinghua University\n\nchongjie@tsinghua.edu.cn\n\nAbstract\n\nHierarchical Reinforcement Learning (HRL) is a promising approach to solving\nlong-horizon problems with sparse and delayed rewards. Many existing HRL\nalgorithms either use pre-trained low-level skills that are unadaptable, or require\ndomain-speci\ufb01c information to de\ufb01ne low-level rewards. In this paper, we aim\nto adapt low-level skills to downstream tasks while maintaining the generality of\nreward design. We propose an HRL framework which sets auxiliary rewards for\nlow-level skill training based on the advantage function of the high-level policy.\nThis auxiliary reward enables ef\ufb01cient, simultaneous learning of the high-level\npolicy and low-level skills without using task-speci\ufb01c knowledge. In addition, we\nalso theoretically prove that optimizing low-level skills with this auxiliary reward\nwill increase the task return for the joint policy. Experimental results show that\nour algorithm dramatically outperforms other state-of-the-art HRL methods in\nMujoco domains2. We also \ufb01nd both low-level and high-level policies trained by\nour algorithm transferable.\n\n1\n\nIntroduction\n\nReinforcement Learning (RL) [1] has achieved considerable successes in domains such as games\n[2, 3] and continuous control for robotics [4, 5]. Learning policies in long-horizon tasks with\ndelayed rewards, such as robot navigation, is one of the major challenges for RL. Hierarchically-\nstructured policies, which allow for control at multiple time scales, have shown their strengths in\nthese challenging tasks [6]. In addition, Hierarchical Reinforcement Learning (HRL) methods also\nprovide a promising way to support low-level skill reuse in transfer learning [7].\nThe subgoal-based HRL methods have recently been proposed and demonstrated great performance\nin sparse reward problems, where the high-level policy speci\ufb01es subgoals for low-level skills to learn\n[8, 9, 10, 11]. However, the performances of these methods heavily depend on the careful goal space\ndesign [12]. Another line of HRL research adopts a pre-training approach that \ufb01rst learns a set of\nlow-level skills with some form of proxy rewards, e.g., by maximizing velocity [13], by designing\nsome simple, atomic tasks [14], or by maximizing entropy-based diversity objective [15]. These\nmethods then proceed to learn a high-level policy to select pre-trained skills in downstream tasks, and\neach selected skill is executed for a \ufb01xed number of steps. However, using \ufb01xed pre-trained skills\n\n\u21e4Denotes equal contribution\n2Videos available at: http://bit.ly/2JxA0eN\n\n33rd Conference on Neural Information Processing Systems (NeurIPS 2019), Vancouver, Canada.\n\n\fwithout further adaptation is often not suf\ufb01cient for solving the downstream task, since proxy rewards\nfor pre-training may not be well aligned with the task.\nTo address these challenges, we develop a novel HRL approach with Advantage-based Auxiliary\nRewards (HAAR) to enable concurrent learning of both high-level and low-level policies in continuous\ncontrol tasks. HAAR speci\ufb01es auxiliary rewards for low-level skill learning based on the advantage\nfunction of the high-level policy, without using domain-speci\ufb01c information. As a result, unlike\nsubgoal-based HRL methods, the low-level skills learned by HAAR are environment-agnostic,\nenabling their further transfer to similar tasks. In addition, we have also formally shown that the\nmonotonic improvement property of the policy optimization algorithm, such as TRPO [16], is\ninherited by our method which concurrently optimizes the joint policy of high-level and low-level.\nTo obtain a good estimation of the high-level advantage function at early stages of training, HAAR\nleverages state-of-the-art skill discovery techniques [13, 14, 15] to provide a useful and diverse initial\nlow-level skill set, with which high-level training is accelerated. Furthermore, to make the best use\nof low-level skills, HAAR adopts an annealing technique that sets a large execution length at the\nbeginning, and then gradually reduces it for more \ufb01ne-grained execution.\nWe compare our method with state-of-the-art HRL algorithms on the benchmarking Mujoco tasks with\nsparse rewards [17]. Experimental results demonstrate that (1) our method signi\ufb01cantly outperforms\nprevious algorithms and our auxiliary rewards help low-level skills adapt to downstream tasks better;\n(2) annealing skill length accelerates the learning process; and (3) both high-level policy and low-level\nadapted skills are transferable to new tasks.\n\n2 Preliminaries\n\nA reinforcement learning problem can be modeled by a Markov Decision Process (MDP), which\nconsists of a state set S, an action set A, a transition function T , a reward function R, and a discount\nfactor  2 [0, 1]. A policy \u21e1(a|s) speci\ufb01es an action distribution for each state. The state value\nfunction V\u21e1(s) for policy \u21e1 is the expected return V\u21e1(s) = E\u21e1[P1i=0 irt+i|st = s]. The objective\nof an RL algorithm in the episodic case is to maximize the V\u21e1(s0), where s0 \u21e0 \u21e20(s0).\nHRL methods use multiple layers of policies to interact jointly with the environment. We overload all\nnotations in standard RL setting by adding superscripts or subscripts. In a two-layer structure, the\njoint policy \u21e1joint is composed of a high-level policy \u21e1h(ah|sh) and low-level skills \u21e1l(al|sl, ah).\nNotice that the state spaces of the high level and low level are different. Similar to [13, 18, 19, 20],\nwe factor the state space S into task-independent space Sagent and task-related space Srest, with\nwhich we de\ufb01ne sl 2 Sagent and sh 2 S. The high-level action space in our settings is discrete and\nah is a one-hot vector, which refers to a low-level skill. A low-level skill is a subpolicy conditioned\non ah that alters states in a consistent way [15, 19]. h and l denote the discount factor for high and\nlow levels, respectively.\n\n3 Method\n\nIn this section, we present our algorithm, HRL with Advantage function-based Auxiliary Rewards\n(HAAR). First we describe the framework of our algorithm. Second, we formally de\ufb01ne the advantage-\nbased auxiliary reward. Finally, we theoretically prove that the monotonicity of the optimization\nalgorithm used for each level\u2019s training is retained for the joint policy.\n\n3.1 The HAAR Learning Framework\n\ni encoded by a one-hot vector. \u21e1l is a neural network which takes ah\n\ni and state sl\ni. Different low-level skills are distinguished by different ah\n\ni takes a high-level\nFigure 1 illustrates the execution cycle of HAAR. At timestep i, an agent on state sh\ni as inputs,\naction ah\nand outputs a low-level action al\ni injected\ninto this neural network. In this way, a single neural network \u21e1l can encode all the low-level skills\n[13]. The selected low-level skill will be executed for k steps, i.e., ah\ni (i \uf8ff j < i + k). After\nt is the cumulative k-step\nthis, the high-level policy outputs a new action. The high-level reward rh\nenvironment return, i.e., rh\nt is the auxiliary reward computed\nfrom the high-level advantage function, which will be discussed in detail in the next section.\n\nj = ah\n\ni=0 rt+i. The low-level reward rl\n\nt =Pk1\n\n2\n\n\fHigh level step 0\n\n*%+\n\n,%+\n\n$%+\n\nHigh level step 1\n\n\u2026\n\nCalculate\nAdvantage\n\n,%&\n\n$%&\n*%&\n$'&\n*'&\n$()'&\n*()'&\n\nE\nn\nv\ni\nr\no\nn\nm\ne\nn\nt\n\nLow level step 0\n\nLow level step 1\n\nstep!\u22121\u2026\n\nLow level\n\nFigure 1: A schematic illustration of HAAR carried out in one high-level step. Within high-level\nstep 0, a total of k low-level steps are taken. Then the process continues to high-level step 1 and\neverything in the dashed box is repeated.\n\nt, rl\n\nt, sl\n\nt, al\n\nt in the low-level experience as {sl\n\nAlgorithm 1 shows the learning procedure of HAAR. In each iteration, we \ufb01rst sample a batch of\nT low-level time steps by running the joint policy \u21e1joint in the way shown in Figure 1 (Line 5).\nt introduced in the next section and replace the environment\nThen we calculate the auxiliary reward rl\nreward rt with rl\nt+1} for 0 \uf8ff t < T (Line 6). Finally we\nupdate \u21e1h and \u21e1l with Trust Region Policy Optimization (TRPO) [16] using the modi\ufb01ed experience\nof the current iteration (Line 7, 8). In fact, we can use any actor-critic policy gradient algorithm [21]\nthat improves the policy with approximate monotonicity.\nIn most previous works of skill learning and hierarchical learning [13, 22, 8], the skill length k is\n\ufb01xed. When k is too small, the horizon for the high-level policy will be long and the agent explores\nslowly. When k is too large, the high-level policy becomes in\ufb02exible, hence a non-optimal policy. To\nbalance exploration and optimality, we develop a skill length annealing method (Line 9). The skill\nlength ki is annealed with the iteration number i as ki = k1e\u2327i , where k1 is the initial skill length\nand \u2327 is the annealing temperature. We de\ufb01ne a shortest length ks such that when ki < ks, we set ki\nto ks to prevent the skills from collapsing into a single action.\n\n3.2 Advantage Function-Based Auxiliary Reward\n\nThe sparse environment rewards alone can hardly provide enough supervision to adapt low-level\nskills to downstream tasks. Here we utilize the high-level advantage functions to set auxiliary rewards\n\nAlgorithm 1 HAAR algorithm\n1: Pre-train low-level skills \u21e1l.\n2: Initialize high-level policy \u21e1h with a random policy.\n3: Initialize the initial skill length k1 and the shortest skill length ks.\n4: for i 2{ 1, ..., N} do\n5:\n6: Modify low-level experience with auxiliary reward rl\n7:\n8:\n9:\n10: end for\n11: return \u21e1h,\u21e1 l.\n\nOptimize \u21e1h with the high-level experience of the i-th iteration.\nOptimize \u21e1l with the modi\ufb01ed low-level experience of the i-th iteration.\nki+1 = max(f (ki), ks).\n\nt de\ufb01ned in Equation (1).\n\nCollect experiences following the scheme in Figure 1, under \u21e1h and \u21e1l for T low-level steps.\n\n3\n\n\ffor low-level skills. The advantage function [23] of high-level action ah\nt = ah, sh\n\nAh(sh, ah) = Esh\n\nt + hVh(sh\n\nt+k\u21e0(\u21e1h,\u21e1l)[rh\n\nt+k)|ah\n\nt is de\ufb01ned as\n\nt at state sh\nt = sh]  Vh(sh).\n\nTo encourage the selected low-level skills to reach states with greater values, we set the estimated\nhigh-level advantage function as our auxiliary rewards to the low-level skills.\n\nt ,ah\nt\n\nRsh\n\nl\n\n(sl\n\nt..sl\n\nt+k1) = Ah(sh\n\nt , ah\n\nt ),\n\nl\n\nwhere Rsh\nt ,ah\nt+k1) denotes the sum of k-step auxiliary rewards under the high-level state-\nt..sl\nt\naction pair (sh\nt ). For simplicity, We do a one-step estimation of the advantage function in Equation\n(1). As the low-level skill is task-agnostic and do not distinguish between high-level states, we split\nthe total auxiliary reward evenly among each low-level step, i.e., we have\n\n(sl\nt , ah\n\nrl\ni\n\nt\uf8ffi<t+k\n\n=\n\n=\n\nt , ah\nt )\n\nAh(sh\n\n1\nk\nt + hVh(sh\nt+k)  Vh(sh\nrh\nt )\nk\n\n.\n\n(1)\n\n(2)\n\nAn intuitive interpretation of this auxiliary reward function is that, when the temporally-extended\nexecution of skills quickly backs up the sparse environment rewards to high-level states, we can\nutilize the high-level value functions to guide the learning of low-level skills.\nIn order to obtain meaningful high-level advantage functions at early stages of training, we pre-train\nlow-level skills \u21e1l(al\nt ) with one of the existing skill discovery algorithms [13, 15] to obtain a\ndiverse initial skill set. This skill set is likely to contain some useful but imperfect skills. With these\npre-trained skills, the agent explores more ef\ufb01ciently, which helps the estimate of high-level value\nfunctions.\n\nt|sl\n\nt, ah\n\n3.3 Monotonic Improvement of Joint Policy\nIn this section we show that HAAR retains the monotonicity of the optimization algorithm used for\neach level\u2019s training, and improves the joint policy monotonically. Notice that in HAAR, low-level\nskills are optimized w.r.t the objective de\ufb01ned by auxiliary rewards instead of environment rewards.\nNevertheless, optimizing this objective will still lead to increase in joint policy objective. This\nconclusion holds under the condition that (1) the optimization algorithms for both the high and low\nlevel guarantee monotonic improvement w.r.t their respective objectives; (2) the algorithm used in the\nproof is slightly different from Algorithm 1: in one iteration \u21e1l is \ufb01xed while optimizing \u21e1h, and vice\nversa; and (3) discount factors h, l are close to 1.\nWe de\ufb01ne the expected start state value as our objective function to maximize (for convenience, we\nuse \u21e1 in place of \u21e1joint )\n\n\u2318(\u21e1) = \u2318(\u21e1h,\u21e1 l) = E(sh\n\nt ,ah\n\nt )\u21e0(\u21e1h,\u21e1l)\" Xt=0,k,2k,...\n\nt/k\nh rh(sh\n\nt , ah\n\nt )#.\n\nFirst, we assert that the optimization of the high level policy \u21e1h with \ufb01xed low level policy \u21e1l leads\nto improvement in the joint policy. Since the reward for high level policy is also the reward for the\njoint policy, \ufb01xing \u21e1l in (3), it essentially becomes the expression for \u2318h(\u21e1h). Therefore, \u21e1h and \u21e1\nshare the same objective when we are optimizing the former. Namely, when \u21e1l is \ufb01xed, maximizing\n\u2318h(\u21e1h) is equivalent to maximizing \u2318(\u21e1).\nNow we consider the update for the low-level policy. We can write the objective of the new joint\npolicy \u02dc\u21e1 in terms of its advantage over \u21e1 as (proved in Lemma 1 in the appendix)\n\n\u2318(\u02dc\u21e1) = \u2318(\u21e1) + E(sh\n\nt ,ah\n\nt/k\nh Ah(sh\n\nt , ah\n\nSince \u2318(\u21e1) is independent of \u2318(\u02dc\u21e1), we can express the optimization of the joint policy as\n\n(3)\n\n(4)\n\n(5)\n\nt )\u21e0\u02dc\u21e1\" Xt=0,k,2k,...\nt )\u21e0\u02dc\u21e1\" Xt=0,k,2k,...\n\n4\n\nt )#.\nt )#.\n\nmax\n\n\u02dc\u21e1\n\n\u2318(\u02dc\u21e1) = max\n\n\u02dc\u21e1\n\nE(sh\n\nt ,ah\n\nt/k\nh Ah(sh\n\nt , ah\n\n\fLet \u02dc\u21e1l denote a new low-level policy. In the episodic case, the optimization algorithm for \u02dc\u21e1l tries to\nmaximize\n\n\u2318l(\u02dc\u21e1l) = Esl\n\n0\u21e0\u21e2l\n\n0\n\n[Vl(sl\n\n0)] = E(sl\n\nt,al\n\nt\nl rl(sl\n\nt, al\n\nt)#.\n\nt)\u21e0(\u02dc\u21e1l,\u21e1h)\" Xt=0,1,2,...\nt )\u21e0(\u02dc\u21e1l,\u21e1h)\" Xt=0,k,2k,...\n\n(6)\n\n(7)\n\nRecall our de\ufb01nition of low-level reward in Equation (1) and substitute it into Equation (6), we have\n(detailed derivation can be found in Lemma 2 in the appendix)\n\n\u2318l(\u02dc\u21e1l) = Esl\n\n0\n\n[Vl(sl\n\n0)] \u21e1\n\nl\n\n1  k\n1  l\n\nE(sh\n\nt ,ah\n\nt/k\nh Ah(sh\n\nt , ah\n\nt )#.\n\nl\n\nNotice how we made an approximation in Equation (7). This approximation is valid when h and l\nare close to 1 and k is not exceptionally large (see Lemma 2). These requirements are satis\ufb01ed in\ntypical scenarios. Now let us compare this objective (7) with the objective in (5). Since 1k\nis a\n1l\npositive constant, we argue that increasing (7), which is the objective function of the low level policy,\nwill also improve the objective of the joint policy \u21e1 in (5).\nIn summary, our updating scheme results in monotonic improvement of \u2318(\u21e1joint) if we can monoton-\nically improve the high-level policy and the low-level policy with respect to their own objectives. In\npractice, we use TRPO [16] as our optimization algorithm.\nRecall that we make an important assumption at the beginning of the proof. We assume \u21e1h is \ufb01xed\nwhen we optimize \u21e1l, and \u21e1l is \ufb01xed when we optimize \u21e1h. This assumption holds if, with a batch of\nexperience, we optimize either \u21e1h or \u21e1l, but not both. However, this may likely reduce the sample\nef\ufb01ciency by half. We \ufb01nd out empirically that optimizing both \u21e1l and \u21e1h with one batch does not\ndowngrade the performance of our algorithm (see Appendix C.1). In fact, optimizing both policies\nwith one batch is approximately twice as fast as collecting experience and optimizing either policy\nalternately. Therefore, in the practical HAAR algorithm we optimize both high-level and low-level\npolicies with one batch of experience.\n\n4 Related Work\n\nHRL has long been recognized as an effective way to solve long-horizon and sparse reward problems\n[24, 25, 26, 27]. Recent works have proposed many HRL methods to learn policies for continuous\ncontrol tasks with sparse rewards [8, 9, 13, 14]. Here we roughly classify these algorithms into two\ncategories. The \ufb01rst category lets a high-level policy select a low-level skill to execute [13, 14, 15, 28],\nwhich we refer to as the selector methods. In the second category, a subgoal is set for the low level by\nhigh-level policies [8, 9, 11, 10, 25], which we refer to as subgoal-based methods.\nSelector methods enable convenient skill transferring and can solve diverse tasks. They often require\ntraining of high-level and low-level policies within different environments, where the low-level skills\nare pre-trained either by proxy reward [13], by maximizing diversity [15], or in designed simple\ntasks [14]. For hierarchical tasks, low-level skills are frozen and only high-level policies are trained.\nHowever, the frozen low-level skills may not be good enough for all future tasks. [22] makes an\neffort to jointly train high-level and low-level policies, but the high-level training is restricted to a\ncertain number of steps due to approximations made in the optimization algorithm. [13] mentions a\npotential method to train two levels jointly with a Gumble-Softmax estimator [29]. The Option-Critic\nalgorithm [30] also trains two levels jointly. However, as noted by [11], joint training may lead to\nloss of semantic meaning of the output of high policies. Therefore, the resulted joint policy in [30]\nmay degenerate into a deterministic policy or a primitive policy (also pointed out in [16]), losing\nstrengths brought by hierarchical structures. To avoid these problems, our algorithm, HAAR, trains\nboth policies concurrently (simultaneously, but in two optimization steps). Furthermore, these joint\ntraining algorithms do not work well for tasks with sparse rewards, because training low-level skills\nrequires dense reward signals.\nSubgoal-based methods are designed to solve sparse reward problems. A distance measure is required\nin order for low-level policies to receive internal rewards according to its current state and the subgoal.\nMany algorithms simply use Euclidean distance [8, 9] or cosine-distance [11] as measurements.\nHowever, these distance measure within state space does not necessarily re\ufb02ect the \u201ctrue\u201d distance\n\n5\n\n\fbetween two states [31]. Therefore these algorithms are sensitive to state space representation [12].\nTo resolve this issue, [31] proposes to use actionable state representation, while [32] learns to map\nthe original goal space to a new space with a neural network. Our algorithm HAAR, on the other\nhand, manages to avoid the thorny problem of \ufb01nding a proper state representation. By using only\nthe advantage function for reward calculation, HAAR remains domain-independent and works under\nany state representation.\nThe way we set auxiliary rewards share some similarities with the potential-based reward shaping\nmethods [33], which relies on heuristic knowledge to design a potential reward function to facilitate\nthe learning. In contrast, our method requires no prior knowledge and is able to take advantage of the\nhierarchical structure.\n\n5 Experiments\n\n5.1 Environment Setup\nWe adapt the benchmarking hierarchical tasks introduced in [17] to test HAAR. We design the\nobservation space such that the low-level skills are task-agnostic, while the high-level policy is as\ngeneral as possible. The low level only has access to the agent\u2019s joint angles, stored in sl. This\nchoice of low-level observation necessitates minimal domain knowledge in the pre-training phase,\nsuch that the skill can be transferred to a diverse set of domains. This is also discussed in [13]. The\nhigh level can perceive the walls/goals/other objects by means of seeing through a range sensor - 20\n\u201crays\u201d originating from the agent, apart from knowing its own joint angles, all this information being\nconcatenated into sh. To distinguish between states, the goal can always be seen regardless of walls.\nNote that unlike most other experiments, the agent does not have access to any information that\ndirectly reveals its absolute coordinates (x, y coordinates or top-down view, as commonly used in\nHRL research experiments). This makes our tasks more challenging, but alleviates over-\ufb01tting of the\nenvironment and introduces potential transferability to both \u21e1h and \u21e1l, which we will detail on later.\nWe compare our algorithm to prior methods in the following tasks:\n\n2(a). We randomize the start position of the ant to acquire even sampling of states.\n\n\u2022 Ant Maze: The ant is rewarded for reaching the speci\ufb01ed position in a maze shown in Figure\n\u2022 Swimmer Maze: The swimmer is rewarded for reaching the goal position in a maze shown\n\u2022 Ant Gather: The ant is rewarded for collecting the food distributed in a \ufb01nite area while\n\nin Figure 2(b).\n\npunished for touching the bombs, as shown in Figure 2(c).\n\n(a)\n\n(a)\n\n(b)\n\n(c)\n\nFigure 2: A collection of environments that we use. (a) Ant in maze (b) Swimmer in maze (c) Ant in\ngathering task.\n\n5.2 Results and Comparisons\nWe compare our algorithm with the state-of-the-art HRL method SNN4HRL [13], subgoal-based\nmethods HAC [8] and HIRO [9] and non-hierarchical method TRPO [16] in the tasks above. HAAR\nand SNN4HRL share the same set of pre-trained low-level skills with stochastic neural network.\n\n6\n\n\fHAAR signi\ufb01cantly outperforms baseline methods. Some of the results are shown in Figure 3. All\ncurves are averaged over 5 runs and the shaded error bars represent a con\ufb01dence interval of 95%. In\nall the experiments, we include a separate learning curve of HAAR without annealing the low-level\nskill length, to study the effect of annealing on training. Our full implementation details are available\nin Appendix B.\nComparison with SNN4HRL and Non-Hierarchical Algorithm\nCompared with SNN4HRL, HAAR is able to learn faster and achieve higher convergence values in\nall the tasks3. This veri\ufb01es that mere pre-trained low-level skills are not suf\ufb01cient for the hierarchical\ntasks.\n\n(a) Ant Maze\n\n(b) Swimmer Maze\n\n(c) Ant Gather\n\nFigure 3: Learning curves of success rate or average return in Ant Maze, Swimmer Maze and Ant\nGather tasks. The curves are HAAR with skill annealing, HAAR without skill length annealing,\nSNN4HRL and TRPO, respectively.\n\nThe success rate of SNN4HRL in the Swimmer Maze task is higher than that of the Ant Maze task\nbecause the swimmer will not trip over even if low-level skills are not \ufb01ne-tuned. Nevertheless, in\nSwimmer Maze, our method HAAR still outperforms SNN4HRL. HAAR reaches a success rate of\nalmost 100% after fewer than 200 iterations.\nThe main challenges of Ant Gather task is not sparse rewards, but rather the complexity of the\nproblem, as rewards in the Ant Gather task is much denser compared to the Maze environment.\nNevertheless, HAAR still achieves better results than benchmark algorithms. This indicates that\nHAAR, though originally designed for sparse reward tasks, can also be applied in other scenarios.\nTRPO is non-hierarchical and not aimed for long-horizon sparse reward problems. The success rates\nof TRPO in all maze tasks are almost zero. In Ant Gather task, the average return for TRPO has a\nrise because the ant robot learns to stay static and not fall over due to the death reward 10.\nComparison with Subgoal-Based Methods\nWe also compare our method HAAR with the state-of-the-art subgoal-based HRL methods, HAC and\nHIRO in the Ant Maze environment. Because we use a realistic range sensor-based observation and\nexclude the x, y coordinates from the robot observation, subgoal-based algorithms cannot properly\ncalculate the distances between states, and perform just like the non-hierarchical method TRPO. We\neven simplify the Maze task by placing the goal directly in front of the ant, but it is still hard for those\nsubgoal-based methods to learn the low-level gait skills. Therefore, we omit them from the results.\nThis result accords with our previous analysis of subgoal-based algorithms and is also validated by\ndetailed studies in [12], which mutates state space representation less than we do, and still achieves\npoor performance with those algorithms.\nThe Effect of Skill Length Annealing\n\n3In our comparative experiments, the numbers of timesteps per iteration when training with SNN4HRL is\ndifferent from that in the original paper [13]. SNN4HRL\u2019s performance, in terms of timesteps, is consistent with\nthe original paper.\n\n7\n\n\fHAAR without annealing adopts the same skill length as HAAR with annealing at the end of training,\nso that the \ufb01nal joint policies of two training schemes are the same in structure. The learning curves\nare presented in Figure 3. In general, training with skill length annealing helps the agent learn faster.\nAlso, annealing has no notable effect on the \ufb01nal outcome of training, because the \ufb01nal policies, with\nor without annealing, share the same skill length k eventually. We offered an explanation for this\neffect at the end of the Section 3.1.\n\n5.3 Visualization of Skills and Trajectories\n\nTo demonstrate how HAAR is able to achieve such an outperformance compared to other state-of-\nthe-art HRL methods, we provide a deeper look into the experimental results above. In Figure 4, we\ncompare the low-level skills before and after training in the Ant Maze task.\n\nS\n\nG\n\n(c)\n\nRepetitions\nSkill 0\nSkill 1\nSkill 2\nSkill 3\nSkill 4\nSkill 5\nNo Visitation\n\n(a)\n\n(b)\n\nFigure 4: (a) Visitation plot of initial low-level skills of the ant. (b) Low-level skills after training\nwith auxiliary rewards in Ant Maze. (c) Sample trajectories of the ant after training with HAAR in\nAnt Maze.\n\nIn Figure 4, (a) and (b) demonstrate a batch of experiences collected with low-level skills before and\nafter training, respectively. The ant is always initialized at the center and uses a single skill to walk\nfor an arbitrary length of time. Comparing (b) with (a), we note that the ant learns to turn right (Skill\n1 in yellow) and go forward (Skill 0 in red) and well utilizes these two skills in the Maze task in (c),\nwhere it tries to go to (G) from (S). We offer analysis for other experiments in Appendix C.\nIn our framework, we make no assumption on how those initial skills are trained, and our main\ncontribution lies in the design of auxiliary rewards to facilitate low-level control training.\n\n5.4 Transfer of Policies\n\nInterestingly, even though HAAR is not originally designed for transfer learning, we \ufb01nd out in\nexperiments that both \u21e1h and \u21e1l could be transferred to similar new tasks. In this section we analyze\nthe underlying reasons of our method\u2019s transferability.\nWe use the Ant Maze task shown in Figure 2(a) as the source task, and design two target tasks in\nFigure 5 that are similar to the source task. Target task (a) uses a mirrored maze (as opposed to the\noriginal maze in Figure 2(a)) and target task (b) is a spiral maze. Now we test the transferability of\nHAAR by comparing the learning curves of (1) transferring both high-level and low-level policies,\n(2) transferring the low-level alone, and (3) not transferring any policy. We randomly pick a trained\n\u21e1l and its corresponding \u21e1h from the learned policies in the experiment shown in Figure 2(a), and\napply them directly on tasks in Figure 5.\nHAAR makes no assumption on state space representation. Therefore, in experiments we only allow\nagents access to information that is universal across similar tasks. First, as de\ufb01ned in Section 2, sl\nis the ego-observation of the agent\u2019s joint angles. This ensures the low-level skills are unaware of\nits surroundings, hence limited to atomic actions and avoids the problem of the joint policy being\ndegenerated to always using the same low-level policy [11, 30].\nApart from information in sl, the high level can also perceive surrounding objects through a range\nsensor. We block its access to absolute coordinates so that the agent does not simply remember the\nenvironment, but learns to generalize from observation. Our experimental results in Figure 5 (c)(d)\n\n8\n\n\f(a)\n\n(b)\n\n(c)\n\n(d)\n\nFigure 5: (a) and (b) are tasks to test the transferability of learned policies. (c) and (d) are the\ncorresponding learning curves of transferring both high and low-level policies, transferring only\nlow-level policy, and not transferring (the raw form of HAAR).\n\nveri\ufb01es that both low-level and high-level policies are indeed transferable and can facilitate learning\nin a similar new task.\nFor both target tasks, there is a jump start of success rate by transferring both \u21e1h and \u21e1l. The learning\ncurve of target task (b) enjoys a very high jump start due to its trajectorical similarity to the source\ntask. Transferring both \u21e1h and \u21e1l results in very fast convergence to optimum. Transferring only \u21e1l\nalso results in signi\ufb01cantly faster training compared to non-transfer learning. This indicates that with\nHAAR, the agent learns meaningful skills in the source task (which is also analyzed by Figure 4). By\ncontrast, it is unlikely for works that rely on coordinates as part of the observation, such as [9], to\ntransfer their policies.\nWe want to point out that as the maze we use in this experiment is simple, the agent could possibly\nderive its location according to its observation, therefore still over-\ufb01tting the environment to some\nextent. However, using more complex mazes as source tasks may resolve this problem.\n\n5.5 Discussion of State Observability\n\nIn our experiments, the decision process on the high level is clearly an MDP since states are de\ufb01nitive\nfrom the observation. We notice that the low level states, however, are not fully observable. Direct\ninformation about the maze(walls and the goal) is excluded from the low level. Nevertheless,\nindirect information about the maze is expressed through ah, which is a function of wall and goal\nobservation. Strictly speaking, the low-level dynamics is a partially observable Markov decision\nprocess. But owing to the indirect information carried in ah, we use sl to approximate the complete\nstate and still apply TRPO on it. Experimental results verify the validity of such approximation. This\napproximation could be avoided by taking partial observability into consideration. For example, the\nGTRPO algorithm [34] can be utilized to optimize the low-level policy.\n\n6 Conclusion\n\nIn this work, we propose a novel hierarchical reinforcement learning framework, HAAR. We design\na concurrent training approach for high-level and low-level policies, where both levels utilize the\nsame batch of experience to optimize different objective functions, forming an improving joint\npolicy. To facilitate low-level training, we design a general auxiliary reward that is dependent only\non the high-level advantage function. We also discuss the transferability of trained policies under\nour framework, and to combine this method with transfer learning might be an interesting topic for\nfuture research. Finally, as we use TRPO for on-policy training, sample ef\ufb01ciency is not very high\nand computing power becomes a major bottleneck for our algorithm on very complex environments.\nTo combine off-policy training with our hierarchical structure may have the potential to boost sample\nef\ufb01ciency. As the low-level skill initialization scheme has a dramatic in\ufb02uence on performance, an\nexploration of which low-level skill initialization scheme works best is a future direction as well.\n\n9\n\n\fAcknowledgments\nThe authors would like to thank the anonymous reviewers for their valuable comments and helpful\nsuggestions. The work is supported by Huawei Noah\u2019s Ark Lab under Grant No. YBN2018055043.\n\nReferences\n[1] Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction, volume 1.\n\nMIT press Cambridge, 1998.\n\n[2] Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G\nBellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al.\nHuman-level control through deep reinforcement learning. Nature, 518(7540):529, 2015.\n\n[3] Volodymyr Mnih, Adria Puigdomenech Badia, Mehdi Mirza, Alex Graves, Timothy Lilli-\ncrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep\nreinforcement learning. In International conference on machine learning, pages 1928\u20131937,\n2016.\n\n[4] Shixiang Gu, Ethan Holly, Timothy Lillicrap, and Sergey Levine. Deep reinforcement learning\nfor robotic manipulation with asynchronous off-policy updates. In 2017 IEEE international\nconference on robotics and automation (ICRA), pages 3389\u20133396. IEEE, 2017.\n\n[5] Lei Tai, Giuseppe Paolo, and Ming Liu. Virtual-to-real deep reinforcement learning: Continuous\ncontrol of mobile robots for mapless navigation. In 2017 IEEE/RSJ International Conference\non Intelligent Robots and Systems (IROS), pages 31\u201336. IEEE, 2017.\n\n[6] Mostafa Al-Emran. Hierarchical reinforcement learning: a survey. International journal of\n\ncomputing and digital systems, 4(02), 2015.\n\n[7] Tianmin Shu, Caiming Xiong, and Richard Socher. Hierarchical and interpretable skill acquisi-\n\ntion in multi-task reinforcement learning. arXiv preprint arXiv:1712.07294, 2017.\n\n[8] Andrew Levy, George Konidaris, Robert Platt, and Kate Saenko. Learning multi-level hierar-\n\nchies with hindsight. 2018.\n\n[9] O\ufb01r Nachum, Shixiang (Shane) Gu, Honglak Lee, and Sergey Levine. Data-ef\ufb01cient hierarchical\nreinforcement learning. In Advances in Neural Information Processing Systems 31, pages 3303\u2013\n3313. 2018.\n\n[10] Tejas D Kulkarni, Karthik Narasimhan, Ardavan Saeedi, and Josh Tenenbaum. Hierarchical\ndeep reinforcement learning: Integrating temporal abstraction and intrinsic motivation. In\nAdvances in Neural Information Processing Systems 29, pages 3675\u20133683. Curran Associates,\nInc., 2016.\n\n[11] Alexander Sasha Vezhnevets, Simon Osindero, Tom Schaul, Nicolas Heess, Max Jaderberg,\nDavid Silver, and Koray Kavukcuoglu. Feudal networks for hierarchical reinforcement learning.\nIn International Conference on Machine Learning, pages 3540\u20133549, 2017.\n\n[12] Zach Dwiel, Madhavun Candadai, Mariano J. Phielipp, and Arjun K. Bansal. Hierarchical\n\npolicy learning is sensitive to goal space design. arXiv e-prints, 2019.\n\n[13] Carlos Florensa, Yan Duan, and Pieter Abbeel. Stochastic neural networks for hierarchical\nreinforcement learning. In Proceedings of The 34th International Conference on Machine\nLearning, 2017.\n\n[14] Nicolas Heess, Greg Wayne, Yuval Tassa, Timothy Lillicrap, Martin Riedmiller, and David\n\nSilver. Learning and transfer of modulated locomotor controllers. arXiv e-prints, Oct 2016.\n\n[15] Benjamin Eysenbach, Abhishek Gupta, Julian Ibarz, and Sergey Levine. Diversity is all you\n\nneed: Learning skills without a reward function. arXiv e-prints, Feb 2018.\n\n[16] John Schulman, Sergey Levine, Philipp Moritz, Michael I. Jordan, and Pieter Abbeel. Trust\n\nregion policy optimization. In ICML, 2015.\n\n10\n\n\f[17] Yan Duan, Xi Chen, Rein Houthooft, John Schulman, and Pieter Abbeel. Benchmarking deep\nreinforcement learning for continuous control. arXiv e-prints, page arXiv:1604.06778, Apr\n2016.\n\n[18] George Konidaris and Andrew Barto. Autonomous shaping: Knowledge transfer in reinforce-\nment learning. In Proceedings of the 23rd international conference on Machine learning, pages\n489\u2013496. ACM, 2006.\n\n[19] George Konidaris and Andrew G Barto. Building portable options: Skill transfer in reinforce-\n\nment learning. In IJCAI, volume 7, pages 895\u2013900, 2007.\n\n[20] Abhishek Gupta, Coline Devin, YuXuan Liu, Pieter Abbeel, and Sergey Levine. Learn-\ning invariant feature spaces to transfer skills with reinforcement learning. arXiv preprint\narXiv:1703.02949, 2017.\n\n[21] Richard S Sutton. Temporal credit assignment in reinforcement learning. 1985.\n[22] Kevin Frans, Jonathan Ho, Xi Chen, Pieter Abbeel, and John Schulman. Meta learning shared\n\nhierarchies. In International Conference on Learning Representations, 2018.\n\n[23] John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, and Pieter Abbeel. High-\ndimensional continuous control using generalized advantage estimation. arXiv preprint\narXiv:1506.02438, 2015.\n\n[24] Peter Dayan and Geoffrey E Hinton. Feudal reinforcement learning. In S. J. Hanson, J. D.\nCowan, and C. L. Giles, editors, Advances in Neural Information Processing Systems 5, pages\n271\u2013278. Morgan-Kaufmann, 1993.\n\n[25] Richard S. Sutton, Doina Precup, and Satinder Singh. Between MDPs and semi-MDPs: A\nframework for temporal abstraction in reinforcement learning. Artif. Intell., 112(1-2):181\u2013211,\nAugust 1999.\n\n[26] Thomas G. Dietterich. Hierarchical reinforcement learning with the MAXQ value function\n\ndecomposition. J. Artif. Int. Res., 13(1):227\u2013303, November 2000.\n\n[27] Nuttapong Chentanez, Andrew G. Barto, and Satinder P. Singh. Intrinsically motivated re-\ninforcement learning. In L. K. Saul, Y. Weiss, and L. Bottou, editors, Advances in Neural\nInformation Processing Systems 17, pages 1281\u20131288. MIT Press, 2005.\n\n[28] Siyuan Li, Fangda Gu, Guangxiang Zhu, and Chongjie Zhang. Context-aware policy reuse.\n\narXiv preprint arXiv:1806.03793, 2018.\n\n[29] Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with Gumbel-Softmax.\n\nIn International Conference on Learning Representations, 2017.\n\n[30] Pierre-Luc Bacon, Jean Harb, and Doina Precup. The option-critic architecture. In AAAI, pages\n\n1726\u20131734, 2017.\n\n[31] Dibya Ghosh, Abhishek Gupta, and Sergey Levine. Learning actionable representations with\n\ngoal-conditioned policies. arXiv e-prints, Nov 2018.\n\n[32] O\ufb01r Nachum, Shixiang Gu, Honglak Lee, and Sergey Levine. Near-optimal representation\n\nlearning for hierarchical reinforcement learning. arXiv e-prints, Oct 2018.\n\n[33] Sam Michael Devlin and Daniel Kudenko. Dynamic potential-based reward shaping.\n\nIn\nProceedings of the 11th International Conference on Autonomous Agents and Multiagent\nSystems, pages 433\u2013440. IFAAMAS, 2012.\n\n[34] Kamyar Azizzadenesheli, Manish Kumar Bera, and Animashree Anand kumar. Trust region\n\npolicy optimization for POMDPs. arXiv e-prints, page arXiv:1810.07900, Oct 2018.\n\n11\n\n\f", "award": [], "sourceid": 812, "authors": [{"given_name": "Siyuan", "family_name": "Li", "institution": "Tsinghua University"}, {"given_name": "Rui", "family_name": "Wang", "institution": "Stanford University"}, {"given_name": "Minxue", "family_name": "Tang", "institution": "Tsinghua University"}, {"given_name": "Chongjie", "family_name": "Zhang", "institution": "Tsinghua University"}]}