Contrastive Behavioral Similarity Embeddings for Generalization in Reinforcement Learning
Rishabh Agarwal, Marlos C. Machado, Pablo Samuel Castro, Marc G. Bellemare
TL;DR
This work addresses the challenge of generalization in reinforcement learning by exploiting the sequential structure of RL through a policy-centered state similarity metric (PSM) and a contrastive learning framework to produce policy similarity embeddings (PSEs). By combining a theoretically grounded PSM with CMEs, the approach explicitly encodes invariances in optimal behavior across related environments, providing a bound on transfer suboptimality and improving zero-shot generalization across diverse benchmarks. Empirically, PSEs outperform standard regularization and bisimulation-based baselines on a pixel-based Jumping Task, LQR with distractors, and the Distracting DM Control Suite, and are robust to suboptimal policies and task variations. The results suggest that aligning representations with behavioral similarity is a powerful, orthogonal contribution to existing data augmentation and domain-generalization techniques in RL, with practical benefits for generalization in complex, high-dimensional tasks.
Abstract
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.
