Meta-Reinforcement Learning with Zero-Shot Reinforcement Learning

Jake Grigsby, Siddhant Agarwal, Yu Lei, Leonidas Varveropoulos, Yuke ZhuNeurIPS 2026

TL;DR

Simulators and AI coding tools have made generating diverse training environments cheap, yet manually designing every reward function an AI agent might ever need remains a painstaking bottleneck. This paper introduces MetaBFM, a unified reinforcement learning framework that fuses supervised meta-RL with unsupervised Behavior Foundation Models. The result is an agent with test-time "knobs" that can match specialist meta-RL performance on familiar objectives while adapting on the fly to completely novel, out-of-distribution goals.

What Problem Does This Paper Address?

Imagine teaching a robot to adapt quickly to new situations at test time. Standard Meta-Reinforcement Learning (Meta-RL) excels at this—learning to infer hidden rules from a few trial-and-error episodes—provided you train it on a massive variety of both environments (physics, layouts) and reward functions (goals). However, crafting thousands of bug-free reward functions is notoriously difficult; if you miss a behavior during training, the agent overfits and fails at test time.

On the flip side, Behavior Foundation Models (BFMs) learn from reward-free data using successor features—essentially learning how to reach any future state so they can pursue new goals at test time via Zero-Shot RL (ZSRL) without retraining. Historically, BFMs needed an offline dataset to infer a new task, though recent work (OptiBFM) showed they can infer tasks online just like Meta-RL.

So, can BFMs replace reward-hungry Meta-RL? Not quite. When the authors tested standard BFMs across changing environments, the models completely collapsed—averaging their actions across incompatible physics instead of figuring out which world they were in.

Figure 1: BFM and Meta-RL Generalization. In offline ColorGrid (n = 9), we vary training environments (columns) and rewards (rows), then evaluate k = 6 episode adaptation on train and held-out tasks. Meta-RL improves with training set diversity but needs many reward functions to generalize; BFMs adapt in the fixed-environment setting (left column), but fail across environments.

To bridge these two worlds, an agent needs four capabilities: identifying novel environment dynamics, collecting its own diverse data online, balancing exploration and exploitation at test time, and utilizing supervised rewards whenever they are available.

Methods

Rather than altering the core BFM machinery (primarily built on TD-JEPA here), the authors build a modular, hybrid architecture called MetaBFM:

  • Latent Context Learning (LCL): To stop BFMs from going blind across different environments, a causal sequence model reads the agent's interaction history and outputs an online estimate of the environment's dynamics ($\tilde{c}_d$) at every timestep. It learns via self-supervised inverse dynamics (predicting actions from states) and latent dynamics (predicting next-step embeddings), with actions staggered by two steps so the network can't cheat. This context is simply appended to the state.
The Latent Context Learning (LCL) module uses self-supervised dynamics objectives to infer hidden environment rules on the fly.
  • Episodic Curiosity ($\alpha$): Standard BFMs collapse onto narrow behaviors if trained online. MetaBFM adds a memory-equipped critic trained on episodic intrinsic rewards—bonuses that decay within a multi-episode trial—encouraging the agent to visit new states and reduce LCL dynamics uncertainty.
  • Configurable Hybrid Objective ($\alpha$ and $\beta$): MetaBFM trains its policy to optimize a blend of unsupervised successor-feature values and a critic that mixes intrinsic curiosity with extrinsic (supervised) task rewards. By conditioning the policy on two continuous weights, $\alpha$ and $\beta$, you get a single agent with test-time dials:
  • $\alpha=1, \beta=1$: Pure supervised Meta-RL mode (exploit training task priors).
  • $\alpha=1, \beta=0$: Pure Exploration mode (search the environment).
  • $\alpha=0, \beta=0$: Pure ZSRL mode (pursue brand-new reward functions inferred online).

Datasets

Because MetaBFM focuses on online adaptation, experiments span custom diagnostic worlds and established continuous-control simulators (sometimes seeded with offline data):

  • ColorGrid: A newly introduced diagnostic $n \times n$ continuous 2D gridworld where cell layouts are randomly permuted ($(n^2)!$ possible dynamics) and cell rewards are randomized.
  • G1 Humanoid Motion Tracking (LAFAN): 4.6 hours of human motion-capture sequences evaluated under randomized wind and gravity perturbations.
  • Wind: A 2D navigation benchmark with random wind directions and a held-out goal quadrant for testing out-of-distribution (OOD) reward generalization.
  • DeepMind Control (DMC) Walker: Simulated bipedal locomotion across 10k randomized body geometries, friction, and damping parameters, trained only to walk forward and tested on unseen skills (e.g., walk backward, crouch).
  • MetaWorld (ML1 & ML45): Hardware-accelerated tabletop robotic manipulation across 50 environments, initialized with an offline replay buffer of demonstrations before continuing online training.

Key Insights and Ideas

  • BFMs average over ambiguity: Without an explicit mechanism to infer environment physics, a BFM trained across multiple dynamics performs worse on normal physics than one trained in a single environment, because it hedges its bets across all worlds.
  • Offloading reward memory unlocks length extrapolation: Standard black-box Meta-RL struggles to adapt past the number of episodes it saw during training. In ZSRL mode, MetaBFM keeps improving for $k > 20$ episodes even when trained on just $k = 2$ or $3$ episodes, likely because estimating the goal is offloaded from policy weights to linear regression on successor features ($z^*$).
  • Joint context learning scales: Pretraining the LCL dynamics module isn't strictly necessary; training it jointly from scratch alongside the BFM matches pretrained performance once task diversity is large enough—crucial for purely online RL.
Figure 4: Latent context learning improves BFM generalization. We increase the number of training (cd, cr) task pairs with separate offline datasets. Standard TD-JEPA collapses across environments, while LCL-augmented TD-JEPA recovers adaptation and improves test performance as the training set grows. Pretraining LCL is most helpful at small training set sizes, but joint training approaches the same performance at scale.

Key Results

  • Humanoid Locomotion: Adding LDM context learning to a multi-dynamics BFM drops in-distribution joint tracking error (mpjpe-l) from 132.7 down to 121.5 (nearly recovering the single-environment oracle's 117.2) and improves OOD dynamics error from 151.6 to 145.9 (versus 194.7 for the single-dynamics baseline).
  • Zero-Shot Skill Generalization: On DMC Walker (trained solely on walk) and Wind (with an excluded quadrant), supervised Meta-RL completely flatlines on OOD objectives like walk_backward or crouch_walk. Switching MetaBFM to ZSRL mode ($\beta=0$) enables steady online adaptation while matching Meta-RL on in-distribution walk in reward-following mode ($\alpha=1, \beta=1$).
  • Robotic Manipulation: On MetaWorld ML45, MetaBFM matches supervised Meta-RL's high success rates (~80%+) on the 45 training tasks, explores over 3$\times$ more workspace regions in exploration mode, and reaches ~18% success on a novel 50-environment goal-reaching task where supervised modes stay near 0% chance.

Limitations and Future Work

  • Limits of OOD Manipulation: MetaBFM is no silver bullet for completely foreign object interactions. On MetaWorld's 5 held-out manipulation tasks, it failed to generalize in any mode—likely because unstructured curiosity doesn't naturally stumble into complex, multi-step object manipulations enough to learn their successor features.
  • Computational Overhead & Manual Knobs: Training MetaBFM is heavier than a standalone BFM (mitigated partially by sharing Transformer backbones), and in these experiments, the test-time $\alpha$ and $\beta$ schedules are set manually rather than adapted automatically.
  • Future Direction: The authors envision shifting generalist RL effort away from hand-engineering endless reward functions and toward scaling up diverse, easily generated environments.

Summary updated

Abstract

Meta-reinforcement learning (meta-RL) trains agents to adapt to novel tasks from test-time experience, but requires diverse training environments and reward functions. While environments are becoming cheaper to generate, it remains difficult to anticipate every objective an agent may be asked to pursue at test time. Behavior Foundation Models (BFMs) learn policies from reward-free data and support zero-shot RL (ZSRL): adaptation to new objectives at test time using a large reward-labeled dataset. Recent work has shown that BFM task inference can instead be performed online without prior task-specific data. We note that this capability positions BFMs and meta-RL as alternative approaches for online adaptation to new reward functions in a fixed environment. We then ask whether we can extend BFMs to compete with meta-RL more broadly, including in novel environments, and identify four challenges: environment identification, online data collection, test-time exploration, and learning from mixed reward supervision. We study each individually, then propose MetaBFM, a hybrid method that addresses all four. During training, it combines supervised reward-following with unsupervised learning; at test time, it can interpolate between exploration, exploitation, and ZSRL-style reward inference. We demonstrate that MetaBFM can recover the in-distribution performance of supervised meta-RL while generalizing to reward functions outside the training set. Our work suggests that BFMs and meta-RL are complementary research directions whose combined strengths allow adaptive agents to learn more diverse behaviors from a fixed set of supervised objectives.
BibTeX
@inproceedings{grigsby2026meta,
  author = {Jake Grigsby and Siddhant Agarwal and Yu Lei and Leonidas Varveropoulos and Yuke Zhu},
  title = {{Meta-Reinforcement Learning with Zero-Shot Reinforcement Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=FAb595Jqbg},
}
Figure