Continual Model-Based Reinforcement Learning with Hypernetworks

Yizhou Huang, Kevin Xie, Homanga Bharadhwaj, Florian Shkurti

TL;DR

HyperCRL is a novel framework that uses task-conditional hypernetworks to enable robots to learn changing environment dynamics continually. By generating task-specific weights for a dynamics model, it prevents catastrophic forgetting and avoids the linear training-time scaling of traditional methods, maintaining high performance across a sequence of diverse manipulation and locomotion tasks.

What Problem Does This Paper Address?

In Model-Based Reinforcement Learning (MBRL), a robot learns a "dynamics model"—a mathematical representation of how the world reacts to its actions. Traditionally, these models are either retrained from scratch as new data arrives (which becomes prohibitively slow as experience grows) or finetuned on new tasks (which causes the robot to "forget" how to handle previous environments, a phenomenon known as catastrophic forgetting).

For a robot to operate in the real world—where it might encounter different floor frictions, varying object masses, or new tool handles—it needs a way to adapt to new physics without losing its previously acquired skills. The authors address the dual challenge of scalability (training time shouldn't explode) and retention (old tasks shouldn't be forgotten).

Methods

The core of the proposed method is HyperCRL (Continual Reinforcement Learning via Hypernetworks).

Overview of the HyperCRL architecture showing the hypernetwork generating weights for the dynamics model used in CEM planning.

Key components include:

  • Hypernetworks: Instead of training a single dynamics network, the authors train a "hypernetwork" ($H$). This meta-network takes a low-dimensional task embedding ($e_t$) as input and outputs the entire set of weights ($\theta_t$) for a separate "target" dynamics network ($f$).
  • Task-Specific Embeddings: For every new task, a new embedding vector is initialized and learned. This allows the hypernetwork to specialize the dynamics model for the current environment.
  • Output Regularization: To prevent forgetting, the authors introduce a regularization loss. They keep a "snapshot" of the hypernetwork from previous tasks. When learning a new task, the hypernetwork is penalized if its output for old task embeddings deviates from the snapshot's output. This effectively "locks in" the knowledge of old dynamics without needing to store old state-transition data.
  • Planning with CEM: The generated task-specific dynamics model is used within a Model Predictive Control (MPC) loop, where the Cross-Entropy Method (CEM) optimizes action sequences in real-time.

Datasets

The authors evaluated HyperCRL on four distinct simulated robotic environments using the Surreal Robotics Suite and MuJoCo:

  1. Pusher: A Panda robot arm must push a block with non-uniform mass distributions to a goal. Tasks vary by changing the center of mass and inertia.
  2. Door Opening: The robot must open doors with different handles (pull, round, lever). This is challenging because different handles require vastly different motions (e.g., rotating vs. pulling).
  3. Block Sliding: The robot hits one block to slide a second block to a goal. Tasks vary the friction coefficient of the second block.
  4. HalfCheetah: A standard locomotion benchmark where the robot's body proportions (torso and leg size) are varied across tasks.
The Pusher environment (left) and Door environment (right) setups.

Key Insights and Ideas

  • Weight Space vs. Data Space: Most continual learning methods try to remember old data (coresets). HyperCRL remembers the mapping to the correct weights. This is much more memory-efficient for lifelong learning.
  • Fixed Capacity: Unlike "progressive" networks that grow with every new task, HyperCRL uses a fixed-size hypernetwork. This makes it more realistic for robots with finite onboard memory.
  • Positive Transfer: Interestingly, the results showed instances of "positive backward transfer," where learning a new, related task actually improved the robot's performance on a previously learned task. This suggests the hypernetwork is learning a generalized understanding of physics.

Key Results

  • Zero Forgetting: In the Pusher and Door experiments, HyperCRL achieved nearly 100% retention of performance on old tasks. In contrast, simple finetuning performance dropped to near zero as new tasks were introduced.
  • Outperforming Baselines: HyperCRL consistently beat established continual learning algorithms like Elastic Weight Consolidation (EWC) and Synaptic Intelligence (SI), which often failed to adapt to the highly discontinuous dynamics of tasks like door opening.
  • Oracle-Level Performance: HyperCRL's average reward was on par with a "Multi-task Oracle"—a theoretical baseline that has access to all data from all tasks simultaneously.

Limitations and Future Work

  • Known Task Boundaries: Currently, the system must be told when a task has changed to initialize a new embedding. Future work could involve automatic "change-point detection" to make the robot truly autonomous.
  • Hypernetwork Scale: The hypernetwork itself is quite large because its output layer must be as big as the total number of parameters in the target network. This might limit the complexity of the target networks that can be used.
  • Input Modality: The current work uses low-dimensional state vectors. Extending this to high-dimensional inputs like raw camera images is a logical next step.

Summary updated

BibTeX
@inproceedings{huang2021continual,
  author = {Yizhou Huang and Kevin Xie and Homanga Bharadhwaj and Florian Shkurti},
  title = {{Continual Model-Based Reinforcement Learning with Hypernetworks}},
  booktitle = {IEEE International Conference on Robotics and Automation},
  year = {2021},
  url = {https://openreview.net/forum?id=0TyD27EkF7O},
}
Figure