Year: 2021

Abstract:
Reinforcement learning (RL) agents are widely used for solving complex sequential decision making tasks, but still exhibit difficulty in generalizing to scenarios not seen during training. While prior online approaches demonstrated that using additional signals beyond the reward function can lead to better generalization capabilities in RL agents, i.e. using self-supervised learning (SSL), they struggle in the offline RL setting, i.e. learning from a static dataset. We show that performance of online algorithms for generalization in RL can be hindered in the offline setting due to poor estimation of similarity between observations. We propose a new theoretically-motivated framework called Generalized Similarity Functions (GSF), which uses contrastive learning to train an offline RL agent to aggregate observations based on the similarity of their expected future behavior, where we quantify this similarity using generalized value functions. We show that GSF is general enough to recover existing SSL objectives while also improving zero-shot generalization performance on a complex offline RL benchmark, offline Procgen.

heading: 1 INTRODUCTION
text: Reinforcement learning (RL) is a powerful framework for solving complex tasks that require a sequence of decisions. The RL paradigm has allowed for major breakthroughs in various fields, e.g. outperforming humans on video games (Mnih et al., 2015; Schwarzer et al., 2020), controlling stratospheric balloons (Bellemare et al., 2020) and learning reward functions from robot manipulation videos (Chen et al., 2021). More recently, RL agents have been tested in a generalization setting, i.e. in which training involves a finite number of related tasks sampled from some distribution, with a potentially distinct sampling distribution during test time (Cobbe et al., 2019; Song et al., 2019). The main issue for designing generalizable agents is the lack of on-policy data from tasks not seen during training: it is impossible to enumerate all variations of a real-world environment during training and hence the agent must extrapolate from a (limited) training task collection onto a broader set of problems. Since the learning agent is given no training data from test-time tasks, this problem is referred to as zero-shot generalization. In our work, we are interested in the problem of zero-shot generalization where the difference between tasks is predominantly due to perceptually distinct observations. An example of this setting is any environment with distractor features (Cobbe et al., 2020; Stone et al., 2021), i.e. features with no dependence on the reward signal nor the agent’s decisions. This generalization setting has recently received much attention (Liu et al., 2020a; Agarwal et al., 2021; Mazoure et al., 2021), due to its particular relevance to real-world scenarios, for example deploying a single autonomous driving agent at day or at night.
Generalization capabilities of an agent can be analyzed through the prism of representation learning, under which the agent’s current belief about a rich and high-dimensional environment are summarized in a low-dimensional entity, called a representation. Recent work in online RL has shown that learning state representations with specific properties such as disentanglement (Higgins et al., 2017) or linear separability (Lin et al., 2020) can improve zero-shot generalization performance. Achieving this with limited data (i.e. offline RL) is challenging, since the representation will have a large estimation error over regions of low data coverage. A common solution to mitigate this task-specific overfitting and extracting the most information out of the data consists in introducing auxiliary learning signals other than instantaneous reward (Raileanu and Fergus, 2021). As we show later in the
paper, many such signals already contained in the dataset can be used to further improve generalization performance. For instance, the generalization performance of PPO on Procgen remains limited even when training on 200M frames, while generalization-oriented agents (Raileanu and Fergus, 2021; Mazoure et al., 2021) can outperform it by leveraging additional auxiliary signals. However, a major issue with the aforementioned methods is their exorbitant reliance on online access to the environment, an impractical restriction for real-world scenarios.
In contrast, in many real-world scenarios access to the environment is restricted to an offline, fixed dataset of experience (Ernst et al., 2005; Lange et al., 2012). A natural limitation for generalization from offline data is that policy improvement is dependent on dataset quality. Specifically, highdimensional problems such as control from pixels require large amounts of training experience: a standard training of PPO (Schulman et al., 2017) for 25 million frames on Procgen (Cobbe et al., 2020) generates more than 300 Gb of data, an impractical amount of data to share for offline RL research. Improving zero-shot generalization performance from an offline dataset of high-dimensional observations is therefore a hard problem due to limitations on dataset size and quality.
In this work, we are interested in improving zero-shot generalization across a family of PartiallyObservable Markov decision processes (MDPs, Puterman, 1990) in an offline RL setting, i.e. by training agents on a fixed dataset. We hypothesize that in order for an RL agent to be able to generalize across perceptually different POMDPs without adaptation, observations with similar future behavior should be assigned to close representations. We use the generalized value function (GVF) framework (Sutton et al., 2011) to capture future behavior with respect to an arbitrary instantaneous signal (called cumulant) for a given state. The choice of cumulant then determines the nature of the behavioral similarity that is encouraged for generalization. For example, using reward as the signal gives rise to of reward-aware behavioral similarity such as bisimulation (Ferns et al., 2004; Li et al., 2006; Castro, 2020; Zhang et al., 2020); using future state-action counts encourages reward-free behavioral similarity (Misra et al., 2020; Liu et al., 2020a; Agarwal et al., 2021; Mazoure et al., 2021).
Our main contributions are as follows:
1. We propose Generalized Similarity Functions (GSF), a novel self-supervised learning algorithm for reinforcement learning, that aggregates latent representations by the future behavior (or generalized value function) under their respective observations.
2. We devise a new benchmark constructed to test zero-shot generalization of offline RL algorithms: offline Procgen. It consists of 5M transitions from 200 related levels of 16 distinct games.
3. We evaluate performance of GSF and other baseline methods on offline Procgen, and show that GSF outperforms both previous state-of-the-art offline RL and representation learning baselines on the entire distribution of levels.
4. We analyze the theoretical properties of GSF and describe the impact of hyperparameters and cumulant functions on empirical behavior.

heading: 2 RELATED WORKS
text: Generalization in reinforcement learning Generalizing a model’s predictions across a variety of unseen, high-dimensional inputs has been extensively studied in the static supervised learning setting (Bartlett, 1998; Triantafillou et al., 2019; Valle-Pérez and Louis, 2020; Liu et al., 2020b). Generalization in RL has received a lot of attention: extrapolation to unseen rewards (Barreto et al., 2016; Misra et al., 2020), observations (Zhang et al., 2020; Raileanu and Fergus, 2021; Liu et al., 2020a; Agarwal et al., 2021; Mazoure et al., 2021) and transition dynamics (Ball et al., 2021). Each generalization scenario is best solved by their respective set of methods: sufficient exploration (Misra et al., 2020; Agarwal et al., 2020), auxiliary learning signals (Srinivas et al., 2020; Mazoure et al., 2020; Stooke et al., 2021) or data augmentation (Ball et al., 2021; Sinha and Garg, 2021). Data augmentation is a promising technique, but typically relies on handcrafted domain information, which might not be available a priori. In fact, we will show in our experiments that generalization in the offline RL setting is poor even when using such handcrafted data augmentations, without additional representation learning mechanisms. In this work, we posit that representation learning should use instantaneous auxiliary signals in order to prevent overfitting onto a unique signal (e.g. reward
across tasks) and improve generalization performance. Theoretical generalization guarantees have only been provided so far for limited scenarios, mostly for bandits (Swaminathan and Joachims, 2015), linear MDPs (Boyan and Moore, 1995; Wang et al., 2021b; Nachum and Yang, 2021) and across reward functions (Castro and Precup, 2010; Barreto et al., 2016; Wang et al., 2021a; Touati and Ollivier, 2021).
Representation learning For simple POMDPs, near-optimal policies can be found by optimizing for the reward alone. However, more complex settings may require additional auxiliary signals in order to find state abstractions better suited for control. The problem of learning meaningful state representations (or abstractions) for planning and control has been extensively studied previously (Jong and Stone, 2005; Li et al., 2006), but saw real breakthroughs only recently, in particular due to advances in self-supervised learning (SSL). Outside of RL, SSL has achieved spectacular results by closing the gap between unsupervised and supervised learning on certain datasets (Hjelm et al., 2018; Oord et al., 2018; Caron et al., 2020; Grill et al., 2020). Representation learning, and specifically self-supervised learning, has also been used to achieve state-of-the-art generalization and sample efficiency results in RL on challenging control problems such as data efficient Atari (Schwarzer et al., 2020; 2021), DeepMind Control (Agarwal et al., 2021) and Procgen (Mazoure et al., 2020; Stooke et al., 2021; Raileanu and Fergus, 2021; Mazoure et al., 2021).Noteworthy instances of theoretically-motivated representation learning methods for RL include heuristic-guided learning (Sun et al., 2018; Cheng et al., 2021), and random Fourier features (Nachum and Yang, 2021).
Offline reinforcement learning When learning from a static dataset, agents should balance interpolation and extrapolation errors, while ensuring proper diversity of actions (i.e. prevent collapse to most frequent action in the data). Popular offline RL algorithms such as BCQ (Fujimoto et al., 2019), MBS (Liu et al., 2020c), and CQL (Kumar et al., 2020) rely on a behavior regularization loss (Wu et al., 2019) as a tool to control the extrapolation error. Some methods, such as F-BRC (Kostrikov et al., 2021) are defined only for continuous action spaces while others, such as MOReL (Kidambi et al., 2020) estimate a pessimistic transition model. The major issue with current offline RL algorithms such as CQL is that they are perhaps overly pessimistic for generalization purposes, i.e. CQL and MBS ensure that the policy improvement is well-supported by the batch of data. As we will show in our empirical comparisons, using overly conservative policy updates can prevent the representation from fully leveraging the information of the training dataset.

heading: 3 PROBLEM SETTING

heading: 3.1 PARTIALLY-OBSERVABLE MARKOV DECISION PROCESSES
text: A (infinite-horizon) partially-observable Markov decision process (POMDP, Murphy, 2000) M is defined by the tuple M = hS, p0,A, pS ,O, pO, r, i, where S is a state space, p0 = P[s0] is the starting state distribution, A is an action space, pS = P[·|st, at] : S ⇥ A ! (S) is a transition function, O is an observation space, pO = P[·|st] : S ! (O)1 is an observation function, r : S ⇥ A ! [rmin, rmax] is a reward function and 2 [0, 1) is a discount factor. The system starts in one of the initial states s0 ⇠ p0 with observation o0 ⇠ pO(·|s0). At every timestep t = 1, 2, 3, .., the agent, parameterized by a policy ⇡ : O ! (A), samples an action at ⇠ ⇡(·|ot). The environment transitions into a next state st+1 ⇠ pS(·|st, at) and emits a reward rt = r(st, at) along with a next observation ot+1 ⇠ pO(·|st+1). The goal of an RL agent is to maximize the cumulative rewards P 1
t=0 trt obtained over the entire
episode. Value-based off-policy RL algorithms achieve this by estimating the state-action value function under a target policy ⇡:
Q⇡(st, at) = EP⇡t [ 1X
k=1
kr(st+k, at+k)|st, at], 8st 2 S, at 2 A (1)
where P⇡t denotes the joint distribution of {st+k, at+k}1k=1 obtained by executing ⇡ in the environment.
1 (X ) denotes the entire set of distributions over the space X .
An important distinction from online RL is that, instead of sampling access to the environment, we assume access to a historical dataset Dµ collected by logging experience of the policy, µ, in the form {oi,t, ai,t, ri,t}i=N,t=Ti=1,t=1 where, for practical purposes, the episode is truncated at T timesteps. Furthermore, we assume that the agent can only be trained on a limited collection of POMDPs Mtrain = {Mi}mi=1, and its performance is evaluated on the set of test POMDPs Mtest. We assume that both Mtrain and Mtest were sampled from a common task distribution and that every POMDP Mi 2 M = Mtrain [Mtest shares the same transition dynamics and reward function with M but has a different observation function pi,O. Importantly, since we perform control from pixels, we are in the POMDP setting (see Yarats et al., 2019) and therefore emphasize the difference between observations ot and corresponding states st throughout the paper.

heading: 3.2 REPRESENTATION LEARNING
text: Previous works in the RL literature have studied the use of auxiliary signals to improve generalization performance. Among others, Liu et al. (2020a); Agarwal et al. (2021) define the similarity of two observations to depend on the distance between action sequences rolled out from that observation under their respective optimal policies. They achieve this by finding a latent space Z ✓ S in which the distance dZ(z, z0) for all z, z0 2 Z is equivalent to distance between true latent states dS(s, s0) for all s, s0 2 S; the aforementionned works learn Z by optimizing action-based similarities between observations.
In practice, latent space z is decoded from observation o using a latent state decoder f : O ! Z from observation ot. Through the paper, we assume that all value functions have a linear form in the latent decoded state, i.e. Q✓(o, a) = ✓>a f (o) = ✓>a z , which agrees with our practical implementation of all algorithms. Within this model family, the ability of an RL agent to correctly decode latent states from unseen observations directly affects its policy, and therefore, its generalization capabilities. In the next section, we discuss why representation learning is important for offline RL, and how existing action-based similarity metrics fail to recover the true latent states for important families of POMDPs.

heading: 4 MOTIVATING EXAMPLE
text: Multiple recently proposed self-supervised objectives (Liu et al., 2020a; Agarwal et al., 2021) conjecture that observations o1 2M1, o2 2M2 that emit similar future action sequences under optimal policies ⇡⇤1 ,⇡⇤2 should be decoded into nearby latent states z1, z2. While this heuristic can correctly group observations with respect to their true latent state in simple action spaces, it fails to identify similar pairs of trajectories in POMDPs with multiple optimal policies. For instance, two trajectories might visit an identical set of latent states, but have drastically different actions.
Fig. 1 shows one such example: two levels of the Climber game have a near-identical true latent state (see Appendix) and value function (average normalized mean-squared error of 0.0398 across episode), while having very different action sequences from a same PPO policy (average total variation distance of 0.4423 across episode). The problem is especially acute in Procgen, since the PPO policy is high-entropy for some environments (see Fig. 4), i.e. various levels can have multiple drastically different near-optimal policies, and hence fail to properly capture observation similarities.
In this scenario, assigning observations to a similar latent state by value function similarity would yield a better state representation than reasoning about action similarities. In a POMDP with a
different structure, grouping representations by action sequences can be optimal. So how do we unify these similarity metrics under a single framework?
In the next section, we use this insight to design a general way of improve representation learning through self-supervised learning of discounted future behavior.

heading: 5 METHOD
text: We propose to measure a generalized notion of future behavior similarity using generalized value functions, as defined by the corresponding cumulant function. The choice of cumulant determines which components of the future trajectory are most relevant for generalization.

heading: 5.1 QUANTIFYING FUTURE BEHAVIOR WITH GVFS
text: An RL agent’s future discounted behavior can be quantified not only by its the value function, but other auxiliary signals, for example, by its observation occupancy measure, known as successor features (Dayan, 1993; Barreto et al., 2016). The choice of the examined signal quantifies the properties the agent will exhibit in the future, such as accumulated returns, or observation visitation density. See Thm. 2 in the Appendix for the connection between successor features and interpolation error in our method.
Following the work of Sutton et al. (2011), we can broaden the class of value functions to any kind of cumulative discounted signal, as defined by a bounded cumulant function c : O ⇥ A ! Rd, s.t. |c(o, a)|  cmax for cmax = supo,a2O⇥A c(o, a). While typically cumulants are scalar-valued functions (e.g. reward), we also make use of the vector-valued case for learning the successor features (Barreto et al., 2016), in which case the norm of c(o, a) is bounded.
Definition 1 (Generalized value function) Let c be any bounded function over Rd, let 2 [0, 1] and µ any policy. The generalized value function is defined as
Gµ(ot) = EPµt [ 1X
k=1
kc(ot+k, at+k)|ot] (2)
for any timestep t 1 and ot 2 O.
Since, in our case, we can learn Gµ for each distinct POMDP Mi for the dataset Dµ, we index the GVF using the POMDP index, i.e. Gµi = LearnGVF(c,D
µ, i) (in practice, the learning is parallelized).
Algorithm 1: LearnGVF(c,Dµ, i, ✓(0), J,↵, ): Offline estimation of GVF Ĝµi Input : Cumulant function c, dataset Dµ, POMDP label i, initial parameters ✓(0), target
parameters ✓̃, latent state decoder f , iterations J , learning rate ↵, discount 1 for j = 1, .., J do 2 o, a, o0 ⇠ D[i]; // Sample transition from POMDP i 3 c c(o, a); 4 o random crop(o); 5 z, z0 f(o), f(o0); 6 ✓(j) ✓(j 1) ↵r✓(j 1)(G✓(j 1)(z) c G✓̃(j 1)(z
0))2 ; 7 Update target parameters ✓̃ with of online parameters ✓;

heading: 5.2 MEASURING DISTANCES BETWEEN GVFS OF DIFFERENT POMDPS
text: Examining the difference between future behaviors of two observations quantifies the exact amount of expected behavior change between these two observations. Using the GVF framework, we could compute the distance between o1 2 M1 and o2 2 M2 by first estimating the latent state with z = f(o) using a (learned) latent state decoder f , and then evaluating the distance
dµ(o1 i, o2 j) = |Gµi (f(o1)) G µ j (f(o2))| i, j = 1, 2, .., (3)
a measure of dissimilarity that can then be used in a contrastive loss.
However, the distance between GVFs from two different POMDPs can have drastically different scales: |Gµ1 (o1) G µ 2 (o2)|  cµ1,max+c µ 2,max
1 , making point-wise comparison meaningless. The issue is less acute for cumulants which induce a unnormalized density estimate (e.g. indicator functions for successor representation), and more problematic when the cumulant incorporates the extrinsic reward function. To avoid this problem, we suggest performing a comparison based on order statistics.
A robust distance estimate between GVF signals across POMDPs can be obtained by looking at the cumulative distribution function of Gi denoted Fi(g) = P[Gi(ot)  g] for all ot 2 O. Gi is a deterministic GVF with the set of discontinuity points of measure 0, and as such Fi can be understood through the induced state distribution Pµt (using continuous mapping theorem from Mann and Wald (1943)). It can be estimated from n independent and identically distributed samples of Dµ as
F̂i(g) = 1
n
nX
i=1
Gi<g, Gi = LearnGVF(c,D µ, i), g 2
ï
ci,max 1 , ci,max 1
ò (4)
and its inverse, the empirical quantile function (van der Vaart, 1998)
F̂ 1i (p) = inf{g 2
ï
cµi,max 1 , cµi,max 1
ò : p  Fi(g)}, p 2 [0, 1] (5)
We use the empirical quantile function to partition the range of all GVFs into K quantile bins, i.e. disjoint sets with identical size where the set corresponding to quantile k is defined as Ii(k) = {o 2 Mi : F 1 i ( k K )  G µ i (o)  F 1 i ( k+1 K )} and it’s aggregated version as I(k) = [ m i=1Ii(k).
Importantly, we augment the dataset Dµ with observation-specific labels, which correspond to the index of the quantile bin into which the GVF G of an observation o 2Mi falls into:
li(o) = max k o2Ii(k) (6)
These self-supervised labels are then used in a multiclass InfoNCE loss (Oord et al., 2018), which is a variation of metric learning with respect to the quantile distance defined above (Khosla et al., 2020; Song and Ermon, 2020).

heading: 5.3 SELF-SUPERVISED LEARNING OF GSFS
text: After augmenting the offline dataset with observation labels, we use a simple self-supervised learning procedure to minimize distance in the latent representation space between observations with identical labels.
First, the observation o is encoded using a non-linear encoder f : O ! Z with parameters into a latent state representation z = f (o)2. The representation z is then passed into two separate trunks: 1) a linear matrix ✓a which recovers the state-action value function Q✓(o, a) = ✓>a z, and 2) a non-linear projection network h✓ : Z ! Z with parameters ✓h to obtain a new embedding, used for contrastive learning.
The projection h(z) is then used used in a multiclass InfoNCE loss (Oord et al., 2018; Song and Ermon, 2020) where a linear classifier W 2 R|Z|⇥K aims to correctly predict the observation labels (i.e. quantile bins k = 1, 2, ..,K) from h(z):
`NCE(✓h, ,W) = Eo⇠Dµ ï KX
k=1
l(o)=kLogSoftmax[W>h(f (o))/⌧ ]k ò , (7)
where ⌧ > 0 is a temperature parameter.
Our empirical findings suggest that this version of the loss is more stable than other multi-class contrastive losses (see Appendix 7.3).
2This encoder is different from the one used to evaluate the GVFs.

heading: 5.4 ALGORITHM
text: Our method relies on the approximation oracle LearnGVF, to produce GVF estimates, later used in the contrastive learning phase.
Since we are concerned with the offline RL setting, we add our auxiliary loss on top of Conservative Q-learning (CQL, Kumar et al., 2020), a strong baseline. CQL is trained using a linear combination of Q-learning (Watkins and Dayan, 1992; Ernst et al., 2005) and behavior-regularization:
`CQL(✓) = Eo,a,r,o0⇠Dµ [(r+ max a02A Q✓̃(o 0, a0) Q✓(o, a)) 2]+ Es⇠Dµ [LSE(Q✓(o, a)) Ea⇠µ[Q✓(o, a)]], (8) for 0, ✓̃ target network parameters3 and LSE being the log-sum-exp operator 4.
Algorithm 2: GSF : Offline RL with future behavior observation matching Input : Dataset D ⇠ µ, initialized Q-function Q✓ with encoder f✓f and action weights ✓a,
per-POMDP set of GVFs G = {Gµi }i2, state projection network h , epoch number J , number of POMDPs m, number of quantiles K, temperature parameter ⌧ , exponential moving average parameter
1 for epoch j = 1, 2, .., J do 2 for minibatch B ⇠ D do
/* Data augmentation on observation */
3 o random crop(o) for all o 2 B; 4 z f (o) for all o 2 B ;
/* Update CQL agent */
5 Update ✓a, using r✓a, `CQL(✓) ; /* Compute G quantiles */ 6 for POMDP Mi = 1, 2, ..,m do 7 Estimate F̂ 1i of G µ i from B ; 8 for observation o 2 B \Mi do 9 l(o) k if F̂ 1i ( k K )  G µ i (o)  F̂ 1 i ( k+1 K ) ;
/* Update encoder and projection network */
10 Update ✓h, ,W using r✓h, ,W`NCE(✓h, ,W) computed with z, l(o) and ⌧ ; 11 Update CQL agent’s target network with of online parameters , ✓;
Alg. 2 summarizes the learning procedure for GSF as implemented on top of a CQL agent for a discrete action space. In our experiments, all baselines use random crops as data augmentation.
3A copy of ✓ updated solely using an exponential moving average (see Appendix). 4 https://en.wikipedia.org/wiki/LogSumExp
Connection to existing methods Our framework is able to recover objectives similar to those of prior works by carefully designing the cumulant function.
• Cross-State Self-Constraint (CSSC, Liu et al., 2020a): In CSSC, observations o1, o2 are considered similar if they have identical future action sequences of length K under some fixed policy; a total of |A|K distinct classes are possible. This approach can be approximated in our framework by picking c(ot, at) = at(a), 8a 2 A. The problem reduces to a |A|T t-way classification problem for observations of timestep t, which GSF approximates using K quantiles.
• Policy similarity embedding (PSE, Agarwal et al., 2021): PSEs balance the distance between local optimal behaviors and long-term dependencies in the transitions, notably using dTV. If we consider the space of Boltzmann policies ⇡Boltzmann with respect to an POMDP-specific value function Q, then choosing c(ot, at) = r(st, at) in GSF will effectively compute the distance between unnormalized policies.

heading: 5.5 CHOICE OF NUMBER OF QUANTILES K
text: How should the number of quantiles K be set, and what is the effect of smaller/ larger values of K on the observation distance? Thm. 1 highlights a trade-off when choosing the number of quantiles bins empirically.
Theorem 1 Let G1, G2 be generalized value functions with cumulants c1, c2 from respective POMDPs M1,M2, K be the number of quantile bins, n1, n2 the number of sample transitions from each POMDP. Suppose that P[supt=1,2,.. |c1(o1,t, µ(o1,t)) c2(o2,t, µ(o2,t))| > (1 )"/ ]  . Then, for any k = 1, 2, ..,K and " > 0 the following holds without loss of generality:
P ï
sup o1,o22I(k) |G1(o1) G2(o2)| > 3"
ò  2e 2n1" 2/4 + p(n1,K, ") + (9)
where p(n,K, ") = P ï sup
k=1,2,..,K
F̂ 11 k+1/K
F̂ 11 k/K
> " ò
(10) . The proof can be found in the Appendix Sec. 7.2. For POMDP M1, the error decreases monotonically with increasing bin number K (second term) but the variance of bin labels depends on the number of sample transitions n1 (first term). The inter-POMDP error (third term) does not affect the bin assignment. Hence, choosing a large K will amount to pairing states by rankings, but results in high variance, as orderings are estimated from data and each bin will have n = 1. Setting K too small will group together unrelated observations, inducing high bias.

heading: 6 EXPERIMENTS
text: Unlike for single task offline RL (Fu et al., 2020), most works on zero-shot generalization from offline data either come up with an ad hoc solution suiting their needs, e.g. (Ball et al., 2021), or assess performance on benchmarks that do not evalute generalization across observation functions (e.g., Yu et al., 2020). To accelerate progress in this field, we devised the offline Procgen benchmark, an offline RL dataset to directly test for generalization of offline RL agents across observation functions5.
Offline Procgen benchmark We evaluate the proposed approach on an offline version of the Procgen benchmark (Cobbe et al., 2020), which is widely used to evaluate zero-shot generalization across complex visual perturbations. Given a random seed, Procgen allows to sample procedurally generated level configurations for 16 games under various complexity modes: “easy”, “hard” and “exploration”. The dataset is obtained as follows: we first pre-train a PPO (Schulman et al., 2017) agent for 25M timesteps on 200 levels of “easy” distribution for each environment6 (“easy” mode is widely used to test generalization capabilities (Cobbe et al., 2020; Raileanu and Fergus, 2021; Mazoure et al., 2021)). All agents use the IMPALA encoder architecture (Espeholt et al., 2018), which has enough parameters to allow better generalization performance, compared to other models (e.g., Mnih et al., 2015).
5The benchmark will be open-sourced. 6We use the TFAgents’ implementation (Guadarrama et al., 2018)
Results We compare the zero-shot performance on the entire distribution of ”easy” POMDPs for GSF against that of strong RL and representation learning baselines: behavioral cloning (BC) - to assess the quality of the PPO policy, CQL (Kumar et al., 2020) - the current state-of-the-art on multiple offline benchmarks which balances RL and BC objectives, CURL (Srinivas et al., 2020), CTRL (Mazoure et al., 2021), DeepMDP (Gelada et al., 2019) - which learns a metric closely related to bisimulation across the MDP, Value Prediction Network (VPN, Oh et al., 2017) - which combines model-free and model-based learning of values, observations, next observations, rewards and discounts, Cross-State Self-Constraint (CSSC, Liu et al., 2020a) - which boosts similarity of observations with identical action sequences, as well as Policy Similarity Embeddings (Agarwal et al., 2020), which groups observation representations based on distance in optimal policy space.
Fig. 3 shows the performance of all methods over 5 random seeds and all 16 games on the offline Procgen benchmark after 1 million training steps. Per-game average scores for all methods can be found in Tab. 2 (Appendix). The scores are standardized per-game using the downstream task’s (offline RL) performance, in this case implemented by CQL. It can be seen that GSF performs better than other offline RL and representation learning baselines.
Using different cumulants functions can lead to different label assignments and hence different similarity groups. Fig. 3 examines the performance of GSF with respect to 3 cumulants: 1) r(st, at), rewards s.t. GSF learns the policy’s Qµ-value, 2) ot(o), the successor representation7 (Dayan, 1993; Barreto et al., 2016) s.t. GSF learns induced distribution over Dµ (Machado et al., 2020) and 3) at(a), action counts, s.t. GSF learns discounted policy. While rewards and successor feature cumulant choices leads to similar performance, using action-based distance leads to larger variance.

heading: 7 DISCUSSION
text: In this work we proposed GSF, a novel algorithm which combines reinforcement learning with representation learning to improve zero-shot generalization performance on challenging, pixel-based control tasks. GSF relies on computing the similarity between observation pairs with respect to any instantaneous accumulated signal, which leads to improved empirical performance on the newly introduced offline Procgen benchmark. Theoretical results suggest that GSF ’s hyperparameter choice depends on a trade-off between finite sample approximation and extrapolation error.
While our work answered some questions regarding zero-shot generalization in offline RL, some questions persist: can GVF-based distances be included in a contrastive objective without the need for quantile discretization (perhaps through re-scaling or order statistics)? Can the cumulant function be chosen a priori for a specific task structure other than Procgen, and shown to lead to optimal representations?
7In the continuous observation space, we learn a d-dimensional successor feature vector z via TD and computing the quantiles over ||z ||1.
REPRODUCIBILITY STATEMENT
To ensure reproducibility of our work, we attach the source code to the submission, provide all proofs of both theorems in the appendix (with assumptions) and will open-source the offline Procgen benchmark.

Review summaries:
The authors build on previous work which regularized states with similar value-function or future action sequences to have similar representations, by instead looking at successor features, i.e. the accumulated value of future cumulants. To deal with continuous value function whose scale can vary accross environments, they apply a quantile-binning technique. They also propose an offline version of Procgen as benchmark.

The paper addresses the problem of generalization and representation learning in reinforcement learning. Concretely, the authors propose an approach of self-supervision for improving offline-RL based on similarity learning over the considered state space. In this context, the concept of generalized value function is introduced. The similarity measure is defined as a classification problem over quantized latent space. The paper is evaluated in an offline setting of Procgen which is a dataset for multi-task reinforcement learning generalization evaluation. More particularly, the proposed approach claims to be particularly efficient in improving zero-shot generalization performance on one offline RL benchmark, offline Procgen. The offline Procgen dataset is a second contribution of the paper.

This paper studied  zero-shot generalization in an offline reinforcement learning setting. The authors proposed to improve the generalization via a better representation learning. Specifically, the authors hypothesized that observation with similar future behaviors should be assigned to similar representations. To this end, the generalized similarity function (GSF) that aggregates latent representations with the future behavior is proposed. The proposed approach is evaluated on an offline version of Procgen. The proposed approach outperforms baselines across different tasks in Procgen.