Introduction
Reinforcement Learning (RL) has demonstrated remarkable success in training agents for complex tasks, yet it often requires prohibitive amounts of data. Meta-reinforcement learning (Meta-RL) addresses this by training agents across a distribution of tasks, enabling them to "learn how to learn" and adapt to new tasks with minimal samples. However, a significant challenge remains: robustness to out-of-distribution (OOD) tasks.
Current Meta-RL methods generally fall into two categories. Encoder-based methods (e.g., PEARL) are sample-efficient but often fail when test tasks deviate significantly from the training distribution. Conversely, gradient-based methods (e.g., MAML) offer better robustness through mathematically consistent adaptation but are typically on-policy and data-intensive. This paper introduces MIER (Model Identification and Experience Relabeling), an algorithm designed to combine the sample efficiency of off-policy RL with the robustness of gradient-based adaptation.
The MIER Framework
MIER decouples the meta-learning process into model identification and policy optimization. The core innovation lies in meta-learning a dynamics and reward model rather than a policy directly.
Model Identification
Instead of a fixed encoder, MIER meta-learns a dynamics model $\hat{p}$ and reward model $r$ conditioned on a latent context variable $\phi$. When encountering a new task, the agent performs "inner adaptation" using gradient descent on $\phi$ to minimize prediction errors for the observed states and rewards. Because dynamics models are trained via supervised learning, they adapt more consistently to unfamiliar environments than complex value functions or policies.
Experience Relabeling
To handle extreme OOD shifts where the initial policy might fail, MIER employs Experience Relabeling. Once the dynamics model is adapted to a new task, the agent "recycles" transitions from its entire history of experiences. It uses the adapted model to predict what the rewards and next states would have been for those past actions under the current task's dynamics. This generates a large volume of synthetic data, allowing the agent to fine-tune its policy using off-policy RL (such as Soft Actor-Critic) without requiring additional real-world interactions.
Experimental Evaluation
The researchers evaluated MIER on several MuJoCo-based benchmarks modified to test extrapolation capabilities. These include:
- Half-Cheetah Velocity: Training on slow speeds and testing on high speeds.
- Ant Direction: Training on a partial circle and testing on an unseen quadrant.
- Negated Joints: A challenging dynamics shift where joint controls are randomly reversed.
Key Results
MIER demonstrates superior performance on OOD tasks compared to state-of-the-art baselines. In the "Ant Direction" task, MIER significantly outperformed PEARL and MAML when navigating the unseen quadrant. In "Negated Joints" environments, the inclusion of experience relabeling (MIER-wR) provided substantial performance gains over methods relying solely on context adaptation. Crucially, MIER maintains the meta-training sample efficiency of leading off-policy methods while providing the robustness typically reserved for gradient-based approaches.
Discussion and Future Work
The success of MIER stems from two key insights: dynamics models are inherently easier to adapt via gradient descent than policies, and experience relabeling allows for efficient policy fine-tuning in unfamiliar territory. By prioritizing consistency over memorization, MIER ensures a "guarantee of improvement" even in novel environments.
However, the method has limitations. It assumes consistent state and action spaces across tasks and relies on the accuracy of the adapted dynamics model to avoid compounding errors in synthetic data. Future research could explore extending MIER to high-dimensional observations like pixels or handling tasks with varying state spaces.
Summary updated