Abstract
Adaptation to non-stationary environments remains a significant challenge for reinforcement learning agents. While model-based agents like DreamerV3 excel in static tasks, they often struggle when environmental dynamics change. This paper introduces Curious Replay (CR), a prioritized experience replay mechanism designed to accelerate adaptation by focusing training on unfamiliar or poorly understood transitions. By integrating count-based novelty and model-prediction error into the sampling priority, CR achieves a new state-of-the-art score of 19.4 on the Crafter benchmark and demonstrates up to 6x faster adaptation in non-stationary tasks compared to uniform sampling baselines.
Introduction
In real-world applications, autonomous agents must navigate environments that are inherently dynamic. Whether it is a self-driving vehicle encountering a novel construction zone or a robotic manipulator handling a new tool, the ability to rapidly update an internal world model is crucial. Biological systems exhibit an innate "investigative" behavior, prioritizing new stimuli to refine their understanding of the world.
In contrast, modern model-based reinforcement learning (MBRL) agents typically rely on uniform sampling from a replay buffer. While effective for stable environments, this approach creates a "memory trap" in non-stationary settings. When the environment changes, the few samples representing the new dynamics are overwhelmed by a vast history of obsolete data. Consequently, the agent continues to train on well-understood, old experiences, leading to delayed adaptation and suboptimal performance.
The Curious Replay Framework
Curious Replay (CR) addresses the limitations of uniform sampling by prioritizing transitions that offer the highest potential for model improvement. Unlike standard Prioritized Experience Replay (PER), which often focuses on Temporal Difference (TD) error to optimize reward acquisition, CR prioritizes the accuracy of the world model itself.
The priority $p_i$ for a given transition $i$ is determined by two primary curiosity signals:
- Count-based Replay: This component tracks the number of times a specific experience has been sampled for training ($v_i$). Transitions that have been "visited" less frequently receive higher priority, ensuring that rare or novel data is not ignored.
- Adversarial Replay: This component utilizes the current model loss ($L_i$). If the world model exhibits high prediction error for a specific transition, it indicates that the model's internal representation of those dynamics is insufficient, necessitating further training.
The combined priority is calculated as: $$p_i = c\beta^{v_i} + (|L_i| + \epsilon)^\alpha$$ where $c, \beta,$ and $\alpha$ are hyperparameters that balance the influence of novelty and surprise. By focusing on model loss rather than value error, CR builds a more robust internal map of the environment, which is foundational for effective policy adaptation.
Experimental Evaluation
The efficacy of Curious Replay was evaluated across a diverse set of benchmarks designed to test both general performance and adaptation speed:
- Crafter: An open-world survival benchmark requiring complex tool-use and exploration.
- Object Interaction Assay: A 3D environment where a novel object is introduced mid-training to measure how quickly an agent notices and learns to interact with new elements.
- Constrained Control Suite: A modification of the DeepMind Control Suite where agent joint constraints are altered during the simulation, testing physical adaptation.
- DeepMind Control Suite (Standard): Used to verify that CR does not degrade performance in stationary environments.
Results and Discussion
Curious Replay demonstrated significant improvements over existing state-of-the-art methods:
- State-of-the-Art on Crafter: DreamerV3 with CR achieved a mean score of 19.4, surpassing the previous SOTA of 14.5. This suggests that better memory management directly translates to better exploration and tool-use in complex environments.
- Accelerated Adaptation: In the Object Interaction Assay, CR agents interacted with novel objects six times faster than those using uniform sampling. The "investigation gap"—the delay between a change occurring and the agent adapting—was drastically reduced.
- Resilience to Distribution Shift: In "Background-Swap" tasks, where visual elements change without affecting physics, CR agents maintained performance and updated their models without the catastrophic forgetting typically observed in standard agents.
- Stability: CR maintained parity with or exceeded baseline performance on standard DeepMind Control Suite tasks, indicating that the prioritization logic is robust and does not introduce instability in static settings.
Conclusion and Future Work
Curious Replay represents a shift in how MBRL agents utilize their memory. By moving away from uniform sampling and toward a curiosity-driven prioritization of the world model's weaknesses, agents can adapt to environmental changes with significantly greater efficiency.
However, challenges remain. The current curiosity signal is task-agnostic, meaning agents may occasionally over-index on "noisy" data that is irrelevant to the primary goal. Furthermore, while CR excels at adapting to physical changes, future work is needed to address scenarios where only the reward function changes. Closing the remaining gap between AI adaptation speeds and the near-instantaneous learning seen in biological organisms remains a key frontier for the field.
Summary updated