Abstract
Meta-reinforcement learning (meta-RL) algorithms provide a data-driven way to acquire learning algorithms that quickly adapt to many tasks with varying rewards or dynamics functions. However, learned meta-policies are often effective only on the exact task distribution on which the policy was trained, and struggle in the presence of distribution shift of test-time rewards or transition dynamics. In this work, we develop a framework for meta-RL algorithms that are able to behave appropriately under test-time distribution shifts in the space of tasks. Our framework centers on an adaptive approach to distributional robustness, in which we train a population of meta-agents to be robust to varying levels of distribution shift, so that when evaluated on a (potentially shifted) test-time distribution of tasks, we can adaptively choose the most appropriate meta-agent to follow. We formally show how this framework allows for improved regret under distribution shift, and empirically show its efficacy on simulated robotics problems under a wide range of distribution shifts.
Introduction
Meta-Reinforcement Learning (meta-RL) aims to produce agents capable of rapid adaptation to new environments. By learning across a variety of tasks, a meta-policy can ideally explore a novel setting and quickly identify optimal behaviors. However, a significant limitation of current meta-RL methods is their reliance on the assumption that test-time tasks are drawn from the same distribution as training tasks. When faced with out-of-distribution (OOD) scenarios—such as a robot encountering different floor friction or larger workspaces than seen during training—standard meta-policies often fail to generalize.
DiAMetR (Distributionally Adaptive Meta Reinforcement Learning) addresses this vulnerability. It enables agents to remain resilient to task distribution shifts by training a population of meta-policies with varying levels of robustness. By employing a bandit-based selection mechanism during deployment, the agent adaptively selects the most suitable policy for the current environment, maintaining performance on familiar tasks while successfully navigating novel ones.
The Challenge of Distribution Shift
The "Achilles' heel" of standard meta-RL is the distribution shift between training and testing. For instance, a meta-policy trained to reach goals within a specific radius may fail to explore effectively if the goal is moved just outside that known boundary. As illustrated in Figure 1, the agent's exploration strategy, optimized for the training distribution, becomes ineffective when the task parameters shift.
DiAMetR: Adaptive Distributional Robustness
DiAMetR leverages the framework of Distributional Robustness to prepare for potential shifts. Instead of optimizing for average performance on a fixed set of tasks, the agent prepares for "worst-case" scenarios within defined uncertainty sets. The framework consists of three primary components:
- Population Training: DiAMetR trains a population of meta-policies, each optimized for a different magnitude of distribution shift ($\epsilon$). This avoids the need to pre-select a single robustness level, which might be overly conservative or insufficiently robust.
- Imagined Tasks: To simulate OOD scenarios during training, the authors use a generative model to "imagine" shifted task distributions. This allows the meta-policies to practice adaptation in synthetic environments that lie outside the original training support.
- Adaptive Selection: At test time, the agent treats the choice of meta-policy as a Multi-Armed Bandit problem. Using Thompson Sampling, the agent evaluates different policies from its population and quickly converges on the one best suited for the observed environment.
Experimental Evaluation
The researchers evaluated DiAMetR across four continuous control environments designed to test various distribution shifts:
- Ant Navigation: A quadruped robot must find a goal; test-time goals are placed at a larger radius than training goals.
- Wind Navigation: A 2D navigation task where test-time wind speeds exceed training speeds.
- Object Localization: A Fetch robot arm must locate an object using its gripper.
- Block Push: A robot arm must push a block to an unobserved location.
Key Insights
- Robustness-Performance Trade-off: Highly robust policies tend to explore more broadly but may be slower on "easy" tasks. DiAMetR sidesteps this trade-off by maintaining a diverse population of policies.
- Generative Uncertainty Sets: Learning a latent task space allows for structured exploration of distribution boundaries, enabling the simulation of realistic OOD shifts.
- Bandit Selection as Meta-Adaptation: The use of Thompson Sampling adds a second layer of adaptation, allowing the agent to adapt not just to a specific task, but to the underlying distribution of tasks.
Results and Discussion
Empirical results demonstrate that DiAMetR consistently outperforms strong baselines such as RL², VariBAD, and HyperX under distribution shift. Notably, DiAMetR avoids the "robustness tax"—it matches or exceeds the performance of standard meta-RL on the original training distribution by selecting specialized, less-robust policies when appropriate. Furthermore, the Thompson Sampling mechanism is highly efficient, typically identifying the optimal meta-policy within a few episodes.
Limitations and Future Work
While effective, training a population of meta-policies increases computational overhead. Future research could investigate parameter-efficient architectures, such as conditioning a single policy on the robustness parameter $\epsilon$. Additionally, extending this framework to high-dimensional visual inputs and developing more comprehensive theoretical bounds for non-stationary environments remain important directions for future work.
Summary updated