\section{Introduction}
\label{submission}

While learning tasks from scratch with reinforcement learning (RL) is often sample inefficient~\citep{heess2017emergence, berner2019dota}, leveraging datasets of pre-collected experience from various tasks can accelerate the learning of new tasks.
This experience can be used in numerous ways, including
to learn a dynamics model~\citep{finn2016unsupervised, kidambi2020morel},
to learn compact representations of observations~\citep{yang2021representation},
to learn behavioral priors~\citep{singh2021parrot},
or to extract meaningful skills or options~\citep{sutton1999between, kipf2019compile, ajay2020opal, nam2021skillbased} for hierarchical reinforcement learning (HRL)~\citep{barto2003recent}.
Our work studies this last approach.
The central idea is to extract commonly occurring behaviors from the pre-collected experience as skills, which can then be used in place of primitive low-level actions to accelerate learning new tasks via planning~\citep{roderick2017deep, liu2020learning} or RL~\citep{mcgovern1998macro, lee2018composing, liu2021motor}.
For example, in a navigation domain, learned skills may correspond to navigating to different rooms or objects.

Prior methods learn skills by maximizing the likelihood of the pre-collected experience~\citep{krishnan2017ddco, kipf2019compile, ajay2020opal, zhang2021minimum}.
However, this maximum likelihood objective (or the lower bounds on it) is \emph{underspecified}: it often admits many solutions, only some of which would help learning new tasks (see Figure \ref{fig:diff-decomp}).
For example, one degenerate solution is to learn a single skill for each entire trajectory; another degenerate solution is to learn skills that operate for a single timestep, equivalent to the original action space.
Both of these decompositions can perfectly reconstruct the pre-collected experiences (and, hence, maximize likelihood), but they are of limited use for learning to solve new tasks.
Overall, the maximum likelihood objective cannot distinguish between such decompositions and potentially more useful decompositions, and we find that this underspecification problem can empirically occur even on simple tasks in our experiments.

\begin{figure}
\vspace{-7mm}
\begin{center}
\centerline{\includegraphics[width=\linewidth]{figures/fig1_horizontal.pdf}}
\vspace{-1mm}
\caption{
Skill learning via maximizing likelihood is \emph{underspecified}: the skills (represented by the different colored segments) on both the left and the right maximize the likelihood (i.e., encode the data), but the skills on the right are more likely to be useful for a new task.
Our approach factors out common temporal structures, yielding the skills on the right.
The visualized tasks are from \citet{kipf2019compile}.
}
\label{fig:diff-decomp}
\vspace{-7mm}
\end{center}
\end{figure}

To address this underspecification problem, we propose to introduce an additional objective which biases skill learning to acquire skills that can accelerate the learning of new tasks.
To construct such an objective, we make two key observations:
\begin{itemize}[itemsep=0pt,topsep=0pt, leftmargin=10mm]
    \item Skills must extract reusable temporally-extended structure from the pre-collected experiences to accelerate learning of new tasks.
    \item \emph{Compressing} data also requires identifying and extracting common structure.
\end{itemize}
Hence, we hypothesize that compression is a good objective for skill learning.
We formalize this notion of compression with the principle of \emph{minimum description length }(MDL)~\citep{rissanen1978modeling}.
Concretely, we combine the maximum likelihood objective (used in prior works) with a new term to minimize the number of bits required to represent the pre-collected experience with skills, which incentivizes the skills to find common structure.
Additionally, while prior compression-based methods typically involve discrete optimization and hence are not differentiable, we also provide a method to minimize our compression objective via gradient descent (Section \ref{sec:approach}), which enables optimizing our objective with neural networks.

Overall, our main contribution is an objective for extracting skills from offline experience, which addresses the underspecification problem with the maximum likelihood objective.
We call the resulting approach \textsc{Love}\xspace (\textbf{L}earning \textbf{O}ptions \textbf{V}ia compr\textbf{E}ssion).
Using multi-task benchmarks from prior work~\citep{kipf2019compile}, we find that \textsc{Love}\xspace can learn skills that enable faster RL and are more semantically meaningful compared to skills learned with prior methods.
We also find that \textsc{Love}\xspace can scale to tasks with high-dimensional image observations, whereas most prior works focus on tasks with low-dimensional observations.

\section{Related Works}

We study the problem of using offline experience from one set of tasks to quickly learn new tasks.
While we use the experience to learn skills, prior works also consider other approaches of leveraging the offline experience, including to learn a dynamics model~\citep{kidambi2020morel}, to learn a compact representation of observations~\citep{yang2021representation}, and to learn behavioral priors for exploring new tasks~\citep{singh2021parrot}.

We build on a rich literature on extracting skills~\citep{sutton1999between} from \emph{offline} experience~\citep{niekum2013incremental, fox2017multi, krishnan2017ddco, sharma2018directed, kipf2019compile, bera2019podnet, pertsch2020accelerating, zhou2020plas, zhao2020augmenting, lee2020learning, ajay2020opal, Shankar2020Discovering, shankar2020learning, nam2021skillbased, zhang2021minimum, lu2021learning, zhu2021bottom, rao2021learning, tanneberg2021skid, yang2021trail}.
These works predominantly learn skills using a latent variable model, where the latent variables partition the experience into skills, and the overall model is learned by maximizing (a lower bound on) the likelihood of the experiences.
This approach is structurally similar to a long line of work in hierarchical Bayesian modeling~\citep{ghahramani2000variational, blei2001topic, fox2011sticky, linderman2016recurrent, johnson2016composing, dai2016recurrent, linderman2017bayesian, kim2019variational, harrison2019continuous, dong2020collapsed}.
We also follow this approach and build off of VTA~\citep{kim2019variational} for the latent variable model,
but differ by introducing a new compression term to address the underspecification problem with maximizing likelihood.
Several prior approaches~\citep{zhang2021minimum, zhao2020augmenting, garcia2017compression} also use compression, but yield open-loop skills, whereas we aim to learn closed-loop skills that can react to the state.
Additionally, \citet{zhang2021minimum} show that maximizing likelihood with variational inference can itself be seen as a form of compression, but this work compresses the latent variables at each time step, which does not in general yield optimal compression as our objective does.
Other works learn skills by limiting the information used from the state~\citep{goyal2019reinforcement}, whereas we learn skills by compressing entire trajectories.

Beyond learning skills from offline experience, prior works also consider learning skills with additional supervision~\citep{andreas2017modular, oh2017zero, shiarlis2018taco, jiang2019language, sontakke2021video2skill}, from online interaction without reward labels~\citep{gregor2016variational, florensa2017stochastic, eysenbach2018diversity, Sharma2020Dynamics, bagaria2021skill}, and from online interaction with reward labels~\cite{thrun1994finding, kulkarni2016hierarchical, bacon2017option, vezhnevets2017feudal, hausman2018learning, nachum2018data}.
Additionally, a large body of work on meta-reinforcement learning~\citep{duan2016rl, wang2016learning, rakelly2019efficient, zintgraf2019varibad, liu2021decoupling} also leverages prior experience to quickly learn new tasks, though not necessarily through skill learning.

\section{Preliminaries}
\label{sec:prelim}
\paragraph{Problem setting.} We consider the problem of using an offline dataset of experience to quickly solve new RL tasks, where each task is identified by a reward function.
The offline dataset is a set of trajectories $\mathcal{D} = \{\tau_i\}_{i = 1}^N$, where each trajectory is a sequence of states ${\mathbf{x}} \in {\mathcal{X}}$ and actions ${\mathbf{a}} \in {\mathcal{A}}$: $\tau_i = \{({\mathbf{x}}_1, {\mathbf{a}}_1), ({\mathbf{x}}_2, {\mathbf{a}}_2), \ldots\}$.
Each trajectory is collected by some unknown policy interacting with a Markov decision process (MDP) with dynamics ${\mathcal{P}}({\mathbf{x}}_{t + 1} \mid {\mathbf{x}}_{t}, {\mathbf{a}}_t)$.
Following prior work~\citep{finn2016unsupervised, agrawal2016learning, dasari2019robonet}, we do not assume access to the rewards (i.e., the task) of the offline trajectories.

Using this dataset, our aim is to quickly solve a new task.
The new task involves interacting with the same MDP as the data collection policy in the offline dataset, except with a new reward function ${\mathcal{R}}({\mathbf{x}}, {\mathbf{a}})$.
The objective is to learn a policy that maximizes the expected returns in as few numbers of environment interactions as possible.

\paragraph{Variational Temporal Abstraction.} Our method builds upon the graphical model from variational temporal abstraction (VTA)~\citep{kim2019variational},
which is a method for decomposing non-control sequential data (i.e., data without actions) into subsequences.
We overview VTA below and extend it to handle actions it Section \ref{sec:vta_actions}.

\begin{wrapfigure}[15]{r}{0.387\textwidth}
\begin{center}
\vspace{-7mm}
\centerline{\includegraphics[width=0.38\textwidth]{figures/vta_pgm.pdf}}
\vspace{-1mm}
\caption{\footnotesize The VTA graphical model (adapted from \citet{kim2019variational}).
The model decomposes the data $x_{1:T}$ into subsequences demarcated by when the boundary variables $m_t = 1$ (highlighted in \textcolor[HTML]{bf9000}{yellow}).
Each subsequence is assigned a descriptor ${\mathbf{z}}$, where all ${\mathbf{z}}_t$ within a subsequence are the same (outlined in dashed lines).
}
\label{fig:pgm}
\end{center}
\end{wrapfigure}

VTA assumes that each observation ${\mathbf{x}}_t$ is associated with an abstract representation ${\mathbf{s}}_t$ and a subsequence descriptor ${\mathbf{z}}_t$. An additional, binary random variable ${\mathbf{m}}_t$ indicates whether a new subsequence begins at the current observation.
VTA uses the following generative model:
\begin{enumerate}[itemsep=0mm, topsep=0mm, leftmargin=10mm]
    \item Determine whether to begin a new subsequence: ${\mathbf{m}}_t~\sim~p({\mathbf{m}}_t \mid {\mathbf{s}}_{t - 1})$. A new subsequence always begins on the first time step, i.e., ${\mathbf{m}}_1 = 1$.
    \item Sample the descriptor:    ${\mathbf{z}}_{t} \sim p({\mathbf{z}}_{t} \mid {\mathbf{z}}_{<t}, {\mathbf{m}}_t)$. If ${\mathbf{m}}_t = 0$, the previous descriptor is copied, i.e., ${\mathbf{z}}_t~=~{\mathbf{z}}_{t - 1}$.
    \item Sample the next state abstract representation:\\ ${\mathbf{s}}_{t} \sim p({\mathbf{s}}_t \mid {\mathbf{s}}_{<t}, {\mathbf{z}}_t, {\mathbf{m}}_t) $.
    \item Sample the observation: ${\mathbf{x}}_{t} \sim p({\mathbf{x}}_{t} \mid {\mathbf{s}}_{t})$.
\end{enumerate}
We visualize this sampling procedure in Figure~\ref{fig:pgm}. Formally, we can write this generative model as:
\begin{align*}
     p({\mathbf{x}}_{1:T}, {\mathbf{z}}_{1:T}, {\mathbf{s}}_{1:T}, {\mathbf{m}}_{1:T})
    = \prod_{t=1}^T \,\, p({\mathbf{x}}_t \mid {\mathbf{s}}_t) p({\mathbf{m}}_t \mid {\mathbf{s}}_{t - 1}) p({\mathbf{s}}_t \mid {\mathbf{s}}_{<t}, {\mathbf{z}}_t, {\mathbf{m}}_t)
     p({\mathbf{z}}_t \mid {\mathbf{z}}_{<t}, {\mathbf{m}}_t).
\end{align*}

VTA maximizes the likelihood of the observed data under this latent variable model using the standard evidence lower bound (ELBO):
\begin{align*} \footnotesize
    \log p({\mathbf{x}}_{1:T}) \geq \sum_{{\mathbf{m}}_{1:T}} \int_{\substack{{\mathbf{s}}_{1:T}, \\ {\mathbf{z}}_{1:T}}} q_{\boldsymbol{\theta}}({\mathbf{z}}_{1:T}, {\mathbf{s}}_{1:T}, {\mathbf{m}}_{1:T} \mid {\mathbf{x}}_{1:T}) \cdot \log \frac{p_{\boldsymbol{\theta}}({\mathbf{x}}_{1:T}, {\mathbf{z}}_{1:T}, {\mathbf{s}}_{1:T}, {\mathbf{m}}_{1:T})}{q_{\boldsymbol{\theta}} ({\mathbf{z}}_{1:T}, {\mathbf{s}}_{1:T}, {\mathbf{m}}_{1:T} \mid {\mathbf{x}}_{1:T})}
\end{align*}
This lower bound holds for any choice of $q_{\boldsymbol{\theta}}$. VTA chooses to factor this distribution as:
\begin{small}
 \begin{align*}
    & q_{\boldsymbol{\theta}}({\mathbf{z}}_{1:T}, {\mathbf{s}}_{1:T}, {\mathbf{m}}_{1:T} \mid {\mathbf{x}}_{1:T}) = \prod_{t=1}^T q_{\boldsymbol{\theta}}({\mathbf{m}}_t \mid {\mathbf{x}}_{1:t}) \, q_{\boldsymbol{\theta}}({\mathbf{z}}_t \mid {\mathbf{z}}_{t-1}, {\mathbf{m}}_t, {\mathbf{x}}_{1:T})\,
     q_{\boldsymbol{\theta}}({\mathbf{s}}_t \mid {\mathbf{z}}_t, {\mathbf{m}}_t, {\mathbf{x}}_{1:t}).
\end{align*}
\end{small}

As discussed above and as we observe in Section \ref{sec:didactic}, the maximum likelihood objective is underspecified and may yield degenerate or unhelpful solutions, which we address in the next section.
Specifically, we use the graphical model from VTA, but introduce a new objective that compresses the latent variables ${\mathbf{z}}$, while also maximizing the ELBO.

\section{\textsc{Love}\xspace: Learning Options via Compression}\label{sec:approach}

In this section, we describe our method for learning skills from pre-collected experience.
We first extend the VTA graphical model to handle experience labeled with actions, and then introduce a compression objective that encourages extracting common structure from the experience.

\subsection{A Graphical Model for Interaction Data}\label{sec:vta_actions}
We now extend the VTA graphical model~\citep{kim2019variational} to handle sequential data labeled with actions, where descriptors ${\mathbf{z}}$ now represent skills.
From a high level, the model partitions a trajectory into subsequences with the boundary variables ${\mathbf{m}}$ and labels each subsequence as a skill ${\mathbf{z}}$.

We wish to learn a state-conditional policy rather than the joint distribution of the whole trajectory.
To do this, we write a new generative model for the actions ${\mathbf{a}}_{1:T}$ conditional on the state ${\mathbf{x}}_{1:T}$:
\begin{align*}
      p({\mathbf{z}}_{1:T}, {\mathbf{s}}_{1:T}, {\mathbf{m}}_{1:T}, {\mathbf{a}}_{1:T} \mid {\mathbf{x}}_{1:T})
     = \prod_{t=1}^T \,\, p({\mathbf{a}}_t \mid {\mathbf{s}}_t) p({\mathbf{m}}_t \mid {\mathbf{s}}_{t - 1}) p({\mathbf{s}}_t \mid {\mathbf{x}}_{t}, {\mathbf{z}}_t)
     p({\mathbf{z}}_t \mid {\mathbf{x}}_{t}, {\mathbf{z}}_{t - 1}, {\mathbf{m}}_{t-1}).
\end{align*}
This differs from the original VTA generative model in two ways:
(1) we introduce a $p({\mathbf{a}}_t \mid {\mathbf{s}}_t)$ term that indicates how actions are sampled;
and (2) the distributions over ${\mathbf{z}}_t$ and ${\mathbf{s}}_t$ do not depend on all previous ${\mathbf{z}}_{1:t}$ and ${\mathbf{s}}_{1:t}$ to encode the Markov property.
We then augment the variational distribution such that the posterior over skills ${\mathbf{z}}$ also depends on actions:
\begin{small}
\begin{align*}
     q_{\mathbf{\theta}}({\mathbf{z}}_{1:T}, {\mathbf{s}}_{1:T}, {\mathbf{m}}_{1:T} \mid {\mathbf{x}}_{1:T}, {\mathbf{a}}_{1:T}) =  \prod_{t=1}^T \underbrace{ q_{\mathbf{\theta}}({\mathbf{m}}_t \mid {\mathbf{x}}_{1:t})}_{\substack{\text{termination} \\ \text{policy}}} \,\underbrace{ q_{\mathbf{\theta}}({\mathbf{z}}_t \mid {\mathbf{z}}_{t - 1}, {\mathbf{m}}_t, {\mathbf{x}}_{1:T}, {\mathbf{a}}_{1:T})}_{\text{skill posterior}}
    \underbrace{ q_{\mathbf{\theta}}({\mathbf{s}}_t \mid {\mathbf{z}}_t, {\mathbf{x}}_t)}_{\text{state abstraction posterior}}.
\end{align*}
\end{small}

Overall, this yields a model with 3 learned components:
\begin{itemize}[itemsep=0pt, topsep=0pt, leftmargin=10mm]
    \item A \emph{state abstraction posterior} $q_{\mathbf{\theta}}({\mathbf{s}}_t \mid {\mathbf{z}}_t, {\mathbf{x}}_t)$ and \emph{decoder} $p_{\mathbf{\theta}}({\mathbf{a}}_t \mid {\mathbf{s}}_t)$, which together form a distribution over actions conditioned on the skill ${\mathbf{z}}_t$ and current state ${\mathbf{x}}_t$.
    We refer to these jointly as the \emph{skill policy} $\pi_{\mathbf{\theta}}({\mathbf{a}}_t \mid {\mathbf{z}}_t, {\mathbf{x}}_t) = \mathbb{E}_{{\mathbf{s}}_t \sim q_{\mathbf{\theta}}({\mathbf{s}}_t \mid {\mathbf{z}}_t, {\mathbf{x}}_t)}\left[p_{\mathbf{\theta}}({\mathbf{a}}_t \mid {\mathbf{s}}_t)\right]$.
    \item A \emph{termination policy} $q_{\mathbf{\theta}}({\mathbf{m}}_t \mid {\mathbf{x}}_{1:t})$, which determines whether the previous skill terminates.
    \item A \emph{skill posterior} $q_{\mathbf{\theta}}({\mathbf{z}}_t \mid {\mathbf{z}}_{t - 1}, {\mathbf{m}}_t, {\mathbf{x}}_{1:T}, {\mathbf{a}}_{1:T})$, which outputs the current skill ${\mathbf{z}}_t$ conditioned on all states ${\mathbf{x}}_{1:T}$ and actions ${\mathbf{a}}_{1:T}$.
    This depends on ${\mathbf{m}}_t$ and ${\mathbf{z}}_{t - 1}$, since the boundary variables determine whether the previous skill ${\mathbf{z}}_{t - 1}$ terminates: when ${\mathbf{m}}_t = 0$, the previous skill does not terminate and ${\mathbf{z}}_t = {\mathbf{z}}_{t - 1}$.
\end{itemize}

Once this model is learned, the skill policy and termination policy represent the skills, without a need for the skill posterior:
Given a skill variable ${\mathbf{z}}$, the skill policy encodes what actions the skill takes, and the termination policy determines when the skill stops.
In the next section, we describe our objective for learning this model.
Then, in Section \ref{sec:hrl}, we describe how we use the skill policy and termination policy to learn new tasks.

\subsection{Discovering Structure via Compression}\label{sec:compression_objective}

As previously discussed, the maximum likelihood objective is underspecified for skill learning, because many skills can maximize likelihood, independent of whether they are useful for learning new tasks.
In this section, we address this with a new objective that attempts to measure how useful skills will be for learning new tasks in terms of compression.
Our objective is based on the intuition that effectively compressing a sequence of data requires factoring out common structure, and factoring out common structure is critical for learning useful skills.

We measure the complexity of a skill decomposition as the amount of information required to communicate the sequence of skills that encode the pre-collected experience.
The latent variable model introduced in the previous section encodes each trajectory as a sequence of skills ${\mathbf{z}}_{1:T}$ and boundaries ${\mathbf{m}}_{1:T}$.
However, using the skill and termination policies, it is possible to recover each trajectory from only the skill variables at the boundary points: i.e., at the time steps $\{t \in [T] \, \mid \, {\mathbf{m}}_t = 1\}$.
For a prior on skills $p_{{\mathbf{z}}}$, an optimal code requires $-\log p_{{\mathbf{z}}}({\mathbf{z}}_t)$ bits to send a skill ${\mathbf{z}}_t$~\citep[Chapter 5.2]{cover1999elements}.
Hence, the expected code length of communicating a trajectory $\mathbf{\tau}_{1:T}~=~\{({\mathbf{x}}_1, {\mathbf{a}}_1), \ldots, ({\mathbf{x}}_T, {\mathbf{a}}_T)\}$ is:
\begin{equation*}
    \textsc{InfoCost}(\mathbf{\theta}; p_{{\mathbf{z}}}) = -\mathbb{E}_{\substack{\mathbf{\tau}_{1:T},\\{\mathbf{m}}_{1:T},\\{\mathbf{z}}_{1:T}}}\left[\sum_{t=1}^T \log p_{{\mathbf{z}}}({\mathbf{z}}_t) {\mathbf{m}}_t\right],
\end{equation*}
where the expectation is under trajectories $\mathbf{\tau}_{1:T}$ from the pre-collected experience and sampling ${\mathbf{z}}_{1:T}$ from the skill posterior and ${\mathbf{m}}_{1:T}$ from the termination policy.
The choice of prior that minimizes the average code length is one that equals the empirical distribution of skills under the pre-collected experience~\citep[Chapter 5.3]{cover1999elements}:
\begin{align*}
    p_{{\mathbf{z}}}^{\star} \triangleq \argmin_{p_{{\mathbf{z}}}} \textsc{InfoCost}( \mathbf{\theta}; p_{{\mathbf{z}}}),
\quad \text{where } p_{\mathbf{z}}^{\star}({\mathbf{z}}) = \frac{1}{n_\text{s}} \mathbb{E}_{\substack{\mathbf{\tau}_{1:T},\\{\mathbf{m}}_{1:T},\\{\mathbf{z}}_{1:T}}}\left[\sum_{t=1}^T \delta({\mathbf{z}}_t = {\mathbf{z}}){\mathbf{m}}_t\right],
\end{align*}
and $n_\text{s} \triangleq \mathbb{E}_{\substack{\mathbf{\tau}_{1:T},{\mathbf{m}}_{1:T}}}\left[\sum_{t=1}^{T}{\mathbf{m}}_t\right]$.
In Appendix \ref{app:valid_density}, we show that this marginal $p_{\mathbf{z}}^{\star}$ is a proper density for both continuous and discrete ${\mathbf{z}}$.
Substituting in this optimal choice of prior, we can show that the code length can be expressed as the marginal entropy ${\mathcal{H}}_{p_{{\mathbf{z}}}^{\star}}[{\mathbf{z}}]$ times the number of skills per trajectory $n_\text{s}$ (see Appendix \ref{app:rewrite} for proof):
{
\begin{align}\label{eqn:compression_objective}
\footnotesize
{\mathcal{L}}_{\text{CL}}(\mathbf{\theta}) \triangleq \min_{p({\mathbf{z}}_t)} \textsc{InfoCost}(\mathbf{\theta}; p({\mathbf{z}}_t))
 = -\mathbb{E}_{\substack{\mathbf{\tau}_{1:T},\\{\mathbf{m}}_{1:T},\\{\mathbf{z}}_{1:T}}}\left[\sum_{t=1}^T \log p_{{\mathbf{z}}}^{\star}({\mathbf{z}}_t) {\mathbf{m}}_t\right] = n_\text{s}{\mathcal{H}}_{p_{{\mathbf{z}}}^{\star}}[{\mathbf{z}}].
\end{align}
}Intuitively, this is equal to the average code length of a skill multiplied by the the average number of skills per trajectory.
Note that compression is only beneficial if the model also achieves high likelihood of the data.
We capture this by solving the following constrained optimization problem:
\begin{equation}\label{eqn:constrained_optimization}
    \min_{\boldsymbol{\theta}}\,\, {\mathcal{L}}_{\text{CL}}( \boldsymbol{\theta}) \quad
    \text{s.t.} \,\, {\mathcal{L}}_{\text{ELBO}}(\boldsymbol{\theta}) \leq C,
\end{equation}
where ${\mathcal{L}}_{\text{ELBO}}(\boldsymbol{\theta})$ a negated evidence lower bound on the log-likelihood (detailed in Appendix \ref{app:elbo}).
\paragraph{Remarks.}
We discuss a connection between this objective and variational inference in Appendix~\ref{app:prior}.
Additionally, while this work focuses on the RL setting, our objective generally applies to sequential modeling problems. We believe that it could be useful for many applications beyond option learning.

\subsection{Connections to Minimal Description Length}
Our approach closely relates to the minimum description length (MDL) principle~\citep{rissanen1978modeling}.
This principle equates \emph{learning} with \emph{finding regularity} in data, which can be used to \emph{compress} the data.
Informally, the best model is the one that encodes the data with the lowest description length.
Given a model $\mathbf{\theta}$ that encodes the data $\mathcal{D}$ into some message, one way to formalize the description length of the data $L(\mathcal{D})$ is with a crude two-part code~\citep{grunwald2004tutorial}.
This decomposes the description length of the data as the length of the message plus the length of the model:
\begin{align}\label{eqn:mdl}
    L({\mathcal{D}}) = \underbrace{L({\mathcal{D}} \mid \boldsymbol{\theta})}_{\text{message length}} + \underbrace{L(\boldsymbol{\theta})}_{\text{model length}}.
\end{align}
In our case, the message is the latent variables ${\mathbf{z}}_t$ at the boundary points $\{t \in [T] \, \mid \, {\mathbf{m}}_t = 1\}$, which can be decoded into the data $\mathcal{D}$ with the skill and termination policies (representing the model).
Hence, our approach can be seen as an instance of minimizing the description length $L(\mathcal{D})$.
Optimizing our objective in Equation~\ref{eqn:compression_objective} is equivalent to minimizing the message length $L({\mathcal{D}} \mid \boldsymbol{\theta})$.
While we do not directly attempt to minimize the model length term $L(\mathbf{\theta})$,
many works~\citep{neyshabur2014search, valle2018deep} indicate that deep learning has \emph{implicit regularization}, which biases optimization toward low complexity solutions without an explicit regularizer.
In general, computing the true description length or appropriate notion of complexity for neural networks is a tall order~\citep{neyshabur2017exploring, zhang2021understanding, Jiang*2020Fantastic};
however, there is a rich space of methods to be explored here and we therefore leave the extension of our approach to directly minimizing the model length term for future work.

\subsection{A Practical Implementation}\label{sec:practical}
\paragraph{Model.}
We instantiate our model by defining discrete skills ${\mathbf{z}} \in [K]$, state abstractions ${\mathbf{s}} \in {\mathbb{R}}^d$, and binary boundary variables ${\mathbf{m}} \in \{0, 1\}$.
We parameterize all components of our model as neural networks.
See Appendix \ref{app:arch} for architecture details.

\paragraph{Optimization.}
We apply Gumbel-softmax~\citep{jang2016categorical, maddison2016concrete} to optimize over the discrete random variables ${\mathbf{z}}$ and ${\mathbf{m}}$.
We rewrite the compression objective ${\mathcal{L}}_\text{CL}$ as a product of $n_\text{s}$ and ${\mathcal{H}}_{p_{{\mathbf{z}}}^{\star}}[{\mathbf{z}}_t]$ in Equation \ref{eqn:compression_objective} to improve the stability of optimization.
This rewriting allows computing a gradient in terms of a distribution over the skill variables $p^\star_{\mathbf{z}}$, rather than samples ${\mathbf{z}}_{t}$, which yields a more accurate finite sample gradient.
Empirically, this leads to stabler optimization and convergence to better solutions.

We approximate the optimal skill prior $p_{{\mathbf{z}}}^{\star}$ using our skill posterior as:
\begin{align*}\footnotesize
    p_{{\mathbf{z}}}^{\star}({\mathbf{z}}) \approx\frac{1}{ \widehat{\mathbb{E}}_{\substack{\mathbf{\tau}_{1:T}, \\{\mathbf{m}}_{1:T}}} \left[\sum_{t = 1}^T {\mathbf{m}}_t\right]} \widehat{\mathbb{E}}_{\substack{\mathbf{\tau}_{1:T},\\{\mathbf{m}}_{1:T},\\{\mathbf{z}}_{1:T}}} \left[\sum_{t = 1}^T q_{\boldsymbol{\theta}}({\mathbf{z}}_t = {\mathbf{z}} \mid {\mathbf{z}}_{t-1}, {\mathbf{m}}_t, {\mathbf{x}}_{1:T}, {\mathbf{a}}_{1:T})\,{\mathbf{m}}_t\right] ,
\end{align*}
where $\widehat{\mathbb{E}}$ denotes the empirical expectation over minibatches of ${\mathbf{x}}_{1:T}, {\mathbf{a}}_{1:T}$ from ${\mathcal{D}}$ and sampling ${\mathbf{m}}_{1:T}$ from the termination policy.
We solve the constrained optimization problem (Equation \ref{eqn:constrained_optimization}) with dual gradient descent on the Lagrangian.
In Appendix \ref{app:algo}, we summarize the overall training procedure in Algorithm \ref{alg:love} and report details about the Lagrangian.

\paragraph{Enforcing a minimum skill length.} Though degenerate solutions such as skills that only take a single action score poorly in our compression objective, empirically, such solutions create local optima that are difficult to escape.
To avoid this, we mask the boundary variables during training to ensure that each skill $z_t$ operates for at least $T_\text{min} = 3$ time steps.
We find that when the skills are at least minimally temporally extended, optimization of the compression objective appears to be stabler and achieves better values.
We remove these masks at test time, when we learn a task with our skills.

\section{Using the Learned Skills for Hierarchical RL}
\label{sec:hrl}
We now describe how we quickly learn new tasks, given the skills learned from the pre-collected experience.
Overall, we simply augment the agent's action space with the learned skills and learn a new policy that can take either low-level actions or learned skills, similar to \citet{kipf2019compile}.
However, our compression objective may result in unused skills, since this decreases the encoding cost of the used skills.
Therefore, we first filter down to only the skills that are used to compress the pre-collected experience by selecting the skills where the marginal is over some threshold $\alpha$:
\begin{align*}
    {\mathcal{Z}} = \big\{k \in [K] \,\,\mid\,\,  p_{{\mathbf{z}}}^{\star}(k) > \alpha \big\}.
\end{align*}
Then, on a new task with action space $\mathcal{A}$, we train an agent using the augmented action space ${\mathcal{A}}^+ = {\mathcal{A}} \, \cup \, {\mathcal{Z}}$.
When the agent selects a skill $z \in {\mathcal{Z}}$, we follow the procedure in Algorithm~\ref{alg:hrl} in the Appendix.
We take actions following the skill policy $\pi_{\mathbf{\theta}}({\mathbf{a}}_t \mid {\mathbf{z}}, {\mathbf{x}}_t)$ (lines 2--3), until the termination policy $q_{\mathbf{\theta}}({\mathbf{m}}_t \mid {\mathbf{x}}_{1:t})$ outputs a termination ${\mathbf{m}}_t = 1$ (line 5).
At that point, the agent observes the next state ${\mathbf{x}}_{t + 1}$ and selects the next action or skill.

\section{A Didactic Experiment: Frame Prediction}\label{sec:didactic}

Before studying the RL setting, we first illustrate the effect of \textsc{Love}\xspace in the simpler setting of sequential data without actions.
In this setting, we use the original VTA model, which partitions a sequence ${\mathbf{x}}_{1:T}$ into contiguous subsequences with the boundary variables ${\mathbf{m}}$ and labels each subsequence with a descriptor ${\mathbf{z}}$, as described in Section \ref{sec:prelim}.
Here, VTA's objective is to maximize the likelihood of the sequence ${\mathbf{x}}_{1:T}$, and our compression objective applies to this setting completely unmodified.
We compare \textsc{Love}\xspace and only maximizing likelihood, i.e., VTA~\citep{kim2019variational}, by measuring how well the learned subsequences correspond to underlying patterns in the data.
To isolate the effect of the compression objective, we do not enforce a minimum skill length.

\begin{figure}
    \vspace{-7mm}
    \begin{minipage}{0.43\linewidth}
        \centering
        \includegraphics[width=\linewidth]{figures/color_s2.pdf}
\caption{\footnotesize Learned boundaries and descriptors on \emph{Simple Colors}.
        \textsc{Love}\xspace recovers the patterns, while VTA learns boundaries that break up patterns or span multiple patterns (outlined in \textcolor{red}{red}).}
        \label{fig:color-simple}
\end{minipage}\hfill
    \begin{minipage}{0.54\linewidth}
\captionof{table}{\footnotesize Effect of \textsc{Love}\xspace~on the \emph{Simple Colors} and \emph{Conditional Colors} datasets (5 seeds). All approaches achieve similar values for the likelihood objective, but \textsc{Love}\xspace better recovers the correct boundaries.}
            \vspace{-2mm}
\center\small
            \resizebox{\linewidth}{!}{\begin{tabular}{ccccc}
                \toprule
                &\multicolumn{2}{c}{\textit{Simple Colors}}& \multicolumn{2}{c}{\textit{Conditional Colors}}\\
                 & \textbf{VTA} & \textbf{\textsc{Love}\xspace} & \textbf{VTA} & \textbf{\textsc{Love}\xspace}  \\
                 \cmidrule(lr){2-2} \cmidrule(lr){3-3} \cmidrule(lr){4-4} \cmidrule{5-5}
${\mathcal{L}}_{\text{ELBO}}$  & $2868 {\scriptstyle\, \pm \, 43}$ & $2838 {\scriptstyle\, \pm \, 19}$ & $2832 {\scriptstyle\, \pm \, 7.7}$ & $2827 {\scriptstyle\, \pm \, 1.9}$\\
\midrule
                Precision & $0.87 {\scriptstyle\, \pm \, 0.19}$ & $\mathbf{0.99} {\scriptstyle\, \pm \, 0.01}$ & $0.84 {\scriptstyle\, \pm \, 0.22}$ & $\mathbf{0.99} {\scriptstyle\, \pm \, 0.01}$\\
                Recall & $0.79 {\scriptstyle\, \pm \, 0.13}$ & $\mathbf{0.85} {\scriptstyle\, \pm \, 0.03}$ & $\mathbf{0.82} {\scriptstyle\, \pm \, 0.16}$ & $\mathbf{0.83} {\scriptstyle\, \pm \, 0.06}$ \\
                F1 & $0.82 {\scriptstyle\, \pm \, 0.13}$ & $\mathbf{0.91} {\scriptstyle\, \pm \, 0.02}$ & $0.83 {\scriptstyle\, \pm \, 0.19}$ & $\mathbf{0.90} {\scriptstyle\, \pm \, 0.03}$ \\
Code Length & $7.58 {\scriptstyle\, \pm \, 1.3}$ & $\mathbf{6.34} {\scriptstyle\, \pm \, 0.75}$ & $9.17 {\scriptstyle\, \pm \, 1.76}$ & $\mathbf{6.83} {\scriptstyle\, \pm \, 0.51}$ \\
                \bottomrule
            \end{tabular}
            }
\label{tab:synthetic-results}

\end{minipage}
    \vspace{-3mm}
\end{figure}

\paragraph{Dataset.}
We consider two simple datasets \emph{Simple Colors} and \emph{Conditional Colors}, which consist of sequences of $32 \times 32$ monochromatic frames, with repeating underlying patterns.
\emph{Simple Colors} consists of 3 patterns: 3 consecutive yellow frames, 3 consecutive blue frames and 3 consecutive green frames.
The dataset is generated by sampling these patterns with probability 0.4, 0.4, and 0.2 respectively and concatenating the results.
Each pattern is sampled independent of history.
The dataset is then divided into sequences of 6 patterns, equal to $6 \times 3 = 18$ frames.

In contrast to \emph{Simple Colors}, \emph{Conditional Colors} tests learning patterns that depend on history.
It consists of 4 patterns: the 3 patterns from \emph{Simple Colors} with an additional pattern of 3 consecutive purple frames.
The dataset is generated by uniformly sampling the patterns from \emph{Simple Colors}.
To make the current timestep pattern dependent on the previous timestep, the yellow frames are re-colored to purple, if the previous pattern was blue or yellow.
As in \emph{Simple Colors}, the dataset is divided into sequences of 6 patterns.

In both datasets, the optimal encoding strategy is to learn 3 subsequence descriptors (i.e., skills), one for each pattern in \emph{Simple Colors}.
In \emph{Conditional Colors}, the descriptor corresponding to yellow in \emph{Simple Colors} either outputs yellow or purple, depending on the history.
This encoding strategy achieves an expected code length of $6.32$ nats in \emph{Simple Colors} and $6.59$ nats in \emph{Conditional Colors}.

\paragraph{Results.}
We visualize the learned descriptors and boundaries in Figure \ref{fig:color-simple}.
\textsc{Love}\xspace successfully segments the sequences into the patterns and assigns a consistent descriptor ${\mathbf{z}}$ to each pattern.
In contrast, despite the simple structure of this problem, VTA learns subsequences that span over multiple patterns or last for fewer timesteps than a single pattern.

Quantitatively, we measure the (1) precision, recall, and F1 scores of the boundary prediction, (2) the ELBO of the maximum likelihood objective and (3) the average code length $\mathcal{L}_\text{CL}$ in Table \ref{tab:synthetic-results}.
While both VTA and \textsc{Love}\xspace achieve approximately the same negated ELBO (lower is better), \textsc{Love}\xspace recovers the correct boundaries with much higher precision, recall, and F1 scores.
This illustrates that the underspecification problem can occur even in simple sequential data.
Additionally, we find that \textsc{Love}\xspace achieves an encoding cost close to the optimal value.
One interesting, though rare, failure mode is that \textsc{Love}\xspace sometimes even achieves a lower encoding cost than the optimal value by over-weighting the compression term and imperfectly reconstructing the data. In Appendix~\ref{app:sensitivity}, we conduct a ablation study on the weights of ${\mathcal{L}}_{\text{CL}}$ in optimization.

\section{Experiments}\label{sec:experiments}
\begin{wrapfigure}[14]{r}{0.36\textwidth}
\vspace{-8mm}
\begin{center}
     \includegraphics[width=0.35\textwidth]{figures/grid_world.pdf}
\caption{Multi-task grid world instance from \citet{kipf2019compile}. The agent must pick up a sequence of objects in a specified order.}
     \label{fig:grid_world}
\end{center}
\end{wrapfigure}

We aim to answer three questions:
(1) Does \textsc{Love}\xspace learn semantically meaningful skills?
(2) Do skills learned with \textsc{Love}\xspace accelerate learning for new tasks?
(3) Can \textsc{Love}\xspace scale to high-dim pixel observations?
To answer these questions, we learn skills from demonstrations and use these skills to learn new tasks, first on a 2D multi-task domain, and later on a 3D variant.

\paragraph{Multi-task domain.}
We consider the multi-task $10 \times 10$ grid world introduced by \citet{kipf2019compile}, a representative skill learning approach (Figure \ref{fig:grid_world}).
This domain features a challenging control problem that requires the agent to collect up to 5 objects, and we later add a perception challenge to it with the 3D variant.
We use our own custom implementation, since the code from \citet{kipf2019compile} is not publicly available.
In each task, 6 objects are randomly sampled from a set of $N_\text{obj} = 10$ different objects and placed at random positions in the grid.
Additionally, impassable walls are randomly added to the grid, and the agent is also placed at a random initial grid cell.
Each task also includes an instruction list of $N_\text{pick} = 3$ or $5$ objects that the agent must pick up in order.

Within each task, the agent's actions are to move up, down, left, right, or to pick up an item at the agent's grid cell.
The state consists of two parts: (1) a $10 \times 10 \times (N_\text{obj} + 2)$ grid observation, indicating if the agent, a wall, or any of the $N_\text{obj}$ different object types is present at each of the $10 \times 10$ grid cells; (2) the instruction corresponding to the next object to pick up, encoded as a one-hot integer.
Following \citet{kipf2019compile}, we consider two reward variants:
In the \emph{sparse reward} variant, the agent only receives $+1$ reward after picking up \emph{all} $N_\text{pick}$ objects in the correct order.
In the \emph{dense reward} variant, the agent receives $+1$ reward after picking up each specified object in the correct order.
Our dense reward variant is slightly harder than the variant in \citet{kipf2019compile}, which gives the agent $+1$ reward for picking up objects in \emph{any} order.
The agent receives $0$ reward in all other time steps.
The episode ends when the agent has picked up all the objects in the correct order, or after $50$ timesteps.

\paragraph{Pre-collected experience.} We follow the setting in \citet{kipf2019compile}.
We set the pre-collected experience to be $2000$ demonstrations generated via breadth-first search on randomly generated tasks with only $N_\text{pick} = 3$ and test if the agent can generalize to $N_\text{pick} = 5$ when learning a new task.
These demonstrations are not labeled with rewards and also \textit{do not} contain the instruction list observations.

\paragraph{Points of comparison.} To study our compression objective, we compare with two representatives of learning skills via the maximum likelihood objective:
\begin{itemize}[itemsep=0pt, topsep=0pt, leftmargin=10mm]
    \item VTA \citep{kim2019variational}, modified to handle interaction data as in Section \ref{sec:vta_actions}.
    \item Discovery of deep options (DDO) \citep{fox2017multi}.
    We implement DDO's maximum likelihood objective and graphical model on top of VTA's variational inference optimization procedure, instead of expectation-gradients used in the original paper.
\end{itemize}
For fairness, we also compare with variants of these that implement the minimum skill length constraint from Section \ref{sec:practical}.
CompILE~\citep{kipf2019compile} is another approach that learns skill by maximizing likelihood and was introduced in the same paper as this grid world.
Because the implementation is unavailable, we do not compare with it.
However, we note that CompILE requires additional supervision that \textsc{Love}\xspace, VTA, and DDO do not: namely, it requires knowing how many skills each demonstration is composed of.
This supervision can be challenging to obtain without already knowing what the skills should be.

Since latent variable models are prone to local optima~\citep{kumar2010self}, it is common to learn such models with multiple restarts~\citep{murphy2012machine}.
We therefore run each method with 3 random initializations
and pick the best model according to the compression objective $\mathcal{L}_\text{CL}$ for \textsc{Love}\xspace and according to the ELBO of the maximum likelihood objective $\mathcal{L}_\text{ELBO}$ for the others.
Notably, this does not require any additional demonstrations or experience.

We begin by analyzing the skills learned from the pre-collected experience before analyzing the utility of these skills for learning downstream tasks in the next sections.

\subsection{Analyzing the Learned Skills}\label{sec:analyzing_skills}

\begin{wraptable}[11]{r}{0.55\textwidth}
    \vspace{-4mm}
    \caption{\footnotesize Precision and recall of outputting the boundaries between picking up different objects. Only \textsc{Love}\xspace learns skills that move to and pick up an object.}
    \vspace{-3mm}
    \center\small
    \begin{tabular}{cccc}
        \toprule
        & Precision & Recall & F1 \\ \midrule
DDO \citep{fox2017multi} & 0.19 & \textbf{1} & 0.32 \\
        DDO + min. skill length & 0.26 & 0.53 & 0.35 \\
        VTA \citep{kim2019variational} & 0.19 & \textbf{0.99} & 0.32 \\
        VTA + min. skill length & 0.27 & 0.53 & 0.36\\
        \textsc{Love}\xspace (ours) & \textbf{0.90} & 0.94 & \textbf{0.92} \\
        \bottomrule
    \end{tabular}
    \label{tab:grid_prec_recall}
\end{wraptable}
We analyze the learned skills by comparing them to a natural decomposition that partitions the demonstration in $N_\text{pick}$ sequences of moving to and picking up an object.
Specifically, we measure the precision and recall of each method in outputting the correct boundaries of these $N_\text{pick}$ sequences.

\begin{figure*}[t]
\begin{center}
\vspace{-7mm}
    \centerline{\includegraphics[width=\linewidth]{figures/grid_returns.pdf}}
\vspace{-1mm}
\caption{\textbf{Sample efficient learning.} We plot returns vs. timesteps of environment interactions for 4 settings in the grid world with 1-stddev error bars (5 seeds). Only \textsc{Love}\xspace achieves high returns across all 4 settings.}
\label{fig:grid_returns}
\end{center}
\vspace{-5mm}
\end{figure*}

We find that only \textsc{Love}\xspace recovers the correct boundaries with both high precision and recall (Table \ref{tab:grid_prec_recall}).
Visually examining the skills learned with \textsc{Love}\xspace shows that each skill moves to an object and picks it up.
We visualize \textsc{Love}\xspace's skills in Appendix \ref{app:visualization}.
In contrast, maximizing likelihood with either DDO or VTA learns degenerate skills that output only a single action, leading to high recall, but low precision.
Adding the minimum skill length constraint to these approaches prevents such degenerate solutions, but still does not lead to the correct boundaries.
Skills learned by VTA with the minimum skill length constraint exhibit no apparent structure, but skills learned by DDO with the minimum skill length constraint appear to move toward objects, though they terminate at seemingly random places.
These results further illustrate the underspecification problem.
All approaches successfully learn to reconstruct the demonstrations and achieve high likelihood, but only \textsc{Love}\xspace and DDO with the minimum skill length constraint learn skills that appear to be semantically meaningful.

\subsection{Learning New Tasks}
Next, we evaluate the utility of the skills for learning new tasks.
To evaluate the skills, we sample a new task in each of 4 settings: with sparse or dense rewards and with $N_\text{pick} = 3$ or $N_\text{pick} = 5$.
Then we learn the new tasks following the procedure in Section \ref{sec:hrl}:
we augment the action space with the skills and train an agent over the augmented action space.
To understand the impact of skills, we also compare with a low-level policy that learns these tasks using only the original action space, and the same low-level policy that incorporates the demonstrations by pre-training with behavioral cloning.
We parametrize the policy for all approaches with dueling double deep Q-networks \citep{mnih2015human, wang2016dueling, van2016deep} with $\epsilon$-greedy exploration.
We report the returns of evaluation episodes with $\epsilon = 0$, which are run every 10 episodes.
We report returns averaged over 5 seeds.
See Appendix \ref{app:hrl-hparam} for full details.

\paragraph{Results.}
Overall, \textsc{Love}\xspace learns new tasks across all 4 settings comparably to or faster than both skill methods based on maximizing likelihood and incorporating demonstrations via behavior cloning (Figure \ref{fig:grid_returns}).
More specifically, when $N_\text{pick} = 3$, DDO with the min. skill length constraint performs comparably to \textsc{Love}\xspace, despite not segmenting the demonstrations into sequences of moving to and picking up objects.
We observe that while a single DDO skill does not move to and pick up an object, the skills consistently move toward objects, which likely helps with exploration.
Imitating the demonstrations with behavior cloning also accelerates learning when $N_\text{pick} = 3$ with dense rewards, though not as much as \textsc{Love}\xspace or DDO, and yields insignificant benefit in all other settings.
Skill learning with VTA yields no benefit over no skill learning at all.

Recall that $N_\text{pick} = 3$ in all of the demonstrations.
\textsc{Love}\xspace learns new tasks in the generalization setting of $N_\text{pick} = 5$ much faster than the other methods.
With dense rewards, DDO (min. skill length) also eventually solves the task, but requires over $8\times$ more timesteps.
The other approaches learn to pick up some objects, but never achieve optimal returns of 5.
With sparse rewards, \textsc{Love}\xspace is the only approach that achieves high returns, while all other approaches achieve 0 returns.
This likely occurs because this setting creates a challenging exploration problem, so exploring with low-level actions or skills learned with VTA or DDO rarely achieves reward.
By contrast, exploring with skills learned with \textsc{Love}\xspace achieves rewards much more frequently, which enables \textsc{Love}\xspace to ultimately solve the task.

\subsection{Scaling to High-dimensional Observations}

Prior works in the offline multi-task setting have learned skills from low-dimensional states and then transferred them to high-dim pixel observations~\citep{rao2021learning}, or have learned hierarchical models from pixel observations~\citep{kim2019variational, fox2017multi}.
However, to the best of our knowledge, prior works in this setting have not directly learned skills from high-dim pixel observations, only from low-dimensional states.
Hence, in this section, we test if \textsc{Love}\xspace can scale up to high-dim pixel observations by considering a challenging 3D image-based variant of the multi-task domain above, illustrated in Figure~\ref{fig:3dworld}.
The goal is still to pick up $N_{\text{pick}}$ objects in the correct order, where objects are blocks of different colors.
Each task includes 3 objects randomly sampled from a set of $N_\text{obj} = 6$ different colors.
The observations are $400 \times 60 \times 3$ egocentric panoramic RGB arrays.
The actions are to move forward / backward, turn left / right, and pick up.

\begin{figure}
    \begin{minipage}{0.35\linewidth}
    \centerline{\includegraphics[width=0.95\columnwidth]{figures/3d_world_high_res.png}}
    \vspace{2.2mm}
    \caption{3D visual multi-task domain.}
    \label{fig:3dworld}
\end{minipage}\hfill
    \begin{minipage}{0.6\linewidth}
    \vspace{2mm}
    \centerline{\includegraphics[width=0.79\columnwidth]{figures/3d_world.pdf}}
    \vspace{-2.2mm}
    \caption{Returns on the 3D visual multi-task domain with 1-stddev error bars (5 seeds). Only \textsc{Love}\xspace achieves near-optimal returns.}
    \label{fig:3d_results}
\end{minipage}
\end{figure}

We consider only the harder \emph{sparse reward} and generalization setting, where the agent must pick up $N_{\text{pick}} = 4$ objects in the correct order, after receiving 2,000 pre-collected demonstrations of the approximate shortest path of picking up $N_{\text{pick}} = 2$ objects in the correct order.
We use the same hyperparameters as in multi-task domain and only change the observation encoder and action decoder (full details in Appendix~\ref{app:3d_arch}).
Figure~\ref{fig:3d_results} shows the results.
Again, \textsc{Love}\xspace learns skills that each navigate to and pick up an object, which quickly achieves optimal returns, indicating its ability to scale to high-dim observations.
In contrast, the other approaches perform much worse on pixel observations than the previous low-dim observations.
DDO also makes progress on the task, but requires far more samples, as it again learns skills that only operate for a few timesteps, though they move toward the objects.
All other approaches fail to learn at all, including the variants of VTA and DDO without the min. skill length, which are not plotted.

\section{Conclusion}\label{sec:conclusion}
We started by highlighting the underspecification problem: maximizing likelihood does not necessarily yield skills that are useful for learning new tasks.
To overcome this problem, we drew a connection between skill learning and compression and proposed a new objective for skill learning via compression and a differentiable model for optimizing our objective.
Empirically, we found that the underspecification problem occurs even on simple tasks and learning skills with our objective allows learning new tasks much faster than learning skills by maximizing likelihood.

Still, important future work remains. \textsc{Love}\xspace applies when there are useful and consistent structures that can be extracted from multiple trajectories. This is often present in multi-task demonstrations, which solve related tasks in similar ways. However, an open challenge for adapting to general offline data like D4RL~\citep{fu2020d4rl}, is to ensure that the learned skills do not overfit to potentially noisy or unhelpful behaviors often present in offline data.
In addition, we showed a connection between skill learning and compression by minimizing the description length of a crude two-part code.
However, we only proposed a way to optimize the message length term and not the model length.
Completing this connection by accounting for model length may therefore be an promising direction for future work.

\paragraph{Reproducibility.}
Our code is publicly available at \url{https://github.com/yidingjiang/love}.

\paragraph{Acknowledgements.}
{
We would like to thank Karol Hausman, Abhishek Gupta, Archit Sharma, Sergey Levine, Annie Xie, Zhe Dong, Samuel Sokota for valuable discussions during the course of this work, and Victor Akinwande, Christina Baek, Swaminathan Gurumurthy for comments on the draft.
We would also like to thank the anonymous reviewers for their valuable feedback.
Last, but certainly not least, YJ and EZL thank the beautiful beach of Kona for initiating this project.

YJ is supported by funding
from the Bosch Center for Artificial Intelligence.
EZL is supported by a National Science Foundation Graduate Research Fellowship under Grant No. DGE-1656518.
CF is a Fellow in the CIFAR Learning in Machines and Brains Program.
This work was also supported in part by the ONR grant N00014-21-1-2685, Google, and Intel.
Icons in this work were made by ThoseIcons, FreePik, VectorsMarket, from FlatIcon.

}

\begin{center}
    \textit{\textsc{Love}\xspace is a many-splendored thing. \textsc{Love}\xspace lifts us up where we belong. All you need is \textsc{Love}\xspace.} \\
    --- Moulin Rouge (Elephant Love Song Medley)
\end{center}

\bibliographystyle{plainnat}