Original: O FFLINE
Revised: O FFLINE

Original: M ETA -R EINFORCEMENT
Revised: M ETA -R EINFORCEMENT

Original: L EARNING
Revised: L EARNING

Original: WITH
Revised: WITH

Original: O NLINE S ELF -S UPERVISION
Revised: O NLINE S ELF -S UPERVISION

Original: Anonymous authors
Revised: Anonymous authors

Original: Paper under double-blind review
Revised: Paper under double-blind review

Original: A BSTRACT
Revised: A BSTRACT

Original: Meta-reinforcement learning (RL) methods can meta-train policies that adapt to new tasks with orders of magnitude less data than standard RL, but meta-training itself is costly and time-consuming.
Revised: Meta-reinforcement learning (RL) methods can meta-train policies that adapt to new tasks with orders of magnitude less data than standard RL, but meta-training itself is costly and time-consuming.

Original: If we can meta-train on ofﬂine data, then we can reuse the same static dataset, labeled once with rewards for different tasks, to meta-train policies that adapt to a variety of new tasks at meta-test time.
Revised: If we can meta-train on ofﬂine data, then we can reuse the same static dataset, labeled once with rewards for different tasks, to meta-train policies that adapt to a variety of new tasks at meta-test time.

Original: Although this capability would make meta-RL a practical tool for real-world use, ofﬂine meta-RL presents additional challenges beyond online meta-RL or standard ofﬂine
Revised: Although this capability would make meta-RL a practical tool for real-world use, ofﬂine meta-RL presents additional challenges beyond online meta-RL or standard ofﬂine

Original: RL settings.
Revised: RL settings.

Original: Meta-RL learns an exploration strategy that collects data for adapting, and also meta-trains a policy that quickly adapts to data from a new task.
Revised: Meta-RL learns an exploration strategy that collects data for adapting, and also meta-trains a policy that quickly adapts to data from a new task.

Original: Since this policy was meta-trained on a ﬁxed, ofﬂine dataset, it might behave unpredictably when adapting to data collected by the learned exploration strategy, which differs systematically from the ofﬂine data and thus induces distributional shift.
Revised: Since this policy was meta-trained on a ﬁxed, ofﬂine dataset, it might behave unpredictably when adapting to data collected by the learned exploration strategy, which differs systematically from the ofﬂine data and thus induces distributional shift.

Original: We propose a hybrid ofﬂine meta-RL algorithm, which uses ofﬂine data with rewards to meta-train an adaptive policy, and then collects additional unsupervised online data, without any reward labels to bridge this distribution shift.
Revised: We propose a hybrid ofﬂine meta-RL algorithm, which uses ofﬂine data with rewards to meta-train an adaptive policy, and then collects additional unsupervised online data, without any reward labels to bridge this distribution shift.

Original: By not requiring reward labels for online collection, this data can be much cheaper to collect.
Revised: By not requiring reward labels for online collection, this data can be much cheaper to collect.

Original: We compare our method to prior work on ofﬂine meta-RL on simulated robot locomotion and manipulation tasks and ﬁnd that using additional unsupervised online data collection leads to a dramatic improvement in the adaptive capabilities of the meta-trained policies, matching the performance of fully online meta-RL on a range of challenging domains that require generalization to new tasks.
Revised: We compare our method to prior work on ofﬂine meta-RL on simulated robot locomotion and manipulation tasks and ﬁnd that using additional unsupervised online data collection leads to a dramatic improvement in the adaptive capabilities of the meta-trained policies, matching the performance of fully online meta-RL on a range of challenging domains that require generalization to new tasks.

Original:  I NTRODUCTION
Revised:  I NTRODUCTION

Original: Reinforcement learning (RL) agents are often described as learning from reward and punishment analogously to animals: in the same way that a person might train a dog by providing treats, we might train RL agents by providing rewards.
Revised: Reinforcement learning (RL) agents are often described as learning from reward and punishment analogously to animals: in the same way that a person might train a dog by providing treats, we might train RL agents by providing rewards.

Original: However, in reality, modern deep RL agents require so many trials to learn a task that providing rewards by hand is often impractical.
Revised: However, in reality, modern deep RL agents require so many trials to learn a task that providing rewards by hand is often impractical.

Original: Meta-reinforcement learning in principle can mitigate this, by learning to learn using a set of meta-training tasks, and then acquiring new behaviors in just a few trials at meta-test time.
Revised: Meta-reinforcement learning in principle can mitigate this, by learning to learn using a set of meta-training tasks, and then acquiring new behaviors in just a few trials at meta-test time.

Original: Current meta-RL methods are so efﬁcient that meta-trained policies require only a handful of trajectories (Rakelly et al., 2019), which is reasonable for a human to provide by hand.
Revised: Current meta-RL methods are so efﬁcient that meta-trained policies require only a handful of trajectories (Rakelly et al., 2019), which is reasonable for a human to provide by hand.

Original: However, the meta-training phase in these algorithms still requires a large number of online samples, often even more than standard RL, due to the multi-task nature of the meta-learning problem.
Revised: However, the meta-training phase in these algorithms still requires a large number of online samples, often even more than standard RL, due to the multi-task nature of the meta-learning problem.

Original: Ofﬂine reinforcement learning methods, which use only prior experience without active data collection, provide a potential solution to this issue, because a user must only annotate multi-task data with rewards once in the ofﬂine dataset, rather than doing so in the inner loop of RL training, and the same ofﬂine multi-task data can be reused repeatedly for many training runs.
Revised: Ofﬂine reinforcement learning methods, which use only prior experience without active data collection, provide a potential solution to this issue, because a user must only annotate multi-task data with rewards once in the ofﬂine dataset, rather than doing so in the inner loop of RL training, and the same ofﬂine multi-task data can be reused repeatedly for many training runs.

Original: While a few recent works have proposed ofﬂine meta-RL algorithms Dorfman & Tamar (2020); Mitchell et al.
Revised: While a few recent works have proposed ofﬂine meta-RL algorithms Dorfman & Tamar (2020); Mitchell et al.

Original: (2021), we identify a speciﬁc problem when an agent trained with ofﬂine meta-RL is tested on a new task: the distributional shift between the behavior policy from the ofﬂine data and the meta-test time exploration policy means that adaptation procedures learned from ofﬂine data might not perform well on the (differently distributed) data collected by the exploration policy at meta-test time.
Revised: (2021), we identify a speciﬁc problem when an agent trained with ofﬂine meta-RL is tested on a new task: the distributional shift between the behavior policy from the ofﬂine data and the meta-test time exploration policy means that adaptation procedures learned from ofﬂine data might not perform well on the (differently distributed) data collected by the exploration policy at meta-test time.

Original: This mismatch in training distribution occurs because ofﬂine meta-RL never trains on data generated by the meta-learned exploration policy.
Revised: This mismatch in training distribution occurs because ofﬂine meta-RL never trains on data generated by the meta-learned exploration policy.

Original: In practice, we ﬁnd that this mismatch leads to a large degradation in performance when adapting to new tasks.
Revised: In practice, we ﬁnd that this mismatch leads to a large degradation in performance when adapting to new tasks.

Original: Moreover, we do not want to remove this distributional shift by simply adopting a conservative exploration strategy, because learning an exploration strategy enables an agent to collect better data for faster adaptation.
Revised: Moreover, we do not want to remove this distributional shift by simply adopting a conservative exploration strategy, because learning an exploration strategy enables an agent to collect better data for faster adaptation.

Original: We propose to address this challenge by collecting additional online data without any reward supervision, leading to a semi-supervised ofﬂine meta-RL algorithm, as illustrated in Figure 1.
Revised: We propose to address this challenge by collecting additional online data without any reward supervision, leading to a semi-supervised ofﬂine meta-RL algorithm, as illustrated in Figure 1.

Original: Online data can be relatively cheap to collect when it does not require reward labels, but it can still make it possible to bridge the distributional shift issue.
Revised: Online data can be relatively cheap to collect when it does not require reward labels, but it can still make it possible to bridge the distributional shift issue.

Original: To make it feasible to use this data for meta-training, we can generate synthetic reward labels for it based on the labeled ofﬂine data.
Revised: To make it feasible to use this data for meta-training, we can generate synthetic reward labels for it based on the labeled ofﬂine data.

Original: Based on this principle, we propose semi-supervised meta actor-critic (SMAC), which uses rewardlabeled ofﬂine data to bootstrap a semi-supervised meta-reinforcement learning procedure, in which an ofﬂine meta-RL agent collects additional online experience without any reward labels.
Revised: Based on this principle, we propose semi-supervised meta actor-critic (SMAC), which uses rewardlabeled ofﬂine data to bootstrap a semi-supervised meta-reinforcement learning procedure, in which an ofﬂine meta-RL agent collects additional online experience without any reward labels.

Original: SMAC uses the reward supervision from the ofﬂine dataset to learn to generate new reward functions, which it uses to autonomously annotate rewards in these rewardless interactions and meta-train on this new data.
Revised: SMAC uses the reward supervision from the ofﬂine dataset to learn to generate new reward functions, which it uses to autonomously annotate rewards in these rewardless interactions and meta-train on this new data.

Original: Our method contains two novel contributions:
Revised: Our method contains two novel contributions:

Original: ﬁrst, it is the ﬁrst method to combine the efﬁcient PEARL (Rakelly et al., 2019) amortized inference method for meta-RL with AWAC (Nair et al., 2020), an effective approach for ofﬂine RL with online ﬁnetuning.
Revised: ﬁrst, it is the ﬁrst method to combine the efﬁcient PEARL (Rakelly et al., 2019) amortized inference method for meta-RL with AWAC (Nair et al., 2020), an effective approach for ofﬂine RL with online ﬁnetuning.

Original: This already yields an effective new ofﬂine meta-RL procedure.
Revised: This already yields an effective new ofﬂine meta-RL procedure.

Original: Second, it is the ﬁrst approach to perform ofﬂine meta-RL with self-supervised online ﬁnetuning, without ground truth rewards.
Revised: Second, it is the ﬁrst approach to perform ofﬂine meta-RL with self-supervised online ﬁnetuning, without ground truth rewards.

Original: We evaluate our method and prior ofﬂine meta-RL methods on a number of benchmarks (Dorfman & Tamar, 2020; Mitchell et al., 2021), as well as a challenging  manipulation domain that requires generalization to new tasks, with just a few reward-labeled trials at meta-test time.
Revised: We evaluate our method and prior ofﬂine meta-RL methods on a number of benchmarks (Dorfman & Tamar, 2020; Mitchell et al., 2021), as well as a challenging robot manipulation domain that requires generalization to new tasks, with just a few reward-labeled trials at meta-test time.

Original: We ﬁnd that, while standard meta-RL methods perform well at adapting to training tasks, they suffer from data-distribution shifts when adapting to new tasks.
Revised: We ﬁnd that, while standard meta-RL methods perform well at adapting to training tasks, they suffer from data-distribution shifts when adapting to new tasks.

Original: In contrast, our method attains signiﬁcantly better performance, on par with an online meta-RL method that receives fully labeled online interaction data.
Revised: In contrast, our method attains signiﬁcantly better performance, on par with an online meta-RL method that receives fully labeled online interaction data.

Original:  R ELATED W ORKS
Revised:  R ELATED W ORKS

Original: Many prior meta-RL algorithms assume that reward labels are provided with each episode of online interaction (Duan et al., 2016; Finn et al., 2017; Gupta et al., 2018b; Xu et al., 2018; Hausman et al., 2018;
Revised: Many prior meta-RL algorithms assume that reward labels are provided with each episode of online interaction (Duan et al., 2016; Finn et al., 2017; Gupta et al., 2018b; Xu et al., 2018; Hausman et al., 2018;

Original: Rakelly et al., 2019; Humplik et al., 2019; Kirsch et al., 2019; Zintgraf et al., 2020; Xu et al., 2020; Zhao et al., 2020; Kamienny et al., 2020).
Revised: Rakelly et al., 2019; Humplik et al., 2019; Kirsch et al., 2019; Zintgraf et al., 2020; Xu et al., 2020; Zhao et al., 2020; Kamienny et al., 2020).

Original: In contrast to these prior methods, our method only requires ofﬂine prior data with rewards, and additional online interaction does not require any ground truth reward signal.
Revised: In contrast to these prior methods, our method only requires ofﬂine prior data with rewards, and additional online interaction does not require any ground truth reward signal.

Original: Prior works have also studied other formulations that combine unlabeled and labeled trials.
Revised: Prior works have also studied other formulations that combine unlabeled and labeled trials.

Original: For example, imitation and inverse reinforcement learning methods use ofﬂine demonstrations to either learn a reward function (Abbeel & Ng, 2004; Finn et al., 2016; Ho &
Revised: For example, imitation and inverse reinforcement learning methods use ofﬂine demonstrations to either learn a reward function (Abbeel & Ng, 2004; Finn et al., 2016; Ho &

Original: Ermon, 2016; Fu et al., 2017) or to directly learn a policy (Schaal, 1999; Ross & Bagnell, 2010; Ho &
Revised: Ermon, 2016; Fu et al., 2017) or to directly learn a policy (Schaal, 1999; Ross & Bagnell, 2010; Ho &

Original: Ermon, 2016; Reddy et al., 2019; Peng et al., 2020).
Revised: Ermon, 2016; Reddy et al., 2019; Peng et al., 2020).

Original: Semi-supervised and positive-unlabeled reward learning (Xu & Denil, 2019; Zolna et al., 2020; Konyushkova et al., 2020)
Revised: Semi-supervised and positive-unlabeled reward learning (Xu & Denil, 2019; Zolna et al., 2020; Konyushkova et al., 2020)

Original: methods use reward labels provided for some interactions to train a reward function for RL.
Revised: methods use reward labels provided for some interactions to train a reward function for RL.

Original: However, all of these methods have been studied in the context of a single task.
Revised: However, all of these methods have been studied in the context of a single task.

Original: In contrast, we focus on meta-learning an RL procedure that can adapt to new reward functions.
Revised: In contrast, we focus on meta-learning an RL procedure that can adapt to new reward functions.

Original: In other words, we do not focus on recovering a single reward function, because there is no single test time reward or task.
Revised: In other words, we do not focus on recovering a single reward function, because there is no single test time reward or task.

Original: SMAC uses a context-based adaptation procedure similar to that proposed by Rakelly et al.
Revised: SMAC uses a context-based adaptation procedure similar to that proposed by Rakelly et al.

Original: (2019), which is related to contextual policies, such as goal-conditioned reinforcement learning (Kaelbling, 1993; Schaul et al., 2015; Andrychowicz et al., 2017; Pong et al., 2018;
Revised: (2019), which is related to contextual policies, such as goal-conditioned reinforcement learning (Kaelbling, 1993; Schaul et al., 2015; Andrychowicz et al., 2017; Pong et al., 2018;

Original: Colas et al., 2018;
Revised: Colas et al., 2018;

Original: Warde-
Revised: Warde-

Original: Farley et al., 2018; Péré et al., 2018; Nair et al., 2018) or successor features (Kulkarni et al., 2016;
Revised: Farley et al., 2018; Péré et al., 2018; Nair et al., 2018) or successor features (Kulkarni et al., 2016;

Original: Barreto et al., 2017; 2019; Grimm et al., 2019).
Revised: Barreto et al., 2017; 2019; Grimm et al., 2019).

Original: In contrast, our meta-learning procedure applies to any RL problem, does not assume that the reward is deﬁned by a single goal state or ﬁxed basis function, and only requires reward labels for static ofﬂine data.
Revised: In contrast, our meta-learning procedure applies to any RL problem, does not assume that the reward is deﬁned by a single goal state or ﬁxed basis function, and only requires reward labels for static ofﬂine data.

Original: Our method addresses a similar problem to prior ofﬂine meta-RL methods (Mitchell et al., 2021;
Revised: Our method addresses a similar problem to prior ofﬂine meta-RL methods (Mitchell et al., 2021;

Original: Dorfman & Tamar, 2020).
Revised: Dorfman & Tamar, 2020).

Original: In our comparisons, we ﬁnd that after ofﬂine meta-training, our method is competitive to these prior approaches, but that with additional self-supervised online ﬁne-tuning, our method signiﬁcantly outperforms these methods by mitigating the aforementioned distributional shift issue.
Revised: In our comparisons, we ﬁnd that after ofﬂine meta-training, our method is competitive to these prior approaches, but that with additional self-supervised online ﬁne-tuning, our method signiﬁcantly outperforms these methods by mitigating the aforementioned distributional shift issue.

Original: Our method addresses the distribution shift problem by using online interactions without reward supervision.
Revised: Our method addresses the distribution shift problem by using online interactions without reward supervision.

Original: In our experiments, we found that SMAC greatly improves performance on both training and held-out tasks.
Revised: In our experiments, we found that SMAC greatly improves performance on both training and held-out tasks.

Original: Lastly, SMAC is also related to unsupervised meta-learning methods (Gupta et al., 2018a; Jabri et al., 2019), which annotate data with their own rewards.
Revised: Lastly, SMAC is also related to unsupervised meta-learning methods (Gupta et al., 2018a; Jabri et al., 2019), which annotate data with their own rewards.

Original: In contrast to these methods, we assume that there exists an ofﬂine dataset with reward labels that we can use to learn to generate similar rewards.
Revised: In contrast to these methods, we assume that there exists an ofﬂine dataset with reward labels that we can use to learn to generate similar rewards.

Original:  P RELIMINARIES
Revised:  P RELIMINARIES

Original: Meta-reinforcement learning.
Revised: Meta-reinforcement learning.

Original: In meta-RL, we assume there is a distribution of tasks p T ( · ) .
Revised: In meta-RL, we assume there is a distribution of tasks p T ( · ) .

Original: A task T is a Markov decision process (MDP), deﬁned by a tuple T =
Revised: A task T is a Markov decision process (MDP), deﬁned by a tuple T =

Original: ( S , A , r, γ, p 0 , p d ) , where S is the state space,
Revised: ( S , A , r, γ, p 0 , p d ) , where S is the state space,

Original: A is the action space, r is a reward function, γ is a discount factor, p 0 ( s 0 ) is the initial state distribution, and p d ( s t +1 | s t , a t ) is the environment dynamics distribution.
Revised: A is the action space, r is a reward function, γ is a discount factor, p 0 ( s 0 ) is the initial state distribution, and p d ( s t +1 | s t , a t ) is the environment dynamics distribution.

Original: A replay buffer D is a set of state, action, reward, next-states tuples, D
Revised: A replay buffer D is a set of state, action, reward, next-states tuples, D

Original: = { s i , a i , r i , s (cid:48)
Revised: = { s i , a i , r i , s (cid:48)

Original: i } N size i =1 , where all the rewards come from the same task.
Revised: i } N size i =1 , where all the rewards come from the same task.

Original: We will use the letter h to denote a mini-batch or “history” and the notation h ∼ D to denote that a mini-batch h is sampled from a replay buffer D .
Revised: We will use the letter h to denote a mini-batch or “history” and the notation h ∼ D to denote that a mini-batch h is sampled from a replay buffer D .

Original: We will use the letter τ to represent a trajectory τ =
Revised: We will use the letter τ to represent a trajectory τ =

Original: ( s 1 , a 1 , s 2 , . . . )
Revised: ( s 1 , a 1 , s 2 , . . . )

Original: without reward labels.
Revised: without reward labels.

Original: A meta-episode consists of sampling a task T ∼ p T ( · ) , collecting T trajectories with a policy π θ with parameters θ , adapting the policy to the task between trajectories, and measuring the performance on the last trajectory.
Revised: A meta-episode consists of sampling a task T ∼ p T ( · ) , collecting T trajectories with a policy π θ with parameters θ , adapting the policy to the task between trajectories, and measuring the performance on the last trajectory.

Original: Between trajectories, the adaptation procedure transforms the history of states and actions h from the current meta-episode into a context z
Revised: Between trajectories, the adaptation procedure transforms the history of states and actions h from the current meta-episode into a context z

Original: =
Revised: =

Original: A φ ( h ) , which is then given to the policy π θ ( a , | s , z ) for adaptation.
Revised: A φ ( h ) , which is then given to the policy π θ ( a , | s , z ) for adaptation.

Original: The exact representation of π θ , A φ , and z depends on the speciﬁc meta-RL method used.
Revised: The exact representation of π θ , A φ , and z depends on the speciﬁc meta-RL method used.

Original: For example, the context z can be weights of a neural network (Finn et al., 2017) outputted by a gradient update, hidden activations ouputted by a recurrent neural network (Duan et al., 2016), or latent variables outputted by a stochastic encoder (Rakelly et al., 2019).
Revised: For example, the context z can be weights of a neural network (Finn et al., 2017) outputted by a gradient update, hidden activations ouputted by a recurrent neural network (Duan et al., 2016), or latent variables outputted by a stochastic encoder (Rakelly et al., 2019).

Original: Using this notation, the objective in meta-RL is to learn the adaptation parameters φ and policy parameters θ to maximize performance on a meta-episode given a new task T sampled from p ( T ) .
Revised: Using this notation, the objective in meta-RL is to learn the adaptation parameters φ and policy parameters θ to maximize performance on a meta-episode given a new task T sampled from p ( T ) .

Original: PEARL.
Revised: PEARL.

Original: Since we require an off-policy meta-RL procedure for ofﬂine meta-training, we build on probabilistic embeddings for actor-critic RL (PEARL) (Rakelly et al., 2019), an online off-policy meta-RL algorithm.
Revised: Since we require an off-policy meta-RL procedure for ofﬂine meta-training, we build on probabilistic embeddings for actor-critic RL (PEARL) (Rakelly et al., 2019), an online off-policy meta-RL algorithm.

Original: In PEARL, z is a vector and the adaptation procedure A φ consists of sampling z from a distribution z ∼ q φ e ( z | h ) .
Revised: In PEARL, z is a vector and the adaptation procedure A φ consists of sampling z from a distribution z ∼ q φ e ( z | h ) .

Original: The distribution q φ e is generated by an encoder with parameters φ e .
Revised: The distribution q φ e is generated by an encoder with parameters φ e .

Original: This encoder is a set-based neural network that processes the tuples in h
Revised: This encoder is a set-based neural network that processes the tuples in h

Original: = { s i , a i , r i , s (cid:48) i } N enc
Revised: = { s i , a i , r i , s (cid:48) i } N enc

Original: i
Revised: i

Original: =1 in a permutation-invariant manner to produce the mean and variance of a diagonal multivariate Gaussian.
Revised: =1 in a permutation-invariant manner to produce the mean and variance of a diagonal multivariate Gaussian.

Original: The policy is a contextual policy π θ ( a | s , z ) conditioned on z by concatenating z to the state s .
Revised: The policy is a contextual policy π θ ( a | s , z ) conditioned on z by concatenating z to the state s .

Original: The policy parameter θ is trained using soft-actor critic (Haarnoja et al., 2018) which involves learning a Q -function, Q w ( s , a , z ) , with parameter w that estimates the sum of future discounted rewards conditioned on the current state, action, and context.
Revised: The policy parameter θ is trained using soft-actor critic (Haarnoja et al., 2018) which involves learning a Q -function, Q w ( s , a , z ) , with parameter w that estimates the sum of future discounted rewards conditioned on the current state, action, and context.

Original: The encoder parameters are trained by back-propagating the critic loss into the encoder.
Revised: The encoder parameters are trained by back-propagating the critic loss into the encoder.

Original: The actor, critic, and encoder losses are minimized via gradient descent with mini-batches sampled from separate replay buffers for each task.
Revised: The actor, critic, and encoder losses are minimized via gradient descent with mini-batches sampled from separate replay buffers for each task.

Original: Ofﬂine reinforcement learning.
Revised: Ofﬂine reinforcement learning.

Original: In ofﬂine reinforcement learning, we assume that we have access to a dataset D collected by some behavior policy π β .
Revised: In ofﬂine reinforcement learning, we assume that we have access to a dataset D collected by some behavior policy π β .

Original: An RL agent must train on this ﬁxed dataset and cannot interact with the environment.
Revised: An RL agent must train on this ﬁxed dataset and cannot interact with the environment.

Original: One challenge that ofﬂine RL poses is that the distribution of states and actions that an agent will see when deployed will likely be different from those seen in the ofﬂine dataset as they are generated by the agent, and a number of recent methods have tackled this distribution shift issue (Fujimoto et al., 2019b;a; Kumar et al., 2019;
Revised: One challenge that ofﬂine RL poses is that the distribution of states and actions that an agent will see when deployed will likely be different from those seen in the ofﬂine dataset as they are generated by the agent, and a number of recent methods have tackled this distribution shift issue (Fujimoto et al., 2019b;a; Kumar et al., 2019;

Original: Wu et al., 2019; Nair et al., 2020; Levine et al., 2020).
Revised: Wu et al., 2019; Nair et al., 2020; Levine et al., 2020).

Original: Moreover, one can combine ofﬂine RL with meta-RL by training meta-RL
Revised: Moreover, one can combine ofﬂine RL with meta-RL by training meta-RL

Original: [Figure] [Figure]
Revised: [Figure] [Figure]

Original: |
Revised: |

Original: [Figure]
Revised: [Figure]

Original: ) |
Revised: ) |

Original: [Figure]
Revised: [Figure]

Original: P o s tA
Revised: P o s tA

Original: d a p t a t i o n
Revised: d a p t a t i o n

Original: R e t u r n s
Revised: R e t u r n s

Original: Ant Direction: Adapting from Online vs Oﬄine Data
Revised: Ant Direction: Adapting from Online vs Oﬄine Data

Original: [Figure]
Revised: [Figure]

Original: on multiple datasets D 1 , . . .
Revised: on multiple datasets D 1 , . . .

Original: , D N buff (Dorfman & Tamar, 2020; Mitchell et al., 2021), but in the next section we describe some limitations of this combination.
Revised: , D N buff (Dorfman & Tamar, 2020; Mitchell et al., 2021), but in the next section we describe some limitations of this combination.

Original:  T HE P ROBLEM WITH N AÏVE O FFLINE M ETA -R EINFORCEMENT L EARNING
Revised:  T HE P ROBLEM WITH N AÏVE O FFLINE M ETA -R EINFORCEMENT L EARNING

Original: Ofﬂine meta-RL is the composition of meta-RL and ofﬂine RL: the objective is to maximize the standard meta-RL objective using only a ﬁxed set of replay buffers, D
Revised: Ofﬂine meta-RL is the composition of meta-RL and ofﬂine RL: the objective is to maximize the standard meta-RL objective using only a ﬁxed set of replay buffers, D

Original: =
Revised: =

Original: {D i } N buff i
Revised: {D i } N buff i

Original: =1 , where each buffer corresponds to data for one task.
Revised: =1 , where each buffer corresponds to data for one task.

Original: Ofﬂine meta-RL methods can in principle utilize the same constraint-based approaches that standard ofﬂine RL algorithms have used to mitigate distributional shift.
Revised: Ofﬂine meta-RL methods can in principle utilize the same constraint-based approaches that standard ofﬂine RL algorithms have used to mitigate distributional shift.

Original: However, they must also contend with an additional distribution shift challenge that is speciﬁc to the meta-RL scenario: distribution shift in z -space.
Revised: However, they must also contend with an additional distribution shift challenge that is speciﬁc to the meta-RL scenario: distribution shift in z -space.

Original: Distribution shift in z -space occurs because meta-learning requires learning an exploration policy π θ that generates data for adaptation.
Revised: Distribution shift in z -space occurs because meta-learning requires learning an exploration policy π θ that generates data for adaptation.

Original: However, ofﬂine meta-RL only trains the adaptation procedure
Revised: However, ofﬂine meta-RL only trains the adaptation procedure

Original: A φ ( h ) using ofﬂine data generated by a previous behavior policy, which we denote as π β .
Revised: A φ ( h ) using ofﬂine data generated by a previous behavior policy, which we denote as π β .

Original: After ofﬂine training, there will be a mismatch between this learned exploration policy π θ and the behavior policy π β , leading to a difference in the history h and in turn, in the context variables z
Revised: After ofﬂine training, there will be a mismatch between this learned exploration policy π θ and the behavior policy π β , leading to a difference in the history h and in turn, in the context variables z

Original: = A φ ( h ) .
Revised: = A φ ( h ) .

Revised: For example, in a robot manipulation setting, the ofﬂine dataset may contain smooth trajectories that were collected by a human teleoperator (Kofman et al., 2005).

Revised: In contrast, the learned exploration may contain jittering due learning artifacts or the use of a stochastic policy.

Revised: This jittering may not impede the robot from exploring the environment, but may result in a trajectory distribution shift that degrades the adaptation process, which only learned to adapt to smooth, human-generated trajectories in the ofﬂine dataset.

Original: In other words, if p ( z | h ofﬂine ) and p ( z | h online ) denote the marginal distribution of z given histories h sampled using ofﬂine and online data, respectively, the differences between π θ and π β will lead to differences between p ( z | h ofﬂine ) during ofﬂine training and p ( z | h online ) at meta-test time.
Revised: More formally, if p ( z | h ofﬂine ) and p ( z | h online ) denote the marginal distribution of z given histories h sampled using ofﬂine and online data, respectively, the differences between π θ and π β will lead to differences between p ( z | h ofﬂine ) during ofﬂine training and p ( z | h online ) at meta-test time.

Original: To illustrate this difference, we compare p ( z | h ofﬂine ) and p ( z | h online ) on the Ant Direction task (see Section 6).
Revised: To illustrate this difference, we compare p ( z | h ofﬂine ) and p ( z | h online ) on the Ant Direction task (see Section 6).

Original: We approximate these distributions by using the PEARL encoder discussed in
Revised: We approximate these distributions by using the PEARL encoder discussed in

Original: Section 3, with p ( z | h ) ≈
Revised: Section 3, with p ( z | h ) ≈

Original: q φ e ( z | h ) , where h is sampled either from the ofﬂine data set or using the learned policy.
Revised: q φ e ( z | h ) , where h is sampled either from the ofﬂine data set or using the learned policy.

Original: We measure the KL-divergence observed at the end of ofﬂine training between the posterior p ( z | h ) and a ﬁxed prior p z ( z ) , for different samples of h .
Revised: We measure the KL-divergence observed at the end of ofﬂine training between the posterior p ( z | h ) and a ﬁxed prior p z ( z ) , for different samples of h .

Original: If the two distributions were the same, then we would expect the distribution of KL divergences to also be similar.
Revised: If the two distributions were the same, then we would expect the distribution of KL divergences to also be similar.

Original: However, Figureshows that the two distributions are markedly different after the ofﬂine training phase of SMAC.
Revised: However, Figureshows that the two distributions are markedly different after the ofﬂine training phase of SMAC.

Original: We also observe that this distribution shift negatively impacts the resulting policy.
Revised: We also observe that this distribution shift negatively impacts the resulting policy.

Original: In Figure 2, we plot the performance of the learned policy when conditioned on z sampled from q φ e ( z | h ofﬂine ) compared to q φ e ( z | h online ) .
Revised: In Figure 2, we plot the performance of the learned policy when conditioned on z sampled from q φ e ( z | h ofﬂine ) compared to q φ e ( z | h online ) .

Original: We see that the policy that uses ofﬂine data, h ofﬂine , leads to improvement, while the same policy that uses data from the learned policy, h online drops in performance.
Revised: We see that the policy that uses ofﬂine data, h ofﬂine , leads to improvement, while the same policy that uses data from the learned policy, h online drops in performance.

Original: Since we evaluate the same policy π θ and only change how z is sampled, this degradation in performance suggests that the policy suffers from distributional shift between p ( z | h ofﬂine ) and p ( z | h online ) .
Revised: Since we evaluate the same policy π θ and only change how z is sampled, this degradation in performance suggests that the policy suffers from distributional shift between p ( z | h ofﬂine ) and p ( z | h online ) .

Original: In other words, the encoder produces z vectors that are too unfamiliar to the policy when conditioned on these exploration trajectories.
Revised: In other words, the encoder produces z vectors that are too unfamiliar to the policy when conditioned on these exploration trajectories.

Original: We note that this issue arises in any method that trains non-Markovian policies with ofﬂine data.
Revised: We note that this issue arises in any method that trains non-Markovian policies with ofﬂine data.

Original: For example, recurrent policies for partially observed MDPs (Jaakkola et al., 1995) depend both on the current observation o and a history h .
Revised: For example, recurrent policies for partially observed MDPs (Jaakkola et al., 1995) depend both on the current observation o and a history h .

Original: When deployed, these policies must also contend with potential distributional shifts between the training and test-time history distributions, in addition to the change in observation distribution o .
Revised: When deployed, these policies must also contend with potential distributional shifts between the training and test-time history distributions, in addition to the change in observation distribution o .

Original: This additional distribution shift may explain why many memory-based recurrent policies are often trained online (Duan et al., 2016; Heess et al., 2017; Espeholt et al., 2018) or have beneﬁted from refreshing the memory states (Kapturowski et al., 2018).
Revised: This additional distribution shift may explain why many memory-based recurrent policies are often trained online (Duan et al., 2016; Heess et al., 2017; Espeholt et al., 2018) or have beneﬁted from refreshing the memory states (Kapturowski et al., 2018).

Original: In this paper, we focus on addressing this issue speciﬁcally in the ofﬂine meta-RL setting.
Revised: In this paper, we focus on addressing this issue speciﬁcally in the ofﬂine meta-RL setting.

Original: Ofﬂine meta-RL with self-supervised online training.
Revised: Ofﬂine meta-RL with self-supervised online training.

Original: In complex environments where many behaviors are possible, the distribution shift in z -space will likely be inevitable, since the learned policy is likely to deviate from the behavior policy.
Revised: In complex environments where many behaviors are possible, the distribution shift in z -space will likely be inevitable, since the learned policy is likely to deviate from the behavior policy.

Original: To address this issue, we introduce an additional assumption: in addition to the ofﬂine dataset, we assume that the agent can autonomously interact with the environment without observing additional reward supervision .
Revised: To address this issue, we introduce an additional assumption: in addition to the ofﬂine dataset, we assume that the agent can autonomously interact with the environment without observing additional reward supervision .

Original: This problem statement is useful for scenarios where autonomously interacting with the world is relatively easy, but online reward supervision is more expensive to obtain.
Revised: This problem statement is useful for scenarios where autonomously interacting with the world is relatively easy, but online reward supervision is more expensive to obtain.

Original: Formally, we assume that the agent can generate additional rollouts in an MDP without a reward function, T \ r = ( S , A , γ, p 0 , p d ) .
Revised: Formally, we assume that the agent can generate additional rollouts in an MDP without a reward function, T \ r = ( S , A , γ, p 0 , p d ) .

Original: These additional interactions enable the agent to explore using the learned exploration policy.
Revised: These additional interactions enable the agent to explore using the learned exploration policy.

Original: Since the resulting states and actions are from the learned exploration policy, we can use them to construct h online and enable an agent to train on the online context distribution, p ( z | h online ) , thus mitigating the distribution shift issue described above.
Revised: Since the resulting states and actions are from the learned exploration policy, we can use them to construct h online and enable an agent to train on the online context distribution, p ( z | h online ) , thus mitigating the distribution shift issue described above.

Original: However, meta-training requires that the history h online contain not just states and actions, but also rewards.
Revised: However, meta-training requires that the history h online contain not just states and actions, but also rewards.

Original: In the next section, we describe a method for autonomously labeling these rollouts with synthetic reward labels to enable an agent to meta-train on this additional data.
Revised: In the next section, we describe a method for autonomously labeling these rollouts with synthetic reward labels to enable an agent to meta-train on this additional data.

Original:  S EMI -S UPERVISED M ETA A CTOR -C RITIC
Revised:  S EMI -S UPERVISED M ETA A CTOR -C RITIC

Original: In this section, we present our method, semi-supervised meta actor-critic (SMAC).
Revised: In this section, we present our method, semi-supervised meta actor-critic (SMAC).

Original: SMAC consists of ofﬂine meta-training followed by self-supervised online meta-training to mitigate the distribution shift in z -space.
Revised: SMAC consists of ofﬂine meta-training followed by self-supervised online meta-training to mitigate the distribution shift in z -space.

Original: The SMAC adaptation procedure consists of passing history through the encoder described in Section 3, resulting in a posterior q φ e ( z | h ) .
Revised: The SMAC adaptation procedure consists of passing history through the encoder described in Section 3, resulting in a posterior q φ e ( z | h ) .

Original: Below, we describe both phases.
Revised: Below, we describe both phases.

Original: 5. O FFLINE M ETA -T RAINING
Revised: 5. O FFLINE M ETA -T RAINING

Original: To learn from the user-provided ofﬂine data, we adapt the PEARL (Rakelly et al., 2019) to the ofﬂine setting.
Revised: To learn from the user-provided ofﬂine data, we adapt the PEARL (Rakelly et al., 2019) to the ofﬂine setting.

Original: Similar to PEARL, we update the critic by minimizing the Bellman error:
Revised: Similar to PEARL, we update the critic by minimizing the Bellman error:

Original: [Equation]
Revised: [Equation]

Revised: (cid:48) , a (cid:48) , z )))

Original:  where ¯ w are target network weights updated using soft target updates (Lillicrap et al., 2016).
Revised: 2 (cid:3) , (1) where ¯ w are target network weights updated using soft target updates (Lillicrap et al., 2016).

Original: PEARL has a policy updated based on soft actor critic (SAC) (Haarnoja et al., 2018), but when naïvely applied to the ofﬂine setting, these policy updates suffer from off-policy bootstrapping error accumulation (Kumar et al., 2019), which occurs when the target Q-function for bootstrapping
Revised: PEARL has a policy updated based on soft actor critic (SAC) (Haarnoja et al., 2018), but when naïvely applied to the ofﬂine setting, these policy updates suffer from off-policy bootstrapping error accumulation (Kumar et al., 2019), which occurs when the target Q-function for bootstrapping

Original: Q ( s (cid:48) , a (cid:48) ) is evaluated at actions a (cid:48) outside of the training data.
Revised: Q ( s (cid:48) , a (cid:48) ) is evaluated at actions a (cid:48) outside of the training data.

Original: To avoid error accumulation during ofﬂine training, we implicitly constrain the policy to stay close to the actions observed in the replay buffer, following the approach in a single-task ofﬂine RL algorithm called AWAC (Nair et al., 2020).
Revised: To avoid error accumulation during ofﬂine training, we implicitly constrain the policy to stay close to the actions observed in the replay buffer, following the approach in a single-task ofﬂine RL algorithm called AWAC (Nair et al., 2020).

Original: AWAC uses the following loss to approximate a constrained optimization problem, where the policy is constrained to stay close to the data observed in D :
Revised: AWAC uses the following loss to approximate a constrained optimization problem, where the policy is constrained to stay close to the data observed in D :

Original: [Equation]
Revised: [Equation]

Original: We estimate the value function V ( s , z ) =
Revised: We estimate the value function V ( s , z ) =

Original: E a ∼ π θ ( a | s , z ) Q ( s , a , z ) with a single sample, and λ is the resulting Lagrange multiplier for the optimization problem.
Revised: E a ∼ π [Equation] a | s , z ) Q ( s , a , z ) with a single sample, and λ is the resulting Lagrange multiplier for the optimization problem.

Original: See Nair et al.
Revised: See Nair et al.

Original: (2020) for a full derivation.
Revised: (2020) for a full derivation.

Original: With this modiﬁed actor update, we can train the encoder, actor, and critic on the ofﬂine data without the overestimation issues that afﬂict conventional actor-critic algorithms (Kumar et al., 2019).
Revised: With this modiﬁed actor update, we can train the encoder, actor, and critic on the ofﬂine data without the overestimation issues that afﬂict conventional actor-critic algorithms (Kumar et al., 2019).

Original: However, it does not address the z -space distributional shift issue discussed in Section 4, because the exploration policy learned via this ofﬂine procedure will still deviate signiﬁcantly from the behavior policy π β .
Revised: However, it does not address the z -space distributional shift issue discussed in Section 4, because the exploration policy learned via this ofﬂine procedure will still deviate signiﬁcantly from the behavior policy π β .

Original: As discussed previously, we will aim to address this issue by collecting additional online data without reward labels and learning to generate reward labels if self-supervised meta-training.
Revised: As discussed previously, we will aim to address this issue by collecting additional online data without reward labels and learning to generate reward labels if self-supervised meta-training.

Original: Learning to generate rewards.
Revised: Learning to generate rewards.

Original: To continue meta-training online without ground truth reward labels, we propose to use the ofﬂine dataset to learn a generative model over meta-training task reward functions that we can use to label the transitions collected online.
Revised: To continue meta-training online without ground truth reward labels, we propose to use the ofﬂine dataset to learn a generative model over meta-training task reward functions that we can use to label the transitions collected online.

Original: Recall that during ofﬂine learning, we learn an encoder q φ e that maps experience h to a latent context z that encodes the task.
Revised: Recall that during ofﬂine learning, we learn an encoder q φ e that maps experience h to a latent context z that encodes the task.

Original: In the same way that we train our policy π θ ( a | s , z ) that conditionally decodes z into actions, we additionally train a reward decoder r φ d ( s , a , z ) with parameter φ d 1 that conditionally decodes z into rewards.
Revised: In the same way that we train our policy π θ ( a | s , z ) that conditionally decodes z into actions, we additionally train a reward decoder r φ d ( s , a , z ) with parameter φ d 1 that conditionally decodes z into rewards.

Original: We train the reward decoder r φ d to reconstruct the observed reward in the ofﬂine dataset through a mean squared error loss.
Revised: We train the reward decoder r φ d to reconstruct the observed reward in the ofﬂine dataset through a mean squared error loss.

Original: Because we use the latent space z for reward-decoding, we back-propagate the reward decoder loss into q φ e .
Revised: Because we use the latent space z for reward-decoding, we back-propagate the reward decoder loss into q φ e .

Original: As visualized in Figure 3, we also regularize the posteriors q φ e ( z | h ) against a prior p z ( z ) to provide an information bottleneck in that latent space z and ensure that samples from p z ( z ) represent meaningful latent variables.
Revised: As visualized in Figure 3, we also regularize the posteriors q φ e ( z | h ) against a prior p z ( z ) to provide an information bottleneck in that latent space z and ensure that samples from p z ( z ) represent meaningful latent variables.

Original: We found it beneﬁcial to not back-propagate the critic loss into the encoder, in contrast to prior work such as PEARL.
Revised: We found it beneﬁcial to not back-propagate the critic loss into the encoder, in contrast to prior work such as PEARL.

Original: To summarize, we train the encoder and reward decoder by minimizing the following loss, in which we assume that z ∼ q φ e ( h ) :
Revised: To summarize, we train the encoder and reward decoder by minimizing the following loss, in which we assume that z ∼ q φ e ( h ) :

Original: [Equation] [Equation]
Revised: [Equation] [Equation]

Original: 5. S ELF -S UPERVISED O NLINE M ETA -T RAINING
Revised: 5. S ELF -S UPERVISED O NLINE M ETA -T RAINING

Original: We now describe the self-supervised online training procedure, during which we use the reward decoder to provide supervision.
Revised: We now describe the self-supervised online training procedure, during which we use the reward decoder to provide supervision.

Original: First, we collect a trajectory τ by rolling out our exploration policy π θ conditioned on a context sampled from the prior p ( z ) .
Revised: First, we collect a trajectory τ by rolling out our exploration policy π θ conditioned on a context sampled from the prior p ( z ) .

Original: To emulate the ofﬂine meta-training supervision, we would like to label τ with rewards that are in the distribution of meta-training tasks.
Revised: To emulate the ofﬂine meta-training supervision, we would like to label τ with rewards that are in the distribution of meta-training tasks.

Original: As such, we sample a replay buffer D i uniformly from D to get a history h ofﬂine ∼ D i from the ofﬂine data.
Revised: As such, we sample a replay buffer D i uniformly from D to get a history h ofﬂine ∼ D i from the ofﬂine data.

Original: We then sample from the posterior z ∼ q φ e ( z | h ofﬂine ) and label the reward r generated of a new state and action, ( s , a ) , using the reward decoder r generated = r φ d ( s , a , z ) , where z ∼ q φ e ( z | [Equation]
Revised: We then sample from the posterior z ∼ q φ e ( z | h ofﬂine ) and label the reward r generated of a new state and action, ( s , a ) , using the reward decoder r generated = r φ d ( s , a , z ) , where z ∼ q φ e ( z | h ) .

Original: We then add the labeled trajectory to the buffer and perform actor and critic updates as in ofﬂine metatraining.
Revised: We then add the labeled trajectory to the buffer and perform actor and critic updates as in ofﬂine metatraining.

Original: Lastly, since we do not observe additional ground-truth rewards, during the self-supervised phase we do not update the reward decoder r φ d or encoder q φ e and instead only train the policy and
Revised: Lastly, since we do not observe additional ground-truth rewards, during the self-supervised phase we do not update the reward decoder r φ d or encoder q φ e and instead only train the policy and

Original: Q-function.
Revised: Q-function.

Original: We visualize this procedure in Figure 3.
Revised: We visualize this procedure in Figure 3.

Original: We note that the distribution shift discussed in Section 4 is not an issue for the reward decoder.
Revised: We note that the distribution shift discussed in Section 4 is not an issue for the reward decoder.

Original: The distribution shift only occurs when we sample z from the encoder using online data, i.e. z ∼ q φ e ( z | h online ) , but, we only sample from this reward decoder using z sampled from the encoder using ofﬂine data, i.e. z ∼ q φ e ( z | h ofﬂine ) .
Revised: The distribution shift only occurs when we sample z from the encoder using online data, i.e. z ∼ q φ e ( z | h online ) , but, we only sample from this reward decoder using z sampled from the encoder using ofﬂine data, i.e. z ∼ q φ e ( z | h ofﬂine ) .

Original: The reward decoder does need to generalize to new states and actions, but we argue that reward prediction generalization is easier than policy state, action, and z generalization, and any ofﬂine RL method must also contend with this standard state and action distribution shift.
Revised: The reward decoder does need to generalize to new states and actions, and we hypothesize that reward prediction generalization is easier than policy state, action, and z generalization. If true, then we would expect that using the reward decoder to label rewards and train on those labels, as in SMAC, will outperform directly using the policy on new tasks (as in Figure 2).

Original: 5. A LGORITHM S UMMARY AND D ETAILS
Revised: 5. A LGORITHM S UMMARY AND D ETAILS

Original: We visualize SMAC in Figure 3.
Revised: We visualize SMAC in Figure 3.

Original: For ofﬂine training, we assume access to ofﬂine datasets D
Revised: For ofﬂine training, we assume access to ofﬂine datasets D

Original: =
Revised: =

Original: {D i } N buff i
Revised: {D i } N buff i

Original: =1 , where each buffer corresponds to data generated for one task.
Revised: =1 , where each buffer corresponds to data generated for one task.

Original: Each iteration, we sample a buffer
Revised: Each iteration, we sample a buffer

Original: D i ∼ D and a history from this buffer h ∼ D i .
Revised: D i ∼ D and a history from this buffer h ∼ D i .

Original: We condition the stochastic encoder q φ e on this history to obtain a sample z ∼ q φ e ( z | h ) .
Revised: We condition the stochastic encoder q φ e on this history to obtain a sample z ∼ q φ e ( z | h ) .

Original: We then use this sample z and a second history sample h (cid:48) ∼ D i to update the Q -function, the policy, encoder, and decoder by minimizing Equation (1),
Revised: We then use this sample z and a second history sample h (cid:48) ∼ D i to update the Q -function, the policy, encoder, and decoder by minimizing Equation (1),

Original: Equation (2), and Equation (3) respectively.
Revised: Equation (2), and Equation (3) respectively.

Original: During the self-supervised phase, we found it beneﬁcial to train the actor with a combination of the loss in Equation (2) and the original PEARL actor loss, weighted by hyperparameter λ pearl .
Revised: During the self-supervised phase, we found it beneﬁcial to train the actor with a combination of the loss in Equation (2) and the original PEARL actor loss, weighted by hyperparameter λ pearl .

Original: We provide pseudo-code for SMAC in Appendix A.
Revised: We provide pseudo-code for SMAC in Appendix A.

Original:  E XPERIMENTS
Revised:  E XPERIMENTS

Original: We presented a method that uses self-supervised data to mitigate the z -space distribution shift that occurs in ofﬂine meta-RL.
Revised: We presented a method that uses self-supervised data to mitigate the z -space distribution shift that occurs in ofﬂine meta-RL.

Original: In this section, we evaluate how well the self-supervised phase of SMAC mitigates the resulting drop in performance, and we compare SMAC to prior ofﬂine meta-RL methods on a range of meta-RL benchmark tasks that require generalization to unseen tasks at meta-test time.
Revised: In this section, we evaluate how well the self-supervised phase of SMAC mitigates the resulting drop in performance, and we compare SMAC to prior ofﬂine meta-RL methods on a range of meta-RL benchmark tasks that require generalization to unseen tasks at meta-test time.

Original: Meta-RL tasks.
Revised: Meta-RL tasks.

Original: We ﬁrst evaluate our method on multiple simulated MuJoCo (Todorov et al., 2012) meta-learning tasks that have been used in past online and ofﬂine meta-RL papers (Finn et al., 2017;
Revised: We ﬁrst evaluate our method on multiple simulated MuJoCo (Todorov et al., 2012) meta-learning tasks that have been used in past online and ofﬂine meta-RL papers (Finn et al., 2017;

Original: Rakelly et al., 2019; Dorfman & Tamar, 2020; Mitchell et al., 2021) (see Figure 9).
Revised: Rakelly et al., 2019; Dorfman & Tamar, 2020; Mitchell et al., 2021) (see Figure 9).

Original: Although there are standardized benchmarks for ofﬂine RL (Fu et al., 2020) and meta-RL (Yu et al., 2020), there are no standard benchmarks for ofﬂine meta-RL particular, so we use a combination of tasks in prior work (Dorfman & Tamar, 2020; Mitchell et al., 2021),like ant navigation, and  a more complex robotic manipulation domain meant to push task generalization to the limit.
Revised: Although there are standardized benchmarks for ofﬂine RL (Fu et al., 2020) and meta-RL (Yu et al., 2020), there are no standard benchmarks for ofﬂine meta-RL particular, so we use a combination of tasks in prior work (Dorfman & Tamar, 2020; Mitchell et al., 2021), and introduce a more complex robotic manipulation domain meant to push task generalization to the limit.

Original:  Cheetah Velocity requires controlling a “half cheetah” to move forward and backward. Following prior work (Rakelly et al., 2019; Dorfman & Tamar, 2020), the reward function is the negative absolute difference between the agent’s x-velocity and a target velocity uniformly sampled from [0 , 3] .
Revised: We ﬁrst evaluate ﬁve different domains, Cheetah Velocity, Ant Direction, Humanoid, Walker Param, and Hopper Param, which have been used in prior work (Rothfuss et al., 2018; Rakelly et al., 2019; Dorfman & Tamar, 2020). In the ﬁrst three domains, the agent is rewarded for moving in an unobserved target velocity and a meta-episode consists of sampling a desired velocity.

Original: The second task,Ant
Revised: The last task,

Original: Direction , contains a quadruped “ant” robot that can move in a plane.
Revised: Humanoid, is particularly challenging due to the high space dimension of 376 .

Original: The reward function is the dot product between the agent’s velocity and a direction uniformly sampled from the unit circle. In both of these domains, a meta-episode consists of sampling a desired velocity.
Revised: The last two domains, Walker Param and Hopper Param, require adapting to different dynamics parameters, such as friction, joint mass, and inertia.

Original: The agent must learn to discover which velocity will maximize rewards within T = 3 episodes, each of length 200 .
Revised: The agent must adapt to each task within T = 3 episodes, each of length 200 .

Original: We also evaluated SMAC on a signiﬁcantly more diverse robot manipulation meta-learning task called Sawyer Manipulation , based on the goal-conditioned environment introduced by Khazatsky et al.(2021).
Revised: We also evaluated SMAC on a signiﬁcantly more diverse robot manipulation meta-learning task called Sawyer Manipulation, based on the goal-conditioned environment introduced by Khazatsky et al.

Original: This is a simulated PyBullet environment Coumans & Bai (2016–2021) in which a
Revised: This is a simulated PyBullet environment Coumans & Bai (2016–2021) in which a

Original: Sawyer robot arm can manipulate various objects.
Revised: Sawyer robot arm can manipulate various objects.

Original: Sampling a task T ∼ p ( T ) involves sampling both a new conﬁguration of the environment and the desired behavior to achieve, such as pushing a button, opening a drawer, or lifting an object (see Figure 4).
Revised: Sampling a task T ∼ p ( T ) involves sampling both a new conﬁguration of the environment and the desired behavior to achieve, such as pushing a button, opening a drawer, or lifting an object (see Figure 4).

Original: The sparse reward is 0 when the desired behavior is achieved and − 1 otherwise.
Revised: The sparse reward is 0 when the desired behavior is achieved and − 1 otherwise.

Original: The action space consists of 3 dimensions to control the end-effector in Euclidean space and one dimension to control the gripper.
Revised: The action space consists of 3 dimensions to control the end-effector in Euclidean space and one dimension to control the gripper.

Original: The state is a 13-dimensional vector, which we detail in Appendix C.
Revised: The state is a 13-dimensional vector, which we detail in Appendix C.

Original: The sparse reward, precise manipulation requirement, and diversity of object conﬁguration between each task sample make this environment difﬁcult.
Revised: The sparse reward, precise manipulation requirement, and diversity of object conﬁguration between each task sample make this environment difﬁcult.

Original: In all of the environments, we test the meta-RL procedure’s ability to generalize to new tasks by evaluating the policies on held-out tasks sampled from the same distribution as in the ofﬂine datasets.
Revised: In all of the environments, we test the meta-RL procedure’s ability to generalize to new tasks by evaluating the policies on held-out tasks sampled from the same distribution as in the ofﬂine datasets.

Original: We give a complete description of  task distribution in Appendix C.[Figure] P o s t - A d a p t a t i o n R e t u r n s [Figure]
Revised: We give a complete description of environments and task distribution in Appendix C.

Original: P o s t - A d a p t a t i o n R e t u r n s

Original: [Figure]

Original: P

Original: [Figure]

Original: s t

Original: [Figure]

Original: A

Original: [Figure]

Original: t

Original: i

Original: [Figure]

Original: Ofﬂine data collection.
Revised: Ofﬂine data collection.

Original: For the MuJoCo tasks, we use the replay buffer from a single PEARL run that uses the ground-truth reward.
Revised: For the MuJoCo tasks, we use the replay buffer from a single PEARL run that uses the ground-truth reward.

Original: We limit the data collection to 1200 transitions (i e.,trajectories) per task and terminate the PEARL run early, forcing the meta-RL agent to learn from highly suboptimal data.
Revised: We limit the data collection to 1200 transitions (i.e.,trajectories) per task and terminate the PEARL run early, forcing the meta-RL agent to learn from highly suboptimal data.

Original: For Sawyer Manipulation , we collect data using a scripted policy that randomly performs one of many possible tasks in the environment.
Revised: For Sawyer Manipulation, we collect data using a scripted policy that randomly performs one of many possible tasks in the environment.

Original: We used 50 training tasks andtrajectories of length 75 each.
Revised: We used 50 training tasks andtrajectories of length 75 each.

Original: Note that the performed task (e.g. open drawer) may differ from the task that is rewarded (e.g. push a button).
Revised: Note that the performed task (e.g. open drawer) may differ from the task that is rewarded (e.g. push a button).

Original: As a result, in the ofﬂine dataset, the robot succeeds on the task in 46% of the transitions, indicating that this data is highly suboptimal.
Revised: As a result, in the ofﬂine dataset, the robot succeeds on the task in 46% of the transitions, indicating that this data is highly suboptimal.

Original: In contrast to prior work (Dorfman & Tamar, 2020; Mitchell et al., 2021), we use this limited data because it enables us to test how well the different methods can improve over suboptimal, ofﬂine data.
Revised: In contrast to prior work (Dorfman & Tamar, 2020; Mitchell et al., 2021), we use this limited data because it enables us to test how well the different methods can improve over suboptimal, ofﬂine data.

Original: See Appendix C for further discussion and details.
Revised: See Appendix C for further discussion and details.

Original: Comparisons and ablations.
Revised: Comparisons and ablations.

Original: As an upper bound, we include the performance of PEARL with online training using oracle ground-truth rewards rather than self-generated rewards, which we label
Revised: As an upper bound, we include the performance of PEARL with online training using oracle ground-truth rewards rather than self-generated rewards, which we label

Original: Online Oracle .
Revised: Online Oracle .

Original: To understand the importance of using the actor loss in Equation (2), we include an ablation that replaces Equation (2) with the actor loss from PEARL, which we label SMAC (actor ablation) .
Revised: To understand the importance of using the actor loss in Equation (2), we include an ablation that replaces Equation (2) with the actor loss from PEARL, which we label SMAC (actor ablation) .

Original: We also include a meta-imitation baseline, labeled meta behavior cloning , which replaces the actor update in Equation (2) with simply maximizing log π θ ( a | s , z ) .
Revised: We also include a meta-imitation baseline, labeled meta behavior cloning , which replaces the actor update in Equation (2) with simply maximizing log π θ ( a | s , z ) .

Original: This baseline illustrates the gap between ofﬂine meta-RL and imitation, and conﬁrms that our ofﬂine meta-RL method indeed improves over the behavior policy.
Revised: This baseline illustrates the gap between ofﬂine meta-RL and imitation, and conﬁrms that our ofﬂine meta-RL method indeed improves over the behavior policy.

Original: For comparisons to prior work, we include the two previously proposed ofﬂine meta-RL methods: meta-actor critic with advantage weighting (labelled
Revised: For comparisons to prior work, we include the two previously proposed ofﬂine meta-RL methods: meta-actor critic with advantage weighting (labelled

Original: MACAW )
Revised: MACAW )

Original: (Mitchell et al., 2021) and Bayesian ofﬂine RL (labelled BOReL ) (Dorfman & Tamar, 2020).
Revised: (Mitchell et al., 2021) and Bayesian ofﬂine RL (labelled BOReL ) (Dorfman & Tamar, 2020).

Original: Since these methods have only been applied to the ofﬂine phase, we report their performance only after ofﬂine training, since they do not have a self-supervised online stage.
Revised: MACAW and BOReL assume that rewards are provided during training and cannot make use of the self-supervised online interaction, and so we cannot compare directly to these past works. Therefore, we report their performance only after ofﬂine training.

Original: For these prior work, we used the open-sourced code directly from each paper (PEARL, MACAW, and BOReL), and and trained these methods using the same ofﬂine dataset.
Revised: For these prior work, we used the open-sourced code directly from each paper (PEARL, MACAW, and BOReL), and and trained these methods using the same ofﬂine dataset.

Original: To ensure a fair comparison, we ran the original hyperparameters and matched SMAC hyperparameters (matching network size, learning rate, and batch size), taking the better of the two as the result for each prior method.
Revised: To ensure a fair comparison, we ran the original hyperparameters and matched SMAC hyperparameters (matching network size, learning rate, and batch size), taking the better of the two as the result for each prior method.

Original: We include a list of all hyperparameters and network architectures in Appendix C.3.
Revised: We include a list of all hyperparameters and network architectures in Appendix C.3.

Original: Comparison results.
Revised: Comparison results.

Original: We plot the mean post-adaptation returns and standard deviation acrossseeds in Figure 5.
Revised: We plot the mean post-adaptation returns and standard deviation acrossseeds in Figure 5.

Original: We see that across all three environments, SMAC consistently improves during the self-supervised phase, and often achieves a similar performance to the oracle that uses ground-truth reward during the online phase of learning.
Revised: We see that across all three environments, SMAC consistently improves during the self-supervised phase, and often achieves a similar performance to the oracle that uses ground-truth reward during the online phase of learning.

Original: SMAC also signiﬁcantly improves over meta behavior cloning, which conﬁrms that the data in the ofﬂine dataset is far from optimal.
Revised: SMAC also signiﬁcantly improves over meta behavior cloning, which conﬁrms that the data in the ofﬂine dataset is far from optimal.

Original: We also observed even before the online phase, our method is competitive with BOReL and MACAW as a stand-alone ofﬂine meta-RL method.
Revised: We also observed even before the online phase, our method is competitive with BOReL and MACAW as a stand-alone ofﬂine meta-RL method.

Original: When self-supervised training is included, we see that
Revised: When self-supervised training is included, we see that

Original: SMAC signiﬁcantly improves over the performance of BOReL on all three tasks and signiﬁcantly improves over MACAW on two of the three tasks, including the Sawyer Manipulation environment, which is by far the most challenging and exhibits the most variability between tasks.
Revised: SMAC signiﬁcantly improves over the performance of BOReL on all three tasks and signiﬁcantly improves over MACAW on two of the three tasks, including the Sawyer Manipulation environment, which is by far the most challenging and exhibits the most variability between tasks.

Original: In this domain, we also see the largest gains from the AWAC actor update, in contrast to the actor ablation in[Figure] blue, which corresponds to a PEARL-style update, indicating that properly handling the ofﬂine phase is also important for good performance.
Revised: In this domain, we also see the largest gains from the AWAC actor update, in contrast to the actor ablation in blue, which corresponds to a PEARL-style update, indicating that properly handling the ofﬂine phase is also important for good performance.

Original: In conclusion, our method is the only one attains generalization performance close to the Online
Revised: In conclusion, our method is the only one attains generalization performance close to the Online

Original: Oracle upper bound baseline on all three tasks, indicating that self-supervised online ﬁne-tuning is highly effective for mitigating distributional shift in meta-RL, whereas without it ofﬂine meta-RL generally does not exceed the performance of a meta-imitation learning baseline.
Revised: Oracle upper bound baseline on all three tasks, indicating that self-supervised online ﬁne-tuning is highly effective for mitigating distributional shift in meta-RL, whereas without it ofﬂine meta-RL generally does not exceed the performance of a meta-imitation learning baseline.

Original: Visualizing the distribution shift.
Revised: Visualizing the distribution shift.

Original: Lastly, we further investigate if the self-supervised training helps speciﬁcally because it mitigates a distribution shift caused by the exploration policy.
Revised: Lastly, we further investigate if the self-supervised training helps speciﬁcally because it mitigates a distribution shift caused by the exploration policy.

Original: To investigate this, we visualize the trajectories of the learned policy both before and after the selfsupervised phase for the Ant Direction task in Figure 6.
Revised: To investigate this, we visualize the trajectories of the learned policy both before and after the selfsupervised phase for the Ant Direction task in Figure 6.

Original: For each plot, we show trajectories from the  policy π θ ( a | s , z ) when the encoder q φ e ( z | h ) is conditioned on histories from either the ofﬂine dataset ( h ofﬂine ) or from the learned exploration policy ( h online ).
Revised: For each plot, we show trajectories from the [Figure] policy π θ ( a | s , z ) when the encoder q φ e ( z | h ) is conditioned on histories from either the ofﬂine dataset ( h ofﬂine ) or from the learned exploration policy ( h online ).

Original: Since the same policy is evaluated, differences between the resulting trajectories represent the distribution shift caused by using history from the learned exploration policy rather than from the ofﬂine dataset.
Revised: Since the same policy is evaluated, differences between the resulting trajectories represent the distribution shift caused by using history from the learned exploration policy rather than from the ofﬂine dataset.

Original: We see that before the self-supervised phase, there is a large difference between the two modes that can only be attributed to the difference in h .
Revised: We see that before the self-supervised phase, there is a large difference between the two modes that can only be attributed to the difference in h .

Original: When using h online , the post-adaptation policy only explores one mode, but when using h ofﬂine , the policy moves in all directions.
Revised: When using h online , the post-adaptation policy only explores one mode, but when using h ofﬂine , the policy moves in all directions.

Original: This qualitative difference explains the large performance gap observed in Figure 2 and highlights that the adaptation procedure is sensitive to the history h used to adapt.
Revised: This qualitative difference explains the large performance gap observed in Figure 2 and highlights that the adaptation procedure is sensitive to the history h used to adapt.

Original: In contrast, after the self-supervised phase, the policy moves in all directions regardless of where the history came from.
Revised: In contrast, after the self-supervised phase, the policy moves in all directions regardless of where the history came from.

Original: In Appendix B, we also visualize the exploration trajectories and found that the exploration trajectories are qualitatively similar both before and after the self-supervised phase.
Revised: In Appendix B, we also visualize the exploration trajectories and found that the exploration trajectories are qualitatively similar both before and after the self-supervised phase.

Original: Together, these results illustrate the SMAC policy learns to adapt to the exploration trajectories by using the self-supervised phase to mitigate the distribution shift that occurs with naïve ofﬂine meta RL.
Revised: Together, these results illustrate the SMAC policy learns to adapt to the exploration trajectories by using the self-supervised phase to mitigate the distribution shift that occurs with naïve ofﬂine meta RL.

Original:  C ONCLUSION
Revised:  C ONCLUSION

Original: In this paper, we studied a problem speciﬁc to ofﬂine meta-RL: distribution shift in the context parameters z .
Revised: In this paper, we studied a problem speciﬁc to ofﬂine meta-RL: distribution shift in the context parameters z .

Original: This distribution shift occurs because the data collected by the meta-learned exploration policy differs from the ofﬂine dataset.
Revised: This distribution shift occurs because the data collected by the meta-learned exploration policy differs from the ofﬂine dataset.

Original: We provided evidence that this difference is hurts the nonMarkovian adaptation procedure in meta-RL, since the learned policy depends on the history through the context parameters z .

Original: To address this problem, we assumed that an agent can sample new trajectories without additional reward labels and presented SMAC, a method that uses these additional interactions together with state-of-the-art ofﬂine RL techniques to provide an effective meta-RL method.
Revised: To address this problem, we assumed that an agent can sample new trajectories without additional reward labels and presented SMAC, a method that uses these additional interactions together with state-of-the-art ofﬂine RL techniques to provide an effective meta-RL method.

Original: Experimentally, we found that SMAC signiﬁcantly improves over the performance of prior ofﬂine meta-RL methods,sometimes achieving better performance after the ofﬂine phase alone, and signiﬁcantly improving performance after the self-supervised online phase.
Revised: Experimentally, we found that SMAC signiﬁcantly improves over the performance of prior ofﬂine meta-RL methods, after the self-supervised online phase.

Original: While SMAC signiﬁcantly improves ofﬂine meta-RL performance, a limitation is the need to gather additional unlabeled online samples.
Revised: While SMAC signiﬁcantly improves ofﬂine meta-RL performance, a limitation is the need to gather additional unlabeled online samples.

Original: This requirement may be practical in domains where collecting reward labels is expensive, and a promising approach for future work is to combine our method with learned methods to generate ofﬂine reward labels (Christiano et al., 2017; Brown et al., 2019).
Revised: This requirement may be practical in domains where collecting reward labels is expensive, and a promising approach for future work is to combine our method with learned methods to generate ofﬂine reward labels (Christiano et al., 2017; Brown et al., 2019).

Revised: Lastly, using self-supervised interaction to mitigate distribution shift in ofﬂine meta RL is orthogonal to the underlying meta RL algorithm.

Revised: In this paper, we built off of PEARL (Rakelly et al., 2019) due to its simplicity, but this insight could easily be used to improve other existing (Mitchell et al., 2021;

Revised: Dorfman & Tamar, 2020) or future ofﬂine meta RL algorithms.

Original: R EPRODUCIBILITY S TATEMENT
Revised: R EPRODUCIBILITY S TATEMENT

Original: To ensure reproducibility, we have included the source code for our method and environments in the supplementary ﬁle, which includes a README ﬁle that describes how to install our code and run the experiments.
Revised: To ensure reproducibility, we have included the source code for our method and environments in the supplementary ﬁle, which includes a README ﬁle that describes how to install our code and run the experiments.

Original: We describe in detail the environments and hyperparameters used for the experiment in Appendix C. For clarity, we have also included pseudo-code of SMAC on the ﬁrst page of the supplementary material
Revised: We describe in detail the environments and hyperparameters used for the experiment in Appendix C. For clarity, we have also included pseudo-code of SMAC on the ﬁrst page of the supplementary material

Original: Supplementary Material A M ETHOD P SEUDO - CODE
Revised: Supplementary Material A M ETHOD P SEUDO - CODE

Original: We present the pseudo-code for SMAC in Algorithm 1.
Revised: We present the pseudo-code for SMAC in Algorithm 1.

Original: Algorithm 1 Semi-Supervised Meta Actor-Critic
Revised: Algorithm 1 Semi-Supervised Meta Actor-Critic

Revised: 1: Input decoder do (cid:46)

Revised: Sample buffer D

Revised: ∼ D two histories from buffer h h (cid:48)

Revised: D i . 4:

Original: Use  ﬁrst history sample to h to infer z encode it z ∼ q φ e ( h ) .
Revised: Use the ﬁrst history sample to h to infer z encode it z ∼ q φ e ( h ) .

Original:  π 
Revised: Update π θ , Q w , q φ e , r φ d by minimizing L actor , L critic , L reward with samples z , h (cid:48) . 6: for iteration n = 1 , . . , N online do (cid:46) self phase 7:

Original: Q q minimizing L actor
Revised: Collect trajectory τ with π a s with z ∼ p

Original: L critic samples z do
Revised: Sample buffer D i ∼ D and ofﬂine history h ∼ D Use h ofﬂine to label the rewards in τ , as in Equation (4), and add the resulting data to D i . Sample buffer D i ∼ D and two histories from buffer h , h (cid:48) ∼ D i .

Original:  B A DDITIONAL E XPERIMENTAL R ESULTS
Revised: Encode ﬁrst history z = q φ e ( h ) . Update minimizing B A DDITIONAL E XPERIMENTAL R ESULTS

Original: Exploration and ofﬂine dataset visualization In Figure 7, we visualize the post-adaption trajectories generated when conditioning the encoder the online exploration trajectories h online and the ofﬂine trajectories h ofﬂine .
Revised: Exploration and ofﬂine dataset visualization In Figure 7, we visualize the post-adaption trajectories generated when conditioning the encoder the online exploration trajectories h online and the ofﬂine trajectories h ofﬂine .

Original: Similar to Figure 6, and also visualize the online and ofﬂine trajectories themselves.
Revised: Similar to Figure 6, and also visualize the online and ofﬂine trajectories themselves.

Original: We see that the exploration trajectories h online and the ofﬂine trajectories h ofﬂine are very different (green vs red, respectively), but the self-supervised phase mitigates the negative impact that this distribution shift has on ofﬂine meta RL.
Revised: We see that the exploration trajectories h online and the ofﬂine trajectories h ofﬂine are very different (green vs red, respectively), but the self-supervised phase mitigates the negative impact that this distribution shift has on ofﬂine meta RL.

Original: In particular, the post-adaptation trajectories conditioned on these two data sources (blue and orange) are similar after the self-supervised training, whereas before the self-supervised training, only the trajectories conditioned on the ofﬂine data (blue) move in multiple directions.
Revised: In particular, the post-adaptation trajectories conditioned on these two data sources (blue and orange) are similar after the self-supervised training, whereas before the self-supervised training, only the trajectories conditioned on the ofﬂine data (blue) move in multiple directions.

Original: Addressing state-space distribution shift by self-supervised meta-training on test tasks.
Revised: Addressing state-space distribution shift by self-supervised meta-training on test tasks.

Original: Another source of distribution shift that can negatively impact a meta-policy is a distribution shift in state space.
Revised: Another source of distribution shift that can negatively impact a meta-policy is a distribution shift in state space.

Original: While this distribution shift occurs in standard ofﬂine RL, we expect this issue to be more prominent in meta RL, where there is a focus on generalizing to completely novel tasks.
Revised: While this distribution shift occurs in standard ofﬂine RL, we expect this issue to be [Figure] [Figure] [Figure]

Revised: t - A d a p t a t i o n

Revised: R e t u r n s

Original:  In many real-world scenarios, experiencing the state distribution of a novel task is possible, but it is the supervision (ie. reward signal) that is expensive to obtain.
Revised: [Figure] [Table] more prominent in meta RL, where there is a focus on generalizing to completely novel tasks. In many real-world scenarios, experiencing the state distribution of a novel task is possible, but it is the supervision (ie. reward signal) that is expensive to obtain.

Original: Can we mitigate state distribution shift by allow the agent to meta-train in the test task environments, but without rewards?
Revised: Can we mitigate state distribution shift by allow the agent to meta-train in the test task environments, but without rewards?

Original: In this experiment, we evaluate our method, SMAC, when training online on the test tasks instead of on the meta-training tasks as in the experiments in Section 6.
Revised: In this experiment, we evaluate our method, SMAC, when training online on the test tasks instead of on the meta-training tasks as in the experiments in Section 6.

Original: Prior work has explored this idea of self-supervision with test tasks in supervised learning Sun et al.
Revised: Prior work has explored this idea of self-supervision with test tasks in supervised learning Sun et al.

Original: and goal-conditioned
Revised: and goal-conditioned

Original: RL Khazatsky et al.
Revised: RL Khazatsky et al.

Original: We use the Sawyer Manipulation environment to study how self-supervised training can mitigate state distribution shifts, as these environments contain signiﬁcant variation between tasks.
Revised: We use the Sawyer Manipulation environment to study how selfsupervised training can mitigate state distribution shifts, as these environments contain signiﬁcant variation between tasks.

Original: To further increase the complexity of the environment, we use a version of the environment which samples from a set of eight potential desired behaviors instead of three.
Revised: To further increase the complexity of the environment, we use a version of the environment which samples from a set of eight potential desired behaviors instead of three.

Original: We compare self-supervised training on test tasks to self-supervised training on the set of metatraining tasks, which are also the tasks contained in the ofﬂine dataset.
Revised: We compare self-supervised training on test tasks to self-supervised training on the set of metatraining tasks, which are also the tasks contained in the ofﬂine dataset.

Original: A large gap in performance indicates that interacting with the test tasks can mitigate the resulting distribution shift even when no reward labels are provided.[Figure] [Figure] [Figure]
Revised: A large gap in performance indicates that interacting with the test tasks can mitigate the resulting distribution shift even when no reward labels are provided.

Original: t - A d a p t a t i o n

Original: R e t u r n s [Figure] -truth rewards We show the results in Figure 8 and ﬁnd that there is indeed a large performance gap between the two training modes, with self-supervision on test tasks improving post-adaptation returns while self-supervision on meta-training tasks does not improve post-adaptation returns.
Revised: We show the results in Figure 8 and ﬁnd that there is indeed a large performance gap between the two training modes, with self-supervision on test tasks improving post-adaptation returns while self-supervision on meta-training tasks does not improve post-adaptation returns.

Original: We also compare to an oracle method that performs online training with the test tasks and the ground-truth reward signal.
Revised: We also compare to an oracle method that performs online training with the test tasks and the ground-truth reward signal.

Original: We see that SMAC is competitive with the oracle, demonstrating that we do not need access to rewards in order to improve on test tasks.
Revised: We see that SMAC is competitive with the oracle, demonstrating that we do not need access to rewards in order to improve on test tasks.

Original: Instead, the entire performance gain comes from experiencing the new state distribution of test tasks.
Revised: Instead, the entire performance gain comes from experiencing the new state distribution of test tasks.

Original: Overall, these results suggest that SMAC is effective for mitigate distribution shifts in both z -space and state space, even when an agent can interact in the environment without reward supervision.
Revised: Overall, these results suggest that SMAC is effective for mitigate distribution shifts in both z -space and state space, even when an agent can interact in the environment without reward supervision.

Revised: Reward Accuracy Dependence Our method involves training a reward decoder, and so a natural question is: How good must the reward decoder be for SMAC to work?

Revised: We found that the reward loss does not need to be particularly low for our method to work.

Revised: Speciﬁcally, in the Sawyer Manipulation environment, the reward scale is either − 1 or 0 , meaning that the maximum reward scale is 1 .

Original:  C E XPERIMENTAL D ETAILS C. D ATA C OLLECTION D IFFERENCE FROM P RIOR W ORK
Revised: We observed that the reward decoder loss is around 0 . 2 on the training task and around 0 . 25 on the test tasks, indicating that the method does not need a relatively low reward decoder loss to perform well. C E XPERIMENTAL D ETAILS C. D ATA C OLLECTION D IFFERENCE FROM P RIOR W ORK

Original: BOReL and MACAW were both developed assuming several orders of magnitude more data than the regime that we tested.
Revised: BOReL and MACAW were both developed assuming several orders of magnitude more data than the regime that we tested.

Original: For example, in the BOReL paper (Dorfman & Tamar, 2020), the Cheetah
Revised: For example, in the BOReL paper (Dorfman & Tamar, 2020), the Cheetah

Original: Velocity was trained with an ofﬂine dataset using 400 million transitions and performs additional reward relabeling using ground-truth information about the transitions.
Revised: Velocity was trained with an ofﬂine dataset using 400 million transitions and performs additional reward relabeling using ground-truth information about the transitions.

Original: In contrast, our ofﬂine dataset contains only 240 thousand transitions, roughly three orders of magnitude fewer transitions.
Revised: In contrast, our ofﬂine dataset contains only 240 thousand transitions, roughly three orders of magnitude fewer transitions.

Original: Similarly,
Revised: Similarly,

Original: MACAW uses 100M transitions for Cheetah Velocity , over 40 times more transitions than used in our experiments.
Revised: MACAW uses 100M transitions for Cheetah Velocity, over 40 times more transitions than used in our experiments.

Original: These prior methods also collect ofﬂine datasets by training task-speciﬁc policies , which converge to near-optimal policies within the ﬁrst million time step (Haarnoja et al., 2018), meaning that they utilize very high-quality data.
Revised: These prior methods also collect ofﬂine datasets by training task-speciﬁc policies , which converge to near-optimal policies within the ﬁrst million time step (Haarnoja et al., 2018), meaning that they utilize very high-quality data.

Original: In contrast, our experiments focused on the scenario with many fewer and much lower quality trajectories, which is likely the cause of the relatively worse performance of BOReL and MACAW than in the original papers.
Revised: In contrast, our experiments focused on the scenario with many fewer and much lower quality trajectories, which is likely the cause of the relatively worse performance of BOReL and MACAW than in the original papers.

Original: C. E NVIRONMENT D ETAILS
Revised: C. E NVIRONMENT D ETAILS

Original: In this section, we describe the state and action space of each environment.
Revised: In this section, we describe the state and action space of each environment.

Original: We also describe how reward functions were generated and how the ofﬂine data was generated.
Revised: We also describe how reward functions were generated and how the ofﬂine data was generated.

Original: Ant Direction The Ant Direction task consists of controlling a quadruped “ant” robot that can move in a plane.
Revised: Ant Direction The Ant Direction task consists of controlling a quadruped “ant” robot that can move in a plane.

Original: Following prior work (Rakelly et al., 2019; Dorfman & Tamar, 2020), the reward function is the dot product between the agent’s velocity and a direction uniformly sampled from the unit circle.
Revised: Following prior work (Rakelly et al., 2019; Dorfman & Tamar, 2020), the reward function is the dot product between the agent’s velocity and a direction uniformly sampled from the unit circle.

Original: The state space is R 20 , comprising the orientation of the ant (in quaternion) as well as the angle and angular velocity of all 8 joints.
Revised: The state space is R 20 , comprising the orientation of the ant (in quaternion) as well as the angle and angular velocity of all 8 joints.

Original: The action space is [ − 1 , 1] 8 , with each dimension corresponding to the torque applied to a respective joint.
Revised: The action space is [ − 1 , 1] 8 , with each dimension corresponding to the torque applied to a respective joint.

Revised: The reward function is the negative absolute difference between the agent’s x-velocity and a target velocity uniformly sampled from [0 , 3] .

Original: The ofﬂine data is collected by running PEARL (Rakelly et al., 2019) on this meta RL task with 100 pre-sampled 2 target velocities.
Revised: The ofﬂine data is collected by running PEARL (Rakelly et al., 2019) on this meta RL task with 100 pre-sampled 2 target velocities.

Original: We terminate PEARL after 100 iterations, with each iteration consisting of collecting trajectories until at least 1000 new transitions have been observed.
Revised: We terminate PEARL after 100 iterations, with each iteration consisting of collecting trajectories until at least 1000 new transitions have been observed.

Original: As discussed in Appendix C.1, this results in highly suboptimal data, enabling us to test how well the different methods can improve over the ofﬂine data.
Revised: As discussed in Appendix C.1, this results in highly suboptimal data, enabling us to test how well the different methods can improve over the ofﬂine data.

Original: In PEARL, there are two replay buffers saved for each task, one for sampling data for training the encoder and another for training the policy and
Revised: In PEARL, there are two replay buffers saved for each task, one for sampling data for training the encoder and another for training the policy and

Original: Q-function.
Revised: Q-function.

Original: We will call the former replay buffer the encoder replay buffer and the latter the RL replay buffer.
Revised: We will call the former replay buffer the encoder replay buffer and the latter the RL replay buffer.

Original: The encoder replay buffer contains data generated by only the exploration policy, in which z ∼ p
Revised: The encoder replay buffer contains data generated by only the exploration policy, in which z ∼ p

Original: z ( z ) .
Revised: z ( z ) .

Original: The RL replay buffer contains all data generated, including both exploration and post-adaptation, in which z ∼ q φ e ( z | h ) .
Revised: The RL replay buffer contains all data generated, including both exploration and post-adaptation, in which z ∼ q φ e ( z | h ) .

Original: To make the ofﬂine dataset, we load the last 1200 samples of the RL replay buffer and the last 400 transitions from the encoder replay buffer into corresponding
Revised: To make the ofﬂine dataset, we load the last 1200 samples of the RL replay buffer and the last 400 transitions from the encoder replay buffer into corresponding

Original: RL and encoder replay buffers for SMAC.
Revised: RL and encoder replay buffers for SMAC.

Original: Cheetah Velocity The Cheetah Velocity task consists of controlling a two-legged “half cheetah” that can move forwards or backwards along the x-axis.
Revised: Cheetah Velocity The Cheetah Velocity task consists of controlling a two-legged “half cheetah” that can move forwards or backwards along the x-axis.

Original: Following prior work (Rakelly et al., 2019; Dorfman & Tamar, 2020), the reward function is the absolute difference product between the agent’s x-velocity and a velocity uniformly sampled from [0 , 3] .
Revised: Following prior work (Rakelly et al., 2019; Dorfman & Tamar, 2020), the reward function is the absolute difference product between the agent’s x-velocity and a velocity uniformly sampled from [0 , 3] .

Original: The state space is R 20 , comprising the z -position; the cheetah’s x- and z- velocity; the angle and angular velocity of each joint and the half-cheetah’s y-angle; and the XYZ position of the center of mass.
Revised: The state space is R 20 , comprising the z -position; the cheetah’s x- and z- velocity; the angle and angular velocity of each joint and the half-cheetah’s y-angle; and the XYZ position of the center of mass.

Original: The action space is [ − 1 , 1] 6 , with each dimension corresponding to the torque applied to a respective joint.
Revised: The action space is [ − 1 , 1] 6 , with each dimension corresponding to the torque applied to a respective joint.

Original: The ofﬂine data is collected in the same way as in the Ant Direction task, using a run from PEARL with 100 pre-sampled target velocities.
Revised: The ofﬂine data is collected in the same way as in the Ant Direction task, using a run from PEARL with 100 pre-sampled target velocities.

Original: For the ofﬂine dataset, we use the ﬁrst 1200 samples from the RL replay buffer and last 400 samples from the encoder replay buffer after 50 PEARL iterations, with each iteration containing at least 1000 new transitions.
Revised: For the ofﬂine dataset, we use the ﬁrst 1200 samples from the RL replay buffer and last 400 samples from the encoder replay buffer after 50 PEARL iterations, with each iteration containing at least 1000 new transitions.

Original: For only this environment, we found that it was beneﬁcial to freeze the encoder buffer during the self-supervised phase.
Revised: For only this environment, we found that it was beneﬁcial to freeze the encoder buffer during the self-supervised phase.

Original:  The state space, action space, and reward is described in Section 6.
Revised: Sawyer Manipulation The state space, action space, and reward is described in Section 6.

Original: Tasks are generated by sampling the initial conﬁguration, and then the desired behavior.
Revised: Tasks are generated by sampling the initial conﬁguration, and then the desired behavior.

Original: There are ﬁve[Table] objects: a drawer opened by handle, a drawer opened by button, a button, a tray, and a graspable object.
Revised: There are ﬁve objects: a drawer opened by handle, a drawer opened by button, a button, a tray, and a graspable object.

Original: The state is a 13-dimensional vector comprising of the 3D position of the end-effector and positions of objects in the scene: 3 dimensions for the graspable object, and 1 dimension for each articulated joint in the scene including the robot grippers.
Revised: The state is a 13-dimensional vector comprising of the 3D position of the end-effector and positions of objects in the scene: 3 dimensions for the graspable object, and 1 dimension for each articulated joint in the scene including the robot grippers.

Original: If an object is not present, it takes on position 0 in the corresponding element of the state space.
Revised: If an object is not present, it takes on position 0 in the corresponding element of the state space.

Original: First, the presence or absence of each of the ﬁve is randomized.
Revised: First, the presence or absence of each of the ﬁve is randomized.

Original: Next, the position of the drawers (from 2 sides), initial position of the tray (from 4 positions), and the object (from 4 positions) is randomized.
Revised: Next, the position of the drawers (from 2 sides), initial position of the tray (from 4 positions), and the object (from 4 positions) is randomized.

Original: Finally, the desired behavior is randomly chosen from the following list, but only including the ones that are possible in the scene: "move hand", "open top drawer with handle", or "open bottom drawer with button".
Revised: Finally, the desired behavior is randomly chosen from the following list, but only including the ones that are possible in the scene: "move hand", "open top drawer with handle", or "open bottom drawer with button".

Original: The ofﬂine data is collected using a scripted controller that does not know the desired behavior and randomly performs potential tasks in the scene, choosing another task if it ﬁnishes one task before the trajectory ends.
Revised: The ofﬂine data is collected using a scripted controller that does not know the desired behavior and randomly performs potential tasks in the scene, choosing another task if it ﬁnishes one task before the trajectory ends.

Original: This data is loaded into a single replay buffer used for both the encoder and RL.
Revised: This data is loaded into a single replay buffer used for both the encoder and RL.

Original: C. H YPERPARAMETERS
Revised: C. H YPERPARAMETERS

Original: We list the hyperparameters for training the policy, encoder, decoder, and Q-network in Table 1.
Revised: We list the hyperparameters for training the policy, encoder, decoder, and Q-network in Table 1.

Original: If hyperparameters were different across environments, they are listed in Table 2.
Revised: If hyperparameters were different across environments, they are listed in Table 2.

Original: For pretraining, we use the same hyperparameters and train for 50000 gradient steps.
Revised: For pretraining, we use the same hyperparameters and train for 50000 gradient steps.

Original: Below, we give details on non-standard hyperparameters and architectures.
Revised: Below, we give details on non-standard hyperparameters and architectures.

Original: Batch sizes.
Revised: Batch sizes.

Original: The RL batch size is the batch size per task when sampling ( s , a , r, s (cid:48) )
Revised: The RL batch size is the batch size per task when sampling ( s , a , r, s (cid:48) )

Original: tuples to update the policy and Q-network.
Revised: tuples to update the policy and Q-network.

Original: The encoder batch size is the size of the history h per task used to conditioned the encoder q φ e ( z | h ) .
Revised: The encoder batch size is the size of the history h per task used to conditioned the encoder q φ e ( z | h ) .

Original: The meta batch size is how many tasks batches were sampled and concatenated for both the RL and encoder batches.
Revised: The meta batch size is how many tasks batches were sampled and concatenated for both the RL and encoder batches.

Original: In other words, for each gradient update, the policy and Q-network observe ( RL batch size ) × ( meta batch size ) transitions and the encoder observes ( RL batch size ) ×
Revised: In other words, for each gradient update, the policy and Q-network observe ( RL batch size ) × ( meta batch size ) transitions and the encoder observes ( RL batch size ) ×

Original: ( encoder batch size ) transitions.
Revised: ( encoder batch size ) transitions.

Original: Encoder architecture.
Revised: Encoder architecture.

Original: The encoder uses the same architecture as in Rakelly et al.
Revised: The encoder uses the same architecture as in Rakelly et al.

Original: The posterior is given as the product of independent factors
Revised: The posterior is given as the product of independent factors

Original: [Equation]
Revised: [Equation]

Revised: [Table]

Revised: [Table]

Original: where each factor is a multi-variate Gaussian over R d z with learned mean and diagonal variance.
Revised: where each factor is a multi-variate Gaussian over R d z with learned mean and diagonal variance.

Original: In other words,
Revised: In other words,

Original: [Equation]
Revised: [Equation]

Original: Hyperparameter Cheetah Velocity

Original: Ant Direction

Original: Sawyer Manipulation horizon (max # of transitions per trajectory)

Original: [Figure]

Original: [Table] transitions [Table] The mean and standard deviation is the output of a single MLP network with output dimensionality 2 × d z .
Revised: The mean and standard deviation is the output of a single MLP network with output dimensionality 2 × d z .

Original: The output of the MLP network is split into two halves.
Revised: The output of the MLP network is split into two halves.

Original: The ﬁrst half is the mean and the second half is passed through the softplus activation to get the standard deviation.
Revised: The ﬁrst half is the mean and the second half is passed through the softplus activation to get the standard deviation.

Original: Self-supervised actor update.
Revised: Self-supervised actor update.

Original: The parameter λ pearl controls the actor loss during the selfsupervised phase, which is
Revised: The parameter λ pearl controls the actor loss during the selfsupervised phase, which is

Original: [Equation]
Revised: [Equation]

Original: where L PEARLactor is the actor loss from PEARL (Rakelly et al., 2019).
Revised: where L PEARLactor is the actor loss from PEARL (Rakelly et al., 2019).

Original: For reference, the PEARL actor loss is
Revised: For reference, the PEARL actor loss is

Original: [Equation]
Revised: [Equation]

Original: When the parameter λ pearl is zero, the actor update is equivalent to the actor update in AWAC (Nair et al., 2020).
Revised: When the parameter λ pearl is zero, the actor update is equivalent to the actor update in AWAC (Nair et al., 2020).

Original: Comparisons As discussed in Section 6, we used the authors’ code for PEARL (Rakelly et al., 2019), 3 BOReL (Dorfman & Tamar, 2020), 4 and MACAW (Mitchell et al., 2021).
Revised: Comparisons As discussed in Section 6, we used the authors’ code for PEARL (Rakelly et al., 2019), 3 BOReL (Dorfman & Tamar, 2020), 4 and MACAW (Mitchell et al., 2021).

Original: 5 To ensure a fair comparison, we ran the original hyperparameters and matched SMAC hyperparameters (matching network size, learning rate, and batch size), taking the better of the two as the result for each prior method.
Revised: 5 To ensure a fair comparison, we ran the original hyperparameters and matched SMAC hyperparameters (matching network size, learning rate, and batch size), taking the better of the two as the result for each prior method.

Original: For all comparisons, we evaluated the ﬁnal policy using the same evaluation method as
Revised: For all comparisons, we evaluated the ﬁnal policy using the same evaluation method as

Original: SMAC, i.e. collecting exploration trajectories with the learned policy and perform adaptation using this newly collected data.
Revised: SMAC, i.e. collecting exploration trajectories with the learned policy and perform adaptation using this newly collected data.