Abstract
In reinforcement learning, Monte Carlo algorithms update the Q function by averaging the episodic returns. In the Monte Carlo UCB (MC-UCB) algorithm, the action taken in each state is the action that maximizes the Q function plus a UCB exploration term, which biases the choice of actions to those that have been chosen less frequently. Although there has been significant work on establishing regret bounds for MC-UCB, most of that work has been focused on finite-horizon versions of the problem, for which each episode terminates after a constant number of steps. For such finite-horizon problems, the optimal policy depends both on the current state and the time within the episode. However, for many natural episodic problems, such as games like Go and Chess and robotic tasks, the episode is of random length and the optimal policy is stationary. For such environments, it is an open question whether the Q-function in MC-UCB will converge to the optimal Q function; we conjecture that, unlike Q-learning, it does not converge for all MDPs. We nevertheless show that for a large class of MDPs, which includes stochastic MDPs such as blackjack and deterministic MDPs such as Go, the Q-function in MC-UCB converges almost surely to the optimal Q function. An immediate corollary of this result is that it also converges almost surely for all finite-horizon MDPs. We also provide numerical experiments, providing further insights into MC-UCB.
Introduction
Reinforcement learning (RL) typically relies on two primary methods for updating value estimates: Q-learning, which utilizes dynamic programming to update estimates step-by-step, and Monte Carlo (MC) methods, which update estimates based on the total return received at the end of an episode. While Q-learning is mathematically guaranteed to converge in most standard environments, the theoretical foundations for Monte Carlo methods—specifically those employing Upper Confidence Bounds (UCB) for exploration—have remained incomplete.
Existing literature on Monte Carlo UCB (MC-UCB) has largely focused on finite-horizon problems, where episodes terminate after a fixed number of steps. In these settings, the optimal policy is time-dependent. However, many complex real-world tasks, including strategic games like Chess and Go or robotic navigation, are characterized by random-length episodes where termination depends on reaching a specific state (e.g., winning, losing, or reaching a goal). In these scenarios, the optimal policy is stationary. This paper addresses the open question of whether MC-UCB converges to the optimal stationary policy in random-length environments.
The Optimal Policy Feed-Forward (OPFF) Class
The authors identify a broad class of environments termed Optimal Policy Feed-Forward (OPFF) MDPs. In an OPFF MDP, following the optimal policy ensures that the agent never revisits a state it has already encountered. This class is remarkably inclusive, encompassing:
- Deterministic games like Go.
- Stochastic games like Blackjack.
- Monotonic tasks where progress is inherently directional.
By focusing on OPFF MDPs, the environment can be treated similarly to a Directed Acyclic Graph (DAG) under the optimal policy, which facilitates a rigorous mathematical proof of convergence.
Methodology: First-Visit MC-UCB
The study focuses on First-visit MC-UCB. The algorithm selects actions by maximizing the sum of the current action-value estimate ($Q$) and an exploration term that increases for actions that have been sampled less frequently.
To address the complexities of random-length episodes, the authors implement two critical mechanisms:
- Loop Detection: Since suboptimal policies might lead to infinite cycles in non-finite horizons, the algorithm incorporates a time limit ($M$) and a mechanism to break out of detected cycles.
- Backward Induction Proof: The convergence proof utilizes the Strong Law of Large Numbers (SLLN). By starting from terminal states and working backward, the authors demonstrate that as the number of episodes approaches infinity, the probability of selecting a suboptimal action vanishes, while optimal actions are sampled sufficiently to converge to their true values.
Empirical Evaluation
The theoretical findings were validated using two classic reinforcement learning benchmarks:
1. Blackjack
As a stochastic card game where the state changes monotonically, Blackjack serves as a primary example of an OPFF MDP. In experiments, MC-UCB performed on par with Monte Carlo with Exploring Starts (MCES). Notably, MC-UCB converged faster than MCES in terms of the action-value function, despite MC-UCB using a more realistic exploration strategy that starts every episode from the same initial state.
2. Stochastic Cliff-Walking
This 2D grid-world task requires an agent to reach a goal while avoiding a "cliff." The authors introduced environmental noise (stochastic "wind") to test robustness. MC-UCB variants successfully converged to the optimal value function even in the presence of this stochasticity, achieving competitive performance against baseline methods.
Key Insights and Implications
- Theoretical Bridge: This work provides the first formal proof that MC-UCB converges "almost surely" to the optimal solution for random-length episodes in OPFF environments.
- Finite-Horizon as a Corollary: The authors demonstrate that all finite-horizon MDPs are technically a subset of OPFF MDPs (since time is a state component that only moves forward). Consequently, this proof serves as a general convergence guarantee for the finite-horizon case as well.
- Practicality over MCES: Unlike MCES, which requires the ability to start episodes from arbitrary state-action pairs, MC-UCB is applicable to standard episodic settings where the agent always starts from a fixed initial state.
Conclusion and Future Work
While this paper establishes a significant theoretical milestone for MC-UCB in OPFF environments, it also highlights remaining challenges. The authors conjecture that MC-UCB may not converge for all general MDPs, particularly those where the optimal policy involves cycles. Future research is needed to find concrete counter-examples for non-OPFF environments and to establish tight regret bounds for the random-length setting. Additionally, extending this theory to two-player zero-sum games remains a vital step toward fully understanding the success of modern AI systems like AlphaZero.
Summary updated