V ALUE F UNCTION S PACES : S KILL -C ENTRIC S TATE A BSTRACTIONS FOR L ONG -H ORIZON R EASONING
A BSTRACT
Reinforcement learning can train policies that effectively perform complex tasks.
However for long-horizon tasks, the performance of these methods degrades with horizon, often necessitating reasoning over and composing lower-level skills.
Hierarchical reinforcement learning aims to enable this by providing a bank of lowlevel skills as action abstractions.
Hierarchies can further improve on this by abstracting the space states as well.
We posit that a suitable state abstraction should depend on the capabilities of the available lower-level policies.
We propose Value
Function Spaces: a simple approach that produces such a representation by using the value functions corresponding to each lower-level skill.
These value functions capture the affordances of the scene, thus forming a representation that compactly abstracts task relevant information and robustly ignores distractors.
Empirical evaluations for maze solving and robotic manipulation tasks demonstrate that our approach improves long-horizon performance and enables better zero-shot generalization than alternative model-free and model-based methods
I NTRODUCTION
For an agent to perform complex tasks in realistic environments, it must be able to effectively reason over long horizons, and to parse high-dimensional observations to infer the contents of a scene and its affordances.
It can do so by constructing a compact representation that is robust to distractors and suitable for planning and control.
Consider, for instance, a robot rearranging objects on a desk.
To succcessfully solve the task, the robot must learn to sequence a series of simple skills, such as picking and placing objects and opening drawers, and interpret its observations to determine which skills are most appropriate.
This requires the ability to understand the capabilities of these simpler skills, as well as the ability to plan to execute them in the correct order.
Hierarchical reinforcement learning (HRL) aims to enable this by leveraging abstraction , which simpliﬁes the higher-level control or planning problem.
Typically, this is taken to mean abstraction of actions in the form of primitive skills (e.g., options (Sutton et al., 1999)).
However, signiﬁcantly simplifying the problem for the higher level requires abstraction of both states and actions.
This is particularly important with rich sensory observations, where standard options frameworks provide a greatly abstracted state space, but do not simplify the perception or estimation problem.
The nature of the ideal state abstraction in HRL is closely tied to the action abstraction, as the most suitable abstraction of state should depend on the kinds of decisions that the higher-level policy needs to make, which in turn depends on the actions (skills) available to it.
This presents a challenge in designing
HRL methods, because it is difﬁcult to devise a state abstraction that is both highly abstracted (and therefore removes many distractors) and still sufﬁcient to make decisions for long-horizon tasks.
This challenge differs markedly from representation learning problems in other domains, like computer vision and unsupervised learning (Schroff et al., 2015; van den Oord et al., 2018; Chen et al., 2020), since it is intimately tied to the capabilities exposed to the agent via its skills.
We therefore posit that a suitable representation for a higher-level policy in HRL should depend on the capabilities of the skills available to it.
If this representation is sufﬁcient to determine the abilities and outcomes of these skills, then the high-level policy can select the skill most likely to perform the desired task.
This concept is closely tied to the notion of affordances, which has long been studied Open Drawer
Pick Blue
Place Blue in Drawer Close Drawer
[Equation]
tt 3 t 2 tt
[Figure]
Pick
[Figure]
Close
[Figure]
[Equation]
in cognitive science and psychology as an action-centric representation of state (Gibson, 1977), and has inspired techniques in robotics and RL (Zech et al., 2017; Xu et al., 2021; Mandikal & Grauman, 2021).
Given a set of skills that span the possible interactions in an environment, we propose that the value functions corresponding to these policies can provide a representation that suitably captures the capabilities of the skills in the current state and thus can be used to form a compact embedding space for high-level planning.
We call this embedding space Value Function Spaces (VFS).
Note that we intend to use these skills as high-level actions without modiﬁcations – the important problems of skill discovery and test-time adaptation are beyond the scope of our work.
Figure 1a illustrates the state abstraction constructed by VFS for the desk rearrangement example discussed above: VFS captures the affordances of the skills and represents the state of the environment, along with preconditions for the low-level skills, forming a functional representation to plan over.
Since VFS constructs a skill-centric representation of states using the value functions of the low-level skills, it captures functional equivalence of states in terms of their affordances: in
Figure 1b, states with varying object or arm positions (i-iii), different background textures (iv), and distractor objects (v) are functionally equivalent for planning, and map to the same embedding in our representation.
This signiﬁcantly simpliﬁes the high-level planning problem, making it easier for the higher level policy to generalize to novel environments to the limit of the skills themselves.
Statement of Contributions.
The primary contribution of this work is VFS, a novel state representation derived from the value functions of low-level skills available to the agent.
We show that VFS leverages the properties of value functions, notably their ability to model possible skills and completed skills, to form an effective representation for high-level planning, and is compatible with both model-free and model-based high-level policies.
Empirical evaluations in maze-solving and robotic manipulation demonstrate that the skill-centric representation constructed by VFS outperforms representations learned using contrastive and information-theoretic objectives in long-horizon tasks.
We also show that VFS can generalize to novel environments in a zero-shot manner.
R ELATED W ORK
Hierarchical RL has been studied extensively in the literature, commonly interpreted as a temporal abstraction of the original MDP.
Early works have interpreted the hierarchy introduced in this setting as an abstraction of state and action spaces (Sutton et al., 1999; Dietterich, 2000; Thomas & Barto, 2012).
The popular options framework Sutton et al.
; Precup (2000) provides a natural way of incorporating temporally extended actions into RL systems.
An agent that possesses the transition model and reward model for such a SMDP (known as an option model ) is capable of sample-based planning in discrete (Kocsis & Szepesv´ari, 2006) and continuous state spaces (Konidaris et al., 2014;
Gopalan et al., 2017).
However, doing so in environments with high-dimensional observations (such as images) is challenging.
In this work, we explore the efﬁcacy of learned skills operating on highdimensional observations for long-horizon control in realistic environments.
To improve the quality of lower-level policies, recent work in HRL has studied various facets of the problem, including discovery of skills (Konidaris & Barto, 2009;
Zhang et al., 2021b; Florensa et al., 2017; Warde-Farley et al., 2018), end-to-end training of both levels (Kulkarni et al., 2016;
Tessler et al., 2017) and integrating goal-conditioned behaviors (Ghosh et al., 2019; Nachum et al., 2019).
In this work, we assume that the low-level skills are given, and do not focus on discovering them.
Instead, we focus on how skills can simplify the higher-level control problem by providing a representation that is suitable for either model-based or model-free control.
The high-level policy does not rely on any hand-crafted rewards and only receives a sparse outcome reward.
Our method can also be interpreted as a representation learning approach.
Representation learning techniques have been employed extensively in model-free RL by augmenting auxiliary tasks based on reconstruction losses (Lange et al., 2012; Higgins et al., 2017; Yarats et al., 2019) and predicting the future conditioned on past observations (Schmidhuber, 1990; Jaderberg et al., 2017; van den
Oord et al., 2018; Shelhamer et al., 2016).
Contrastive learning has also been used in recent works to discover a meaningful latent space and extract reward signals for RL (Sermanet et al., 2017;
Warde-Farley et al., 2018; Dwibedi et al., 2018; Laskin et al., 2020).
Unlike these prior works, our aim is speciﬁcally to learn a representation that is grounded in the capabilities of the low-level skills, which gives us a skill-centric abstraction of high-dimensional observations that can compactly represent affordances of the scene while being robust to functionally-irrelevant distractors.
Alongside developments in model-free RL, prior work has also sought to learn predictive models of the environment for sampling and planning, in a model-based RL framework.
This has been demonstrated by learning dynamics using future predictions (Watter et al., 2015;
Oh et al., 2017; Ebert et al., 2017; Banijamali et al., 2018; Ha & Schmidhuber; Hafner et al., 2018; Ichter & Pavone, 2019; Hafner et al., 2020; Zhang et al., 2019), learning belief representations (Gregor et al., 2019;
Lee et al., 2019) and representing state similarity using the bisimulation metric (Castro, 2020; Zhang et al., 2021a; Agarwal et al., 2021).
The combination of learned model-free policies with structures like graphs (Savinov et al., 2018; Eysenbach et al., 2019) and trees (Ichter et al., 2021) to plan over extended horizons has also been demonstrated to improve generalization and exploration.
Although our method can utilize a model-based high-level controller to plan over temporally extended skills, our objective is not to develop better model-based RL algorithms.
Rather, we focus on developing suitable state abstractions in a hierarchical RL framework, and then evaluate these representations by employing them in both model-based and model-free higher-level controllers.
P RELIMINARIES
We assume that an agent has access to a ﬁnite set of temporally extended options O , or skills, which it can sequence to solve long-horizon tasks.
These skills can be trained for a wide range of tasks by using manual reward speciﬁcation (Huber & Grupen, 1998; Stulp & Schaal, 2011), using relabeling techniques (Andrychowicz et al., 2017), or via unsupervised skill discovery (Daniel et al., 2016;
Fox et al., 2017; Warde-Farley et al., 2018; Sharma et al., 2020).
In this work, the skills are learned via
RL with sparse, hand-speciﬁed reward functions, but in general could come from any source.
Since many prior works have focused on skill discovery, we do not explicitly address how these skills are produced, but assume that they are given.
We assume that each skill has a maximum rollout length of τ time steps, after which it is terminated.
We also assume that each skill o i ∈
O is accompanied by a critic, or value function, V o i denoting the expected cumulative skill reward executing skill o i from current state s t .
This is readily available for policies trained with RL, but for an arbitrary policy, we can use policy evaluation to obtain a value function.
Our setting is closely related to the options framework of Sutton et al.
Options are skills that consist of three components: a policy π : S × A → [0 , 1] , a termination condition β : S + → [0 , 1] , and an initiation set I ⊆ S , where S , A are the low-level state and action spaces in a fully observable decision process.
An option (cid:104)I , π, β (cid:105) is available at state s t
if and only if s t ∈
I .
We do not assume we have an initiation set, and show that the value functions provide this information.
We assume that the policies come with a termination condition, or alternatively, have a ﬁxed horizon τ .
Next, we describe a framework to formulate a decision problem that uses these options for planning.
We assume that the low-level observation and action space of the agent can be described as a fully observable semi-Markov decision process (SMDP)
M described by a tuple ( S, O, R, P, τ, γ ) , where
S ⊆ R n is the n -dimensional continuous state space; O is a ﬁnite set of temporally extended skills, or options, with a maximum horizon of τ time steps; R ( s (cid:48) | s, o i ) is the task reward received after executing the skill o
i ∈
O at state s ∈ S ; P ( s (cid:48) | s, o i ) is a PDF describing the probability of arriving in state s (cid:48) ∈ S after executing skill o i ∈
O at state s ∈ S ; γ ∈ (0 , 1] is the discount factor.
Given a ﬁnite set of options, our objective is to obtain a high-level decision-policy that selects among them, resulting in a sequence of options that reach the desired goal.
Note that generally, many image-based problems are partially observed so that the entire history of observation-action pairs may be required to describe the state.
Explicitly addressing partial observability is outside the scope of our work, so we follow the convention in prior work by assuming full observability and refer to images as states (Lillicrap et al., 2016; Nair et al., 2018).
S KILL V ALUE F UNCTIONS AS S TATE S PACES
The notion of value in RL is closely related to affordances, in that the value function predicts the capabilities of the skill being learned.
The supervised learning problem of affordance prediction (Ugur et al., 2009) can in fact be cast as a special case of value prediction (Sutton & Barto, 2018; Graves et al., 2020).
In this section, we construct a skill-centric representation of state derived from skill value functions that captures the affordances of the low-level skills, and empirically show that this representation is effective for high-level planning.
Given an SMDP M ( S, O, R, P, τ, γ ) with a ﬁnite set of k skills o i ∈
O trained with sparse outcome rewards and their corresponding value functions
V o
i , we construct an embedding space Z by stacking these skill value functions.
This gives us an abstract representation that maps a state s t to a k -dimensional representation Z ( s t ) :
=
[ V o 1 ( s t ) , V o 2 ( s t ) , ..., V o k ( s t )] , which we call the Value
Function Spaces, or VFS for short.
This representation captures functional information about the exhaustive set of interactions that the agent can have with the environment by means of executing the skills, and is thus a suitable state abstraction for downstream tasks.
Figure 1(a) illustrates the proposed state abstraction for a conceptual desk rearrangement task rollout with eight low-level skills.
A raw observation, such as an image of the robotic arm and desk, is abstracted by a 8-dimensional tuple of value functions of the available skills.
This representation captures positional information about the contents of the scene (e.g., both blocks are on the counter and drawer is closed since the corresponding values are 1 at t 0 ), preconditions for interactions (e.g., both blocks can be lifted since the “pick” values are high at t 0 ), and the effects of executing a feasible skill (e.g., the value corresponding to the “Open Drawer” skill increases on executing it at t 1 ), making it suitable for high-level planning.
Since VFS learns a skill-centric representation of the scene, it is robust to exogenous factors of variation, such as background distractors and appearance of task-irrelevant components of the scene.
This also enables VFS to generalize to novel environments with the same set of low-level skill, which we demonstrate empirically.
Figure 1(b) illustrates this for the desk rearrangement task.
All conﬁgurations shown are functionally equivalent – an open drawer with the red cube in it, blue cylinder on the countertop, empty robot arm – and can be interacted with identically.
VFS maps these conﬁgurations to the same abstract state by ignoring factors like arm pose, task-centric position of objects, color of the desk, or additional objects, which do not affect the low-level skills.
M ODEL -F REE RL WITH V ALUE F UNCTION S PACES
In this section, we instantiate a hierarchical model-free RL algorithm that uses VFS as the state abstraction and the skills as the low-level actions.
We compare the long-horizon performance of VFS to alternate representations for HRL trained with constrastive and information theoretic objectives for the task of maze-solving and ﬁnd that VFS outperforms the next best baseline by up to 54% on the most challenging tasks.
Lastly, we compare the zero-shot generalization performance of these representations and empirically demonstrate that the skill-centric representation constructed by our method can successfully generalize to novel environments with the same set of low-level skills.
5. A N A LGORITHM FOR H IERARCHICAL RL
We instantiate a hierarchical RL algorithm that learns a Q-function Q ( Z, o ) at the high-level using
VFS as the “state” Z and the skills o i ∈
O as the temporally extended actions.
Given such a Qfunction, a greedy high-level policy can be obtained by π Q ( Z ) =
arg max o i ∈
O Q ( Z, o i ) .
We use
DQN (Mnih et al., 2015), which uses mini-batches sampled from a replay buffer of transition tuples ( Z t , o t , r t , Z t +1 ) to train the learned Q-function to satisfy the Bellman equation.
This is done using gradient descent on the loss L = E ( Q ( Z t , o t ) − y t ) 2 , where y t =
r t + γ max o t (cid:
) ∈
O Q ( Z t +1 , o t (cid:48) ) .
In order to make the optimization problem more stable, the targets y t are computed using a separate target network which is update at a slower pace than the main network.
Q-learning also suffers from an overestimation bias, due to the maximization step above, and harms learning.
Hasselt et al.
(2016) address this overestimation by decoupling the selection of action from its evaluation.
We use this variant, called DDQN, for subsequent evaluations in this work.
Note that we are using the skills as given, without updating or ﬁnetuning them.
While there have been several improvements to DDQN (Hessel et al., 2018) and alternative algorithms for model-free RL in discrete action spaces (Schaul et al., 2015; Bellemare et al., 2017;
Christodoulou, 2019), and these improvements will certainly improve the overall performance of our algorithm, our goal is to evaluate the efﬁcacy of VFS as a state representation and we study it in the context of a simple DDQN pipeline.
5. E VALUATING L ONG -H ORIZON P ERFORMANCE IN M AZE -S OLVING
To evaluate the long-horizon performance of VFS against commonly used representation learning methods, we use the versatile MiniGrid environment (Chevalier-Boisvert et al., 2018) in a fully observable setting, where the agent receives a top-down view of the environment.
We consider two tasks: (i) MultiRoom , where the agent is tasked with reaching the goal by solving a variablesized maze spanning up to 10 rooms.
The agent must cross each room and open the door to access the following rooms; (ii) KeyCorridor , where the agent is tasked with reaching a goal up to 7 rooms away and may face locked doors.
The agent must ﬁnd the key corresponding to a colorcoded door and open it to access subsequent rooms.
Both these tasks have a sparse reward that is only provided for successfully reaching the goal.
This presents a challenging domain for longhorizon sequential reasoning, where tasks may require over 200 time steps to succeed, making a great testbed for evaluating the ability of the state abstractions to capture relevant information for sequencing multiple skills.
The agents have access to the following temporally extended skills –
GoToObject , PickupObject , DropObject and UnlockDoor – where the ﬁrst three skills are text-conditioned and Object may refer to a door, key, box or circle of any color.
Since MiniGrid is easily reconﬁgurable, we also generate a set of holdout MultiRoom mazes with different grid layouts to evaluate the zero-shot generalization performance of the policies trained with these representations.
Note that the grid layouts, as well as object positions, for these tasks are randomly generated for every experiment and are not static.
Example grid layouts are shown in Figure 2.
We provide further implementation details in Appendix A.1.
Baselines: We compare VFS extensively against a variety of competitive baselines for representation learning in RL using contrastive and information-theoretic objectives.
We consider representations learned both ofﬂine and online (in loop with RL); note that VFS is constructed entirely from the values of the available skills and is not learned.
Further, all baselines have access to these skills.
Raw Observations: We train a high-level policy operating on raw input observations.
Autoencoder (AE):
We use an autoencoder to extract a compact latent space using a reconstruction loss on an ofﬂine dataset of trajectories, similar to Lange et al.
Contrastive Predicting Coding (CPC):
We learn a representation by optimizing the InfoNCE loss over an ofﬂine dataset of trajectories (van den Oord et al., 2018).
Online Variational Autoencoder (VAE): We learn a VAE representation jointly (online) with the high-level policy operating on this representation (Yarats et al., 2019).
Contrastive Unsupervised Representations for RL (CURL):
We learn a representation by optimizing a contrastive loss jointly (online) with the RL objective (Laskin et al., 2020).
[Table]
Evaluation: We run experiments for the two tasks with varying number of rooms, to study the performance of the algorithms with increasing time horizon, and report the success rates in Table 1.
HRL from raw observations demonstrates a success rate of 64% in the two-room environment, which can be attributed to the powerful set of skills available to the high-level policy, but this quickly drops to 29% in the largest environment.
The ofﬂine baselines (AE and CPC) construct a compact state abstraction, which makes the learning problem easier for DDQN, and show signiﬁcant improvements in smaller environments (MultiRoom-2,4 and KeyCorridor-3).
However, they are unable to improve the performance in larger environments.
We hypothesize that this is due to the inability of the representations to capture information necessary for the high-level policy, since they are learned independent of the controller.
The performance of representations learned online (VAE and CURL), which are implemented analogous to their ofﬂine counterparts (AE and CPC, respectively) support this hypothesis and improves the performance across all tasks by learning representations jointly with the controller, and scoring up to 54% in the most challenging environment.
We hypothesize that the limited performance of these methods is due to the lack of direct inﬂuence of the downstream task on the representation.
Despite being constructed ofﬂine, VFS explicitly captures the capabilities of the low-level skills and provides an action-centric representation for the high-level policy, greatly simplifying the control problem.
This is reﬂected in the performance of VFS across all tasks – it outperforms all baselines, scoring 98% on the simplest task and up to 68% on the most challenging task, beating the next best method by over 25%.
Figure 2 shows sample rollouts of the high-level policy using VFS as the state representation in the two tasks discussed.
5. Z ERO -S HOT G ENERALIZATION
We evaluate the generalization abilities of these representations by training them for the KeyCorridor task (as above) and evaluating on MultiRoom .
Since the skills available in MultiRoom are a subset of
[Figure]
[Table]
those in KeyCorridor , we ignore any invalid actions executed by the agent.
Note that the high-level agent has not been trained in MultiRoom and the policies are not updated in the target environments.
Table 2 shows the success rates of the representations in the MultiRoom tasks with 4 ( MR4 ) androoms ( MR10 ).
Unsurprisingly, HRL with raw observations fails to generalize, because the maze layout differs signiﬁcantly (e.g. see Figure 3).
AE and CPC learn a compact representation from high-dimensional observations and allow the high-level policy to generalize to simpler tasks like
MR4 and achieve up to 47% success rate.
Interestingly, their online counterparts (VAE and CURL) also fail to generalize and perform poorly, likely because representations learned jointly with the
RL policy can overﬁt to the source environment.
VFS learns a skill-centric representation that can generalize zero-shot to tasks that use the same skills, and thus outperforms the next best baseline by up to 180%, closely matching the performance of an HRL policy trained from scratch in the target environment with online interaction ( HRL-Target ).
M ODEL -B ASED P LANNING WITH V ALUE F UNCTION S PACES
In this section, we introduce a simple model-based RL algorithm that uses VFS as the “state” for planning, which we term VFS-MB.
We study the performance of VFS in the context of a robotic manipulation task, and compare it to alternate representations for model-based RL.
We ﬁnd that the performance of VFS as an abstract representation for raw image observations outperforms all baselines and closely matches that of a pipeline with access to oracular state of the simulator, showing the efﬁcacy of our method in long-horizon planning.
6. A S IMPLE A LGORITHM FOR M ODEL -B ASED RL
We use a simple model-based planner that learns a one-step predictive model, using VFS as the “state.”
Speciﬁcally, this model learns the transition dynamics Z t +1 =
ˆ f ( Z t , o t ) ∀
o t ∈ O via supervised learning using a dataset of prior interactions in the environment.
Note that the predictive model (and the subscript of Z ) is over high-level policy steps, which may be up to τ steps of the lowlevel skills.
This dataset can be collected simply by executing the available skills in the environment for τ steps, where τ is the maximum horizon of the SMDP M , or until termination.
In order to use the learned model ˆ f ( Z t , o t ) , a goal latent state Z g , and a scoring function (cid:15) (e.g. mean squared error) for the high-level task, we need to solve the following optimization problem for the optimal sequence of skills ( o t , . . .
, o t + H − 1 ) to reach the goal:
[Equation]
[Equation]
We use a sampling-based method to ﬁnd solutions to the above equation.
We use random shooting (Rao, 2009) to randomly generate K candidate option sequences, predict the corresponding Z sequences using the learned model ˆ f , compute the rewards for all sequences, and pick the candidate action sequence leading to a latent state closest to the goal, according to Equation 1.
We execute the policy using model-predictive control: the policy executes only the ﬁrst skill o t , receives the updated
Z t +1 from the environment, and recalculates the optimal action sequence iteratively.
Figure 4 shows an overview of the algorithm.
We provide further implementation details in Appendix A.
Note that our goal is to study the behavior of VFS as a state representation in existing RL pipelines, rather than developing a better model-based algorithm.
Using sophisticated methods that adjust the sampling distribution, as in the cross-entropy method (Finn & Levine, 2017; Hafner et al., 2018;
Chua et al., 2018) or path integral optimal control (Williams et al., 2015; Lowrey et al., 2019), as well as more sophisticated models and planning or control methods would likely improve overall performance further, but is outside the scope of this work.
[Figure]
A PPLICATION : R OBOTIC M ANIPULATION
We evaluate the performance of VFS-MB in a complex image-based task using a simulated manipulation environment with an 8-DoF robotic arm, similar to the setup used by Jang et al. The robot only has access to high-dimensional egocentric visual observations.
We consider the task of semantic rearrangement, which requires rearranging objects into semantically meaningful positions – e.g., grouped into (multiple) clusters, or moved to a corner (Figure 5).
Efﬁciently solving this task requires the robot to plan over a series of manipulation maneuvers, interacting with up to 10 distinct objects.
This requires long-horizon planning, and presents a major challenge for RL methods.
Each of the methods we compare have access to a library of MoveANearB skills, trained as a multi-task policy with MT-Opt (Kalashnikov et al., 2021).
There are 10 objects, and 9 possible destinations near which they can be moved, resulting in a total of 90 skills, which then comprise the action space for planning.
The skills control the robot at a frequency of 0.5 Hz, taking an average of 14 time steps to execute with a success rate of 94%.
We provide further details about these skills in Appendix A.2.
We consider two versions of the task, which arrange either 5 or 10 objects to semantic positions.
The
O5 environment uses a random subset of the 10 objects in every experiment; lesser objects allow a smaller planning horizon, making planning problem simpler than in the O10 environment, which has all 10 objects.
We randomize the object positions on the table and command the algorithms to reach the same goal with a planning horizon H = 7 steps for the smaller environment and H =steps for the larger environment, reporting the task success rate averaged over 20 experimental runs.
Baselines: To evaluate the efﬁcacy of the proposed representation for high-level model-based planning, we compare it against four alternative representations used in conjunction with the algorithm described in Section 6.1.
All methods have access to the skills and use them as the low-level action space.
Raw Image learns a policy on raw visual observations from the robot’s onboard camera.
VAE uses a variational autoencoder to project the observations to a 100 − dimensional learned embedding space, similar to Corneil et al.
We train this VAE ofﬂine from trajectories collected by rolling out the models.
CPC uses contrastive predictive coding (van den Oord et al., 2018) to learn a similar representation from ofﬂine trajectories.
We also compare against an Oracle State baseline that has access to privileged information – the simulator state – and learns the model on this .
This gives us an upper bound for the performance of the baselines.
Evaluation: Table 3 shows the success rates on the two versions of the task for each prior method.
The model trained using image observations fares poorly and fails at all but the simplest starting conﬁgurations.
It succeeds in 2/20 experiments in O10 , largely due to poor model predictions.
The
VAE and CPC representations, which learn a more compact embedding space to plan over, succeed in up to 65% of the tasks in the simpler O5 environment.
However, their performance falls sharply in the O10 environment, where the longer horizons read to greater error accumulation.
VFS constructs an effective representation that captures the state of the scene as well as the affordances of the skills,
[Figure]
Representation
[Table]
and succeeds in all tasks in the O5 environment, matching the oracle performance.
It also succeeds in 80% of the tasks in O10 , closely matching the oracle’s performance of 85%.
To understand the factors captured by VFS we sample encoded observations from a large number of independent trajectories and visualize their 2D t-SNE embeddings (van der Maaten & Hinton, 2008).
Figure 6 shows that VFS can successfully capture information about objects in the scene and affordances (e g. which object is in the robot’s arm and can be manipulated), while ignoring distractors like the poses of the objects on the table and the arm.
D ISCUSSION
We proposed Value Function Spaces as state abstractions: a novel skill-centric representation that captures the affordances of the low-level skills.
States are encoded into representations that are invariant to exogenous factors that do not affect values of these skills.
We show that this representation is compatible with both model-free and model-based policies for hierarchical control, and demonstrate signiﬁcantly improved performance both in terms of successfully performing longhorizon tasks and in terms of zero-shot generalization to novel environments, which leverages the invariances that are baked into our representation.
The focus of our work is entirely on utilizing a pre-speciﬁed set of skills, and we do not address how such skills are learned.
Improving the low-level skills jointly with the high-level policy could lead to even better performance on particularly complex tasks, and would be an exciting direction for future work.
More broadly, since our method connects skills directly to state representations, it could be used to turn unsupervised skill discovery methods directly into unsupervised representation learning methods, which could be an exciting path toward more general approaches that retain the invariances and generalization beneﬁts of our method.
R EPRODUCIBILITY S TATEMENT
The primary contribution of our work, VFS, is a skill-centric representation designed to work with existing model-based and model-free pipelines.
The implementation simply involves concatenating the value functions corresponding to the available skills into an embedding vector that can be used for HRL or planning.
We provide all necessary information for setting up VFS to work with a reader’s RL algorithm of choice in Sections 5.1, 6.1 and Appendix A.
Our model-free experiments are conducted on an open-source gym environment and we provide conﬁguration details for setting up our quantitative experiments in Appendix A.1.
We hope that this encourages the community to utilize and build upon the ideas presented in the paper.
We plan to release the code along with information about the proprietary environments used in a public release of this article upon publication
A I MPLEMENTATION D ETAILS
A. M ODEL -F REE RL
Maze-solving environment.
We run our model-free experiments using MiniGrid, a suite of opensource gym environments 1 developed by Chevalier-Boisvert et al.
Speciﬁcally, we use the following registered environments:
MultiRoom (a) MiniGrid-MultiRoom-N2-S4-v (b) MiniGrid-MultiRoom-N4-S5-v (c) MiniGrid-MultiRoom-N6-v 2.
KeyCorridor (a) MiniGrid-KeyCorridorS3R3-v (b) MiniGrid-KeyCorridorS6R3-v
Additionally, we also create a modiﬁcation of 1-(a) above that spans 10 rooms.
We modify the base class of MiniGrid to remove partial observability, and hence, the agents receive a fully observable top-down view of the grid at all times.
Skills for Maze-Solving.
We assume that the algorithms have access to the following temporally extended skills – GoToObject , PickupObject , DropObject and UnlockDoor – where the ﬁrst three skills are text-conditioned and Object may refer to a door, key, box or circle.
The skills corresponding to the key and unlocking are not valid in MultiRoom , but we use the same action speciﬁcation for the agents; if an agent executes an invalid action, the state of the world does not change.
We train the GoTo skills individually using the A2C (Mnih et al., 2016) implementation recommended by the developer 2 .
Each of these skills are trained with a sparse outcome reward (+ if a trajectory is successful, 0 otherwise), without any reward shaping or relabeling.
The remaining skills are oracular and given to us by the MiniGrid environment.
We choose τ = 50 to avoid the
GoTo action from taking too long; if it fails to reach the goal in 50 steps, the skill is considered unsuccessful.
This results in a set of 13 skills of varying lengths – from 1 to 50 time steps.
Baselines.
Since we have 13 skills, the proposed VFS representation is a 13-dimensional vector.
For consistency across methods, we enforce all baselines to learn a 13-dimensional embedding as a state representation.
We use a standard implementation of the AE and VAE baselines.
For CPC, we use our own PyTorch implementation based on this widely used repository 3 .
For CURL, we use the authors’ ofﬁcial implementation 4 .
The AE and CPC representations are trained ofﬂine a dataset of 10 5 observations collected by executing the skills in an open-loop manner.
The HRL policy is trained to convergence for all baselines.
Hierarchical RL.
As discussed in Section 5.1, we use Q-learning to approximate the Q-function of the high-level (semi) MDP and infer the policy indirectly.
Our focus is not to identify the best algorithm for learning a high-level policy, and one could run this analysis with any choice of RL algorithm – actor-critic, Q-learning, policy gradient, etc.
For the sake of this work, we present results using the simple DQN framework.
For the results in the paper, we use a Double-DQN to avoid overestimation bias.
For the experiment with raw observations, we use the convolutional network used widely in the original DQN and DDQN papers – 3 convolutional layers followed by two fully-connected layers.
For the other baselines, with a 13-dimensional representation, we use four fully-connected layers.
All layers use ReLu activations and we optimize the objective using
RMSProp with momentum parameter 0.95.
HRL Evaluation.
Note that the grid layouts, as well as object positions, in MiniGrid are randomly generated for every experiment and are not static.
For quantitative evaluation of the representations (see Table 1 for results), we initialize 20 distinct grid layouts for each task and environment size.
We run all baselines with 5 random seeds and report the mean success rate over 100 experimental runs per baseline per task (a total of 3600 experiments).
The generalization results (see Table 2) were also conducted under the same setting.
A. M ODEL -B ASED RL
Dataset of interactions.
To learn the dynamics function ˆ f in a supervised learning manner, we collect a dataset of trajectories in the manipulation simulator.
We initialize the simulator randomly and execute the available skills in an open-loop fashion to collect tuples of transitions ( s, o, s (cid:48) ) , where executing a skill o at state s terminates in state s (cid:48) at the end of the skill (up to τ time steps).
This gives us a dataset of interactions which we use to train a one-step predictive model.
Note that this model predicts the future states for the high-level policy.
We collect a dataset of one million tuples which is used to train the model for all baselines.
Learned Skills.
The individual skill value functions are distilled from a multitask RL policy trained with MT-Opt Kalashnikov et al.
The value functions Q θ ( s, a ) operate on a state space of (472, 472, 3) RGB images that are center cropped from egocentric (512, 640, 3) egocentric visual observations and an a 8D action space of end-effector translation (3D), end-effector orientation (4D), and gripper closedness (1D).
The reward functions for each task are engineered ground-truth success detectors that are used as sparse rewards.
Learning the Dynamics Function.
We use a neural network to learn a one-step predictive model
Z t +1 =
ˆ f ( Z t , o t ) ∀
o t ∈
O that can approximate the transition dynamics of the skills.
For all nonimage baselines, we use a fully-connected network with 3 hidden layers, each of dimension 500.
For the raw image baseline, we use a MobileNetv2 encoder (Sandler et al., 2018) followed by two fully-connected layers.
All layers use ReLu activations and we optimize the objective using the
Adam optimizer.
For random shooting, we sample K = 50 actions and use controller horizons as described in Section 6.2.
Evaluation.
We evaluate the representations on a set of 20 randomly initialized start-goal conﬁgurations in the robotic manipulation task.
Common semantic goals for this task include “cluster all objects around the bowl”, “divide the objects into two factions”, “move objects to the top-left corner” and so on.
A trajectory is successful if all semantic/proximity relations are valid; two objects are considered “close” if they are less than 5cm apart.