Introduction
Offline Meta-Reinforcement Learning (OMRL) aims to enable agents to generalize to new tasks using only static datasets of previous interactions. A critical component of OMRL is the context encoder, which identifies task-specific features (e.g., environmental physics) from short snippets of experience. However, a major bottleneck in current methods is policy-task entanglement.
In many real-world datasets, data is collected by a limited number of behavior policies. Context encoders often learn to recognize the specific "style" or "signature" of these policies rather than the underlying task dynamics. When the agent is deployed and generates its own data—which differs from the training distribution—the encoder fails to identify the task, leading to poor performance. To address this, we present ReDA (Representation learning via adversarial Data Augmentation).
The ReDA Framework
ReDA breaks the spurious correlation between policy style and task identity through a three-stage process that forces the encoder to focus on essential physical characteristics.
1. Dynamics Model Training
The agent first learns a "world model"—an ensemble of dynamics models—from the offline data. This serves as a learned simulator where the agent can safely "imagine" new interactions without further real-world exploration.
2. Adversarial Data Augmentation
This is the core innovation of ReDA. An adversarial policy is trained within the world model to generate trajectories that are as indistinguishable as possible across different tasks. By attempting to "hide" the task identity from the encoder, the adversary creates a challenging training environment. The adversary's objective includes an uncertainty penalty to keep it within reliable regions of the world model and a task completeness reward to ensure it remains goal-oriented.
3. Robust Task Representation
The context encoder is trained using a contrastive loss (InfoNCE) on this adversarial data. Because the adversary actively suppresses easy-to-learn policy signatures, the encoder is forced to identify the subtle, invariant physical properties that define the task. Finally, a meta-policy is trained using standard offline RL techniques, conditioned on these robust representations.
Experimental Results
ReDA was evaluated on MuJoCo locomotion benchmarks (Walker2d, Hopper, Ant, and HalfCheetah) with task variations defined by physical parameters like gravity and joint damping. To simulate realistic data scarcity, training was limited to interactions from only a few policy checkpoints.
Superior Generalization and Robustness
ReDA demonstrated a significant performance leap over state-of-the-art baselines like FOCAL and OM-SAC:
- On-Policy Performance: When identifying tasks based on its own generated data, ReDA achieved an average score of 3072.5, significantly outperforming OM-SAC (2484.2).
- Off-Policy Robustness: When tested with data from totally unseen, random policies, ReDA maintained high performance (2845.3), while baseline performance often plummeted by 50% or more.
- Representation Clarity: Quantitative analysis of "Relative Distance" (a measure of task identification error) shows that ReDA produces far more accurate task representations than competing methods.
Conclusion
ReDA demonstrates that adversarial training, typically used for defense, can be a powerful tool for feature selection in Reinforcement Learning. By using a learned world model to generate confounding data, ReDA successfully disentangles policy style from environment physics, leading to more robust and generalizable offline meta-policies. Future work will explore scaling this approach to tasks defined by complex reward functions and optimizing the computational overhead of the world model ensemble.
Summary updated