Diversity Enriched Option-Critic

Anand Kamat 1,2, Doina Precup 1,2,3


Abstract

Temporal abstraction allows reinforcement learning agents to represent knowledge and develop strategies over different temporal scales. The option-critic framework has been demonstrated to learn temporally extended actions, represented as options, end-to-end in a model-free setting. However, feasibility of option-critic remains limited due to two major challenges, multiple options adopting very similar behavior, or a shrinking set of task relevant options. These occurrences not only void the need for temporal abstraction, they also suppress performance. In this paper, we tackle these problems by learning a diverse set of options. We introduce an information-theoretic intrinsic reward, which augments the task reward, as well as a novel termination objective, in order to encourage behavioral diversity in the option set. We show empirically that our proposed method is capable of learning options end-to-end on several discrete and continuous control tasks, outperforms option-critic by a wide margin. Furthermore, we show that our approach sustainably generates robust, reusable, reliable and interpretable options, in contrast to option-critic.

1 Introduction↩︎

The ability of reinforcement learning (RL) agents to solve very large problems efficiently depends on building and leveraging knowledge that can be re-used in many circumstances. One type of such knowledge comes in the form of options [1], [2], temporally extended actions that can be viewed as specialized skills which can improve learning and planning efficiency [2], [3]. The option-critic framework [4] proposed a formulation to learn option policies as well as the termination conditions end-to-end, through gradient descent, just from the agent’s experience and rewards. However, this can lead to the option set collapsing in various ways [4], [5], for example options becoming primitive actions, one option learning to solve the entire task and dominating the others, or several options becoming very similar. These degeneracies not only negatively impact the agent’s ability to re-use the learned option set in new situations, they often hurt performance. Furthermore, learning options in a model-free setting is often accompanied with increased sample and computational complexity over primitive action policies, without the desired performance improvements. This raises the fundamental question of why temporal abstraction is needed, especially when a primitive action policy achieves comparable results. There have been attempts to tackle the problem of options collapsing onto multiple copies of the optimal policy [4], [5] as well as ensuring that options do not shrink too much over time [6]. However, finding a solution that can easily generalize over a wide range of tasks with minimal human supervision is still an ongoing challenge. In this paper, we tackle the problem by constructing a diverse set of options, which can be beneficial to increase exploration as well as for robustness in learning challenging tasks [5], [7], [8]. A common approach for encouraging diversity in a policy is entropy regularization [9], [10], but it does not capture the idea of the set of options itself containing skills that differ from each other. Unlike in the case of primitive action policies where each action is significantly distinct, options often learn similar skills reducing the effectiveness of entropy regularization. To address this issue, we use intrinsic motivation. Augmenting the standard maximum reward objective with auxiliary bonus have encouraging results in promoting good exploration and performance [11][13]. We introduce an auxiliary reward which, when combined with the task reward, encourages diversity in the policies of the options. We empirically show how this diversity can help options explore better on several standard continuous control tasks. We then focus on option termination. The termination objective used in option-critic [4] increases the likelihood of an option to terminate if the value of the current option is sub-optimal with respect to another. Though logical, this objective tends to suppress the worse option quickly without adequate exploration, often resulting in a single option dominating over the entire task [4][6]. To overcome this, we also propose a novel termination objective which produces diverse, robust and task relevant options. Our approach suggests that instead of having options compete for selection, adequate exploration of available options should be encouraged so long as they exhibit diverse behavior. Upon testing this new objective quantitatively and qualitatively in a classic tabular setting as well as several standard discrete and continuous control tasks, we demonstrate that our approach achieves a new state-of-the-art performance. Furthermore, our approach demonstrates significant improvements in robustness, interpretibility and reusability of specialized options in transfer learning.

a

b

c

Figure 1: Diversity-Enriched Option-Critic (DEOC) compared against Option-Critic (OC). Each plot is averaged over 20 independent runs..

2 Background↩︎

In RL, an agent interacts with an environment typically assumed to be a Markov Decision Process (MDP) \(\mathcal{M} = (\mathcal{S}, \mathcal{A},\gamma, r, \mathcal{P})\) where \(\mathcal{S}\) is the set of states, \(\mathcal{A}\) is the action set, \(\gamma \in [0,1)\) is the discount factor, \(r:\mathcal{S} \times \mathcal{A} \rightarrow \mathbb{R}\) is the reward function and \(\mathcal{P} :\mathcal{ S} \times \mathcal{A} \times \mathcal{S} \rightarrow [0, 1]\) is the transition dynamics. A policy \(\pi\) is a probabilistic distribution over actions conditioned on states, \(\pi: \mathcal{S} \times \mathcal{A} \rightarrow [0, 1]\) . The value function of a policy \(\pi\) is the expected discounted return \(V_{\pi}(s) = \mathbb{E}_{\pi} \Big[ \sum_{t=0}^{\infty} \gamma^{t}r_{t+1}|s_{0} = s \Big]\). Policy gradient methods aim to find a good policy by optimizing the expected return over a given family of parameterized stochastic policies \(\pi_{\theta}\). Policy improvement is carried out by performing stochastic gradient ascent over the policy parameters. Techniques for defining useful abstractions through hierarchy have sparked a lot of interest [1], [2], [14][18]. We use the options framework [1], [2], which formalizes temporal abstraction by representing knowledge, learning and planning over different temporal scales. An option o is a temporally extended action represented as a triple (\(\mathcal{I_{\textit{o}}, \pi_{\textit{o}}, \beta_{\textit{o}} }\)) where \(\mathcal{I_{\textit{o}} \subseteq S }\) is an initiation set, \(\pi_{\textit{o}}\) is an intra-option policy and \(\beta_{\textit{o}}\): \(\mathcal{S} \rightarrow [0,1]\) is a termination function. The policy over options \(\pi_{\Omega}\), selects an option from those available at a given state and executes it until termination. Upon termination, \(\pi_{\Omega}\) selects a new option and this process is repeated. The option-critic architecture [4] is a gradient-based method for learning options end-to-end without explicitly providing any sub-goals, by updating the parameters of intra-option policies \((\theta_{\pi})\) and terminations (\(\theta_{\beta}\)). The termination gradient in option-critic [4] states that at a state, if the value of an option is sub-optimal compared to the value of the policy over options, the likelihood of its termination should be increased. as follows: \[\label{eq95terminationgradient} \frac{ \partial L(\theta) }{ \partial \theta_{\beta} } = \mathbb{E} \bigg[- \frac{ \partial \beta (S_{t},O_{t}) }{ \partial \theta_{\beta} } A(S_{t},O_{t}) \bigg]\tag{1}\] where \(A(S_{t},O_{t}) = Q_{\pi}(S_{t},O_{t}) - V_{\pi}(S_{t})\) is the termination advantage function.

Since primitive actions are sufficient for learning any MDP, options often degenerate [4]. Several techniques have been proposed to tackle this problem [4][6]. In the next two sections, we outline the main idea for our approach: encouraging diversity in option policies and encouraging the options to terminate in diverse locations.

3 Encouraging Diversity While Learning↩︎

A good reward function can capture more than just information required to perform the task. In this section, we highlight the importance of diversity in options and an approach to achieve it using intrinsic motivation. We design a pseudo-reward signal complementing the task reward in order to encourage diversity. While most relevant literature on learning diverse options [5], [7], [8] use states to distinguish and specialize options, we instead look directly at an option’s behavior to assess its diversity. This idea is well suited when all options are available everywhere, when the state information is imperfect (for example, because the latent representation of the state is still being learned), and when the agent aims to transfer knowledge across tasks. This approach allows the agent to effectively reuse specialized options [4]. For example, an option specialized in leaping over hurdles can be reused if and when the agent encounters a hurdle anywhere in its trajectory. We study reusability and transfer characteristics of options in Section 5.1. For simplicity of exposition, we use two options in our notation in this chapter; however the approach can be easily extended to any number of options. An empirical study with varying number of options are presented in Appendix 9. We construct our pseudo reward function using concepts from information theory. Maximizing the entropy of a policy prevents the policy from quickly falling into a local optimum and has been shown to have substantial improvements in exploration and robustness [9], [10], [19]. We maximize the entropy \(\mathcal{H}( A^{\pi_{\text{\text{O}}_{1}}} \mid S)\) and \(\mathcal{H}( A^{\pi_{\text{\text{O}}_{2}}} \mid S)\) where \(\mathcal{H}\) is the Shannon entropy computed with base e and \(A\) represents respective action distributions. Since we want different options behave differently from each other at a given state, we maximize the divergence between their action distributions \(\mathcal{H}(A^{\pi_{\text{\text{O}}_{1}}}; A^{\pi_{\text{\text{O}}_{2}}}\mid S)\). This aligns with our motivation that skill discrimination should rely on actions. Lastly, we seek to maximize the stochasticity of the policy over options \(\mathcal{H}( O^{\pi_{\Omega}} \mid S)\) to explore all available options at \(S\). Combining all the above terms, we get the following pseudo reward \(\mathcal{R}_{bonus}\): \[\begin{align} \label{eq95pseudoreward} \mathcal{R}_{bonus} &= \mathcal{H}(A^{\pi_{\text{\text{O}}_{1}}} \mid S) + \mathcal{H}(A^{\pi_{\text{\text{O}}_{2}}} \mid S) \nonumber \\ &+ \mathcal{H}( O^{\pi_{\Omega}} \mid S) + \mathcal{H}(A^{\pi_{\text{\text{O}}_{1}}}; A^{\pi_{\text{\text{O}}_{2}}}\mid S) \end{align}\tag{2}\] The first three terms in Eq. 2 seeks to increase the stochasticity of the policies and the fourth term encourages overall diversity in options. Since we use entropy regularization for policy updates in all our implementations as well as baseline experiments, we only use \(\mathcal{H}(A^{\pi_{\text{\text{O}}_{1}}}; A^{\pi_{\text{\text{O}}_{2}}}\mid S)\) as our pseudo reward, \(\mathcal{R}_{bonus}\), highlighting the significance of diversity in the option set.

We incorporate this objective within the standard RL framework by augmenting the reward function to include the pseudo reward bonus from Eq. 2 : \[\label{Eq95reward95augmentation} \mathcal{R}_{aug}(S_{t},A_{t}) = (1 - \tau)R(S_{t},A_{t}) + \tau \mathcal{R}_{bonus}(S_{t})\tag{3}\] where \(\tau\) is a hyper-parameter which controls relative importance of the diversity term against the reward. The proposed reward augmentation yields the maximum diversity objective. The standard RL objective can be recovered in the limit as \(\tau \rightarrow 0\). To demonstrate the benefits of maximizing diversity through augmenting the reward, we test our algorithm, Diversity-Enriched Option-Critic (DEOC), against Option-Critic (OC) in classic Mujoco [20] environments. We use the same hyper-parameter settings across all 20 seeds in all our experiments throughout the paper to test stability. Fig. 1 shows that encouraging diversity improves sample efficiency as well as performance. Details regarding implementation and choices for the underlying algorithm, PPO [21], are provided in Appendix 15.3.

4 Encouraging Diversity in Termination↩︎

In Section 3, we empirically demonstrate that encouraging diversity in option policies improves exploration and performance of option-critic. However, unlike primitive action policies where all actions are available at every step, options execute for variable time steps until a termination condition is met, during which, all other options remain dormant. Due to this, the maximum entropy objective fails to be as effective with options as with primitive action policies. Although having options terminate at every time step may solve this problem, it renders the use of options moot. Additionally, option-critic’s termination function solely validates the best option, suppressing other potentially viable options which may also lead to near-optimum behavior. As a consequence, at a given state, only the best current option gets updated, eventually leading to a single option dominating the entire task. Noise in value estimates or state representations may also cause an option to terminate and consequently lead to the selection of a sub-optimal option. Selecting a sub-optimal option around “vulnerable” states can be catastrophic and also severely hurt performance. In our case, despite \(\mathcal{R}_{bonus}(s,a)\) encouraging diverse options, option-critic’s termination function prevents exploiting this diversity due to inadequate exploration of all relevant options. We tackle these problems by encouraging all options available at a given state to be explored, so long as they exhibit diverse behavior.
In this section we present a novel termination objective which no longer aims to maximize the expected discounted returns, but focuses on the option’s behavior and identifying states where options are distinct, while still being relevant to the task. We build our objective function to satisfy the following two conditions:

  • Options should terminate in states where the available options are diverse. In the classic four-rooms task [1], such states would be the hallways. Terminations localized around hallways have shown significant improvements in performance in the transfer setting [4].

  • The diversity metric used in the termination objective should capture the diversity relative to other states in the sampled trajectories. This prevents options terminating at every step while exploiting diversity effectively for exploration and stability.

Figure 2: Termination-DEOC (TDEOC) algorithm with tabular intra-option Q-Learning

The termination objective we maximize becomes: \[\label{eq95deocobjective} L(\theta_{\beta}) = \mathbb{E} \big[\beta(S_{t},O_{t}) \mathcal{D}(S_{t}) \big]\tag{4}\] The term \(\mathcal{D}(S_{t})\) indicates the relative diversity of options at a given state. We compute \(\mathcal{D}(S_{t})\) by standardizing (with a mean \(\mu=0\), and standard deviation \(\sigma=1\)), the samples of \(\mathcal{R}_{bonus}(S_{t})\) defined in Eq. 2 , collected in the buffer. \[\label{eq95standardize} \mathcal{D}(S_{t}) = \frac{\mathcal{R}_{bonus}(S_{t}) - \mu_{\mathcal{R}_{bonus}}}{ \sigma_{\mathcal{R}_{bonus}}}\tag{5}\] Our approach solves the issue of constant termination at all states, and the updates are scaled appropriately relative to the diversity values of other states in the buffer. Terminating while options are most diverse encourages both options to be selected fairly and explored by the policy over options.

Theorem 1. Given a set of Markov options \(\Omega\) each with a stochastic termination function defined by Eq. 4 and stochastic intra-option policies, with \(|\Omega|<\infty\) and \(|\mathcal{A}|<\infty\), repeated application of policy-options evaluation and improvement [4], [22] yields convergence to a locally optimum solution.

Proof. See Appendix 8.

Note that as with \(\mathcal{R}_{bonus}(S_{t})\), \(\mathcal{D}(S_{t})\) is independent of the termination parameters. An added advantage of using relative diversity is the agent’s ability to respond to events or obstacles in its trajectory. Such events characterize some of the most sensitive states in the environment. The relative diversity \(\mathcal{D}(S_{t})\) in our objective is capable of identifying such states, causing both options to collectively explore and learn the event. We study transfer characteristics further in Section 5.1.

5 Experiments↩︎

We evaluate the effects of the new termination objective on several tasks, to test its performance and stability. The pseudo-code of the algorithm, Termination-DEOC (TDEOC), is presented in Algorithm 2. Implementation details are provided in Appendix 15.

a

b

Figure 3: Visualization of Terminations for different options after 1000 episodes. Darker colors correspond to higher termination likelihood. Both TDEOC and OC show higher terminations around hallways..

a

Figure 4: Four-rooms transfer experiment with four options. After 1000 episodes, the goal state, is moved from the east hallway to a random location in the south east room. TDEOC recovers faster than OC with a difference of almost 70 steps when the task is changed. Each line is averaged over 300 runs..

a

b

c

d

e

f

g

h

i

Figure 5: TDEOC results on standard Mujoco and Miniworld tasks. Our proposed termination objective significantly improves exploration, performance, and each option’s relevance to the task. Option activity refers to number of steps during which the option (Opt1 or Opt2) was active for buffer samples generated at respective time steps. Each plot is averaged over 20 independent runs..

Tabular Four-rooms Navigation Task We first test our algorithm TDEOC, on the classic four-rooms navigation task [1] where transfer capabilities of options were demonstrated against primitive action frameworks [4]. Initially the goal is located in the east hallway and the agent starts at a uniformly sampled state. After 1000 episodes, the goal state is moved to a random location in the lower right room. The goal state yields a reward of +1 while all other states produce no rewards. Visualizations of option terminations (Fig. 3) show that TDEOC identifies the hallways as the ‘bottleneck’ states where options tend to grow diverse. Fig. 4 shows that both TDEOC and OC have nearly the same learning speed for the first 1000 episodes. Upon changing the goal state, TDEOC recovers faster than OC by almost 70 steps while exhibiting lower variance.

a

b

c

d

e

f

g

h

i

Figure 6: TDEOC results on three transfer tasks in Mujoco each averaged over 20 independent runs. The height of the hurdle in HalfCheetahWall-v0 is increased by 0.8 metres after 2e6 steps. For HopperIceWall-v0, the block is moved 0.5 metres away from the agent’s starting point after 1e6 steps. As for TMaze, the most frequent goal is removed after 2e5 steps..

Continuous Control Tasks Next, we show the advantages of a diversity-targeted termination in the non-linear function approximation setting using standard Mujoco tasks [20]. We tested the performance of the TDEOC algorithm against Option-Critic (OC) and PPO [21]. Fig. 5 shows that while OC quickly stagnates to a sub-optimal solution, TDEOC keep improving. We believe the reason for OC’s stagnation is caused by sub-optimal option selection caused by terminations due to noisy value estimates. Since the sub-optimal option isn’t adequately explored, it leads to the selection of a sub-optimal action, which can be catastrophic in states where balance is vital. TDEOC, on the other hand, learns to generate diverse yet relevant option trajectories, thereby gaining better control. This explains why TDEOC handles environment perturbations more robustly. To demonstrate this property, we visualize the activity of each option for TDEOC and OC, in terms of the number of steps the option was active for buffer samples generated at respective time steps. (Fig. 5 (g), 5 (h), 5 (i)). Unlike OC, where only one option stays relevant for the task, TDEOC encourages both options to be selected fairly. TDEOC achieves a new state-of-the-art performance, not only outperforming OC by a wide margin, but also PPO. Our approach easily extends to very complex high dimensional tasks such as Humanoid-v2. TDEOC also exhibits lower variance demonstrating stable results across various random seeds despite using the same hyper-parameter settings. See Appendix 10 for additional results. TDEOC however, exhibits slower learning during the initial phase. This is to be expected, as TDEOC grooms both options to remain relevant and useful, while OC only updates a single dominant option, which requires fewer samples. We study the critical states which inspire diversity in Section 5.2.
Sparse Reward Tasks We evaluate our approach in 3D visual control tasks implemented in Miniworld [23] with discrete actions and a visual sensory input. We consider the T-Maze and Sidewalk environment. We observe that while OC stagnates to a sub-par solution for both tasks, TDEOC manages to learn a better solution faster (Fig. 5). TDEOC even outperforms PPO in Sidewalk, despite the added complexity of learning a hierarchy. We can also observe significantly lower variance in the TDEOC plots.

5.1 Evaluating Transfer↩︎

A key advantage of using options is to learn skills which can be reused in similar tasks. In Section 5, we studied this property in the tabular four-rooms task. In this section, we further test our approach on tasks which require adapting to changes. The benefits of using options are best observed in tasks where hierarchical representation can be exploited.
HalfCheetah Hurdle Through this experiment we evaluate the ability of the agent to react to changes happening later in the trajectory. Reusing the HalfCheetah-v2 environment, a hurdle of height 0.12 metres is placed 10m away from the agent’s starting position. After two million steps, the height of the hurdle is increased by 0.8 metres (to 2 metres). Not only does TDEOC learn faster than option-critic and PPO (Fig. 6 (a)), it also adapts to the change quicker. TDEOC also keeps improving after recovery while PPO’s and OC’s performances stagnate. Despite OC being more robust to transfer [4], PPO recovers faster than OC, as indicated by a smaller difference in performance after recovery than before. This suggests higher velocity can cause increased instability during recovery.
Hopper Ice Wall We add a friction-less block in the Hopper-v2 task with dimensions (0.25m, 0.4m, 0.12m) corresponding to its length, width and height respectively, 2.8 metres away from the agent’s starting position. After a million steps, the block is moved 0.5 metres away from the agent’s starting position. Initially, TDEOC and option-critic have a similar rate of improvement. However, after the change, TDEOC learns to stabilize better and keeps improving (Fig. 6 (b)).
TMaze Continuous We use a task similar to the sparse reward task TMaze from Miniworld [24]. There are two goals located at both ends of the hallway, each producing a reward of +1. After 200,000 steps, the goal most visited is removed, forcing the agent to seek the other goal. Although OC initially recovers from the change better, TDEOC surpasses OC, achieving better final performance (Fig. 6 (c)).

5.2 Interpreting Options Behavior↩︎

Learning tasks hierarchically through options can help us better understand the agent’s solution. In this section, we study qualitatively the states targeted by TDEOC and the corresponding options behavior. Videos of all our experiments are provided on our website 1.

a

b

c

d

Figure 7: Visualizations on TMaze task using two options (marked red and yellow respectively in (a) and (b)). Option terminations localize in the vertical hallway where the agent has yet to decide which goal to navigate towards..

Figure 8: Sample trajectory of the Hopper-v2 task. Terminations are localized near states where the agent is in the air. Both options collaborate to ensure proper posture and balance prior to descending.

TMaze We visualize option behaviors and terminations for the TMaze transfer task from Section 5.1. Figure 7 visualize a sample run where options terminate in the vertical hallway. Once the target goal is determined, a single option navigates towards it. This seems very intuitive, as the choice of navigating to either of the goals is still open in that hallway, indicating that the options are capable of diverse strategies each focused on a specific goal. Therefore, the termination objective we proposed gives rise to intuitive and reusable option behaviors.
Hopper-v2 Next, we consider the Hopper-v2 simulation from Mujoco. From Fig. 8, we can see that options terminate when the agent is in the air, just before descending. Naturally, landing without losing balance is very important, as even a slight mistake can cause catastrophic outcomes. TDEOC manages to employ both options around these states to complement each other, thereby achieving robust control and proper balance (See Appendix 12).
OneRoom We consider the OneRoom task from Miniworld. We visualize a sample trajectory (Fig. 9) where one option learns to scan the room by turning on the spot, and upon observing the goal, the second option navigates towards it (see results in Appendix 13). The termination objective hence gives rise to intuitive option strategies.

Figure 9: Option trajectories in OneRoom task. The first options scans the environment for the goal while the other option moves forward towards it.

6 Related work↩︎

Over the years, identifying bottleneck states as useful sub-goals for options has had lot of success [17], [25], [26]. Our approach can be seen to target bottleneck states characterized by diversity in the induced option set. Unsupervised skill discovery using diversity has also shown to be capable of learning challenging tasks using an information theoretic objective [7], [8]. Our algorithm however, exploits a novel behavioral diversity metric for option discovery while also being capable of learning the task simultaneously. While most similar works use states to distinguish and specialize options [5], [7], [8], our approach exploits option’s behavior. Additionally, our approach can learn reusable and interpretable options even though we do not explicitly shape the initiation set [24], [27]. Intrinsic motivation and reward modifications have been very successful in inducing certain desirable properties in RL algorithms, such as efficient exploration [13], [28][30]. Our approach falls in this category as well. A lot of literature relates to learning reward functions to improve performance [11], [31], generalization and robustness [12], and we would like to investigate the utility of such methods in learning options as well.

7 Discussions and Future Work↩︎

In this paper, we highlighted the importance of learning a diverse set of options end-to-end. Inspired by intrinsic motivation, we presented Diversity-Enriched Option-Critic (DEOC), and proposed a novel diversity-targeted, information theoretic termination objective capable of generating diverse option strategies to encourage exploration and make the learning more reliable. The new termination objective, coupled with DEOC’s reward augmentation, produces relevant, robust and useful options. Our proposed algorithm, Termination-DEOC (TDEOC), significantly outperforms option-critic as well as PPO on a wide range of tasks. TDEOC can potentially benefit in scaling tasks to longer horizons. In the future, we would like to further investigate general methods for inferring reward functions and optimization criteria that lead to efficient exploration and transfer in new domains. [32] [33] [34] [35]

8 Proof Theorem 1↩︎

Given a set of Markov options \(\Omega\) each with a stochastic termination function defined by Eq. 4 and stochastic intra-option policies, with \(|\Omega|<\infty\) and \(|\mathcal{A}|<\infty\), repeated application of policy-options evaluation and improvement [4], [22] yields convergence to a locally optimum solution.
We continue the same assumptions and proofs derived by [4], [22]. The termination functions (\(\beta\)) and the intra-option policies (\(\pi_{o}\)) are differentiable in their respective parameters, \(\nu\) and \(\theta\). Also, the parameters of the termination functions, \(\nu\), and that of the intra-option policies, \(\theta\), are independent [4]. We use the TDEOC algorithm with tabular intra-option Q-learning as a template for our proof. An \(\epsilon\)-greedy policy over options \(\pi_{\Omega}\) is used. We reuse the notations and terminologies defined by [4]. The option-value function is defined as: \[Q_{\Omega}(s,o) = \sum_{a \in \mathcal{A}} \pi_{o}(a|s) Q_{U}(s,o,a)\] \(Q_{U}: S \times \Omega \times \mathcal{A} \rightarrow \mathbb{R}\) is the value of executing the option in the context of state-option pair. \(Q_{U}\) is evaluated using the one-step off-policy update defined as: \[\label{eq95q95update} Q_{U}(s,o,a) \leftarrow Q_{U}(s,o,a) + \alpha \Big[ r(s,a) + \gamma \big[ (1 - \beta_{o}(s'))Q_{\Omega}(s',o) + \beta_{o}(s') \max_{\overline{o}} Q_{\Omega}(s',\overline{o}) \big] \Big]\tag{6}\] where \(\alpha\) is the step size and the update target, \(\delta\) is given by: \[\delta = r(s,a) + \gamma \big[ (1 - \beta_{o}(s'))Q_{\Omega}(s',o) + \beta_{o}(s') \max_{\overline{o}} Q_{\Omega}(s',\overline{o}) \big]\] Now we present the intra-option policy optimization equations for option improvement. The objective to be maximized is the expected discounted return: \[\mathcal{J}(\theta) = Q_{\Omega}(s,o)\] where \(\theta\) represents the parameters of the intra-option policies. [4] have derived the intra-option gradient [4], [22] for option policy improvement as: \[\frac{\partial \mathcal{J}(\theta)}{\partial \theta} = \sum_{s.o} \mu_{\Omega}(s,o|s_{0},o_{0}) \sum_{a} \frac{\partial log \pi_{o}(a | s)}{\partial \theta} Q_{U}(s, o, a)\] where \(\mu_{\Omega}(s_{0}, o_{0})\) is the discounted weighting of state-option pair along trajectories starting from \((s_{0}, o_{0})\). Under assumption: \[\label{eq95step95size} \sum_{t=0}^{\infty} \alpha^{\{\theta\}}_{t} = \infty \:\: and \:\: \sum_{t=0}^{\infty} \big[\alpha^{\{\theta\}}_{t}\big]^{2} < \infty\tag{7}\] then the sequence \(\{\theta_{t}\}_{t=0}^{\infty}\) \[\theta_{t+1} \leftarrow \theta_{t} + \alpha_{t}^{\{\theta\}} \frac{\partial log \pi_{o_{t}}(a_{t} | s_{t})}{\partial \theta} Q_{U}(s_{t}, o_{t}, a_{t})\] converges with probability 1 and the \(\lim_{t \rightarrow \infty} \frac{\partial \mathcal{J}(\theta)}{\partial \theta} = 0\) [4], [22]. As for the one-step off-policy intra-option Q learning update in Eq. 6 , we can apply the same convergence properties used by [36] to show \(Q_{U}\) converges to optimal behavior, \(Q^{*}_{U}\) with probability 1 under the same conditions on sequence of step size as in Eq. 7 . To understand it intuitively, the intra-option gradient updates converges intra-option policies to a locally optimum behavior while the \(\epsilon\)-greedy policy over options, \(\pi_{\Omega}\), greedily selects the option with the highest value upon termination.

Hence, our termination condition still allows policy-option iteration to converge to a locally optimum solution. The rate of convergence, however, may vary depending on the termination function. The termination function during option evaluation is used to evaluate the value function \(Q_{U}(s_{t}, o_{t}, a_{t})\), based on the stochastic likelihood of the current option continuing or terminating at the given state. Upon termination, the option with the highest value at that state is selected for evaluation. The structure of the termination function is irrelevant for evaluating and improving options, and is solely used to define the scope of option’s abstraction. [22] also derived a proof showing that a fixed termination function leave the convergence properties unaffected. The advantages of our proposed termination objective are mainly empirical. The assumptions \(|\Omega|<\infty\) and \(|\mathcal{A}|<\infty\) are required to ensure the intrinsic reward and the termination function are bounded.

9 Effects of Varying the Number of Options↩︎

Option-critic framework assumes the number of options to be learnt, to be a hyper-parameter. To ensure reproducible results and fair comparisons, the choice of this hyper-parameter for all experiments presented in the paper relied mainly on previously tested experiments (refer Appendix 15). We reuse the PPOC codebase [37], [38] for all our experiments involving non-linear function approximation. PPOC has only been tested on two options [38] as of yet. However, to demonstrate that our algorithm TDEOC, easily generalizes to most tasks and implementation settings effortlessly, we study its performance while varying the number of options on standard Mujoco tasks. TDEOC’s ability to encourage all available options to remain relevant to the task affects sample complexity. From Fig. 10 we can observe that sample complexity increases as the number of options increase. However, TDEOC still shows similar learning curves and properties despite varying the number of options and still outperforms OC using same number of options (Fig. 12 and 13).

a

b

c

d

Figure 10: TDEOC results on four Mujoco tasks with varying number of options. Sample complexity keeps growing with increasing the number of options. Each line is an average of 20 runs..

a

b

c

d

Figure 11: Option-Critic results on four Mujoco tasks with varying number of options. Each line is an average of 20 runs..

a

b

c

d

Figure 12: TDEOC and OC results on four Mujoco tasks with three options. Each line is an average of 20 runs..

a

b

c

d

Figure 13: TDEOC and OC results on four Mujoco tasks with four options. Each line is an average of 20 runs..

10 Option Relevance↩︎

In the paper we emphasize the importance of options simultaneously learning to remain relevant and useful for the task. In this section we empirically demonstrate how our approach of using a diversity motivated termination objective encourages both options to be explored fairly, thereby preventing a single option dominating over the entire task. In this section, we contrast our algorithm (TDEOC) using our proposed termination objective against Option-Critic(OC). We plot each option’s activity in respective tasks for both algorithms. Option’s activity corresponds to the number of steps it was active for buffer samples generated at respective time steps. Option 1 (indicated with Opt1 in the plots) refers to the dominant option in each task while option 2 (Opt2) is the option which was active for fewer steps compared to option 1 for each run. Each line is an average of 20 runs. It is evident that TDEOC manages to explore and select both options much better than OC. The difference is significant in Mujoco tasks where one option quickly dominates over the entire task. We can reason TDEOC’s performance in Fig. 5 with how TDEOC exploits both the diverse options to to achieve better performance and stability.

a

b

c

d

e

Figure 14: Plots represent the average activity of each option for TDEOC and OC. The plots compare how the termination conditions used for TDEOC and OC contribute towards option activity. Mujoco and Miniworld experiments are recorded until two million steps and ten million steps for Humanoid-v2. Each line represents an average over 20 independent runs..

11 DEOC Results↩︎

We present empirical results (Fig. 15) comparing DEOC against TDEOC and Option-Critic (OC) in this section. DEOC runs were omitted from Fig. 5 for clarity and to retain emphasis on TDEOC’s performance against option-critic. While DEOC shows noticeable improvement in exploration and performance over OC, DEOC still suffers from degeneration as the updates are still the same as that of option-critic’s. This is very observable in the Walker2d-v2 task (Fig. 15 (c)) where DEOC and OC suffer a drop in performance as one of the option dominates leading to a sub-optimal control by the least dominant option when selected due to noisy value or state estimates. TDEOC on the other hand generates useful and complementary options which explains its superior performance.

a

b

c

d

e

Figure 15: Empirical results showing DEOC runs along with TDEOC and OC. Each line represents an average over 20 independent runs..

12 Empirical Results for Hopper-v2 Task↩︎

In Section 5, we compare TDEOC against OC and PPO. We present the performance results for Hopper-v2 task from Mujoco which was absent in Fig 5. TDEOC not only outperforms OC and PPO, it is also capable of handling environment perturbations better.

Figure 16: Results on Hopper-v2 task from Mujoco.

13 Empirical Results for OneRoom Task↩︎

In Section 5.2 we visualize option trajectories for the OneRoom navigation task from Miniworld. The objective of the agent is to scan the room for the goal in the form of a red box located at a random location and navigate towards it. TDEOC manages to demonstrate comparable performance as PPO despite the added complexity of learning a hierarchy for a simple task.

Figure 17: Results on OneRoom task from Miniworld.

14 Reproducibility Checklist↩︎

We list all the items of the Reproducibility Checklist [35] and provide details for each point.

For all models and algorithms presented, check if you include:

  • A clear description of the algorithm. Please refer to Algorithm, 2. We also provide the source code.

  • An analysis of the complexity (time, space, sample size) of any algorithm. We do not perform this analysis.

  • A link to a downloadable source code, with specification of all dependencies, including external libraries. We provide the source code along with our submission. We also explain the experimental setting in the paper and in the Appendix.

For any theoretical claim, check if you include:

  • A statement of the result. See main paper.

  • A clear explanation of any assumptions. See main paper.

  • A complete proof of the claim. See main paper.

For all figures and tables that present empirical results, check if you include:

  • A complete description of the data collection process, including sample size. For our tabular four-rooms task, we reuse the environment from [4]. We use standard versions of Mujoco [20] and Miniworld [23] for our single task evaluations. As for the transfer setting, we use custom environments using [34] for HalfCheetahWall-v0 and HopperIceWall-v0 and [24] for TMaze (continuous). We provide the source code along with all the environments used for our experiments.

  • A link to a downloadable version of the dataset or simulation environment. See [4] for details regarding the four-rooms task and refer to our code for further details. Standard Mujoco [20] and Miniworld [23] tasks are available in their respective repositories. As for the custom tasks, please refer to our source code.

  • An explanation of any data that were excluded, description of any pre-processing step. There is no need for any kind of pre-processing for the data collected from the environments. No data was excluded in any experiment we performed.

  • An explanation of how samples were allocated for training / validation / testing. As with all standard reinforcement learning control experiments, we do not split the data for training and validation. The performance during learning is presented in the main paper.

  • The range of hyper-parameters considered, method to select the best hyper-parameter configuration, and specification of all hyper-parameters used to generate results For the tabular setting, we tune both (TDEOC and OC) for the best hyper-parameters for the given transfer setting. As for the standard Mujoco and Miniworld tasks, we reuse the hyper-parameters provided by baselines and [23] for PPO. For OC we reuse the hyper-parameters provided by [38]. As for the custom tasks, we tune the relevant hyper-parameters for each algorithm and compare the results based on the average results over 20 runs for each hyper-parameter configuration. All the final hyper-parameter configurations are reported in Appendix 15.

  • The exact number of evaluation runs. We average results over 300 runs for the tabular four-rooms case. All our experiments in the non-linear function approximation case are evaluated by averaging 20 independent seeds.

  • A description of how experiments were run. Please refer to the experimental details provided in the main paper as well as the Appendix.

  • A clear definition of the specific measure or statistics used to report results. In the four-rooms case, we use the number of steps to reach the goal as the performance measure for each algorithm. As for the non-linear function approximation case, we use average return to compare different algorithms. Our methods are consistent with standard performance measures used for the respective tasks.

  • Clearly defined error bars. We plot error bars representing 0.5 of the standard deviation to observe differences in variance more acutely.

  • A description of results with central tendency (e.g. mean) & variation (e.g. stddev ). Our results are an average over all the runs. The error bars are half of the standard deviations for each run.

  • A description of the computing infrastructure used. A single CPU is used for the tabular as well as Mujoco based experiments. As for the Miniworld tasks, we use one CPU and a GPU for our results.

15 Implementation Details↩︎

15.1 Choice of Underlying algorithm↩︎

Our proposed termination objective relies on diversity estimates drawn from a well updated policy in order to identify the states where options tend to grow most diverse. This property is best observed in on-policy algorithms where samples from the same policy is used for policy evaluation and policy improvement. PPO is the state-of-the-art on-policy algorithm which is why it was used as the underlying algorithm. Although off-policy algorithms such as TD3 or SAC may achieve superior performance, these methods draw sample from a large buffer (mostly of capacity one million samples) which may even contain samples from the initial random policy, which dilutes TDEOC’s ability to target most diverse states. Also, unlike PPO, TD3 and SAC have only been implemented for continuous control tasks while PPO has also been tested on discrete control tasks such as Miniworld [23]. Another significant reason for choosing PPO is because option-critic had already been implemented using PPO updates (PPOC) [37], [38] and had been tested extensively, making our experiments standard, fair and reproducible.

15.2 Tabular Case↩︎

For our four-rooms experiments, we reuse the implementations by [4]. Augmenting the reward with \(\mathcal{R}_{bonus}\) for tasks with very sparse rewards can cause the agent to prioritize diversifying options over learning the task. To mitigate this, we avoid the reward augmentation step in all our sparse reward tasks including the four-rooms task. Instead of standardizing the diversity values, use update a moving sum of all values observed in the current run and center the diversity around the moving mean instead. For more than three options, the diversity is computed by sampling six pairs of options and averaging the respective cross entropy. The sole reason of this is to avoid computing the mean of all samples at every step. Each algorithm is averaged over 300 runs. The code has been attached in the submission folder.

Table 1: Hyper-parameters for Tabular Four-rooms task
Hyper-parameter TDEOC OC
Termination lr 5e-2 1e-1
Intra-Option lr 1e-2 1e-2
Critic lr 5e-1 5e-1
Action Critic lr 5e-1 5e-1
Discount 0.99 0.99
Max Steps 1000 1000
No of Options 4 4
Temperature 1e-3 1e-3

15.3 Non-Linear Function Approximation Case↩︎

We provide the implementation details as well as the hyper-parameters for all our non-linear function approximation cases. The hyper-parameters for PPO and OC are consistent with those suggested in [37] and [38] respectively. We use two critics for our algorithms (DEOC and TDEOC) as used by [4] in their tabular case implementation. All our plots are averaged over 20 independent runs with the error bounds representing 0.5 of the standard deviation.

15.3.1 ↩︎

For standard Mujoco tasks, we incorporate our algorithm within the PPOC code [38]. The pseudo reward bonus is scaled down depending on the task with the intention of prioritizing task reward. The diversity term is calculated using cross entropy, as stated in the Eq. 2 . We compute the softmax of the action distribution before computing the cross entropy to ensure \(\mathcal{R}_{bonus}\) remains positive. As mentioned earlier, for the TMaze(continuous) task, we avoid augmenting the reward with the diversity term. As for the HalfCheetahWall-v0 and HopperIce-v0, we reuse the resources provided by [34]. The obstacle is observed in the agent’s state space only when the agent is within one metre of the obstacle. The learning rate for TDEOC is slightly slower than OC to allow the algorithm sufficient time to learn the bottleneck states. We average runs over 20 sequential seeds starting from seed 10 for our results.

Table 2: Common hyper-parameters across all continuous control tasks
Hyper-parameter Value
Termination lr 5e-7
Termination lr TMaze(Continuous) 5e-8
Timesteps per batch 2048
Optim epochs 10
Clip param 0.2
Entropy coefficient 0.0
Gamma 0.99
Lambda 0.95
Lr schedule constant
Table 3: Learning rates for various continuous control tasks
Environment TDEOC DEOC OC
Ant-v2 1e-4 3e-4 3e-4
HalfCheetah-v2 1e-4 3e-4 3e-4
Hopper-v2 1e-4 3e-4 3e-4
Walker2d-v2 1e-4 3e-4 3e-4
Humanoid-v2 3.33e-5 1e-4 1e-4
HalfCheetahWall-v0 1e-4 nan 1e-4
HopperIceWall-v0 1e-4 nan 1e-4
TMaze (Continuous) 3e-5 nan 1e-4
Table 4: Trade-off value for various control tasks
Environment Trade-off
Ant-v2 0.2
HalfCheetah-v2 0.7
Hopper-v2 0.2
Walker2d-v2 0.2
HalfCheetahWall-v0 0.6
HopperIceWall-v0 0.4
TMaze (Continuous) 0.0

15.3.2 ↩︎

For Miniworld tasks, we use the code provided by baselines [37] for Atari environments and implement the PPOC networks consistent with [38] within. The objective of the Sidewalk task is for the agent to navigate to a goal object placed at the end of the street. The episode terminates and the environment resets if the agent strays away from the path onto the street. The OneRoom task can be perceived as a simpler version of the Sidewalk task, solely consisting of navigating to the goal object placed randomly anywhere in the room. As for the TMaze environment, the objective is to navigate to a goal object placed randomly at either ends of the horizontal bottom hallway. Due to discrete action space, diversity is computed by taking the softmax of the logits of the policy network. Rest of the implementation is consistent with the continuous control case discussed above. Due to the sparse reward situation, we again do not augment the reward with the diversity term. Like in the continuous control case, we average runs over 20 sequential seeds starting from seed 10 for our results. The hyper parameters used are given below:

Table 5: Common hyper-parameters across all Miniworld tasks
Hyper-parameter Value
Termination lr 5e-7
Timesteps per batch 2048
Optim epochs 4
Entropy coefficient 0.1
Clip Param 0.2
Gamma 0.99
Lambda 0.95
Lr schedule linear
Table 6: Learning rates for various Miniworld tasks
Environment TDEOC OC
MiniWorld-OneRoom-v0 1e-4 3e-4
MiniWorld-Sidewalk-v0 1e-4 3e-4
MiniWorld-TMaze-v0 1e-4 3e-4

References↩︎

[1]
R. S. Sutton, D. Precup, and S. Singh, “Between MDPs and semi-MDPs: A framework for temporal abstraction in reinforcement learning,” Artificial intelligence, vol. 112, no. 1–2, pp. 181–211, 1999.
[2]
D. Precup and R. S. Sutton, “Temporal abstraction in reinforcement learning,” in ICML, 2000.
[3]
T. Mann, D. Mankowitz, and S. Mannor, “Time-regularized interrupting options (TRIO),” in Proceedings of the 31st international conference on machine learning, 2014, vol. 32, pp. 1350–1358, [Online]. Available: http://proceedings.mlr.press/v32/mannb14.html.
[4]
P.-L. Bacon, J. Harb, and D. Precup, “The option-critic architecture,” in Thirty-first AAAI conference on artificial intelligence, 2017.
[5]
A. Harutyunyan, W. Dabney, D. Borsa, N. M. O. Heess, R. Munos, and D. Precup, “The termination critic,” 2019.
[6]
J. Harb, P.-L. Bacon, M. Klissarov, and D. Precup, “When waiting is not an option: Learning options with a deliberation cost,” in Thirty-second AAAI conference on artificial intelligence, 2018.
[7]
K. Gregor, D. J. Rezende, and D. Wierstra, “Variational intrinsic control,” arXiv preprint arXiv:1611.07507, 2016.
[8]
B. Eysenbach, A. Gupta, J. Ibarz, and S. Levine, “Diversity is all you need: Learning skills without a reward function,” CoRR, vol. abs/1802.06070, 2018, [Online]. Available: http://arxiv.org/abs/1802.06070.
[9]
R. J. Williams and J. Peng, “Function optimization using connectionist reinforcement learning algorithms,” Connection Science, vol. 3, no. 3, pp. 241–268, 1991.
[10]
V. Mnih et al., “Asynchronous methods for deep reinforcement learning,” in ICML, 2016.
[11]
A. Y. Ng, D. Harada, and S. Russell, “Policy invariance under reward transformations: Theory and application to reward shaping,” in ICML, 1999, vol. 99, pp. 278–287.
[12]
S. Singh, R. L. Lewis, A. G. Barto, and J. Sorg, “Intrinsically motivated reinforcement learning: An evolutionary perspective,” IEEE Transactions on Autonomous Mental Development, vol. 2, no. 2, pp. 70–82, 2010.
[13]
M. Bellemare, S. Srinivasan, G. Ostrovski, T. Schaul, D. Saxton, and R. Munos, “Unifying count-based exploration and intrinsic motivation,” in Advances in neural information processing systems, 2016, pp. 1471–1479.
[14]
R. Parr and S. J. Russell, “Reinforcement learning with hierarchies of machines,” in Advances in neural information processing systems, 1998, pp. 1043–1049.
[15]
T. G. Dietterich, “Hierarchical reinforcement learning with the MAXQ value function decomposition,” Journal of artificial intelligence research, vol. 13, pp. 227–303, 2000.
[16]
A. McGovern and A. G. Barto, “Automatic discovery of subgoals in reinforcement learning using diverse density,” 2001.
[17]
M. Stolle and D. Precup, “Learning options in reinforcement learning,” in Abstraction, reformulation, and approximation, 2002, pp. 212–223.
[18]
A. S. Vezhnevets et al., “FeUdal networks for hierarchical reinforcement learning,” in ICML, 2017.
[19]
T. Haarnoja, A. Zhou, P. Abbeel, and S. Levine, “Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor,” arXiv preprint arXiv:1801.01290, 2018.
[20]
E. Todorov, T. Erez, and Y. Tassa, “Mujoco: A physics engine for model-based control,” in 2012 IEEE/RSJ international conference on intelligent robots and systems, 2012, pp. 5026–5033.
[21]
J. Schulman, F. Wolski, P. Dhariwal, A. Radford, and O. Klimov, “Proximal policy optimization algorithms,” ArXiv, vol. abs/1707.06347, 2017.
[22]
P.-L. Bacon, “Temporal representation learning,” PhD thesis, PhD thesis, McGill University, 2018.
[23]
M. Chevalier-Boisvert, “Gym-miniworld environment for OpenAI gym,” GitHub repository. https://github.com/maximecb/gym-miniworld; GitHub, 2018.
[24]
K. Khetarpal, M. Klissarov, M. Chevalier-Boisvert, P.-L. Bacon, and D. Precup, “Options of interest: Temporal abstraction with interest functions,” Proceedings of the Thirty-Fourth AAAI Conference on Artificial Intelligence (AAAI-20), 2020.
[25]
A. McGovern and A. G. Barto, “Automatic discovery of subgoals in reinforcement learning using diverse density,” in Proceedings of the eighteenth international conference on machine learning, 2001, pp. 361–368.
[26]
P.-L. Bacon, “On the bottleneck concept for options discovery,” PhD thesis, Masters thesis, McGill University, 2013.
[27]
A. Bagaria and G. Konidaris, “Option discovery using deep skill chaining,” in International conference on learning representations, 2020, [Online]. Available: https://openreview.net/forum?id=B1gqipNYwH.
[28]
G. Ostrovski, M. G. Bellemare, A. van den Oord, and R. Munos, “Count-based exploration with neural density models,” in Proceedings of the 34th international conference on machine learning-volume 70, 2017, pp. 2721–2730.
[29]
H. Tang, R. Houthooft, D. Foote, and A. Stooke, “OpenAI xi chen, yan duan, john schulman, filip DeTurck, and pieter abbeel.# exploration: A study of count-based exploration for deep reinforcement learning,” Advances in neural information processing systems, vol. 30, pp. 2753–2762, 2017.
[30]
M. C. Machado, M. G. Bellemare, and M. Bowling, “Count-based exploration with the successor representation,” Proceedings of the 34th AAAI Conference on Artificial Intelligence (AAAI 2020), 2018.
[31]
Z. Zheng, J. Oh, and S. Singh, “On learning intrinsic rewards for policy gradient methods,” in Advances in neural information processing systems, 2018, pp. 4644–4654.
[32]
M. L. Puterman, Markov decision processes: Discrete stochastic dynamic programming, 1st ed. USA: John Wiley & Sons, Inc., 1994.
[33]
R. Bellman, “The theory of dynamic programming,” Bull. Amer. Math. Soc., vol. 60, no. 6, pp. 503–515, Nov. 1954, [Online]. Available: https://projecteuclid.org:443/euclid.bams/1183519147.
[34]
P. Henderson, W.-D. Chang, F. Shkurti, J. Hansen, D. Meger, and G. Dudek, “Benchmark environments for multitask learning in continuous domains,” ICML Lifelong Learning: A Reinforcement Learning Approach Workshop, 2017.
[35]
J. Pineau, “Machine learning reproducibility checklist.” https://www.cs.mcgill.ca/~jpineau/ReproducibilityChecklist.pdf, 2019.
[36]
R. S. Sutton and A. G. Barto, Reinforcement learning: An introduction. MIT press, 2018.
[37]
P. Dhariwal et al., “OpenAI baselines,” GitHub repository. https://github.com/openai/baselines; GitHub, 2017.
[38]
M. Klissarov, P.-L. Bacon, J. Harb, and D. Precup, “Learnings options end-to-end for continuous action tasks,” ArXiv, vol. abs/1712.00004, 2017.

  1. https://sites.google.com/view/deoc/home↩︎