O UTCOME - DIRECTED R EINFORCEMENT L EARNING BY U NCERTAINTY & T EMPORAL D ISTANCE -A WARE C URRICULUM G OAL G ENERATION
A BSTRACT
Current reinforcement learning (RL) often suffers when solving a challenging exploration problem where the desired outcomes or high rewards are rarely observed.
Even though curriculum RL, a framework that solves complex tasks by proposing a sequence of surrogate tasks, shows reasonable results, most of the previous works still have difficulty in proposing curriculum due to the absence of a mechanism for obtaining calibrated guidance to the desired outcome state without any prior domain knowledge.
To alleviate it, we propose an uncertainty & temporal distance-aware curriculum goal generation method for the outcomedirected RL via solving a bipartite matching problem.
It could not only provide precisely calibrated guidance of the curriculum to the desired outcome states but also bring much better sample efficiency and geometry-agnostic curriculum goal proposal capability compared to previous curriculum RL methods.
We demonstrate that our algorithm significantly outperforms these prior methods in a variety of challenging navigation tasks and robotic manipulation tasks in a quantitative and qualitative way.
INTRODUCTION
While reinforcement learning (RL) shows promising results in automated learning of behavioral skills, it is still not enough to solve a challenging uninformed search problem where the desired behavior and rewards are sparsely observed.
Some techniques tackle this problem by utilizing the shaped reward (Hartikainen et al., 2019) or combining representation learning for efficient exploration (Ghosh et al., 2018).
But, these not only become prohibitively time-consuming in terms of the required human efforts, but also require significant domain knowledge for shaping the reward or designing the task-specific representation learning objective.
What if we could design the algorithm that automatically progresses toward the desired behavior without any domain knowledge and human efforts, while distilling the experiences into the general purpose policy?
An effective scheme for designing such an algorithm is one that learns on a tailored sequence of curriculum goals, allowing the agent to autonomously practice the intermediate tasks.
However, a fundamental challenge is that proposing the curriculum goal to the agent is intimately connected to the efficient desired outcome-directed exploration and vice versa.
If the curriculum generation is ineffective for recognizing frontier parts of the explored and feasible areas, an efficient exploration toward the desired outcome states cannot be performed.
Even though some prior works propose to modify the curriculum distribution into a uniform one over the feasible state space (Pong et al., 2019; Klink et al., 2022) or generate a curriculum based on the level of difficulty (Florensa et al., 2018; Sukhbaatar et al., 2017), most of these methods show slow curriculum progress due to the process of skewing the curriculum distribution toward the uniform one rather than the frontier of the explored region or the properties that are susceptible to focusing on infeasible goals where the agent’s capability stagnates in the intermediate level of difficulty.
Conversely, without the efficient desired outcome-directed exploration, the curriculum proposal could be ineffective when recognizing the frontier parts in terms of progressing toward the desired outcomes because the curriculum goals, in general, are obtained from the agent’s experiences through exploration.
Even though some prior works propose the success-example-based approaches (Fu et al., 2018; Singh et al., 2019; Li et al., 2021), these are limited to achieving the only given example states, which means these cannot be generalized to the arbitrary goal-conditioned agents.
Other approaches propose to minimize the distance between the curriculum distribution and the desired outcome distribution (Ren et al., 2019; Klink et al., 2022), but these require an assumption that the distance between the samples can be measured by the Euclidean distance metric, which cannot be generalized for an arbitrary geometric structure of the environment.
Therefore, we argue that the development of algorithms that simultaneously address both outcome-directed exploration and curriculum generation toward the frontier is crucial to benefit from the outcome-directed curriculum
RL.
In this work, we propose O utcome-directed U ncertainty & T em P oral distance-
A ware C urriculum goal g E neration ( OUTPACE ) to address such problems, which requires desired outcome examples only and not prior domain knowledge nor external reward from the environment.
Specifically, the key elements of our work consist of two parts.
Firstly, our method addresses desired outcomedirected exploration via a Bayesian classifier incorporating an uncertainty quantification based on the conditional normalized maximum likelihood (Zhou & Levine, 2021;
Li et al., 2021), which enables our method to propose the curriculum into the unexplored regions and provide directed guidance toward the desired outcomes.
Secondly, our method utilizes Wasserstein distance with a time-step metric (Durugkar et al., 2021b) not only for a temporal distance-aware intrinsic reward but also for querying the frontier of the explored region during the curriculum learning.
By deploying the above two elements, we propose a simple and intuitive curriculum learning objective formalized with a bipartite matching to generate a set of calibrated curriculum goals that interpolates between the initial state distribution and desired outcome state distribution.
To sum up, our work makes the following key contributions.
• We propose an outcome-directed curriculum RL method which only requires desired outcome examples and does not require an external reward.
• To the best of the author’s knowledge, we are the first to propose the uncertainty & temporal distance-aware curriculum goal generation method for geometry-agnostic progress by leveraging the conditional normalized maximum likelihood and Wasserstein distance.
• Through several experiments in goal-reaching environments, we show that our method outperforms the prior curriculum RL methods, most notably when the environment has a geometric structure, and its curriculum proposal shows properly calibrated guidance toward the desired outcome states in a quantitative and qualitative way.
RELATED WORKS
While a number of works have been proposed to improve the exploration problem in RL, it still remains a challenging open problem.
For tackling this problem, prior works include statevisitation counts (Bellemare et al., 2016; Ostrovski et al., 2017), curiosity/similarity-driven exploration (Pathak et al., 2017; Warde-Farley et al., 2018), the prediction model’s uncertainty-based exploration (Burda et al., 2018; Pathak et al., 2019), mutual information-based exploration (Eysenbach et al., 2018; Sharma et al., 2019;
Zhao et al., 2021; Laskin et al., 2022), maximizing the entropy of the visited state distribution (Yarats et al., 2021; Liu & Abbeel, 2021a;b).
Unfortunately, these techniques are uninformed about the desired outcomes: the trained agent only knows how to visit frontier states as diverse as possible.
On the contrary, we consider a problem where the desired outcome can be specified by the given desired outcome examples, allowing for more efficient outcome-directed exploration rather than naive frontier-directed exploration.
Some prior methods that try to accomplish the desired outcome states often utilize the provided success examples (Fu et al., 2018;
Singh et al., 2019;
Eysenbach et al., 2021;
Li et al., 2021).
However, they do not provide a mechanism for distilling the knowledge obtained from the agent’s experiences into general-purpose policies that can be used to achieve new test goals.
In this work, we utilize the Wasserstein distance not only for an arbitrary goal-conditioned agent but also for querying the frontier of the explored region during curriculum learning.
Although the Wasserstein distance has been adopted by some previous research, they are often limited to imitation learning or skill discovery (Dadashi et al., 2020; Haldar et al., 2022; Xiao et al., 2019; Durugkar et al., 2021a; Fickinger et al., 2021).
Another work (Durugkar et al., 2021b) tries to utilize the Wasserstein distance with the time-step metric for training the goal-reaching agent, but it requires a stationary goal distribution for stable distance estimation.
Our work is different from these prior works in that the distribution during training is non-stationary for calibrated guidance to the desired outcome states.
Suggesting a curriculum can also make exploration easier where the agent learns on a tailored sequence of tasks, allowing the agent to autonomously practice the intermediate tasks in a training process.
However, prior works often require a significant amount of samples to measure the curriculum’s level of difficulty (Florensa et al., 2018; Sukhbaatar et al., 2017), learning progress (Portelas et al., 2020), regret (Jiang et al., 2021).
Curricula are often generated by modifying the goal distribution into the frontier of the explored region via maximizing a certain surrogate objective, such as the entropy of the goal distribution (Pong et al., 2019), disagreement between the value function ensembles (Zhang et al., 2020), but these methods do not have convergence mechanism to the desired outcome distribution.
While some algorithms formulate the generation of a curriculum as an explicit interpolation between the distribution of target tasks and a surrogate task distribution (Ren et al., 2019; Klink et al., 2022), these still depend on the Euclidean distance metric when measuring the distance between distributions, which cannot be generalized for an arbitrary geometric structure of the environment.
In contrast, our method not only provides calibrated guidance to the desired outcome distribution in a sample efficient way but also shows geometry-agnostic curriculum progress by leveraging the bipartite matching problem with uncertainty & temporal distance-based objective.
PRELIMINARY
We consider the Markov decision process (MDP) M
= ( S , A , G , T, ρ 0 , γ ) , where S denotes the state space,
A the action space, G the goal space, T ( s ′ | s, a ) the transition dynamics, ρ 0 the initial distribution, ρ π the state visitation distribution when the agent follows the policy π , and γ the discount factor.
The MDP in our framework is provided without a reward function and considers an environment in which only the desired outcome sample { g k + } Kk =1 are given, assuming that g k + is obtained from the desired outcome distribution G + .
Therefore, our work employs a trainable intrinsic reward function r : S × G ×
A → R , which is detailed in Section 4.1.
Also, we represent the set of curriculum goals as { g kc } Nk =1 and assume that these are sampled from the curriculum goal distribution G c obtained by our algorithm.
3. W ASSERSTEIN D ISTANCE OVER THE T IME - STEP M ETRIC
The Wasserstein distance represents how much “work” is required to transport one distribution to another distribution following the optimal transport plan (Villani, 2009; Durugkar et al., 2021b).
In this section, we describe the Wasserstein distance over the time-step metric and how it can be obtained with a potential function f .
Consider a metric space ( X , d ), where X is a set and d is a metric on X , and two probability measures µ, ν on X .
The Wasserstein-p distance for a given metric d is defined as follows,
[Equation]
where a joint distribution γ denotes a transport plan, and Π( µ, ν ) denotes the set of all possible joint distributions γ , and the second equality is held by the Kantorovich-Rubinstein duality with 1-Lipschitz functions ( f : X → R ) (Villani, 2009; Arjovsky et al., 2017).
If we could define the distance metric as d π ( s, s g ) , which is a time-step metric (quasimetric) based on the number of transition steps experienced before reaching the goal s g ∈ G for the first time when executing the goal-conditioned policy π ( a | s, s g ) , we could design a temporal-distance aware
RL by minimizing the Wasserstein distance W 1 ( ρ π , G ) that gives an estimate of the work needed to transport the state visitation distribution ρ π to the goal distribution G :
[Equation]
Then, the potential function f is approximately increasing along the optimal goal-reaching trajectory.
That is, if ρ π ( s ) consists of the states optimally reaching toward the goal s g , f ( s ) increases along the trajectory and f ( s g ) has the maximum value (Durugkar et al., 2021b;a).
Adopting these prior works, the 1-Lipschitz potential function f with respect to d π ( s, s g ) could be ensured by enforcing that the difference in values of f on the expected transition from every state is bounded byas follows, (detailed derivations are in Appendix B.)
[Equation]
3. C ONDITIONAL N ORMALIZED M AXIMUM L IKELIHOOD (CNML)
For curriculum learning, our work utilizes conditional normalized maximum likelihood (CNML) (Rissanen & Roos; Fogel & Feder, 2018) that can perform an uncertainty-aware classification based on previously observed data by minimizing worst-case regret.
Let D = { ( s p , e p ) } n − 1 p
=
1 be a set of data containing pairs of states s 1: n − 1 and success labels e 1: n − 1 ∈ { 0 , 1 } , where ‘ 1 ’ represents the occurrence of the desired event.
Given a query point s n , CNML in our framework defines the distribution p CNML ( e n | s n ) which predicts the probability that the state s n belongs to the desired outcome distribution G + ( e = 1) .
To explain how CNML predicts the label of s n , we suppose Θ is a set of models, where each model θ ∈ Θ can represent a conditional distribution of labels, p θ ( e 1: n | s 1: n ) .
CNML considers the possibilities that all the possible classes (0,1) will be labeled to the query point s n , and obtains the models ˆ θ ( e 1: n | s 1: n ) ∈ Θ that represent the augmented datasets D ∪ ( s n , e n ) well by solving the maximum likelihood estimation (MLE) problem (LHS of Eq.
Then, CNML that minimizes the regret over those maximum likelihood estimators can be written as follows (Bibas et al., 2019),
[Equation]
If the query point s n is close to one of the data points in the datasets, CNML will have difficulty in assigning a high likelihood to labels that are significantly different from those of nearby data points.
However, if s n is far from the data points in the dataset, each MLE model ˆ θ i =0 , 1 will predict the label e n as its own class, which leads to a large discrepancy in the predictions between the models and provides us with normalized likelihoods closer to uniform (RHS of Eq (4)).
Thus, by minimizing the regret through labeling all possible classes to the new query data, CNML can provide a reasonable uncertainty estimate (Li et al., 2021;
Zhou & Levine, 2021) on the queried s n and classify whether the queried s n is similar to the previously observed data either the forms of label 0, 1, or out-ofdistribution data, which is predicted as 0.5.
However, the classification technique via CNML described above is in most cases computationally intractable, as it requires solving separate MLE problems until convergence on every queried data.
Previous methods proposed some ideas to amortize the cost of computing CNML distribution (Zhou & Levine, 2021; Li et al., 2021).
Following those prior methods, our work adopts MAML (Finn et al., 2017) to address the computational intractability of CNML by training one meta-learner network that can quickly adapt to each model ˆ θ i rather than training each model separately.
As Finn et al.
(2017) requires samples from G + and replay buffer B for the inference, the probability should be represented as p CNML ( e = i | s ; G + , B ) , but we use p CNML ( e = i | s ) for notational simplicity in this work.
More details about the meta-learning-based classification are included in Appendix B.
METHOD
For a calibrated guidance of the curriculum goals to the desired outcome distribution, we propose to progress the curriculum towards the uncertain & temporally distant area before converging to G + , as it is not only the most intuitive way for exploration but also enables the agent to progress without any prior domain knowledge on the environment such as obstacles.
In short, our work tries to obtain the distribution of curriculum goals G c that are considered (a) temporally distant from ρ 0 and, (b) uncertain and, (c) being progressed toward the desired outcome distribution G + .
4. TEMPORAL DISTANCE - AWARE RL WITH THE INTRINSIC REWARD
This section details the intrinsic reward for the RL agent as well as the method of training the parameterized potential function f πϕ , trained with the data collected by the policy π ( a | s, s g ) .
We consider a 1-Lipschitz potential function f πϕ whose value increases as the state is far from the initial state distribution and getting close to the goals s g ∈ G proposed by curriculum learning.
Then, we can train an agent that reaches the goals s g in as few steps as possible by minimizing the Wasserstein distance W 1 ( ρ π , G ) .
Considering that we can obtain the estimate of W 1 ( ρ π , G ) by Eq (2), the loss for training the parameterized potential function f
πϕ can be represented as follows (Durugkar et al.,
2021b;a):
[Equation]
The penalty term with coefficient λ in Eq (5) is from Eq (3) for ensuring the smoothness requirement since we consider the Wasserstein distance over the time-step metric.
Then, assuming the parameter ϕ is trained by Eq (5) at every training iteration, we could obtain the supremum of Eq (2).
Thus, the reward can be represented as r = f πϕ ( s ) − f πϕ
( s g ) , which corresponds to − W 1 ( ρ π , G ) .
4. C URRICULUM L EARNING
As CNML can provide a near-uniform prior (prediction of 0.5) for out-of-distribution data given the datasets (Section 3.2), we could utilize it by treating the desired outcome states in G + as ( e = 1) , and data points in the replay buffer B as ( e = 0) .
Then, we could quantify the uncertainty of a state s based on CNML as
[Equation]
(6) which is proportional to the uncertainty of the queried data s .
However, η ucert alone cannot provide curriculum guidance toward the desired outcome states because it only performs an uninformed search over uncertainties rather than converging to the desired outcome states.
Thus, we modify Eq (6) with an additional guidance term:
[Equation]
where η guidance ( s, G + )
= ( p CNML ( e = 1 | s ) − 0 . 5) · 1 ( p CNML ( e = 1 | s ) ≥ 0 . 5) , and c is a hyperparameter that adjusts the preference on the desired outcome states.
Since the CNML provides near-uniform prior for out-of-distribution data, η ucert provides large values in the uncertain areas.
Also, the guidance term η guidance ( s, G + ) reflects the preference for the states considered to be closer to the desired outcome state distribution.
However, in practice, we found the uncertainty quantification itself sometimes has numerical errors, and it makes p CNML erroneously predict the states near the initial states or boundaries of the already explored regions as uncertain areas.
Therefore, we assume that the curriculum should incorporate the notion of not only the uncertainty but also the temporally distant states from ρ 0 for frontier and desired outcome-directed exploration.
Thus, we formulate the final curriculum learning objective as follows:
[Equation]
where the temporal distance bias term with a coefficient L is represented by the Wasserstein distance from initial state distribution ρ 0 to the curriculum goal distribution G c .
And, given a parameterized 1-Lipschitz potential function f
πϕ over the time-step metric d π ( s, s g ) , we can obtain the estimate of
W 1 ( ρ o , G c ) by RHS of Eq (1).
Also, if we assume ˆ G c to be a finite set of K particles that is sampled from already achieved states in the replay buffer B , the objective function we aim to maximize can be represented as follows:
[Equation]
It enables to propose the curriculum that reflects not only the uncertainty of the states and preference on the desired outcomes but also temporally distant states from ρ 0 , while not requiring prior domain knowledge about the environment such as an obstacle.
4. S AMPLING C URRICULUM G OAL VIA B IPARTITE M ATCHING
Since we assume that desired outcome examples from G + are given rather than its distribution, we could approximate it by the sampled set ˆ G + ( | ˆ G + | = K ).
Then, to solve the curriculum learning problem of Eq (9), we should address the combinatorial setting that requires assigning ˆ G c from the entire curriculum goal candidates in the replay buffer B to the ˆ G + , which is addressed via bipartite matching in this work.
With the hyperparameter c = 4 , we can rearrange Eq (9) as a minimization problem with the costs of cross-entropy loss ( CE ) and temporal-distance bias ( f πϕ ) term: (Refer to the Appendix B for the detailed derivation.)
[Equation]
Intuitively, before discovering the desired outcome states in G + , the curriculum goal s i is proposed in a region of the state space considered to be uncertain and temporally distant from ρ 0 in order to recognize the frontier of the explored regions.
And it is kept updated to converge to the desired outcome states for minimizing the discrepancy between the predicted labels of ˆ G +
and ˆ G c .
Then we can construct a bipartite graph G with the cost of the edges w .
Let V a and V b be the sets of nodes representing achieved states in replay buffer and ˆ G + respectively.
We define a bipartite graph G ( { V a , V b } , E ) with the weight of the edges E ( · , · ) = − w ( · , · ) and separated partitions ( V a and V b ).
To solve the bipartite matching problem, we utilize the Minimum Cost Maximum Flow
[Figure]
algorithm to find K edges with the minimum cost w connecting V a and V b .
(Ahuja et al., 1993;
Ren et al., 2019).
The overall training process is summarized in Algorithm 1 in Appendix B.
EXPERIMENTS
We include 6 environments to validate our proposed method.
Firstly, various maze environments (Point U-Maze, N-Maze, Spiral-Maze) are used to validate the geometry-agnostic curriculum generation capability.
Also, we experimented with the Ant-Locomotion and Sawyer-Peg Push,
Pick&Place environments to evaluate our method in more complex dynamics or other domains rather than navigation tasks.
We compare with other previous curriculum or goal generation methods, where each method has the following properties.
HGG (Ren et al., 2019):
Minimize the distance between the curriculum and desired outcome state distributions based on the Euclidean distance metric and value function bias.
CURROT (Klink et al., 2022):
Interpolate between the curriculum and desired outcome state distribution based on the agent’s current performance via optimal transport.
GoalGAN (Florensa et al., 2018): Generate curriculum goals that are intermediate level of difficulty by training GAN (Goodfellow et al., 2014).
PLR (Jiang et al., 2021): Sample increasingly difficult tasks by prioritizing the levels of tasks with high TD errors.
ALP-GMM (Portelas et al., 2020):
Fit a GMM with an absolute learning progress score approximated by the absolute reward difference.
VDS (Zhang et al., 2020):
Prioritize goals that maximize the epistemic uncertainty of the value function ensembles.
SkewFit (Pong et al., 2019): Maximize the entropy of the goal distribution to be uniform on the feasible state space via skewing the distribution trained by VAE (Kingma & Welling, 2013).
5. E XPERIMENTAL R ESULTS
Firstly, to show how each module in our method is trained, we visualized the uncertainty quantification by CNML, and f πϕ ( s ) values which are proportional to the required timesteps to reach s from ρ 0 .
The uncertainty quantification results (Figure 2) show that the classifier p CNML ( ·| s ) successfully discriminates the queried states as already explored region or desired outcome states, otherwise, uncertain states.
Due to the geometry-agnostic property of the classifier p CNML ( ·| s ) , we could propose the curriculum in the arbitrary geometric structure of the environments, while most of the previous curriculum generation methods do not consider it.
We also visualized the values of the trained potential function f πϕ ( s ) to show how the intrinsic reward is shaped (Figure 2).
As the potential function f πϕ ( s ) is trained to have high values near the desired outcome states due to the Wasserstein distance with the time-step metric, the results show gradual increases of f πϕ ( s ) values along the trajectory toward the desired outcome states.
That is, high values of f πϕ ( s ) indicate the smaller required timesteps to reach the desired outcome state, and this property brings the advantage in identifying the frontier of the explored region.
To validate whether the curriculum goals are properly interpolated from initial states to desired outcome states by combining both objectives for curriculum learning (Eq (8)), we evaluated the
[Figure]
[Figure]
progress of the curriculum goals in a quantitative and qualitative way.
For quantitative evaluation, we compare with other previous works described above with respect to the distance from the proposed curriculum goals to G + .
As we can see in Figure 4, our method is the only one that consistently interpolates from initial states to G + as training proceeds, while others have difficulty with complex dynamics or geometry of the environments.
For qualitative evaluation, we visualized the curriculum goals proposed by our method and other baselines that show somewhat comparable results as training proceeds (Figure 3).
The results show that our method consistently proposes the proper curriculum based on the required timesteps and uncertainties regardless of the geometry and dynamics of the various environments, while other baselines have difficulty as they utilize the Euclidean distance metric to interpolate the curriculum distribution to the G + .
We also evaluated the desired outcome-directed RL performance.
As we can see in Figure 5, our method is able to very quickly learn how to solve these uninformed exploration problems through calibrated curriculum goal proposition.
5. A BLATION S TUDY
Types of curriculum learning cost.
We first evaluate the importance of each curriculum learning objective in Eq (8).
Specifically, we experimented only with uncertainty-related objective ( onlycnml ) and timestep-related objective ( only-f ) when curriculum learning progresses.
As we can see
[Figure]
in Figure 6a, both objectives play complementary roles, which support the requirement of both objectives.
Without one of them, the agent has difficulty in progressing the curriculum goals toward the desired outcome states due to the local optimum of f πϕ or the numerical error of p CNML , and more qualitative/quantitative results and analysis about this and other ablation studies are included in Appendix C.
Reward type & Goal proposition method.
Secondly, we replace the intrinsic reward with the sparse reward, which is typically used in goal-conditioned RL problems, to validate the effects of the timestep-proportionally shaped reward.
Also, for comparing the curriculum proposition method, we replace the Bipartite Matching formulation with a GAN-based generative model, which is similar to Florensa et al.
, but we label the highly uncertain states as positive labels instead of success rates.
As we can see in Figure 6b, the timestep-proportionally shaped reward shows consistently better results due to the more informed reward signal compared to the sparse one, and the generative model has difficulty in sampling the proper curriculum goals because GAN shows training instability with the drastic change of the positive labels, while our method is relatively insensitive because curriculum candidates are obtained from the experienced states from the buffer B rather than the generative model.
Effect of c in η guidance .
Lastly, we experiment with different values of hyperparameter c to validate the effect of η guidance on curriculum learning.
When c is smaller than the default value 4 , it is still possible to explore most of the feasible state space except the area near the desired outcome states due to the uncertainty & temporal distance-aware curriculum (Figure 6c).
But, we could verify that η guidance ’s effect becomes smaller as c decreases and η guidance helps to guide the curriculum goals to the desired outcome states precisely.
This is consistent with our analysis that the uncertainty & temporal distance themselves can provide curriculum goals in the frontier of the explored region while η guidance can further accelerate the guidance to the desired outcome states.
CONCLUSIONS
In this work, we consider an outcome-directed curriculum RL where the agent should progress toward the desired outcome automatically without the reward function and prior knowledge about the environment.
We propose OUTPACE, which performs uncertainty, temporal distance-aware curriculum RL with intrinsic reward, based on the classifier by CNML, and Wasserstein distance with time-step metric.
We show that our method can outperform the previous methods regarding sample efficiency and curriculum progress quantitatively and qualitatively.
Even though our method shows promising results, there are some issues with computational complexity due to the innate properties of the meta-learning inference procedure itself.
Thus, it would be interesting future work to find a way to reduce the inference time for less training wall-clock time.
A CKNOWLEDGEMENT
This work was supported by AI based Flight Control Research Laboratory funded by Defense Acquisition Program Administration under Grant UD200045CD.
Seungjae Lee would like to acknowledge financial support from Hyundai Motor Chung Mong-Koo Foundation.
A T RAINING & E XPERIMENTS DETAILS A. T RAINING DETAILS
Baselines.
The baseline curriculum RL algorithms are trained as follows,
• HGG (Ren et al., 2019) :
We follow the default setting in the original implementation from https://github.com/Stilwell-Git/Hindsight-Goal-Generation .
• CURROT (Klink et al., 2022):
We follow the default setting in the original implementation from https://github.com/psclklnk/currot .
• GoalGAN (Florensa et al., 2018), PLR (Jiang et al., 2021), VDS (Zhang et al., 2020), ALP-GMM (Portelas et al., 2020) :
We follow the default setting in implementation from https://github.com/psclklnk/currot .
• SkewFit (Pong et al., 2019):
We follow the state-based version of SkewFit.
The original implementation was modified and used since only the image-based version is provided in it.
( https://github.com/rail-berkeley/rlkit )
All the baselines are trained by SAC (Haarnoja et al., 2018) with the sparse reward except for the
SkewFit as it uses a reward based on the conditional entropy.
Even though some algorithms’ original implementation is based on on-policy algorithms such as TRPO or PPO (Schulman et al., 2015; 2017), for comparing the sample efficiency, we replace the on-policy algorithm with the off-policy algorithm, SAC, following the referred implementation.
[Table]
PLR ✗ ✗ ✗ ✗
B ✗ ✗
VDS ✓ ✗ ✗ ✓
B ✗ ✓
ALP-GMM ✗ ✗ ✗
✓
GMM ✗ ✗
SkewFit ✓ ✗ ✗ ✓
VAE ✓ ✗
OUTPACE (ours) ✓ ✓
G + ✓
B ✓ ✓
We included a conceptual comparison between our work and previous other curriculum or goal generation methods in Table 1.
• Uncert.-Aware : whether the curriculum goal proposal process is aware of the uncertainty of the candidate goals.
• Timestep-Aware : whether the curriculum goal proposal process is aware of the temporal distance from the initial states or from the desired outcome states.
• Target curriculum dist : whether there exists a mechanism for the curriculum goals to converge to the target distribution.
When there is no target distribution (e
g. just exploring or expanding the curriculum goal distribution as diverse as possible.), we denoted it as ✗ .
• Off-policy : whether the off-policy RL can be applied.
Some baselines need to measure a kind of difficulty, which means they require repeated trials and on-policy RL algorithms with multi-processing such as TRPO, and PPO (Schulman et al., 2015; 2017).
• Curriculum proposal : where the curriculum goals are proposed from.
• Without ext.
reward : whether the algorithm requires external environmental reward or not.
• Without non-forgetting mechanism : whether the algorithm requires implicit or explicit non-forgetting mechanisms.
Some baselines mix the previously practiced curriculum goals with a fixed or varying ratio or make the curriculum distribution into uniform over the state space to cover all possible test goal states.
Training details.
To train the potential function f ϕ via Eq.
(5), s and s g in the buffer should ideally contain all feasible states in the environment.
However, until the policy is learned enough to explore the map, obtaining such ideal distribution is difficult.
To mitigate this issue, following Durugkar et al.
(2021b), we approximate such a distribution with a small replay buffer B f containing recent trajectories and the relabelling technique (Andrychowicz et al., 2017).
While this approximation does not provide f ϕ with the ideal state distribution covering all feasible states, we empirically found that this assumption works well since OUTPACE only queries f ϕ for the explored area when it generates curriculum goals
[Table]
[Table] [Table]
&Place  1e0.
A. E NVIRONMENT DETAILS
• Point-U-Maze : The observation consists of the xy position, angle, velocity, and angular velocity of the ‘point’.
The action space consists of the velocity and angular velocity of the ‘point’.
The initial state of the agent is [0 , 0] and the desired outcome states are obtained by adding uniform noise to the default goal point [0 , 8] .
The size of the map is 12 × 12 .
• Point-N-Maze : It is the same as the Point-U-Maze environment except that the desired outcome states are obtained by adding uniform noise to the default goal point [8 , 16] , and the size of the map is 12 × 20 .
• Point-Spiral-Maze : It is the same as the Point-U-Maze environment except that the desired outcome states are obtained by adding uniform noise to the default goal point [8 , − 8] , and the size of the map is 20 × 20 .
• Ant Locomotion : The observation consists of the xyz position, xyz velocity, joint angle, and joint angular velocity of the ‘ant’.
The action space consists of the torque applied on the rotor of the ‘ant’.
The initial state of the agent is [0 , 0] and the desired outcome states are obtained by adding uniform noise to the default goal point [0 , 8] .
The size of the map is 12 × 12 .
• Sawyer-Peg-Push : The observation consists of the xyz position of the end-effector, the object, and the gripper’s state.
The action space consists of the xyz position of the endeffector and gripper open/close control.
The initial state of the object is [0 . 4 , 0 . 8 , 0 . 02] and the desired outcome states are obtained by adding uniform noise to the default goal point [ − 0 .
We referred to the metaworld (Yu et al., 2020) and EARL (Sharma et al., 2021) environments.
[Figure]
• Sawyer-Peg-Pick&Place : It is the same as the Sawyer-Peg-Push environment except that the desired outcome states are obtained by adding uniform noise to the default goal point [ − 0 .
B A LGORITHM & D ERIVATIONS B. A LGORITHM
1: Input: desired outcome examples ˆ G + , total training episodes N , Env, environment horizon H , actor network π , critic network Q , potential function network f πϕ , replay buffer B , B f 2: for iteration=1,2,...,N do 3: ˆ G c ← sample K curriculum goals that minimize (cid:80)
s i ∈B [ CE ( p CNML ( e = 1 | s i );
y
= p CNML ( e = 1 | ˆ G + ))
− L · f πϕ ( s i )]
(Section 4.3) 4: for i =
1,2,...,K do 5:
Env .
reset () 6: g ← ˆ G c .
pop 7: for t =0,1,..., H -1 do 8: if achieved g then 9: g ← random goal (randomly sample a state with high uncertainty measured by p CNML in a ball B r ( s t ) .)
10: end if 11: a t ← π ( ·| s t , g ) 12: s t
+1 ← Env . step ( a t ) 13: end for 14:
B ← B ∪ { s 0 , a 0 , s 1 ... } , B f ← B f ∪ { s 0 , a 0 , s 1 ... } 15: end for 16: for i =
,M do 17:
Sample a minibatch b from B and label reward using f πϕ ( s t ) (Section 4.1) 18:
Train π and Q with b via SAC (Haarnoja et al., 2018).
Meta-train p CNML with b via meta-NML (Algorithm 2.)
Sample a minibatch b f from B f 21:
Train f
πϕ with b f via Eq.
(5) 22: end for 23: end for
[Equation]
B. D ERIVATIONS
This section contains the definition of time-step metric d π , derivation of Lipschitz smoothness of f , and derivation of Eq.
Regarding d π and Lipschitz smoothness of f , we refer the reader to
Durugkar et al.
(2021b)
for more detailed explanation.
B.2. T IME - STEP METRIC d π , L IPSCHITZ SMOOTHNESS OF f
Definition B.1.
Given a state space S , action space A , transition dynamics T : S ×
A → S , and agent policy π , the time-step metric d π is a quasi-metric where the distance from s ∈ S to s g ∈ S is the expected number of transitions required with the policy π .
The time-step metric can be expressed by the expectation of the number of transitions taken under the policy π , where T π ( ·| s, s g ) is the probability distribution of the timestep required to go from s to s g .
d π can also be written recursively as
[Equation]
if s = s g
[Equation]
|
[Equation] [Equation]
s
[Equation]
)] otherwise .
Lipschitz smoothness of f
If the difference in values of f on the expected transition from every state is bounded by 1, and the policy π can reach the goal s g within a finite number of transitions, then f is the 1-Lipschitz function.
Proof.
We can write | f ( s g ) − f ( s 0 ) | via telescopic sum,
[Equation]
Since E [ | f ( s ′ ) − f ( s ) | ] ≤ 1 by Eq (3), we can write
[Equation]
Thus, f is the 1-Lipschitz function with respect to the time-step metric d π .
B.2. D ERIVATION OF EQUATION (11)
By substituting Eq.
(7) into Eq (9), and omitting f πϕ ( s i 0 ) which is not related to ˆ G c , we obtain the following terms,
[Equation]
Also
[Equation]
if we use the default value of the hyperparameters c =
[Equation]
we can express the above terms as follows,
[Equation]
which can be simplified as
[Equation]
If we could assume that p CNML is well trained to classify the desired outcome examples g i + ∈ ˆ G + from the states s in the already explored region
[Equation]
p CNML ( e = 1 | g i + ) is approximately equal to 1 ( p CNML ( e = 1 |
g i + )
≈ 1 ).
Then, the terms inside the above minimization objective can be approximately represented as
[Equation]
Then, in practical implementation, we can implement the above terms by cross-entropy loss as
[Equation] [Equation]
which is Eq (11).
Even though it is not exactly equivalent to the mathematical definition of the cross-entropy, we can just implement it with cross-entropy loss developed in standard deep learning framework such as PyTorch (Paszke et al., 2019) because choosing s i to maximize log( p CNML ( e = 1 | s i )) and choosing s i close to g i + in order to be classified as desired outcome examples by the p CNML (predicted labels of s i to be close to 1) have the same intuitive meaning.
B. A DETAILED DESCRIPTION OF M ETA -NML
Conditional normalized maximum likelihood (CNML) can perform a conservative k-way classification based on previously seen data (Li et al., 2021;
Zhou & Levine, 2021).
Let D train =
( x i , y i ) } n − 1 i =1 be a set of data containing pairs of inputs x 1: n − 1 and labels y 1: n − 1 ∈ { 1 , · · · , k } , where k is the number of possible labels, and Θ is a set of models.
Given a new input x n , CNML defines the distribution p CNML ( y n = i | x n ) i ∈{ 1 , ··· ,k } by minimizing the regret R of the worst-case label y n as
[Equation] [Equation]
where we define a regret R for label y n of a distribution q and maximum likelihood estimator θ ′ as
[Equation] [Equation]
By solving Eq.
(20), CNML predicts the distribution of the new label y n as Eq.
(22) (Bibas et al., 2019).
[Equation]
where a model θ ′ ( n ) m is a model that represents the augmented dataset D
= D train ∪ ( x n , y n = m ) well.
Thus, the number of total MLE models required is n × k since we should address each data by augmenting with the label 1 , ..., k , respectively ( θ ′ ( α =1: n ) β
=1: k ).
Since our algorithm utilizes 2-way classification ( k = 2 ), we define 2 n tasks τ − i =1: n and τ + i =1: n , which are constructed by augmenting negative ( x i , y = 0) and positive ( x i , y = 1) labels respectively for each data point ( x i ) .
To amortize the training cost of the tasks (tasks τ − , + i =1: n ) we can apply the meta-learning algorithm
(Finn et al., 2017; Li et al., 2021) to this setting and train a model θ which can quickly adapt to the optimal solution after a single step of gradient update with standard classification loss L as
[Equation]
where Eq.
(23) and Eq (24) represent the objective of meta-learning and quick adaptation respectively.
Training CNML via meta-learning and leveraging CNML are shown in lines 3 and 19 of the algorithm overview (Algorithm 1).
Also, we provide the pseudo-code of meta-nml in Algorithm 2.
C M ORE EXPERIMENTAL RESULTS C. F ULL RESULTS OF THE MAIN SCRIPT
We included the full results of the main script in this section.
The uncertainty quantification is visualized in Figure 9, the visualization of the trained f π ϕ ( s ) is in Figure 10, the visualization of the proposed curriculum goals is in Figure 11.
We do not include the visualization results of the
Point-U-Maze, and Sawyer-Peg-Pick&Place results as these environments share the same map with the Ant Locomotion, and Sawyer-Peg-Push environments, respectively.
[Figure] [Figure]
C. E VALUATION WITH THE GOALS SAMPLED FROM THE UNIFORM DISTRIBUTION
In some curriculum RL algorithms, they incorporate a mechanism for remembering previously practiced curricula either implicitly or explicitly.
For example, GoalGAN (Florensa et al., 2018) mixes the previously generated goals with currently generated goals in a specified ratio (e.g. 20 % of previously used goals), and SkewFit (Pong et al., 2019) set the objective as targeting the uniform goal distribution (by maximizing the entropy of the goals H ( g ) ), and CURROT (Klink et al., 2022) also utilizes uniform target curriculum distribution in practice, and so do some of the other baselines.
Due to these algorithmic designs, they require many iterations for explicitly practicing previously used curriculum goals, or show slow progress of curriculum to match the uniform target distribution.
In contrast, our method is based on an intrinsic reward, which is shaped according to the required timesteps proportional values f πϕ ( s ) as described in our main script.
Thus, our method does not need to explicitly consider the non-forgetting mechanism when we design the algorithm because the reward is already shaped with respect to the timesteps for reaching the arbitrary goal points along the trajectory that reaches the desired outcome state.
Because of this property, our method does not consider uniform target distribution or explicitly mixing the previously practiced curriculum goals, and it enables our method to be much faster and show sample-efficient curriculum progress.
We experimented with the goals sampled from the uniform distribution on the feasible state space for validating the previous hypothesis, and the experimental results are shown in Figure 12.
Even though our method does not explicitly consider the previously practiced curriculum goals, it shows success in reaching arbitrary goal points sampled from the uniform distribution.
Performance degrades are observed in sawyer manipulation environments and these are because we set the uniform distribution as areas within the tables in the environment.
But the curriculum goals proposed by our method are converged before the agent explores the entire state space on the table, thus the agent does not have the opportunity to practice the goals from the entire state space.
[Figure]
Maze (d) Ant Locomotion
[Figure]
e
[Figure]
C. A BLATION STUDY
We conducted ablation studies described in our main script in all environments.
Figure 13 shows the average distance from the proposed curriculum goals to the desired final goal states along the training steps, and Figure 14 shows the episode success rates along the training steps.
As we can see in these figures, even though there are not many differences in some environments with simple dynamics, we could obtain consistent analysis with the results in the main script in most of the environments.
We also visualized the curriculum goals obtained by each ablation study as training proceeds in Figure 15.
As we can see in these figures, the curriculum proposal only based on the uncertainty ( onlycnml ) shows progress toward uncertain areas, but it shows unstable curriculum progress, which is depicted by separated curriculum goals despite the same colors or out of order with respect to human intuitive optimal curriculum progress.
This is because the meta-learning-based inference procedure of p CNML has some numerical errors that could lead to the wrong prediction of the states near the boundaries of the already explored regions as uncertain areas (For example, in Figure 9, there exist some states predicted as uncertain area despite already explored region).
Also, even though the curriculum proposal based on the temporal distance only obtained by f πϕ ( only-f ) shows some progress that deviates from the initial states, it still has difficulty in most of the environments because f πϕ is trained to reflect the observed transition data rather than entire state space.
That is, the temporal distance estimation is reliable within the explored region.
Once the trained f πϕ has local optimum before discovering temporally more distant states (Figure 16), the proposed curriculum goals can be stuck in some areas that are wrongly predicted to be the most far from the initial states in terms of the temporal distance, and it leads to the ineffective exploration of the agent and recurrent failures.
[Figure] [Figure]
[Figure] [Figure]