# OPSRL-SSP: Optimistic Posterior Sampling for Stochastic Shortest Path with Minimax-Optimal Regret

OPSRL-SSP adds optimism to posterior sampling and matches minimax regret

Yiming Xu, Xian Wei, Cheng Chen · arXiv · 2026-11-8

- **Problem** Posterior sampling worked well on stochastic shortest path problems, but its regret bound was off by an extra square-root of S factor. That left open whether it could reach the minimax-optimal rate.
- **Method** OPSRL-SSP adds a virtual pseudo-state with an optimistic boundary value to the transition model. It then samples many candidate models per epoch and follows the policy that is optimistic under them.
- **Results** The authors prove a high-probability regret bound whose leading term B⋆√SAK matches the minimax lower bound. The extra terms are lower order.

![Figure 1: Cumulative regret of SSP algorithms on RandomMDP (left) and GridWorld (right) over 5,000 episodes. Curves are averaged over 500 runs; shaded areas sh…](https://refivu.com/papers/bc2f5c49-3b84-4fb5-a9d0-a0d585229c7e/figures/figure-f634b0e32d191c7875e39afc7bb84c37.png?thumb=512)

**Figure 1** : Cumulative regret of SSP algorithms on RandomMDP (left) and GridWorld (right) over 5,000 episodes. Curves are averaged over 500 runs; shaded areas show 95% confidence intervals.

[Original paper](https://arxiv.org/abs/2611.11337v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Yiming Xu, Xian Wei, Cheng Chen · OPSRL-SSP: Optimistic Posterior Sampling for Stochastic Shortest Path with Minimax-Optimal Regret · Original paper figure · Extracted the figure area from page 9 of the original PDF.

## Why posterior sampling misses the minimax rate

Stochastic shortest path problems ask an agent to reach a goal state while keeping its expected cumulative cost low. The difficulty is that the hitting time depends on the policy and may be unbounded under improper policies. Exploration therefore has to be designed so the agent doesn't fall into non-terminating behavior. High variance in value estimates from random hitting times makes provable regret guarantees harder to obtain.

Optimism-based methods have reached a leading regret term of order B⋆√SAK, up to log factors. A series of OFU studies progressively refined this result, culminating in that minimax-optimal leading term. OFU methods typically need explicit variance-aware optimism, built through confidence sets or exploration bonuses. Maintaining these uncertainty estimates and planning under the resulting optimistic models adds substantial computational overhead.

Posterior sampling, also known as Thompson sampling, avoids that machinery and remains empirically competitive.

PSRL-SSP extended posterior sampling to SSPs and showed strong empirical performance against OFU-type algorithms. Its regret bound carries an additional √S factor relative to the minimax lower bound. In Table 1, its leading term is B⋆S√AK, while the minimax-optimal methods have B⋆√SAK. This gap leaves the open question of whether posterior-sampling-based algorithms can achieve minimax-optimal regret in SSP.

Optimistic posterior sampling for finite-horizon MDPs suggested a route, but moving to SSPs raises two challenges.

## Injecting optimism through a pseudo-state

OPSRL-SSP adds a virtual pseudo-state s0 that no policy has to reach, and it routes the injected pseudo-counts into that state. The authors assign s0 the internal boundary value −2B⋆, so the planner sees it as a cheap exit that exists only inside the model. The intent is that at every state-action pair, some sampled model looks optimistic about the value, which the authors frame as the role of this virtual boundary condition.

The pseudo-state is a device for stationary cost-minimizing planning, since it supplies a boundary condition where a finite horizon would otherwise provide one. The prior may put zero pseudo-counts on some coordinates, and those coordinates stay fixed at zero while the strictly positive ones follow an ordinary Dirichlet law. The injected count n0,t(s, a) goes only to the transition into s0, so the physical transitions keep their own counts.

For analysis, the shifted value Uℓ = Ṽℓ + 2B⋆ is zero at s0, which the authors use to simplify control of the pseudo-count bias.

Without a fixed horizon, the number of posterior candidates must grow with global time so that failure probabilities stay summable. The schedule sets Jt from log(4SAπ²t²/δ) and log(1 − γ), where γ is specified in Proposition B.3. The inflation κt(s, a) = 2β⋆(δ, nt(s, a)) scales the pseudo-counts with the visit count, so each state-action pair keeps a constant lower bound on the chance of an optimistic candidate.

## One epoch from sampling to stopping

An epoch in OPSRL-SSP starts by copying the visit counts and injecting the optimistic pseudo-count into the pseudo-state s0. Each state-action pair then gets Jt sampled candidate transition rows, drawn over the extended space S̃. The algorithm solves these sampled models for the value Ṽℓ and the stationary policy πℓ, and follows that policy.

The policy is followed until one of the two stopping conditions fires, so the epoch length is set by the data.

The first stopping test is a count-doubling event at some state-action pair (s, a). It fires when nt(s, a) exceeds twice the count ntℓ(s, a) saved at the epoch's start time tℓ. The episode test fires when the current epoch has more episodes than the previous one. Together, the two tests limit epoch duration and control how many epochs the regret analysis must handle.

The stopping rules matter because SSP episode lengths are random and can be unbounded. A fixed policy therefore can't run for too long, so the algorithm updates its policy at epoch boundaries. The count-doubling test checks whether the data for some pair has grown enough to justify a fresh posterior sample. The episode test keeps epochs from growing without bound when counts change slowly.

When an epoch ends, the algorithm sets Kℓ to the episodes just completed and advances the epoch index ℓ. It then records the new start time tℓ and episode kℓ, and copies the counts again for the new epoch. Each new epoch therefore resamples the candidates, so optimism is refreshed with the latest data.

## How the regret bound closes

The variance analysis turns into the leading term once the regret itself is bounded inside the variance argument. Theorem 1 gives a regret bound of order B⋆√SAK plus B⋆S²A under strictly positive costs, with probability at least 1 − δ. The leading term matches the minimax lower bound Ω(B⋆√SAK) listed in the comparison table.

The proof applies Freedman's inequality to the primary martingale sequence and to the squared martingale-difference sequence. This reduces the problem to bounding the cumulative conditional variance along the true trajectory. That variance bound contains the regret RK, so the inequality feeds back on the quantity it bounds. The proof therefore needs a second step that decouples the error and variance terms.

In the first step, the Cauchy-Schwarz inequality bounds the error summation by a square-root variance term plus LOT0. The authors take LOT0 as O˜(B⋆S²A), which comes from summing the logarithmic decay terms. They then substitute the total variance bound into the regret bound, which gives the variance-dependent form with LOT1. The authors decouple the square root of X with the AM-GM inequality, which trades it for a linear term plus a constant.

They don't carry the recursive error term through, because multiplying by 2 removes its dependence on the error summation.

After substitution, the regret satisfies a quadratic self-bounding form RK ≤ a + b√RK. Completing the square turns this into RK ≤ 2a + 2b², where the constant 2b² equals Õ(B⋆SA). Because 2b² is absorbed into the state-complexity term B⋆S²A, the lower-order term in the final bound is B⋆S²A.

## Handling zero-cost transitions

The main theorem needs the minimum instantaneous cost cmin to be strictly positive, so zero-cost transitions need a separate step. The authors perturb every cost uniformly as cϵ(s, a) = max{c(s, a), ϵ} for a user-specified level ϵ \> 0. This construction makes the minimum cost of the perturbed model exactly ϵ, which is strictly positive. Because the perturbed instance meets the positive-cost condition, the analysis of Theorem 1 applies to it without modification once a valid upper bound on its optimal value is supplied.

Each perturbed cost lies between c(s, a) and c(s, a) + ϵ, so the realized cost of any trajectory can only grow. Lemma C.1 turns this into a pathwise bound: the regret RK in the original SSP is at most Rϵ\_K plus KϵT⋆. The proof evaluates the original optimal policy inside the perturbed model, which adds at most ϵT⋆ to its value. Lemma C.2 applies the same argument to the optimal value function, bounding Bϵ⋆ by B⋆ + ϵT⋆.

Theorem C.4 combines the perturbed regret bound with Lemma C.1, so the original SSP gets a bound with Bϵ in place of B⋆ plus KϵT⋆. The authors choose ϵ = 1/(K + ΓK), with ΓK = √SAK + S²A, which keeps the additive term at most T⋆ up to logarithmic factors. The guarantee still requires a valid input bound Bϵ on the perturbed optimal value, and the choice of ϵ uses only K, S and A.

The authors do not claim that this choice exactly minimizes the bound after the logarithmic factors are expanded.

## Fixed RandomMDP and GridWorld results

The authors ran each method for 500 independent runs of 5,000 episodes on two fixed SSP instances. The RandomMDP instance uses seed 6, with B⋆ ≈ 2.31 and cmin ≈ 0.0417. The GridWorld instance uses seed 1, with B⋆ ≈ 28.66 and cmin = 1. The two instances differ in state space and cost structure, so the comparison spans two cost settings. The plots show mean cumulative regret with pointwise 95% confidence intervals across runs.

The baselines include PSRL-SSP, the OFU methods UC-SSP, Bernstein-SSP, ULCVI, EB-SSP, SVI-SSP and LCB-ADVANTAGE-SSP, and ε-greedy Q-learning. On both instances, OPSRL-SSP performs competitively with ULCVI, SVI-SSP, EB-SSP and PSRL-SSP. It outperforms LCB-ADVANTAGE-SSP and ε-greedy Q-learning on both instances. On RandomMDP, OPSRL-SSP stays close to PSRL-SSP, EB-SSP and Bernstein-SSP, and it beats Q-learning and LCB-ADVANTAGE-SSP.

On GridWorld, it stays close to PSRL-SSP and EB-SSP and sits below Q-learning, LCB-ADVANTAGE-SSP and Bernstein-SSP. The authors read this as posterior sampling keeping its empirical efficiency while performing comparably to the tuned OFU methods.

ULCVI and SVI-SSP also perform strongly on these instances. OPSRL-SSP reaches that level without either of these finite-horizon or explicit-bonus constructions. The baselines' scaling factors were set by grid search, so the comparison depends on that tuning.

## Held-out cohort and ablations on J and n0

On 20 independently generated held-out RandomMDP instances, OPSRL-SSP's endpoint and nAUC point estimates sit below those of the tested ULCVI, EB-SSP, and LCB-ADVANTAGE-SSP configurations. Each instance runs 20 rollouts over 5,000 episodes, and the confidence intervals treat instances as the statistical units. Each instance keeps its sampled costs and transition kernel fixed across methods and across its 20 rollouts.

Because the intervals overlap heavily with PSRL-SSP, the held-out gap is small and the result reads as competitive.

On RandomMDP, the ablation varies J over 1, 4, 8, 16, and 32 while keeping the prior configuration fixed. Increasing J produces a slight increase in cumulative regret, which the authors read as a gap between worst-case theory and average-case behavior. The theory prescribes a schedule that grows like log T to guarantee optimism uniformly over time under worst-case dynamics.

The authors argue that evaluating several transition models and planning greedily on minimum expected cost adds excessive optimism. Because the effect of J is marginal compared with the gap between minimax-optimal methods and baselines, the authors fix J = 1. The practical implementation sets J = 1 through sample\_cap, which avoids maintaining J ≈ log(T) candidates.

The second ablation keeps J = 1 and a total initial prior mass of 0.126, then varies how much of that mass goes to the optimistic pseudo-state n0. The n0 values tested are 0.00, 0.01, 0.02, 0.05, 0.08, and 0.10, with the residual mass spread evenly as Dirichlet smoothing over physical transitions. Regret follows a U-shaped trend, because a larger n0 strengthens optimistic bias but weakens smoothing over real states, raising posterior-update variance.

At n0 = 0.00 the agent lacks optimism and explores too little, while at n0 = 0.10 the optimistic prior dominates and biases learning. The authors place the optimum at n0 = 0.05, which performs comparably to PSRL-SSP. The practical choice keeps the base prior at 0.0095 and the pseudo-mass at 0.05 for the held-out runs.

![Figure 3: Cumulative regret of OPSRL-SSP for varying numbers of posterior samples J∈ {1,4,8,16,32}](https://refivu.com/papers/bc2f5c49-3b84-4fb5-a9d0-a0d585229c7e/figures/figure-b1e0238ea60e8702425b43996fdf9557.png?thumb=512)

**Figure 3** : Cumulative regret of OPSRL-SSP for varying numbers of posterior samples J∈ {1,4,8,16,32}.

[Original paper](https://arxiv.org/abs/2611.11337v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)

## Limitations and what remains untested

The authors name one hard requirement: OPSRL-SSP needs knowledge of B⋆ to run. They point to a doubling scheme, similar to the one in \[9\], as the route to remove this requirement in future work. The zero-cost extension depends on a valid perturbed bound Bϵ, which the algorithm must receive as input. That extension also adds the term KϵT⋆ to the regret bound, so the perturbation level directly affects the final guarantee.

The practical implementation doesn't use the theoretical schedules for J, the base prior and the pseudo-count. Instead, it sets J = 1, uses a constant base Dirichlet prior of 0.0095, and injects a fixed pseudo-count mass at each epoch start. The authors state that the theoretical schedule Jt is a worst-case device for uniform optimism, not an empirical recommendation to explore more.

They also note that a larger Jt can cause over-exploration in benign stochastic environments.

All experiments are tabular, on RandomMDP, GridWorld and the held-out RandomMDP cohort. So the paper doesn't test larger state spaces or function approximation settings. The SVI-SSP diagnostic uses B = 5.1, above the audited maximum B⋆ ≈ 4.9853 among these 20 instances. The fixed-instance comparisons use only two instances, RandomMDP with seed 6 and GridWorld with seed 1.

## Paper info

- **Authors**: Yiming Xu, Xian Wei, Cheng Chen
- **Venue**: arXiv · Preprint
- **First published**: 2026-11-8
- **Added**: 2026-11-10
- **Updated**: 2026-11-8
- **Version**: v1
- **arXiv**: 2611.11337
- **Category**: cs.LG
- **Original paper terms**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **What we show**: Paper info, commentary and permitted figures from the original paper

[Original paper ↗](https://arxiv.org/abs/2611.11337v1) · [PDF ↗](https://arxiv.org/pdf/2611.11337v1)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Abstract

We study online reinforcement learning for the stochastic shortest path (SSP) problem with unknown transition dynamics. Although existing posterior-sampling methods perform well empirically on SSPs, their regret guarantees do not achieve the minimax-optimal order. We address this limitation by proposing OPSRL-SSP, an optimistic posterior-sampling algorithm for the SSP setting. The algorithm operates in epochs and uses a logarithmic, time-dependent schedule for the number of posterior samples. To induce optimism, we augment the transition model with a pseudo-state assigned an optimistic boundary value. We establish a high-probability regret bound of $\\tilde{O}(B\_\\star \\sqrt{SAK} + B\_\\star S^2 A)$, where $B\_\\star$ is an upper bound on the expected cost of the optimal policy, $S$ and $A$ are the numbers of states and actions, respectively, and $K$ is the number of episodes. In addition, we extend the analysis to general zero-cost SSPs using a universal cost-perturbation argument. The leading term matches the minimax lower bound $Ω(B\_\\star \\sqrt{SAK})$, thereby addressing the open problem raised by Jafarnia-Jahromi et al. \[19\] for posterior sampling in the SSP setting.

## Quote from the paper

Yiming Xu, Xian Wei, Cheng Chen (2026). OPSRL-SSP: Optimistic Posterior Sampling for Stochastic Shortest Path with Minimax-Optimal Regret. arXiv:2611.11337v1. https://arxiv.org/abs/2611.11337v1

**BibTeX**

```
@misc{xu2026opsrl,
  title = {{OPSRL-SSP: Optimistic Posterior Sampling for Stochastic Shortest Path with Minimax-Optimal Regret}},
  author = {Yiming Xu and Xian Wei and Cheng Chen},
  year = {2026},
  eprint = {2611.11337},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.11337v1}
}
```

## Other paper commentary

- [Target Recoverability under Selective Labels: A Failure Mode in ECG-Based Acute Coronary Syndrome Prediction](https://refivu.com/en/papers/6be5f693-4010-4ca4-a6a8-74c4cb667334-target-recoverability-under-selective-labels-a-failure-mode.md)
- [But It Was True When I Checked: Compiling SHOP-Style Method Preconditions into Partially-Ordered HTN Planning](https://refivu.com/en/papers/dfa127c3-d21a-4d60-a1c0-9b867b0008c3-but-it-was-true-when-i-checked-compiling.md)
- [Learning to Rank Propagators in Constraint Programming](https://refivu.com/en/papers/c113b866-d02f-420e-897f-5b5ecb0f1080-learning-to-rank-propagators-in-constraint-programming.md)
- [Pixels over Symbols: Sensory Realism Improves Behavioral Alignment in Models of Cognition](https://refivu.com/en/papers/f163388c-619b-4473-b0c2-357e1b91ea25-pixels-over-symbols-sensory-realism-improves-behavioral.md)
- [Guiding future global temperature distributions with simulations and observations](https://refivu.com/en/papers/0f0e0eec-05c1-4800-8206-66b04e61e097-guiding-future-global-temperature-distributions-with.md)
- [Beyond the Mean Gap: What Transferred-Angle QAOA Retains on a Superconducting Processor](https://refivu.com/en/papers/8f033d4e-6221-47eb-ba57-a9271b2927e9-beyond-the-mean-gap-what-transferred-angle-qaoa.md)
- [Evaluating generative samplers for lattice field theory by scale](https://refivu.com/en/papers/ffebee2e-98b3-4531-bbf3-2e6466767ca8-evaluating-generative-samplers-for-lattice-field-theory-by.md)
- [Think or Remember: The Exchange Rate of Agentic Inference](https://refivu.com/en/papers/430e6cf8-4d25-4ea8-8672-86be1d22daf9-think-or-remember-the-exchange-rate-of-agentic.md)
- [Identifiable alignment of unpaired representations](https://refivu.com/en/papers/d1142187-968e-4d40-b99f-8cc798e1c8a1-identifiable-alignment-of-unpaired-representations.md)
- [How to "train" a surgeon? Benchmarking generalist agents in surgical scene understanding](https://refivu.com/en/papers/c14fcb0f-7658-4cdb-aab2-a512b0b5e61c-how-to-train-a-surgeon-benchmarking-generalist-agents.md)
- [AbductionBench: Benchmarking Abductive Reasoning in Large Language Models](https://refivu.com/en/papers/5447aa31-8498-47e7-ac8b-ac02bc06c0bc-abductionbench-benchmarking-abductive-reasoning-in-large.md)

## Terms in this paper

- [Q-learning](https://refivu.com/en/terms/e20b416cb2f7-q-learning)
- [Assumption 1](https://refivu.com/en/terms/5dc7d1083944-assumption-1)
- [minimax lower bound](https://refivu.com/en/terms/d9c37abbb999-minimax-lower-bound)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/bc2f5c49-3b84-4fb5-a9d0-a0d585229c7e-opsrl-ssp-optimistic-posterior-sampling-for-stochastic)
