MoDem: Accelerating Visual Model-Based Reinforcement Learning with Demonstrations

Nicklas Hansen, Yixin Lin, Hao Su, Xiaolong Wang, Vikash Kumar, Aravind Rajeswaran

In the world of robotics, teaching a machine to perform complex tasks—like unscrewing a jar or picking up a peg—from raw camera feeds is notoriously difficult. Deep Reinforcement Learning (RL) is the go-to tool for this, but it is famously "sample-hungry," often requiring millions of trials to learn even simple behaviors.

A new paper from researchers at Meta AI and UC San Diego, titled MoDem (Model-based Reinforcement Learning with Demonstrations), offers a powerful solution. By leveraging just five human demonstrations, MoDem can accelerate the learning process by over 200%, solving complex manipulation tasks in a fraction of the time required by previous methods.

TL;DR

MoDem is a three-phase framework that dramatically improves the sample efficiency of visual model-based RL by integrating a handful of expert demonstrations. By combining policy pretraining, targeted "seeding" of the world model, and aggressive data oversampling, it achieves a 160%–250% higher success rate on challenging robotics tasks compared to state-of-the-art baselines.

What Problem Does This Paper Address?

The primary bottleneck in deploying RL for real-world robotics is sample efficiency. Specifically, two issues collide:

  1. Visual Complexity: Learning to act directly from pixels (visuo-motor control) requires the agent to understand both the physics of the world and the nuances of image processing simultaneously.
  2. The Exploration Problem: In "sparse reward" environments—where the agent only gets a "good job" signal once the task is fully completed—an agent starting from scratch might spend millions of steps flailing randomly without ever stumbling upon the goal.

Model-Based RL (MBRL) tries to solve this by learning a "world model" (a mental simulator) to plan ahead. However, even MBRL struggles to build an accurate model of the task-relevant parts of the environment if it never explores them successfully. Expert demonstrations provide a map to the goal, but simply "dumping" them into the agent's memory (the replay buffer) usually isn't enough; the agent's own noisy data quickly overwhelms the expert's wisdom.

Methods

MoDem introduces a structured, three-phase pipeline to integrate demonstrations into TD-MPC (a high-performance MBRL algorithm):

The three-phase MoDem framework
  1. Phase 1: Policy Pretraining: The agent performs Behavior Cloning (BC) on the five demonstrations. This doesn't make the agent perfect, but it provides a "strong prior"—a rough idea of what the movements should look like.
  2. Phase 2: Seeding: This is the "secret sauce." Instead of starting online learning immediately, the agent uses its pretrained BC policy (plus some noise) to collect a small "seed" dataset from the environment. It then trains its world model and value function on a mix of the expert demos and this seed data. This ensures the world model is accurate in the specific areas of the state space needed to solve the task.
  3. Phase 3: Interactive Learning: The agent begins full online interaction. Crucially, MoDem uses aggressive oversampling, ensuring that a large percentage of the data used for every training update comes from the original expert demonstrations. This prevents the agent from "forgetting" the expert's path as it collects its own (initially unsuccessful) data.

Datasets

The authors evaluated MoDem on 21 challenging tasks across three established benchmarks:

  • Adroit: Highly complex dexterous manipulation using a 24-DoF robotic hand (e.g., opening a door, hammering a nail).
  • Meta-World: A suite of robotic arm manipulation tasks (e.g., assembly, peg insertion).
  • DMControl: Standard locomotion tasks (e.g., Walker, Humanoid) used here to test performance with dense rewards.

The researchers focused on the "low-data regime," limiting the agent to just 5 demonstrations and 100,000 interaction steps (roughly one hour of real-time robot experience).

Key Insights and Ideas

  • Demos are more than just data points: Simply appending demos to a replay buffer is ineffective because they are quickly outnumbered by the agent's own data. MoDem treats them as a foundational guide that must be revisited constantly (via oversampling).
  • The "Seeding" Bridge: Moving directly from BC to online RL often leads to "policy collapse," where the agent forgets the good behavior before the world model is ready to support it. The seeding phase acts as a vital bridge, ensuring the world model is "warmed up" on task-relevant data.
  • Model-Based > Model-Free: The authors found that MBRL is inherently better suited for learning from few demos than model-free methods. Because MBRL learns the physics (the dynamics), it can use the demos to understand how the world works, not just which buttons to press.
  • Augmentation is Essential: Standard image-shift augmentations remain a critical ingredient for making visual RL work, even when using expert demonstrations.

Key Results

MoDem's performance gains are substantial:

MoDem performance comparison on Adroit and Meta-World
  • Adroit Success: On the notoriously difficult Adroit tasks, MoDem achieved a 53% average success rate, while all other baselines (including model-free RL with demos and pure imitation learning) failed to achieve any non-trivial success (0-3%).
  • Meta-World Mastery: In Meta-World, MoDem reached an 81% success rate, compared to just 31% for the next best baseline (FERM).
  • Efficiency: MoDem solved all 15 Meta-World tasks within the 100k step limit, a feat previously requiring millions of steps for standard RL agents.

Limitations and Future Work

  • Demonstration Quality: While MoDem is robust, it still relies on the demonstrations being "successful." It is unclear how it would handle highly sub-optimal or "noisy" human demos.
  • Computational Cost: While the wall-clock time for pretraining is low (about 5 minutes), the iterative planning in TD-MPC is more computationally expensive than simple model-free policies.
  • Fixed Goals: The current implementation was tested on fixed-goal tasks. Extending this to multi-goal or open-ended environments is a logical next step.

In summary, MoDem demonstrates that we don't need "Big Data" for robotics if we use "Smart Data" correctly. By carefully guiding a world-model-based agent with just a handful of human examples, we can bridge the gap between simulation and real-world deployment.

Summary updated

BibTeX
@inproceedings{hansen2023modem,
  author = {Nicklas Hansen and Yixin Lin and Hao Su and Xiaolong Wang and Vikash Kumar and Aravind Rajeswaran},
  title = {{MoDem: Accelerating Visual Model-Based Reinforcement Learning with Demonstrations}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=JdTnc9gjVfJ},
}
Figure