Zero Shot Generalization of Vision-Based RL Without Data Augmentation

## Abstract

Abstract Generalizing vision-based reinforcement learning (RL) agents to novel environments remains a difficult and open challenge. Current trends are to collect large-scale datasets or use data augmentation techniques to prevent overfitting and improve downstream generalization. However, the computational and data collection costs increase exponentially with the number of task variations and can destabilize the already difficult task of training RL agents. In this work, we take inspiration from recent advances in computational neuroscience and propose a model, Associative Latent DisentAnglement (ALDA), that builds on standard off-policy RL towards zero-shot generalization. Specifically, we revisit the role of latent disentanglement in RL and show how combining it with a model of associative memory achieves zero-shot generalization on difficult task variations without relying on data augmentation. Finally, we formally show that data augmentation techniques are a form of weak disentanglement and discuss the implications of this insight.

## 1 Introduction

Training generalist agents that can adapt to novel environments and unseen task variations is a longstanding goal for vision-based RL.
RL generalization benchmarks have focused on data augmentation to increase the amount of training data available to the agent while preventing model overfitting and increasing robustness to environment perturbations (Yarats et al., ; Almuzairee et al., ; Hansen et al., ).
This follows the current trend in the broader robot learning community of training large models at scale on massive datasets (Kim et al., ; Hansen et al., ; Team et al., ) with the hope that the model will generalize.
However, a significant drawback of these approaches is, intuitively, that they require larger models, more training data, longer training times, and have greater training instability that must be dealt with care when training RL agents.

Yet when we examine biological agents, we find that humans and, indeed, many other primates are able to quickly adapt to task variations and environment perturbations DiCarlo et al. (); Friston ().
While all aspects of biological intelligence that contribute to generalization have yet to be understood, there is some understanding in the recent neuroscience literature of aspects related to representation learning that we look to for inspiration.
Many parts of the brain in human and non-human primates contain neurons that represent single factors of variation within the environment, such as grid cells (Hafting et al., ), object-vector cells (Høydal et al., ), and border cells (Solstad et al., ) that represent euclidean spaces, distance to objects, and distance to borders, respectively.
Such disentangled representations have been theorized to facilitate compositional generalization (Higgins et al., ) and have been studied with curated datasets where the factors of variation are known (Higgins et al., ; Whittington et al., ), and even within the context of RL (Higgins et al., ).
It is then to our surprise, with limited exceptions (Dunion et al., ; Sax et al., ), that disentangled representation learning has not garnered much attention within robot learning or RL more generally.
One potential reason for this is that learning disentangled representations while simultaneously learning an RL policy is extremely difficult.
Indeed, Higgins et al. () required a two-stage approach where the disentangled representation was learned first, followed by policy learning.
In addition, Yarats et al. () found that using a $\beta$-VAE directly led to training instability and worse performance, instead opting to use a deterministic autoencoder with softer constraints.
Finally, there is counter-evidence by Schott et al. () to suggest that, while disentangling representations may facilitate generalization, it alone cannot achieve out-of-distribution (OOD) generalization.

Figure: Figure 1: Disentanglement + association. A disentangled representation is learned using the original training data (top). When encountering an OOD sample (bottom), individual latents can be compared and mapped back to known values (colored green). Latent dimensions that are more OOD (colored red) can be mapped back without affecting other latent dimensions.
Refer to caption: x1.png

We hypothesize that one of the potential key missing ingredients to OOD generalization is associative memory mechanisms that use prior experiences to help inform decision-making in light of new data in a disentangled latent space.
Intuitively, if the representation of a stored memory and new observation are disentangled, then the projection of the new observation onto the stored memories becomes a factorized projection in which individual factors can be compared independently of other factors (Figure 1).
Indeed, many of the aforementioned single-factor neurons exist in the entorhinal cortex in the hippocampus (Hafting et al., ), responsible for, amongst other things, memory recollection and association.
Recent literature suggests that the hippocampus learns flexible representations of memories by decomposing sensory information into reusable components and has been implicated in other cognitive tasks such as planning, decision-making, and imagining novel scenarios (Behrens et al., ; Rubin et al., ).
It would then seem that the disentanglement of high-dimensional data into a modular, reusable representation is simply the first step in a multi-step process that enables generalization in biological agents.
Inspired by these two ingredients found in nature, we propose a new method, ALDA (Associative Latent DisentAnglement), that 1. learns a disentangled representation from the training data and 2. uses an associative memory model to recover data points in the original training distribution zero-shot given OOD data.
We demonstrate how this approach enables zero-shot generalization on a common generalization benchmark for vision-based RL without using data augmentation techniques or techniques that remove distractor variables from the latent space.
Finally, we provide a formal proof showing that data augmentation methods for vision-based RL create what we refer to as "weak" disentanglement, where the latent space is perhaps partitioned into two or more categories but not perfectly factorized into individual subcomponents.
We conclude by discussing the implications of this insight and future directions of this line of research.

## 2 Background

### 2.1 Reinforcement Learning

We wish to learn a policy $\pi$ that maps states to optimal actions that maximize cumulative reward.
The agent-environment interaction loop is typically formulated as a Markov Decision Process (MDP) $(\mathcal{S},\mathcal{A},\mathcal{R},\mathcal{P},\gamma)$, where $\mathcal{S}$ and $\mathcal{A}$ are the state and action spaces, $\mathcal{R}(s,a)$ is the reward function, $\mathcal{P}(s^{\prime}|s,a)$ is the probabilistic transition function, and $\gamma$ is the discount factor.
The policy $\pi$ learns a mapping of state to action with the objective of maximizing cumulative discounted return $G_{t}=\mathbb{E}\left[\sum_{t=0}^{T}\gamma^{t}R(s_{t},a_{t})\right]$.
In vision-based RL, we do not assume access to the low dimensional state $s_{t}\in\mathcal{S}$.
Instead, we must infer $s_{t}$ given high-dimensional image observations $o_{t}\in\mathcal{O}$, making the problem a partially observable MDP, or POMDP $(\mathcal{S},\mathcal{A},\mathcal{R},\mathcal{P},\mathcal{O},\gamma)$, where $\mathcal{O}$ is the space of high-dimensional observations.

Soft Actor-Critic (Haarnoja et al., ) is an off-policy actor-critic algorithm that jointly trains a policy $\pi$ and state-action value function $Q$ using the maximum entropy framework.
The policy optimizes the maximum entropy objective $\text{argmax}_{\pi}\sum_{t=1}^{T}\mathbb{E}_{(s_{t},a_{t})\sim\rho_{pi}}[r_{t}
+\alpha\mathcal{H}(\pi(\cdot|s_{t}))]$.
The optimal $Q$ function $Q^{*}(s,a)$ is estimated using temporal difference learning (Sutton, ) by minimizing the soft Bellman residual:

$$ $J(Q)=\mathbb{E}_{(s_{t},a_{t},s_{t+1}\sim\mathcal{D}}\left[(Q(s_{t},a_{t})-r_{ t}-\gamma y)^{2}\right].$ $$

Here, $y$ is the soft $Q$-target, which is computed as $y=r(s_{t},a_{t})+\gamma(\text{min}_{\theta_{1,2}}Q_{\theta_{i}^{{}^{\prime}}}(
s_{t+1},a_{t+1})-\alpha\text{log}\pi(\cdot|s_{t+1}))$. We can then describe the policy’s objective as:

$$ $J(\pi)=\mathbb{E}_{s_{t}\sim\mathcal{D}}\left[\text{min}_{i=1,2}Q_{\theta_{i}} (s_{t},a_{t})-\alpha\text{log}\pi(a_{t}|s_{t})\right].$ $$

A replay buffer $\mathcal{D}$ is maintained that contains transition tuples $(s_{t},a_{t},s_{t+1}$) collected from prior interactions of a potentially different behavior policy.
Since the off-policy RL formulation does not require transitions to be from the current behavior policy, we can reuse prior experience to update the policy and the $Q$-function.
We use SAC as a foundation for our method, and while we propose some architectural changes to improve the synergy between SAC and our method, the changes are generally applicable to most off-policy RL algorithms.

### 2.2 Disentangled Representation Learning.

Nonlinear ICA: The disentanglement problem is sometimes formulated in the literature (Hsu et al., ) through nonlinear independent component analysis (ICA) due to their conceptual similarity. We follow suit since the notation will be useful in later sections. Suppose there are $n_{s}$ nonlinear independent variables $s_{1},...,s_{n_{s}}$ that are the sources of variation of the images in the data distribution. A data-generating model maps sources to images:

$$ $p(\textbf{s})=\prod_{i=1}^{n_{s}}p(s_{i}),\textbf{o}=g(\textbf{s})$ (1) $$

where $g:\mathcal{S}\rightarrow\mathcal{O}$ is the non-linear data generating function.
The nonlinear ICA problem is to recover the underlying sources given samples from this model. Similarly, the goal of latent disentanglement is to learn a latent representation z such that every variable $z_{1},...,z_{n_{s}}\in\textbf{z}$ corresponds to a distinct source $s_{1},...,s_{n_{s}}$.
Unfortunately, nonlinear ICA is nonidentifiable – that is, there are many decompositions of the data into sets of independent latents that fit the dataset, and so recovering the true sources reliably is impossible.
Thus, the field of disentangled representation learning has focused more on empirical results and evaluation metrics on toy datasets where the true sources of variation are known.
Given a dataset of paired source-data samples ${(\textbf{s},\textbf{o}=g(\textbf{s}))}$, the goal is to learn an encoder $f:\mathcal{O}\rightarrow\mathcal{Z}$ and a decoder $\hat{g}:\mathcal{Z}\rightarrow\mathcal{O}$ such that the disentanglement evaluation metrics are high while also maintaining acceptable reconstructions of the data.
Disentanglement models are typically constructed as (variational) autoencoders (Whittington et al., ; Hsu et al., ; Higgins et al., ) and are rarely applied outside of toy datasets.

### 2.3 Generalization in Vision-Based RL

Image augmentation methods have shown success and have become the go-to method for generalizing vision-based RL algorithms such as Soft Actor-Critic (SAC) (Haarnoja et al., ) and TD3 (Fujimoto et al., ), generally using augmentations such as random crops, random distortions, and random image overlays to simulate distracting backgrounds.
Methods such as DrQ (Yarats et al., ), SADA (Almuzairee et al., ), and SVEA (Hansen et al., ) regularize the $Q$ function by providing the original and augmented images as inputs into the critic.
In many cases, however, the image augmentations can put the training data within the support of the distributions of the evaluation environments.
For example, the "random convolution" image augmentation changes the color of the agent and/or background, and the policy is evaluated on an environment where the color of the agent is randomized.
This brings into question whether these methods are truly capable of zero-shot extrapolative generalization when the training data is made to be sufficiently similar to the test data.

Beyond image augmentation techniques are methods that perform self-supervision using auxiliary objectives.
Note that image augmentations for RL are also sometimes referred to as self-supervised objectives, however we wish to make the distinction between methods that leverage data augmentation and those that don’t.
DARLA Higgins et al. (), to the best of our knowledge, is the only prior method that learns a disentangled representation of the image inputs using a highly regularized $\beta$-VAE (Higgins et al., ) for zero-shot generalization in RL.
DARLA’s approach is two-stage, where an initial dataset is collected by sampling random actions to first learn a disentangled latent representation, and then a policy is trained on this representation to maximize future return.
However, a significant shortcoming is that random actions may not cover the full state distribution of the agent for more complicated tasks, whereas our method jointly learns the disentangled representation and the policy.
SAC+AE (Yarats et al., ) trains a decoder to reconstruct the images, resulting in a rich latent space that improves performance and sample efficiency on many vision-based tasks.
Interestingly, SAC+AE mentions $\beta$-VAE’s used by DARLA and proposes using a deterministic variant with similar constraints that shows some zero-shot generalization capability, but the authors make no mention of disentanglement and instead conclude that the key ingredient was adding a reconstruction loss as an auxiliary objective.

Another promising approach to generalization is learning a task-centric or object-centric representation using auxiliary objectives. Yamada et al. () learn a task-centric representation by using expected discounted returns as labels, with the auxiliary task being to minimize the error between the predicted and true return values using the learned representation.
Ferraro et al. (); Pore et al. () use segmentation masks to learn object-centric representations that are robust to background distractors.
One drawback of these approaches is that the latent representation overfits to the task by excluding all other information not relevant to the immediate task, usually citing that irrelevant information in the latent space hinders generalization performance.
However, adapting to a new task that involves information that was previously considered irrelevant becomes a challenge for these methods.
We hypothesize that the issue is not having "irrelevant" information in the latent space but rather that the latent variables are entangled without strong priors for disentanglement.
A disentangled representation then paves the way for association, whereby individual dimensions of latent vectors from OOD images can be independently zero-shot mapped back to known values of those latent variables learned from the training data.

### 2.4 Associative Memory

An associative memory (AM) network stores a set of patterns with the intent to retrieve the most similar stored pattern given an input.
The best-known form is a Hopfield network, originally proposed in Hopfield (), which was inspired by how the brain is capable of recalling entire memories given partial or corrupted input (e.g., recalling a food item given a particular smell).
Classical Hopfield networks could only store and recall binarized memories, whereas modern (dense) Hopfield networks (Krotov & Hopfield, ) can work with continuous representations and are trainable as differentiable layers within existing Deep Learning frameworks (Ramsauer et al., ).
The memory retrieval dynamics are typically formulated as a function of energy minimization.
Let $\xi\in\mathbb{R}^{d}$ be the input query pattern, and $\textbf{X}:=[x_{1},...x_{M}]\in\mathbb{R}^{d\times M}$ be memory patterns.
In AM models, memories are stored on the local minima of the energy landscape, where the goal is to retrieve the closest stored pattern to $\xi$ by minimizing energy.
Modern Hopfield networks assume the following general form for the energy function:

$$ $E=-\sum_{i=1}^{M}F(x_{i}^{T}\xi).$ $$

In particular, by setting $F=-lse(\beta,\textbf{X}^{T}\xi)+\frac{1}{2}\xi^{T}\xi$ (lse = log-sum-exponent), the retrieval dynamics becomes $\xi^{new}=\textbf{X}\text{softmax}(\beta\textbf{X}^{T}\xi)$, which is the attention mechanism (Vaswani, ) and the backbone of modern Hopfield networks.
Follow-up works such as Bietti et al. () show a tight connection between the learning dynamics of Transformers and models of associative memory.

## 3 On the Relationship Between Disentanglement and Data Augmentation

We begin by motivating the case for learning a disentangled representation for RL agents by showing a connection between data augmentation and disentangled representation learning.
Specifically, we formally prove that data augmentation is a weak disentanglement of the latent space.
We define weak disentanglement as a partial factorization of some but perhaps not all latent dimensions of the latent space.
Strong disentanglement, on the other hand, is a complete factorization where each latent dimension $z_{k}\in\textbf{z}$ encodes for a unique source $s_{i}\in\textbf{s}$ and is thus linearly independent of other latent dimensions, which is the goal of disentangled representation learning.
The full proof is provided in A.1.

Theorem 1: Suppose we are given a $\textbf{z}=f_{\theta}(g(\textbf{s}))$, where some latent dimension $z_{k}\in\textbf{z}$ approximates one or more sources. We will denote the approximations as $\hat{s_{i}}$.
We can categorize the sources s into two categories, $D$ and $E$, which correspond to task-relevant and task-irrelevant sources, respectively.
For any such $z_{k}$, if $Q^{*}(\textbf{z},a)$ is an optimality invariant optimal Q-function immune to distractor variables, then the following must be true of z:

$$ $cov(\hat{s_{i}},\hat{s_{j}}|z_{k})=0\text{ }\forall s_{i}\in D,s_{j}\in E,z_{k }\in\textbf{z}.$ (2) $$

Intuitively, if data augmentation enables learning a latent representation such that the $Q(\textbf{z},a)$, a function of z, is immune to distractor variables, then any dimension of the latent space that encodes for task-relevant variables cannot also encode for task-irrelevant variables.
Otherwise, distribution shifts involving the task-irrelevant variables would affect the $Q$ function and, thus, the performance of the agent.
One of two conditions must be true: either z is partitioned, where some variables approximate only sources from $D$, and others only sources from $E$, or z contains no information about sources in $E$ altogether, both of which are a form of weak disentanglement.

We take a probabilistic perspective to see why this relationship is important.
Suppose $s_{1...,k}\in D$ and $s_{1+k,...,n_{s}}\in E$.
In order to learn a latent representation that contains no information about task-irrelevant sources $s_{1+k,...,n_{s}}$, data augmentation methods essentially estimate the marginal distribution over task-relevant sources:

$$ $p(s_{1},...,s_{k})=\sum_{s_{k+1}}\times\sum_{s_{k+2}}\times...\times\sum_{s_{n _{s}}}p(s_{1},...,s_{k},s_{k+1},...s_{n_{s}}).$ (3) $$

The implication of 3 is that we must collect data for every possible variation of the task-irrelevant sources, which may be prohibitively expensive for real-world applications.
Instead, a model with strong priors that leads to disentanglement without data augmentation essentially achieves the same result without the additional costs.
Although the latent representation of such a model may still contain task-irrelevant features, the policy can learn to simply ignore them or associate them with known values in the presence of OOD data, as is the case with ALDA.
In addition, these task-irrelevant features may become relevant if the task changes (e.g., if the current task is for a manipulator to stack a blue cube, and the next task is to stack a red cube), and so it may, in fact, be important to keep them.

Figure: Figure 2: Diagram of our method SAC+ALDA. Trainable components are colored yellow. A strongly regularized autoencoder and the quantized latent space enable latent disentanglement. The latent model is also responsible for association when encountering OOD inputs.
Refer to caption: x2.png

## 4 Method

Experimental Setup.
We first describe the generalization benchmark and our evaluation criteria to provide additional context.
We train on four challenging tasks from the DeepMind Control Suite (Tassa et al., ).
To evaluate zero-shot generalization capability, we periodically evaluate model performance under challenging distribution shifts from the DMControl Generalization Benchmark (Hansen & Wang, ) and the Distracting Control Suite (Stone et al., ) throughout training.
Specifically, we have two evaluation environments: color hard, which randomizes the color of the agent and background to extreme RGB values, and distracting cs, which applies camera shaking and plays a random video in the background from the DAVIS 2017 dataset (Pont-Tuset et al., ).

### 4.1 Disentanglement

We now describe our framework for jointly learning a disentangled representation and performing association.
For latent disentanglement, we choose to use QLAE Hsu et al. (), the current SOTA disentanglement method, which trains an encoder $f_{\theta}$ that maps to a continuous disentangled latent space, a discrete, parameterized latent model $l_{\psi}$, and a decoder $g_{\phi}$ that reconstructs the observation.
Similar to VQ-VAE (van den Oord et al., ), QLAE uses a discrete codebook for the latent space, except that each dimension uses its own separate scalar codebook.
Concretely, $Z$ is the set of latent codes defined by the Cartesian product of $n_{z}$ scalar codebooks $Z=V_{1}\times...\times V_{n_{z}}$ i.e., there are $n_{z}$ latent variables and $|V_{j}|$ discrete categories per variable.
The continuous outputs of the encoder are the latent variables, each of which is quantized to the nearest scalar value in their respective codebooks.

$$ $z_{d_{j}}=\text{argmin}_{v_{jk}\in\textbf{v}_{j}}|f_{\theta}(x)_{j}-v_{jk}|,j= 1,...,n_{z}.$ (4) $$

Since we cannot differentiate through $argmin$, as with VQ-VAE, the authors of QLAE use quantization and commitment losses and a straight-through gradient estimator (Bengio et al., ):

$$ $\mathcal{L}_{\text{quantize}}=||\text{StopGradient}f_{\theta}(x))-z_{d}||_{2}^ {2},\text{ }\mathcal{L}_{\text{commit}}=||f_{\theta}(x)-\text{StopGradient}(z_ {d})||_{2}^{2}.$ (5) $$

The authors claim that while this is a failure mode for vector quantization, $Z$ is low-dimensional enough that, in practice, it does not meaningfully impact performance.
While this may be true for standalone disentanglement benchmarks, we find that it causes training instability and performance degradation when jointly learning a policy for high-dimensional continuous control problems
We propose a solution in section 4.2 from the viewpoint of associative memory.

It is common practice in many vision-based RL algorithms to utilize framestacking to incorporate temporal information into the latent space.
This means that the encoder accepts as input, and the decoder produces a stack of RGB images in $\mathbb{R}^{B\times Ck\times H\times W}$, where $k$ is the number of frames.
However, latent disentanglement models have only been shown to work on datasets of singular images and struggle to disentangle sources of individual images when given stacks of images as inputs.
Evidence of this is presented in the appendix, Section A.5.
To resolve this issue, we fold $k$ into the batch dimension and encode/decode batches of single images in $\mathbb{R}^{Bk\times C\times H\times W}$, resulting in a batch size $Bk$ of disentangled latent vectors $z_{d}\in\mathbb{R}^{Bk\times n_{s_{i}}}$.
To incorporate temporal information, we reshape the batch of latent vectors into $\mathbb{R}^{B\times kn_{s_{i}}}$ and feed it into a 1D convolutional neural network (CNN), producing our final latent vector $z\in\mathbb{R}^{B\times e}$.
$z$ is used as the state representation for the actor and critic networks, while the decoder network for the disentanglement model only ever receives the disentangled representation $z_{d}$ as input.

### 4.2 Association

The naive approach to performing association would be to feed the quantized latent representation through a Hopfield network.
However, upon closer inspection of QLAE’s latent dynamics, we find that most of the components of a generic associative memory model are already present, i.e., QLAE is implicitly also a Hopfield network.

Figure: Figure 3: Ablation comparing SAC+QLAE to SAC+BioAE on the two distribution shift evaluation environments for the walker walk task.
Refer to caption: x3.png

Figure 3 shows a comparison of using SAC with QLAE vs with BioAE Whittington et al. (), another disentanglement method that uses biologically inspired constraints and achieves comparable results on disentanglement benchmarks (Hsu et al., ).
BioAE achieves strong initial performance on the two evaluation environments, but slowly degrades over the course of training.
We suspect both models overfit to the training environment, but QLAE is capable of zero-shot mapping OOD latent variables to in-distribution values. To see the similarity, we first present the general framework described in Millidge et al. () of a universal Hopfield network that all feedforward associative memory networks in the literature can be factorized as:

$$ $z=P\cdot\text{sep}(\text{sim}(X,\xi)).$ (6) $$

$P$ is a projection, sep is a separation function, and sim is a similarity function between the stored memories $X$ and query $\xi$.
While $P$ is originally described as a projection matrix, we extend the definition of $P$ to be any function that projects $X$ and $\xi$ into a shared embedding space.
In this case, equation 4 can be interpreted as follows: $f_{\theta}$ is the projection function that projects high-dimensional images o into an embedding space shared by the scalar codebooks $Z$, which can be interpreted as predetermined memories.
The closest memory is recovered by computing the $L_{1}$ distance, which serves as the similarity function, and $sep$ is the argmin function.
Through this view, we can rewrite the latent dynamics of QLAE in many ways, perhaps exchanging the similarity function for $L_{2}$ distance or dot product, changing the separation function, etc., as long as it follows the framework of 6.
Since $Z$ is a product of scalar codebooks, $L_{1}$ distance remains an appropriate choice for the similarity function.
Instead, we augment the latent dynamics with a Softmax separation function as follows:

$$ $z_{d_{j}}=\text{Softmax}(-\beta L_{1}(f_{\theta}(\textbf{o})_{j},\textbf{v}_{j }))\odot\textbf{v}_{j}$ (7) $$

where $\beta$ is a scalar temperature parameter.
Equation 7 can be interpreted in two ways.
From an associative memory perspective, attention-based Hopfield models apply Softmax to separate the local minima (stored memories) on the energy landscape, where $\beta$ controls the degree of separation, and so we’ve recovered the modern Hopfield memory retrieval dynamics.
From a purely mathematical perspective, we have what resembles the Gumbel-Softmax categorical reparameterization Jang et al. (), although we do not perform any sampling in our method.
This lends a novel view on attention-based Hopfield networks – models with a high-temperature parameter can be interpreted as classifiers over $|\textbf{X}|$ classes, where $|\textbf{X}|$ is the number of stored memories whose local minima are well separated on the energy landscape.

In the limit, as $\beta$ goes to infinity, we achieve maximum separation between memories and recover equation 4.
In practice, we choose a large value for $\beta$ such that we retrieve one scalar from each codebook, as originally intended, although our method works well with smaller values of $\beta$ (see appendix Section A.4 for additional results).
Since large $\beta$ values can cause downstream gradients to vanish, we find that keeping the commitment loss from equation 5 helps keep the outputs of the encoder close to the values of the latent model.
However, we do not optimize the codebook towards the encoder outputs i.e., we omit $\mathcal{L}_{\text{quantize}}$.
This can be interpreted as having a set of task-optimized memories that the encoder must learn to map to under the Hopfield interpretation.
Our final objective for ALDA is as follows:

$$ $\displaystyle J(ALDA)$ $\displaystyle=\mathcal{L}_{\text{commit}}+\mathcal{L}_{\text{reconstruct}}$ (8) $\displaystyle=\mathbb{E}_{\textbf{o}_{t}\sim\mathcal{D}}\Big{[}\Big{.}||\text{ StopGradient}(f_{\theta}(\textbf{o}))-\left[\text{Softmax}(-\beta L_{1}(f_{ \theta}(o),V))\odot V\right]||_{2}^{2}$ $\displaystyle+\log g_{\phi}(\textbf{o}_{t}|\textbf{z}_{d}^{t})+\lambda_{\theta }||\theta||^{2}+\lambda_{\phi}||\phi||^{2}\Big{]}\Big{.}$ $$

where the last two terms are weight-decay on the encoder and decoder parameters controlled by $\lambda_{\theta}\text{ and }\lambda_{\phi}$, respectively. Observations collected by the policy are stored in a replay buffer $\mathcal{D}$, from which batches are randomly sampled to train ALDA.
We observe that this formulation considerably improves training and evaluation performance on the "color hard" environment and to a degree, on the DistractingCS environment, as shown in Figure 4.

The obvious question is, how do we set the dimensionality of $z_{d}$, which should 1:1 correspond to the number of sources $n_{s}$ if the number of sources is unknown? While there is no rigorous method to derive $|z_{d}|$ at this time, we empirically found that setting $|z_{d}|$ to within the ballpark of the size of the observation spaces for the proprioceptive, state-based versions of the tasks seemed to work well. $|z_{d}|$ is set to 12 for all reported tasks.

Figure: Figure 4: Ablation comparing ALDA and QLAE. Average of 5 seeds, shaded region represents a 95% confidence interval.
Refer to caption: x4.png

## 5 Experiments

We compare against several baselines that together represent the full range of different learning paradigms in the literature that attempt to elicit zero-shot generalization.
DARLA (Higgins et al., ) is, to the best of our knowledge, the only other algorithm that attempts to learn a disentangled representation of the image distribution towards zero-shot generalization of vision-based RL.
SAC+AE (Yarats et al., ) uses a deterministic autoencoder with an auxiliary reconstruction objective and strong regularization that demonstrates decent zero-shot generalization capability.
RePo (Zhu et al., ) is a model-based RL algorithm that learns a task-centric latent representation immune to background distractors.
Finally, SVEA (Hansen et al., ) is an off-policy RL algorithm that improves training stability and performance of off-policy RL under data augmentation.
As in their paper, we use the random overlay augmentation for SVEA, where images sampled from the Places (Zhou et al., ) dataset of 10 million images are overlayed during training.
The training curves and evaluation on "color hard" and DistractingCS are presented in Figure 5.

Excluding SVEA, ALDA outperforms all baselines on both distribution shift environments.
ALDA also maintains stability and high performance on the training environment, despite the disentanglement auxiliary objective and extremely strong weight decay ($\lambda_{\theta},\lambda_{\phi}=0.1$) on the encoder and decoder.
We do not expect to outperform SVEA since it uses additional data sampled from a dataset of 1.8 million diverse real-world scenes, likely putting the training data within the support of the data distributions of the evaluation environments.
Nevertheless, ALDA performs comparably and, in some cases, is equal to SVEA despite only seeing images from the original task.
Performance degrades severely for all algorithms on the DistractingCS environment.
We suspect that, in addition to the already difficult task of ignoring the background video, camera shaking affects the implicitly learned dynamics, and thus, additional finetuning may be unavoidable for this task.
Still, ALDA performs better than all baselines excluding SVEA on Distracting CS as well, even matching the performance of SVEA on cartpole balance and finger spin.

Figure: Figure 5: Top row: performance on the training environment. Middle and bottom rows are evaluation results on the "color hard" and DistractingCS evaluation environments, respectively. Average of 5 seeds, shaded region represents a 95% confidence interval.
Refer to caption: x5.png

Figure: Figure 6: Visualization of different latent perturbations. Top: Traversal of select latents for the standard training environment. Bottom: Traversal of select latents when training directly on the color hard environment. Latents that encode for distractor variables (e.g., color) seemingly do not simultaneously encode for task-relevant variables (e.g., agent dynamics). Visualizations of all latent traversals can be found in Appendix section A.3.
Refer to caption: x6.png

The disentangled representation learning field primarily uses toy datasets where the ground truth sources of the data distribution are known.
Therefore, all disentanglement metrics we are aware of require knowing the sources, making it difficult to quantitatively evaluate disentanglement performance on DMControl.
In the absence of any quantitative disentanglement metrics, we opt to show empirical evidence of disentanglement in our model, presented in Figure 6.
In this experiment, we encode an observation o into the disentangled latent representation $z_{d}=l_{\psi}(f_{\theta}(\textbf{o}))$.
We pick a latent variable $z_{d_{i}}$, traverse it while holding all other latent variables fixed, and decode the resulting latent vectors into reconstructed observations $\textbf{o}^{\prime}=g_{\phi}(z_{d}^{\prime})$.
We find that each latent tends to learn information about a single aspect of the robot, for example, the orientation of the torso or the rotation of the left/right leg.
We also find empirical evidence that ALDA does not discard task-irrelevant information, but rather encodes it separately from task-relevant latent variables when training ALDA directly on the color hard environment.

## 6 Discussion

As stated previously, the disentanglement problem by extension of nonlinear ICA is underdetermined, so there are many ways the latent space may factorize, perhaps by representing the sky and background with one latent or by separating them into two latents, etc. Given that both the task and reconstruction gradients of the critic/decoder affect the latent model/encoder, an interesting scientific and philosophical implication is that the model is potentially biased towards a disentangled representation that is useful, although there is no way to quantitatively or qualitatively show such a result at this time. Nevertheless, it remains an interesting line of further investigation from a scientific standpoint, and perhaps, philosophically, says something about whether the question "What is the ground truth factorized representation that best explains the data?" is even the right question to ask.

RL agents deployed in the real world must constantly adapt to changing environmental conditions.
Much of the variance can be captured with a sufficiently large dataset.
However, there remains a portion of the distribution containing every possible edge case and unaccounted-for variation, commonly referred to as "the long tail," that remains elusive because it is prohibitively expensive to account for every possible variation.
Unfortunately, these uncaptured variations are frequent enough due to the ever-changing dynamical nature and complexity of the real world that deploying agents in the real world remains challenging.
Therefore, it seems the case that data augmentation techniques, collecting massive datasets, and the like are not sufficient to develop generalist agents capable of adaptation the way humans and other animals are.
That’s not to say that data isn’t important or a fundamental ingredient to training machine learning models.
In fact, the method proposed in this paper can also utilize data augmentation techniques presented in prior work, as it should.
Instead, our proposition is that if a data-driven model can generalize better with less data, then it will scale better with more data.

In Section 3, we showed how data augmentation and disentangled representation learning aim to achieve the same result – a factorization of the latent space into separate components in order to improve downstream generalization performance.
Given the additional computational and data collection costs and potential training instabilities that data augmentation methods may incur, it seems more fruitful to investigate models with inductive biases that elicit modular and generalizable representations without relying on data scaling laws.
While presenting the model with sufficiently large and diverse datasets remains unquestionably important, we cannot rely solely upon the data in hopes that the model learns a good representation.
As with any other inductive biases, such as using CNNs for vision tasks or transformers for NLP tasks, inductive biases that elicit modular representations while leveraging data are worth studying if we are to develop agents that can perform and adapt well in the real world.

We hope that the work presented here inspires future research into novel models and architectures to learn representations that enable the adaptability we see in our biological counterparts.
We discuss some limitations of our method and promising directions for future research.
One notable limitation is that our disentangled latent representation $z_{d}$ does not explicitly account for temporal information since it primarily estimates the sources that produce the image distribution.
Instead, we must capture temporal information in the downstream 1D-CNN layer as shown in Figure 2.
How to learn a disentangled representation that contains sources of both the image data and temporal information for decision-making tasks remains an open question.
Another limitation is that, while we introduce a simple Hopfield model as a modification to QLAE, we do not take advantage of the more recent literature involving learnable attention-based or energy-based Hopfield networks (Ramsauer et al., ; Hoover et al., ).
Stronger Hopfield models that synergize well with disentangled
representations is another potentially fruitful research direction.

Given that we use a very compact disentangled latent space with strong empirical evidence that individual latents capture information about specific aspects of the agent, an interesting research direction is to investigate whether all or parts of the proprioceptive state representation can be recovered from image observations.
We provide some preliminary evidence of this in the appendix (A.2).
Beyond interpretability, such a model may yield better performance since state-based RL agents tend to perform better than vision-based agents.
Finally, while our work was inspired by the role of the hippocampus in biological intelligence, the exact mechanisms of the machinery and how they interact with decision-making, planning, and imagination components of biological brains are by no means precisely modeled in this paper, nor are all of the computations the hippocampus may be performing fully understood.
Future collaborative research between the machine learning and neuroscience fields into data-driven computational models of these mechanisms may yield even better-performing, adaptable agents.

## 7 Acknowledgements

We would like to thank Tommaso Salvatori for advice and insightful discussion on modern Hopfield networks.
We also thank David Millard, Shashank Hegde, and Yutai Zhou for providing feedback on the proof.

## Appendix A Appendix

### A.1 Proof

Preliminaries. We reintroduce the nonlinear ICA problem formulation here for the reader’s reference.
There are $n_{s}$ nonlinear independent variables $\textbf{s}=s_{1},...,s_{n_{s}}$ that are considered the "ground truth" sources of variation of the data distribution.
We assume there exists a data-generating model that maps sources to images:

$$ $p(\textbf{s})=\prod_{i=1}^{n_{s}}p(s_{i}),\textbf{o}=g(\textbf{s})$ $$

where $g:\mathcal{S}\rightarrow\mathcal{O}$ is the non-linear data generating function.
For the purpose of this proof, we restrict $\mathcal{S}$ and $\mathcal{O}$ to be the space of sources and images within our dataset.
The goal of nonlinear ICA, and by extension, disentangled representation learning, is to recover the underlying sources given samples from this model.
We claim that most, if not all, data augmentation techniques in $Q$-learning are a form of weak disentanglement, where either the method factorizes the latent space into task-relevant / task-irrelevant variables or removes task-irrelevant variables from the latent space entirely.

For a given task, we can split the sources into two categories: sources $s_{1...k},k<n_{s}$ that are task-relevant, which we will call $D$, and sources $s_{k+1,...,n_{s}}$ that are not, whose category we will refer to as $E$.
The encoder maps observations to a latent space $f:\mathcal{O}\rightarrow\mathcal{Z}$, and so z is a function of the sources $\textbf{z}=f_{\theta}(g(s))$.
We refer to $\hat{s_{i}}$ as an approximation to the true variable $s_{i}$ that exists in one or more dimensions of z.
We make no assumptions on whether the sources are entangled or disentangled in z.

Optimality Invariant Image Transformations
Described in Yarats et al. (), data augmentation applied to $Q$-learning can be formulated using the following general framework. An optimality-invariant state transformation $h:\mathcal{O}\times\mathcal{T}\rightarrow\mathcal{O}$ is a mapping that preserves $Q$ values.

$$ $Q(f_{\theta}(\textbf{o}),a)=Q(f_{\theta}(h(\textbf{o},v)),a)\forall\textbf{o} \in\mathcal{O},a\in\mathcal{A},v\in\mathcal{T}.$ (9) $$

$v$ are the parameters of $h(\cdot,\cdot)$ drawn from the set of all possible parameters $\mathcal{T}$.
In other words, $\mathcal{T}$ defines the space of all possible data augmentations that should not affect the output of the $Q$-function.

Proposition 1: Let $\phi:S\rightarrow S$ be a function that perturbs sources $s_{j}\in E$. Then

$$ $h(\textbf{o},v)=g(\phi(\textbf{s})).$ (10) $$

This follows from the definition of $E$ in that any optimality-invariant transformation to the observation must have implicitly resulted from a perturbation of some task-irrelevant source $s_{j}\in E$.

Proposition 2: For any given $\textbf{z}=f_{\theta}(g(\textbf{s}))$ and any perturbation to a true source $s_{j}\in E,j\in[k+1,n_{s}]$ resulting in a new latent $\textbf{z}^{\prime}=f_{\theta}(g(\textbf{s}^{\prime}))$, the following must be true for an optimality invariant optimal $Q$-function:

$$ $Q^{*}(\textbf{z},a)=Q^{*}(\textbf{z}^{\prime},a).$ (11) $$

We can rewrite $\textbf{z}^{\prime}$ as $\textbf{z}^{\prime}=f_{\theta}(g(\phi(\textbf{s})))\text{ i.e. }\textbf{o}=g(
\phi(\textbf{s}))$, and by Proposition 1, $g(\phi(\textbf{s}))=h(\textbf{o},v)$.
Essentially, an optimality invariant $Q$-function is immune to variations of task-irrelevant sources from the set $E$, since they correspond to optimality-invariant state transformations.

Theorem 1: For any $\textbf{z}=f_{\theta}(g(\textbf{s}))$, and for any dimension $z_{k}$ of z, the following must be true for an optimality invariant $Q$-function:

$$ $cov(\hat{s_{i}},\hat{s_{j}}|z_{k})=0\text{ }\forall s_{i}\in D,s_{j}\in E,i\in [1,k],j\in[k+1,n_{s}].$ (12) $$

To see why this must be the case, suppose that the covariance is nonzero and suppose that we perturb $s_{j}\in E$ to $s_{j}^{\prime}$, giving us a new observation $\textbf{o}^{\prime}=g(\textbf{s}^{\prime})$.
Since $s_{j}$ is task-irrelevant, $\textbf{z}^{\prime}=f_{\theta}(\textbf{o}^{\prime})=f_{\theta}(h(\textbf{o},v))$ for some $v\in\mathcal{T}$.
If $\textbf{z}^{\prime}$ is a function of $h$, then by equations 9 and 11, $Q^{*}(\textbf{z}^{\prime},a)=Q^{*}(\textbf{z},a)$.
However, if $cov(\hat{s_{i}},\hat{s_{j}}|z_{k})\neq 0$ for some $z_{k}\in\textbf{z}$, then $\hat{s_{i}}^{\prime}\in\textbf{z}^{\prime}\neq\hat{s_{i}}\in\textbf{z}$.
Since $\hat{s_{i}}\in D$, $Q^{*}(\textbf{z}^{\prime},a)\neq Q^{*}(\textbf{z},a)$, which is a contradiction.
Therefore, the conditional covariance between any $\hat{s_{i}}\in D$ and any $\hat{s_{j}}\in E$ for any given $z_{k}$ must be zero, which implies that the approximations of task-relevant and task-irrelevant sources in z are disentangled.

### A.2 Latent Trajectory Visualizations

Figure: Figure 7: Visualizations of a few latent/state trajectories through time for the Walker agent. Top: Trajectories of several latent variables from the disentangled latent space. Bottom: Trajectories of several rigid body orientations.
Refer to caption: x7.png

Given the low dimensionality of the disentangled latent representations and the fact that they are disentangled, we hypothesize that their trajectories through time may correspond to trajectories of proprioceptive state variables such as rigid-body positions and orientations.
We visualize the trajectories of individual latents through time for a single episode alongside the trajectories of several proprioceptive state variables in Figure 7.
Unfortunately, the mappings of sources to the disentangled latent space likely do not correspond 1:1 with the proprioceptive state, given that the learned mappings are arbitrary and not unique.
However, upon visual inspection, we find that latent trajectories through time exhibit oscillatory behavior patterns similar to that of rigid body orientations from the state representation.
Recovering all or parts of the proprioceptive state representation via unsupervised learning from high-dimensional data is an interesting future research direction.

### A.3 Additional Latent Traversal Plots

Latent traversals for the other reported DMControl tasks are presented here.
We also visualize the latent traversals of ALDA trained directly on the color hard environment.
We find that the latent traversals for cartpole balance are more discontinuous than on other tasks.
One reason for this might be the lack of balanced data and data diversity of the cartpole replay buffer.
The (near) optimal policy is achieved quite early on, after which most images collected are of the cartpole upright and roughly in the same $x$-position.
The lack of data diversity likely makes it difficult to learn a representation in which the latent traversals are more continuous / physically plausible.
Interestingly, this phenomenon does not seem to affect performance on the "color hard" evaluation environment, although we suspect there are performance gains to be had on DistractingCS if the latent interpolations were smoother.
We leave an investigation into the effects of data balancing and data diversity on downstream generalization performance as future work.

Figure: Figure 8: Latent traversals of the disentangled latent vector when training ALDA directly on the "color hard" environment.
Refer to caption: x8.png

Figure: Figure 9: Latent traversals for cartpole balance. Each row corresponds to a latent dimension that is traversed via linear interpolation while all other dimensions are held fixed.
Refer to caption: x9.png

Figure: Figure 10: Latent traversals for the finger spin task. Each row corresponds to a latent dimension that is traversed via linear interpolation while all other dimensions are held fixed.
Refer to caption: x10.png

Figure: Figure 11: Latent traversals for the ball in cup catch task. Each row corresponds to a latent dimension that is traversed via linear interpolation while all other dimensions are held fixed.
Refer to caption: x11.png

### A.4 Beta Study

We perform an analysis of the effects of different $\beta$ values on ALDA’s performance.
The memory retrieval dynamics are reintroduced here for the reader’s reference:

$$ $z_{d_{j}}=\text{Softmax}(-\beta L_{1}(f_{\theta}(\textbf{o})_{j},\textbf{v}_{j }))\odot\textbf{v}_{j}.$ $$

Small values of $\beta$ result in a more even distribution of the probability mass between latent values per codebook, which implies that the output will be a weighted sum of different latent values (or memories under the Hopfield interpretation).
We choose three different values, $\beta=$ (1, 10, 50), and compare with the main result ($\beta=100$) presented in the paper on the Walker domain, shown in 12.
To our surprise, lower $\beta$ values have little to no effect on generalization performance and, in fact, increase training performance.
This perhaps challenges the assumptions made in Hsu et al. () about the requirements of disentanglement via latent quantization, but admittedly requires further analysis, which we leave to future work.

Figure: Figure 12: ALDA is trained on the Walker domain with different values of $\beta$, with evaluations periodically performed on the "color hard" and DistractingCS environments. Average of 4 seeds, shaded region represents a 95% bootstrapped confidence interval.
Refer to caption: x12.png

### A.5 Framestack Ablation

We provide an ablation comparing against a version of ALDA where the encoder receives as input, and the decoder predicts a stack $k=3$ of frames, i.e., the observation size is $(9\times 64\times 64)$.
Since the downstream 1D-CNN layer is no longer necessary, we remove this layer from the variant.
We refer to this variant as "ALDA (framestack)" and present results on the Walker domain in Figure 13.
We also provide latent traversal visualizations of ALDA (framestack), shown in Figure 14.

Figure: Figure 13: Ablation comparing ALDA to ALDA (framestack) on the Walker domain. Average of 4 seeds, shaded region represents a 95% confidence interval.
Refer to caption: x13.png

Figure: Figure 14: Latent traversal visualizations for ALDA (framestack).
Refer to caption: x14.png

From the plots, we can see that while the generalization performance of ALDA (framestack) does not degrade entirely, it does suffer when compared to ALDA.
The latent traversal visualizations show that ALDA (framestack) does not disentangle the dynamics of individual bodies of the agent the way ALDA does.
Many latent dimensions, for example, latent dim 8 (5th row from the bottom), affect two or more aspects of the agent when interpolating the latent values.
One possible explanation is that ALDA (framestack) does better at capturing and disentangling temporal information, given that it sees a stack of consecutive frames, but struggles to disentangle sources of singular images corresponding to non-temporal information, whereas ALDA excels at the latter.

### A.6 Hyperparameters and Model Architectures

Our SAC implementation is based on Yarats & Kostrikov ().

#### A.6.1 Actor and Critic Networks

Following Yarats & Kostrikov (), we use double $Q$-networks, each of which is a 3-layer multi-layer perceptron (MLP) with 1024 hidden units per hidden layer and GeLU activations after all except the final layer.
The actor network is similarly a 3 layer MLP with 1024 hidden units per layer and GeLU activations on all but the final layer.

#### A.6.2 Encoder, Decoder, and Latent Model

We use the same encoder/decoder architectures as Hsu et al. (), with the exception that we replace all leaky ReLU activations with GeLU.
We instantiate the codebooks for the latent model with values evenly spaced between [-1, 1].

#### A.6.3 Hyperparemeters

We list a set of common hyperparameters that are used in all domains.

**Table 1: Common hyperparameters for SAC and ALDA.**
| Parameter | Value |
| --- | --- |
| Replay buffer capacity | 1e6 |
| Batch size | 128 |
| Latent model temperature $\beta$ | 100 |
| Number of latents $|z_{d}|$ | 12 |
| Number of values per latent $V_{j}$ | 12 |
| Encoder weight decay $\lambda_{\theta}$ | 0.1 |
| Decoder weight decay $\lambda_{\phi}$ | 0.1 |
| Frame stack | 3 |
| Action repeat | 2 for finger spin otherwise 4 |
| Episode length | 100 |
| Observation space | (9 x 64 x 64) |
| Optimizer | Adam |
| Actor/Critic learning rate | 1e-3 |
| Encoder/Decoder learning rate | 1e-3 |
| Latent model learning rate | 1e-3 |
| Temperature learning rate | 1e-4 |
| Actor update frequency | 2 |
| Critic update frequency | 2 |
| Discount $\gamma$ | 0.99 |

## Peer Reviews

confidence: 4
contribution: 2
initial_rating: 5
presentation: 3
questions: 1. Please address the aforementioned weaknesses.

2. Is it possible to utilize an RNN unit instead of frame stacking to incorporate temporal information into the latent code?

3. Section A.2 and Figure 7 are not clear to me. Would you please explain the experimental setting there and the results? 

4. How was the hyperparameter search done for all the baselines?
soundness: 3
strengths: * The paper tackles the important challenge of generalization in vision-based RL.

* The paper is well-written and easy to follow.

* The background section clearly explains the different methods for disentanglement representation and associative memory. Also, it provides motivation for using these methods for zero-shot generalization.

* There is a good discussion about the relevant work of zero-shot generalization in vision-based RL.

* The paper visually demonstrates (Figure 6) that the resulting disentanglement representation successfully encodes different data attributes.
summary: The paper proposes an algorithm based on SAC, that performs latent disentanglement representation and combines it with an associative memory model to achieve zero-shot generalization in vision-based RL. The paper shows that the proposed approach improves upon several baselines when tested in two evaluation environments (color hard and distracting cs). In addition, the authors theoretically prove that data augmentation methods for vision-based RL implicitly perform "weak" disentanglement, and therefore lead to a noticeable zero-shot generalization.
weaknesses: * The method was tested in a narrow set of test environments (color hard and distracting cs). The paper could be improved if the authors would show the benefit of the proposed approach on standard (and more challenging) procedurally generated vision-based datasets for zero-shot generalization in RL, such as Procgen [1] or Crafter [2].

* In lines 180-184, the authors mention that one drawback of previous approaches is that the latent representation excludes all information not relevant to the training tasks, which can hinder adaptation to new tasks that involve information that was previously considered irrelevant. The paper would benefit from a concrete experiment that showcases this failure and demonstrates how the proposed approach handles it. 

* Some baselines are missing from the experiment section. For example, a comparison to methods that use the information bottleneck to exclude irrelevant information from the state representation in vision-based RL, such as [3]. 

* An ablation study of |zd| (the dimension of the latent space) is missing. 
 
[1] Cobbe K, Hesse C, Hilton J, Schulman J. Leveraging procedural generation to benchmark reinforcement learning. In International conference on machine learning 2020 Nov 21 (pp. 2048-2056). PMLR.

[2] Hafner D. Benchmarking the spectrum of agent capabilities. arXiv preprint arXiv:2109.06780. 2021 Sep 14.

[3]  Maximilian Igl, Kamil Ciosek, Yingzhen Li, Sebastian Tschiatschek, Cheng Zhang, Sam Devlin, and 492 Katja Hofmann. Generalization in reinforcement learning with selective noise injection and information 493 bottleneck. In Advances in Neural Information Processing Systems 32, pages 13956–13968, 2019.

---

confidence: 4
contribution: 3
initial_rating: 6
presentation: 3
questions: 1. In order to show that ALDA is generalizable to a wider variety of OOD contexts, could you test it on other benchmarks, such as Procgen?

2. Could you elaborate on the associative memory dynamics in ALDA, perhaps using a pseudocode or flow diagram, to show how it specifically supports zero-shot generalization?

3. Is the method applicable to an offline reinforcement learning setting, given that online reinforcement learning can be costly and risky in real-world environments? It would be beneficial to address the adjustments necessary for adapting ALDA for offline reinforcement learning, along with the potential obstacles the authors expect in this adaptation.
soundness: 3
strengths: 1. The paper takes ideas from neuroscience and combines latent disentanglement with associative memory to present a new, augmentation-free method for zero-shot generalization in RL.

2. The methodology is sound, with experiments across challenging tasks that effectively support the primary claims of the paper.

3. The paper is generally clear and well organized, though some technical sections could be further clarified for readability.

4. This work has potential impact by presenting an efficient alternative to data augmentation, likely inspiring further research on generalization in RL without large datasets.
summary: This work introduces Associative Latent Disentanglement (ALDA), a zero-shot generalization strategy for vision-based RL free of data augmentation. Inspiring by neurobiology, ALDA enables agents to generalize to out-of-distribution (OOD) activities by combining associative memory with disentangled latent representations. The results of the experiments show that ALDA is just as good at generalization as or better than current augmentation-based methods, especially in difficult OOD settings.
weaknesses: 1. More proof of ALDA's generalization ability would be obtained by extending the studies to more varied settings, such as Procgen.
Procgen's randomly produced levels and diverse game environments present distinct challenges, unlike those found in the DMControl suite. These settings may demonstrate the efficacy of ALDA's generalization across diverse activities, offering a comprehensive assessment of its adaptation to novel and intricate situations.

2. More illustrations or pseudocode could help to clarify the function of associative memory in processing OOD samples. Particularly, pseudocode illustrating ALDA's processing of an OOD sample—from initial encoding to final output—would effectively elucidate the function of associative memory in the generalization process.

3. An assessment of ALDA's effectiveness in real-world settings would demonstrate its applicability and scalability. For example, testing on a robotic manipulation job requiring the robot to generalize to objects of diverse forms, sizes, or textures not seen during training, could effectively showcase its generalization capabilities in practical applications.

---

confidence: 3
contribution: 3
initial_rating: 5
presentation: 2
questions: - In Figure 2, the encoder is only updated by the ALDA loss, as indicated by the green arrow and the latent model is updated by both the ALDA loss and the critic loss, as indicated by the red arrow.
Is there a reason for this? Any ablation study for this design choice?
- On line 345, according to "the scalar codebooks Z, which can be interpreted as predetermined memories", are the codebooks trained or pre-defined?
If trainable, are they trianed with equation 8 such that $V$ are actually trained parameters?
If pre-defined, how the values are chosen?
- Is there an intuitive connection between equation 7 and Figure 1?
soundness: 4
strengths: - Improving generalization by learning better representations is not a new concept.
For instance, Zhang et al. [2021] aim to encode only task-relevant information from input images.
However, the idea of training disentangled representations specifically for generalization, particularly without data augmentation, is a novel approach.
Recently, numerous studies have explored the effects of scaling laws on enhancing generalization, yet methods for achieving generalization without exposure to out-of-distribution data remain relatively under-explored.

- The idea of considering memory for generalization is intuitive and the author build an interesting connection between the disentangled representation learning framework and associative memory network.

A. Zhang, R. McAllister, R. Calandra, Y. Gal, and S. Levine. Learning invariant representations for reinforcement learning without reconstruction. ICLR 2021
summary: A common way to improve the generalization ability of an agent in reinforcement learning is through data augmentation. However, collecting data can be costly with increasingly varied tasks.
This paper achieves zero-shot generalization by learning disentangled representations, where each latent feature dimension corresponds to an unique source of variation in the input image.
Inspired by neuroscience, the authors incorporate associative memory into the original representation learning loss in QLAE, and build a novel framework called Associative Latent DisentAnglement (ALDA) for RL.
ALDA is evaluated on various control tasks with two types of variations (color-hard and distracting backgrounds), and compared to state-of-the-art methods.
While its performance lags behind data-augmentation-based methods for generalization, it outperforms previous approaches of learning disentangled representations.
weaknesses: - According to the paper, the strong disentanglement requires that each dimension in the latent representation corresponds to a unique source of the variation in the image.
As for the weak disentanglement, a more clear and precise definition (line 216 to line 219) might be helpful for the reader to understand. 
For example, one natural question to ask is if several dimensions in the latent representation $\textbf{z}$ correspond to one unique source, is this a weak disentanglement?
I would appreciate it if you could provide concrete examples for these two types of disentanglement.
This would help readers better understand the key concepts and their implications for the method.
- And the relationship between disentanglement and generalization ability is not so clear to me.
According to the line 233 to line 235, if I understand correctly, weak disentanglement can also lead to generalization.
Is strong disentanglement a necessary condition for generalization or is weak disentanglement sufficient?
If not, please explain more about the benefits and drawbacks of using strong disentanglement vs. weak disentanglement? 
- In the section of experimental results, an explanation is provided for the performance gap between ALDA and SVEA.
However, as mentioned in the paper, the proposed method can definitely be combined with data augmentation.
So, it will strength the paper if the results of combining ALDA and data augmentation are presented.
- minor: missing punctuation on line 305.
In figure 2, $n_s$ is not defined in the paper. 
I guess it is $n_z$ on line 290.

---

confidence: 4
contribution: 3
initial_rating: 6
presentation: 3
questions: 1. In figure 6, top half, the robot starts from different pose when traversing the latent code. what if it starts from the same as in the bottom half

2. What if we compare the proposed method to data augmentation method that uses simpler augmentation, such as color jitter or random crop? For example 

Kostrikov, Ilya, Denis Yarats, and Rob Fergus. "Image augmentation is all you need: Regularizing deep reinforcement learning from pixels." arXiv preprint arXiv:2004.13649 (2020).

Hansen, Nicklas, and Xiaolong Wang. “Generalization in Reinforcement Learning by Soft Data Augmentation.” 2021 IEEE International Conference on Robotics and Automation (ICRA), IEEE, 2021. Crossref, https://doi.org/10.1109/icra48506.2021.9561103.

You can also test of SVEA only using simpler augmentation.

I understand that the main contribution of this paper is generalization without augmentation, it is okay that it is not performing as good.

3. Can you combine the proposed approach with data augmentation? How would you do that?

4. Can you combine disentanglement / association with dynamics? How would do you that?
soundness: 3
strengths: Originality:
The idea of using disentanglement and associative memory for RL to achieve zero-shot generalization is relatively less explored. It is nice formulation to combine both for RL. Unlike existing methods that rely heavily on data augmentation, ALDA achieves generalization without it.

Quality:
The paper is well-researched. It shows data augmentation is one form of disentanglement. It proposed new methods to combine disentanglement and association. The experimentation is carried with ablation studies on different component of the method.

Clarity:
The paper is generally clear, with a well-structured narrative that explains the problem, the motivation, and the solution. It draws inspiration from biological system which is well articulated

Significance:
Its significance lies in that it presents a method for generalization without augmentation. It would be very useful under the case that we cannot anticipate what shift will happen.
summary: The paper proposes Associative Latent DisentAnglement (ALDA), a novel method for zero-shot generalization in vision-based reinforcement learning (RL) without data augmentation. ALDA combines disentangled latent space representations with an associative memory mechanism inspired by biological systems like the hippocampus. This enables RL agents to generalize to out-of-distribution (OOD) environments by recalling previously seen factors of variation, without need of augmentation in training. ALDA outperforms several state-of-the-art methods in tasks involving distribution shifts, demonstrating zero-shot generalization without using data augmentation.
weaknesses: The papers lacks a more thorough discussion of its failure cases.

Suggestion: 
1. What if you vary distracting intensity, how would that change the relative results, especially compared to SVEA. 
2. I also notice it perform worse than SVEA in the training environment, can you add interpretations on that?

Meta-review: This paper proposes Associative Latent DisentAnglement (ALDA), a method for zero-shot generalization in vision-based reinforcement learning (RL) without relying on data augmentation. ALDA combines disentangled latent representations with an associative memory mechanism, drawing inspiration from neuroscience to enable agents to generalize to out-of-distribution environments.

The strengths of this paper include addressing the important challenge of zero-shot generalization in vision-based RL and proposing a novel combination of disentangled representations and associative memory. The main weaknesses of this paper include limited evaluation, demonstrations, and analysis.

This paper received mixed scores. During the post-rebuttal AC-reviewer discussion, Reviewer sfzs suggested that additional validations of generalization, including even simple real-world demonstrations, are essential. Other reviewers did not express disagreement, and nobody explicitly championed the paper. Therefore, the decision is to reject this submission.

Decision: Reject