[Paper Review] Contrastive Behavioral Similarity Embeddings for Generalization in Reinforcement Learning
The paper introduces a policy similarity metric (PSM) and a contrastive learning procedure to create policy similarity embeddings (PSEs) that improve generalization of RL policies across unseen environments.
Reinforcement learning methods trained on few environments rarely learn policies that generalize to unseen environments. To improve generalization, we incorporate the inherent sequential structure in reinforcement learning into the representation learning process. This approach is orthogonal to recent approaches, which rarely exploit this structure explicitly. Specifically, we introduce a theoretically motivated policy similarity metric (PSM) for measuring behavioral similarity between states. PSM assigns high similarity to states for which the optimal policies in those states as well as in future states are similar. We also present a contrastive representation learning procedure to embed any state similarity metric, which we instantiate with PSM to obtain policy similarity embeddings (PSEs). We demonstrate that PSEs improve generalization on diverse benchmarks, including LQR with spurious correlations, a jumping task from pixels, and Distracting DM Control Suite.
Motivation & Objective
- Incorporate the sequential structure of RL into representation learning to improve cross-environment generalization.
- Define a reward-agnostic policy similarity metric (PSM) that captures similarity of long-term optimal behavior across states/environments.
- Learn embeddings (PSEs) that cluster behaviorally similar states using a contrastive objective based on PSM.
- Demonstrate generalization improvements on diverse benchmarks including pixel-based jumping tasks, LQR with spurious correlations, and Distracting DM Control Suite.
Proposed method
- Define a policy similarity metric (PSM) using Dist between optimal policies and a 1-Wasserstein term over next-state distributions, yielding a recursive equation for d*(x,y).
- Use Dist (e.g., TV for discrete actions or L1 on mean actions for continuous) and the Wasserstein term to bound cross-environment policy transfer error (Theorem 1).
- Transform d into a similarity Gamma via a Gaussian kernel and construct a contrastive learning objective (CMEs) to learn embeddings z_theta(t) that respect state similarity across environments.
- Instantiate CMEs with PSM to yield policy similarity embeddings (PSEs) that group states with similar long-term optimal behavior, combining RL imitation/training loss with the CME auxiliary loss.
- Provide an end-to-end architecture where an encoder, projector, and policy head are trained jointly (SimCLR-inspired contrastive loss + RL imitation loss).
- Offer a practical algorithm (Algorithm 1) to compute CMEs from pairs of training MDPs, using nearest-neighbor positives under Gamma and a soft contrastive loss.
Experimental results
Research questions
- RQ1Can a reward-agnostic policy similarity metric (PSM) provide robust cross-environment generalization in RL?
- RQ2Do contrastively learned embeddings (PSEs) that encode PSM-based state similarities improve generalization beyond standard regularization or data augmentation?
- RQ3How do PSEs perform across diverse generalization benchmarks (pixel-based jumping task, LQR with distractors, Distracting DM Control Suite) compared to existing methods?
Key findings
- PSEs improve zero-shot generalization on multiple benchmarks, outperforming regularization and bisimulation-transfer baselines in several settings.
- PSEs substantially enhance generalization when combined with RandConv data augmentation, and can outperform augmentation alone in some configurations.
- Using CMEs with PSM yields ablations that outperform alternatives like l2-embeddings or π*-bisimulation when coupled with PSM, highlighting the importance of the learned invariances.
- PSEs remain robust to moderate policy suboptimality (epsilon-suboptimal policies) and can leverage approximate π* when exact policies are unavailable.
- In color-modified variants of the Jumping Task, PSEs capture task-dependent invariances and maintain superior generalization compared to RandConv alone, where augmentation can otherwise blur task-specific distinctions.
- Across LQR with distractors and Distracting DM Control Suite, PSM-based representations enable strong generalization even without access to true optimal policies.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.