Abstract
In reinforcement learning (RL), when defining a Markov Decision Process (MDP), the environment dynamics are implicitly assumed to be stationary. This assumption of stationarity, while simplifying, can be unrealistic in many scenarios. In the continual reinforcement learning scenario, the sequence of tasks is another source of nonstationarity. In this work, we propose to examine this continual reinforcement learning setting through the Block Contextual MDP (BC-MDP) framework, which enables us to relax the assumption of stationarity. This framework challenges RL algorithms to handle both nonstationarity and rich observation settings and, by additionally leveraging smoothness properties, enables us to study generalization bounds for this setting. Finally, we take inspiration from adaptive control to propose a novel algorithm, ZeUS, that addresses the challenges introduced by this more realistic BC-MDP setting, allows for zero-shot adaptation at evaluation time, and achieves strong performance on several nonstationary environments.
Introduction
Standard Reinforcement Learning (RL) usually assumes a stationary world where environment dynamics and rewards remain constant. However, real-world applications often involve non-stationarity—such as mechanical wear in robots or changing road conditions for autonomous vehicles. Furthermore, agents typically operate on rich, high-dimensional observations (like pixels) rather than ground-truth states.
This paper introduces the Lipschitz Block Contextual MDP (BC-MDP) framework to bridge the gap between idealized theory and practical non-stationary environments. To address these challenges, the authors propose ZeUS (Zero-shot adaptation to Unknown Systems), an algorithm designed for zero-shot adaptation to unseen dynamics without requiring test-time gradient updates. By learning a "smooth" context representation that obeys Lipschitz constraints, the agent can generalize to entirely unseen environment dynamics.
Methodology
The BC-MDP framework combines two powerful concepts: Block MDPs, which handle rich observations mapping to latent states, and Contextual MDPs, which model families of tasks where dynamics and rewards vary based on a hidden context variable.
The core of the proposed approach is the ZeUS algorithm. ZeUS learns a context encoder that is constrained by Lipschitz smoothness. This ensures that small variations in the environment's physical properties lead to small changes in the learned context space, providing a mathematical foundation for generalization.
ZeUS employs a specific loss function based on a "task metric," minimizing the distance between context representations when the underlying dynamics and rewards are similar. At test time, the agent observes a short sequence of transitions (interaction history), infers the current context via the context encoder ($\psi$), and conditions its policy on this context for immediate adaptation. Unlike meta-learning approaches that require gradient steps to adapt, ZeUS adapts purely through its forward pass, making it faster and more robust to catastrophic forgetting.
Experiments and Results
The researchers evaluated ZeUS on non-stationary versions of the DeepMind Control Suite (MuJoCo), including tasks like Cheetah-Run, Walker-Walk, Finger-Spin, and Sawyer-Peg. A key focus was extrapolation: training on one range of physical parameters (e.g., torso lengths) and testing on entirely unseen ranges.
Key Findings
- Superior Extrapolation: ZeUS consistently outperformed baselines like CaDM, UP-OSI, and HyperDynamics. While other agents' performance dropped significantly outside the training distribution, ZeUS maintained high returns.
- Meaningful Latent Spaces: Visualizations showed that the learned context space naturally organized according to true physical parameters (e.g., clustering tasks with similar torso lengths), proving the context loss captures environmental structure.
- Importance of Smoothness: Ablation studies confirmed that the Lipschitz-inspired context loss is critical for zero-shot generalization; removing it led to a significant performance drop.
Conclusion
ZeUS demonstrates that learning smooth context representations allows agents to adapt to "unknown unknowns" in non-stationary environments. While the method currently relies on dense rewards and faces performance degradation in extreme out-of-distribution scenarios, it represents a significant step toward robust, adaptive RL in the real world. Future work may explore active non-stationarity and adaptation in sparse-reward settings.
Summary updated