Abstract
We consider the problem of learning in a non-stationary reinforcement learning (RL) environment, where the setting can be fully described by a piecewise stationary discrete-time Markov decision process (MDP). We introduce a variant of the Restarted Bayesian Online Change-Point Detection algorithm (R-BOCPD) that operates on input streams originating from the more general multinomial distribution and provides near-optimal theoretical guarantees in terms of false-alarm rate and detection delay. Based on this, we propose an improved version of the UCRL2 algorithm for MDPs with state transition kernel sampled from a multinomial distribution, which we call R-BOCPD-UCRL2. We perform a finite-time performance analysis and show that R-BOCPD-UCRL2 enjoys a favorable regret bound of $\mathcal{O}\left(D O \sqrt{A T K_T \log\left (\frac{T}{\delta} \right)} + \frac{K_T \log \frac{K_T}{\delta}}{\min\limits_\ell \:{KL}(\boldsymbol{\theta}^{(\ell+1)},\boldsymbol{\theta}^{(\ell)})} \right)$, where $D$ is the largest MDP diameter, $O$ is the number of states, $A$ is the number of actions, $K_T$ is the number of change points, and $\boldsymbol{\theta}^{(\ell)}$ is the transition kernel. Interestingly, the performance bound does not directly scale with the variation in MDP state transition distributions and rewards. In practice, R-BOCPD-UCRL2 outperforms the state-of-the-art in a variety of scenarios in synthetic environments.
Introduction
In classical Reinforcement Learning (RL), environments are typically assumed to be stationary, meaning the rewards and state transition probabilities remain constant over time. However, real-world scenarios—such as stock market fluctuations, network traffic surges, or mechanical wear in robotics—are inherently non-stationary.
This paper addresses the piecewise stationary MDP challenge. In this setting, the environment remains stable for a period before undergoing an abrupt shift at an unknown "change-point." Existing solutions often rely on sliding windows, which may forget old data too slowly, or require prior knowledge of a "variation budget." This research seeks a method to detect these abrupt changes on the fly and restart the learning process at the optimal moment.
Methodology: R-BOCPD-UCRL2
The authors propose a two-part solution integrated into an algorithm called R-BOCPD-UCRL2:
- Multinomial R-BOCPD: The researchers extended the Restarted Bayesian Online Change-Point Detection (R-BOCPD) framework to handle multinomial distributions. Since discrete MDP transitions are categorical (moving from one state to a set of possible next states), a multinomial detector is significantly more precise than general-purpose detectors. It utilizes a Laplace predictor to estimate probabilities and triggers a restart when observed data deviates significantly from the predicted model.
- Integration with UCRL2: This detector is integrated into the Upper Confidence Bound for Reinforcement Learning (UCRL2) algorithm. When a change in the transition kernel or rewards is identified, the algorithm "restarts," clearing its history and initiating a new learning phase. This allows the agent to maintain high efficiency during stable periods while remaining agile enough to pivot when the environment changes.
Experimental Evaluation
The algorithm was evaluated using synthetic MDPs of varying complexities, ranging from 4 states/7 actions to 16 states/20 actions. Dynamics were simulated with abrupt changes to both state-transition probabilities and reward distributions at random intervals. R-BOCPD-UCRL2 was benchmarked against Vanilla UCRL2, Sliding-Window UCRL2 (SWUCRL2), and an "Oracle" version that is pre-informed of all change-points.
Key Results and Insights
- The $\sqrt{T}$ Regret Bound: While many non-stationary RL algorithms have regret scaling with $T^{2/3}$ or $T^{3/4}$, R-BOCPD-UCRL2 achieves $\tilde{O}(\sqrt{T})$. This matches the theoretical gold standard for stationary RL, suggesting that non-stationarity does not have to be significantly harder than stationarity if detection is handled intelligently.
- Near-Oracle Performance: In simulations, the algorithm performed almost as well as the Oracle-Equipped UCRL2, demonstrating the high accuracy of the multinomial change-point detector.
- Independence from Variation Budgets: Unlike many state-of-the-art methods, R-BOCPD-UCRL2 does not require prior knowledge of how much the environment will change; it reacts dynamically to observed shifts.
- Robustness and Scalability: The algorithm consistently outperformed sliding-window approaches across all tested MDP sizes, proving that the multinomial detection logic scales well to larger state-action spaces.
Conclusion
R-BOCPD-UCRL2 provides a robust framework for RL in abruptly changing environments. However, some limitations remain. The current framework is restricted to discrete state and action spaces; extending this to continuous environments via function approximation or deep RL is a key area for future work. Additionally, while the algorithm is highly effective at detecting radical changes, very subtle shifts may take longer to identify. Future research could also explore adapting this change-point detection to model-free architectures like Q-learning.
Summary updated