Abstract
In the realm of reinforcement learning (RL), the Stochastic Shortest Path (SSP) model provides a robust framework for goal-oriented tasks where an agent seeks to reach a target state with minimum cumulative cost. Unlike finite-horizon or discounted MDPs, SSP involves variable episode lengths, introducing the risk of "improper policies" that may never reach the goal. This paper, originally presented at ICML 2021, introduces PSRL-SSP, the first posterior sampling-based algorithm specifically designed for the SSP setting. By utilizing Bayesian sampling rather than traditional optimistic exploration, PSRL-SSP achieves state-of-the-art performance, bridging the gap between theoretical efficiency and practical utility.
Introduction
Most reinforcement learning research focuses on two primary settings: finite-horizon MDPs, where tasks terminate after a fixed number of steps, and discounted MDPs, where future rewards are mathematically attenuated. However, many real-world problems—such as robotic navigation or strategic gaming—are better modeled as Stochastic Shortest Paths. In an SSP, the agent must reach a specific goal state while minimizing total costs, but the time to completion is not fixed; it depends entirely on the agent's policy.
Historically, algorithms for SSP have relied on the Optimism in the Face of Uncertainty (OFU) principle. While OFU methods provide strong theoretical guarantees, they are often notoriously conservative in practice, leading to slow learning. Posterior Sampling (PS), or Thompson Sampling, offers a more efficient alternative by sampling from a distribution of possible environments. However, applying PS to SSP is non-trivial due to the variable episode lengths and the potential for an agent to become trapped in cycles that never reach the goal.
The PSRL-SSP Algorithm
PSRL-SSP (Posterior Sampling Reinforcement Learning for SSP) addresses these challenges by maintaining a posterior distribution over the unknown environment dynamics. The algorithm operates in a sequence of epochs. At the start of each epoch, the agent samples a model from its current posterior and follows the optimal policy for that specific sample.
Dual Stopping Criteria
The primary innovation of PSRL-SSP lies in its two distinct stopping criteria, which determine when an epoch ends and a new model should be sampled:
- Goal-Visit Criterion: A new epoch is triggered if the number of times the agent reached the goal in the current epoch exceeds the total goal visits in the previous epoch. This ensures that the number of policy updates grows at a controlled rate (approximately $\sqrt{K}$).
- Doubling Criterion: To prevent the agent from following an "improper" sampled policy—one that fails to reach the goal—the algorithm monitors the number of visits to each state-action pair. If any visit count doubles, the epoch ends immediately. This acts as a safety mechanism, forcing the agent to incorporate new data and resample when it spends excessive time in a specific region of the state space.
Theoretical Contributions
The authors establish a near-optimal Bayesian regret bound for PSRL-SSP of $\tilde{O}(B_* S \sqrt{AK})$, where:
- $B_*$ is the maximum expected cost to reach the goal from any state under the optimal policy.
- $S$ and $A$ represent the number of states and actions, respectively.
- $K$ is the number of episodes.
To achieve this tight bound, the researchers utilized Bernstein-type concentration inequalities. This mathematical approach allowed them to derive a regret bound that is less sensitive to the minimum possible cost of a single action, a common bottleneck in previous SSP analyses.
Empirical Performance
PSRL-SSP was evaluated against leading OFU-based algorithms, such as UC-SSP and EB-SSP, on two standard benchmarks:
- RandomMDP: A stochastic environment with 8 states and 2 actions where transitions and costs are randomized.
- GridWorld: A $3 \times 4$ grid where an agent must navigate from a start position to a goal. This environment tests the agent's ability to handle stochastic movement (85% success rate) and uniform step costs.
In both scenarios, PSRL-SSP significantly outperformed its optimistic counterparts. In the GridWorld task, PSRL-SSP converged to the optimal path much faster than UC-SSP or EB-SSP. Notably, some optimistic algorithms failed to show significant learning even after 80,000 episodes, whereas PSRL-SSP demonstrated rapid adaptation.
Key Insights and Future Directions
One of the most significant advantages of PSRL-SSP is its computational simplicity. Unlike OFU methods, which often require solving complex constrained optimization problems to find the "most optimistic" model, PSRL-SSP simply samples a model and solves the standard Bellman equation. Furthermore, the algorithm is largely hyperparameter-free, requiring only a prior distribution (such as a Dirichlet prior) to function effectively.
Despite its success, several avenues for future research remain:
- Regret Gap: There remains a $\sqrt{S}$ gap between the current Bayesian regret bound and the theoretical minimax lower bound.
- Continuous Spaces: Extending the algorithm to handle continuous state and action spaces via function approximation (e.g., neural networks) is a vital next step for scaling to complex real-world tasks.
- Model-Free Variants: As a model-based approach, PSRL-SSP requires maintaining a distribution over transitions. Developing a model-free version of posterior sampling for the SSP setting remains an open challenge.
In conclusion, PSRL-SSP represents a major step forward for goal-oriented reinforcement learning, proving that posterior sampling is not only theoretically sound for variable-length episodes but also practically superior to traditional optimistic methods.
Summary updated