NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Q-learning with Posterior Sampling

Priyank Agrawal, Shipra Agrawal, Azmat Azati · DOI

Introduction

In Reinforcement Learning (RL), agents must navigate the fundamental trade-off between exploration (gathering new information) and exploitation (leveraging existing knowledge). While Upper Confidence Bound (UCB) methods have long enjoyed rigorous theoretical support, practitioners often favor Posterior Sampling (or Thompson Sampling) for its superior empirical performance in deep RL applications.

However, providing theoretical guarantees for model-free posterior sampling has proven difficult. The primary obstacle is bootstrapping: because Q-learning updates current estimates based on future estimates, errors and uncertainties can compound exponentially as they propagate backward through time. This work introduces Q-Learning with Posterior Sampling (PSQL), bridging this gap by providing a mathematically rigorous analysis of a simple, Gaussian-based posterior sampling algorithm.

The PSQL Algorithm

PSQL treats Q-values as random variables following a Gaussian distribution. The algorithm's design is rooted in three key innovations:

  1. Bayesian Derivation: The authors demonstrate that the standard Q-learning update rule can be derived from a Bayesian inference problem using a "regularized Evidence Lower Bound (ELBO)." This provides a formal justification for the specific learning rate schedules ($\alpha_n = \frac{H+1}{H+n}$) required for efficiency.
  2. Action Selection: At each step, the agent samples a Q-value from the posterior for each action and selects the one with the highest sample.
  3. Optimistic Target Construction: To prevent "optimism decay"—where uncertainty vanishes too quickly in recursive updates—the algorithm uses a specific trick. It calculates the update target by taking the maximum of $J$ samples from the posterior of a "special" optimistic action, ensuring the agent remains sufficiently curious without allowing errors to destabilize the learning process.

Theoretical Contributions

The core achievement of this work is the proof of a near-optimal regret bound. PSQL achieves a regret of $\tilde{O}(H^2\sqrt{SAT})$, which closely matches the theoretical lower bound of $\Omega(H\sqrt{SAT})$. This places PSQL on par with the most efficient known algorithms while maintaining the simplicity of a model-free approach.

Comparison of regret bounds for various RL algorithms; PSQL achieves a near-optimal $\tilde{O}(H^2\sqrt{SAT})$ bound.

Empirical Performance

The algorithm was evaluated on classic tabular benchmarks, including a one-dimensional "Chain" MDP and a two-dimensional "Grid-world." These tests challenge an agent's ability to maintain exploration over long horizons and navigate risks.

In head-to-head comparisons, PSQL and its "vanilla" variant (PSQL) significantly outperformed traditional baselines like UCBQL and randomized value iteration methods like RLSVI. Notably, PSQL demonstrated lower variance across runs, suggesting it is more stable and reliable than previous randomized approaches.

Cumulative regret comparison on tabular benchmarks, showing PSQL* outperforming UCBQL and RLSVI.

Key Insights and Future Directions

  • Entropy and Learning Rates: The discovery that entropy regularization weights correspond directly to learning rates provides a powerful new lens for understanding Q-learning dynamics.
  • Model-Free Simplicity: By placing the posterior directly on Q-values rather than complex transition models, PSQL aligns more closely with modern "Noisy Network" styles used in deep RL.

While this work provides a breakthrough for tabular MDPs, extending this rigorous analysis to function approximation (using neural networks) remains a major goal for future research. Additionally, the authors noted that the "vanilla" version (PSQL*) often performs better in practice than the version required for the mathematical proof, suggesting that even tighter theoretical tools may yet be discovered.

Summary updated

BibTeX
@inproceedings{agrawal2026q,
  author = {Priyank Agrawal and Shipra Agrawal and Azmat Azati},
  title = {{Q-learning with Posterior Sampling}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=a4z7OlgSxC},
}
Figure