The Challenge of Offline Meta-RL
In Offline Meta-Reinforcement Learning (OMRL), an agent learns from a fixed dataset of various tasks to quickly adapt to a new, unseen task. A common approach is to use a "context encoder" that looks at a few sample transitions (the context) to infer the current task.
However, there is a hidden trap: the distribution of data in the offline dataset depends on both the task (e.g., "run forward") and the behavior policy (e.g., "a clumsy robot walking"). Standard encoders often accidentally learn the features of the policy rather than the task. When the robot is tested with a different exploration style—an Out-of-Distribution (OOD) policy—the encoder gets confused, leading to biased task inference and total performance collapse.
To solve this, researchers introduce CORRO (COntrastive Robust task Representation learning), a new framework that prevents agents from "cheating" by memorizing behavior policies.
How CORRO Works
CORRO focuses on making task representations invariant to behavior policies through three key innovations:
- Bi-Level Task Encoder: Instead of processing entire trajectories—which heavily leak a specific policy's "style" through temporal structure—CORRO uses a transition-level encoder to extract features from individual $(s, a, r, s')$ tuples. These are then combined by an attention-based aggregator to form the final task representation.
- Mutual Information Maximization: The authors formalize task learning as maximizing the mutual information between the representation and the task identity. They derive a contrastive learning objective (based on InfoNCE) that forces the encoder to distinguish between the same task and different tasks.
- Negative Pair Generation: To truly isolate task features, the encoder needs to see how different tasks respond to the same state-action pairs. Since offline data is sparse, the authors "hallucinate" these negative pairs using a Conditional Variational Autoencoder (CVAE) to predict next states and rewards, or by simply randomizing rewards for tasks that only differ in their reward functions.
By generating negative pairs that share the same state and action but have different outcomes, the model is forced to ignore the "how" (the action/policy) and focus on the "what" (the environment's response).
Key Results
The researchers evaluated CORRO on several standard reinforcement learning benchmarks adapted for the offline meta-RL setting, including Point-Robot navigation and MuJoCo tasks (Ant-Dir, Half-Cheetah-Vel, Walker-Param, and Hopper-Param).
- Superior OOD Generalization: CORRO maintains robust performance even when tested with OOD exploration policies. For example, in the Half-Cheetah-Vel environment, prior methods like FOCAL and Offline PEARL saw their returns drop significantly (to roughly -200) under OOD conditions, while CORRO maintained a much higher return of -89.7.
- Outperforming Supervised Learning: Surprisingly, in some environments like Ant-Dir, CORRO actually outperformed a "Supervised" baseline that had access to ground-truth task labels. This suggests that the contrastive objective learns more useful, nuanced features for RL than simple classification.
- Latent Space Clarity: Visualizations of the learned representations showed that CORRO organizes tasks into clear, continuous manifolds, whereas other methods produced scattered or overlapping clusters.
Limitations and Future Work
While highly effective, CORRO assumes a context is provided and does not address how to learn an optimal exploration policy to collect the most informative context. Additionally, the generative modeling approach (CVAE) adds computational overhead and might struggle with extremely high-dimensional state spaces. Future work could involve learning active exploration policies that work in tandem with these robust representations to further advance offline meta-RL.
Summary updated