Abstract
World models power some of the most efficient reinforcement learning algorithms. In this work, we showcase that they can be harnessed for continual learning – a situation when the agent faces changing environments. World models typically employ a replay buffer for training, which can be naturally extended to continual learning. We systematically study how different selective experience replay methods affect performance, forgetting, and transfer. We also provide recommendations regarding various modeling options for using world models. The best set of choices is called Continual-Dreamer, it is task-agnostic and utilizes the world model for continual exploration. Continual-Dreamer is sample efficient and outperforms state-of-the-art task-agnostic continual reinforcement learning methods on Minigrid and Minihack benchmarks.
Introduction
Reinforcement Learning (RL) has achieved remarkable success in isolated tasks. However, traditional RL agents often struggle when faced with a sequence of different environments, a challenge known as Continual Reinforcement Learning (CRL). The primary obstacle in CRL is "catastrophic forgetting," where an agent overwrites existing knowledge while learning new tasks.
Most current CRL solutions are "task-aware," relying on external signals like task IDs to manage transitions. This research addresses the more demanding task-agnostic setting. In this scenario, the agent must autonomously detect and adapt to environmental changes without explicit notification. The authors introduce Continual-Dreamer, a task-agnostic agent that leverages world models to maintain performance across sequential tasks.
Methods: The Continual-Dreamer Architecture
Continual-Dreamer is built upon the DreamerV2 architecture, which utilizes a "world model" to learn a mental simulator of the environment. The agent interacts with the real world to collect data, trains its world model on this data, and then optimizes its policy by "dreaming" (simulating trajectories) entirely within this latent imagination.
Key components of the approach include:
- Selective Experience Replay: The researchers evaluated various buffer management strategies. Reservoir Sampling emerged as the most effective, ensuring a uniform distribution of experiences across all encountered tasks.
- Plan2Explore: This task-agnostic exploration strategy rewards the agent for visiting states where the world model's predictions are most uncertain (latent disagreement). This enables autonomous discovery and learning of new task dynamics as they appear.
Experimental Setup
The effectiveness of Continual-Dreamer was evaluated on two CRL benchmarks:
- Minigrid: A grid-world environment requiring navigation, key collection, and hazard avoidance. The sequence included DoorKey, SimpleCrossing, and LavaCrossing.
- Minihack: A diverse benchmark based on NetHack, featuring larger state spaces and complex skills like river crossing. Sequences of up to 8 distinct tasks were tested.
Results and Key Insights
Continual-Dreamer consistently outperformed state-of-the-art task-agnostic baselines such as CLEAR and Impala.
Major findings include:
- Imagination as a Generative Buffer: The world model acts as a generative buffer. By maintaining the dynamics of previous tasks in the world model (supported by the replay buffer), the agent can continue practicing those tasks in imagination, effectively preventing forgetting.
- Sample Efficiency: Continual-Dreamer demonstrated significant efficiency, solving tasks with approximately 10x fewer environment interactions than the CLEAR baseline.
- Forward Transfer: The agent showed strong "warm-starting" capabilities. Learning simpler, related tasks first significantly improved performance on complex downstream tasks that were otherwise unsolvable in isolation.
- Minimal Forgetting: In several configurations, the agent exhibited near-zero or even "negative" forgetting, improving on previous tasks while mastering new ones.
Discussion and Future Work
While Continual-Dreamer shows great promise, certain challenges remain. Interference can occur when different tasks share identical starting states but have conflicting goals, leading to data corruption in the world model. Additionally, extreme data imbalance between tasks can still challenge reservoir sampling's ability to retain rare experiences. Future research will focus on scaling these world-model-based strategies to high-dimensional continuous control tasks and even more diverse task distributions.
Summary updated