Skip to main content
QUICK REVIEW

[Paper Review] Robust Task Representations for Offline Meta-Reinforcement Learning via Contrastive Learning

Haoqi Yuan, Zongqing Lu|arXiv (Cornell University)|Jun 21, 2022
Reinforcement Learning in RoboticsComputer Science11 citations
TL;DR

This paper proposes CORRO, a contrastive learning framework for robust task representation learning in offline meta-reinforcement learning that disentangles task identity from behavior policy characteristics. By encoding individual transition tuples through a bi-level network and optimizing an InfoNCE-based contrastive objective with policy-robust negative sampling, CORRO achieves superior generalization to out-of-distribution behavior policies, outperforming prior methods by up to 115% in return on OOD benchmarks.

ABSTRACT

We study offline meta-reinforcement learning, a practical reinforcement learning paradigm that learns from offline data to adapt to new tasks. The distribution of offline data is determined jointly by the behavior policy and the task. Existing offline meta-reinforcement learning algorithms cannot distinguish these factors, making task representations unstable to the change of behavior policies. To address this problem, we propose a contrastive learning framework for task representations that are robust to the distribution mismatch of behavior policies in training and test. We design a bi-level encoder structure, use mutual information maximization to formalize task representation learning, derive a contrastive learning objective, and introduce several approaches to approximate the true distribution of negative pairs. Experiments on a variety of offline meta-reinforcement learning benchmarks demonstrate the advantages of our method over prior methods, especially on the generalization to out-of-distribution behavior policies. The code is available at https://github.com/PKU-AI-Edge/CORRO.

Motivation & Objective

  • To address the instability of task representations in offline meta-RL when behavior policies in test differ from those in training.
  • To disentangle task identity from behavior policy characteristics in offline datasets, where both jointly shape the data distribution.
  • To improve generalization to out-of-distribution (OOD) behavior policies, a key challenge in practical offline meta-RL.
  • To develop a contrastive learning framework that learns task representations invariant to behavior policy shifts.
  • To design effective negative pair generation strategies that approximate the true distribution of negative transitions.

Proposed method

  • Proposes a bi-level encoder structure: the first level encodes individual transition tuples (s, a, r, s'), and the second level aggregates representations across tuples into a task embedding.
  • Formalizes task representation learning as mutual information maximization between the representation and the true task, minimizing influence from behavior policy.
  • Derives a contrastive learning objective based on the InfoNCE lower bound to maximize similarity between positive pairs (same task) and minimize similarity for negative pairs (different tasks).
  • Introduces two negative pair generation methods: generative modeling (using CVAE to sample transitions) and reward randomization (perturbing rewards to create diverse negatives).
  • Uses relabeling and a baseline 'None' method for comparison, where negative pairs are formed from transitions of different tasks with potentially different (s, a).
  • Employs a contrastive loss based on InfoNCE to optimize the representation network, ensuring robustness to distributional shifts in behavior policies.

Experimental results

Research questions

  • RQ1Can contrastive learning on transition tuples improve task representation robustness to behavior policy distribution shifts in offline meta-RL?
  • RQ2How do different negative pair generation strategies affect OOD generalization in offline meta-RL?
  • RQ3Does learning from individual transitions rather than full trajectories reduce memorization of behavior policy features?
  • RQ4Can the proposed method generalize better than supervised baselines that use ground-truth task descriptions?
  • RQ5How does the choice of negative sampling strategy impact performance under out-of-distribution behavior policies?

Key findings

  • CORRO achieves the highest average return on the Point-Robot benchmark under OOD behavior policies, with a return of -5.59 ± 0.57, outperforming FOCAL (-8.64 ± 0.26) and PEARL (-7.06 ± 0.99).
  • In the Half-Cheetah-Vel environment, CORRO achieves -42.9 ± 0.7 in OOD testing, significantly outperforming FOCAL (-208.2) and PEARL (-35.4 ± 1.8).
  • The reward randomization method outperforms generative modeling in Point-Robot, where behavior policies are highly directional and non-overlapping, indicating method-specific effectiveness.
  • The 'None' negative sampling method, which uses random transitions from different tasks, achieves -97.6 in OOD Half-Cheetah-Vel, outperforming FOCAL (-204.1), suggesting that transition-level learning improves OOD generalization.
  • Re-implementing FOCAL with CORRO's InfoNCE loss yields -208.2 in OOD Half-Cheetah-Vel, close to original FOCAL, indicating that the contrastive loss alone is insufficient—transition-level encoding is key.
  • In environments with random exploration for context collection, CORRO achieves the best adaptation performance, demonstrating robustness even when context data is collected via non-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 Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.