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

Q-learning with Posterior Sampling

Priyank Agrawal, Shipra Agrawal, Azmat Azati

Overview

This paper introduces PSQL (Q-Learning with Posterior Sampling), a simple and efficient reinforcement learning algorithm that uses Bayesian Gaussian posteriors to drive exploration. The authors bridge a long-standing gap between theory and practice by proving that this Thompson Sampling-style approach achieves near-optimal regret bounds—meaning it learns nearly as fast as theoretically possible—while significantly outperforming traditional "optimistic" methods in experiments.

The Exploration-Exploitation Challenge

In Reinforcement Learning (RL), an agent must balance exploration (trying new things to learn) and exploitation (using what it knows to get rewards). There are two main ways to handle this:

  1. Upper Confidence Bound (UCB): Adding a mathematical "bonus" to uncertain actions. While easy to analyze theoretically, it often results in overly cautious, "stiff" exploration in practice.
  2. Posterior Sampling (Thompson Sampling): Maintaining a probability distribution (posterior) over possible values and picking an action by sampling from it. This usually works much better in the real world but is notoriously difficult to prove guarantees for in RL.

The primary mathematical hurdle for proving bounds on posterior sampling in RL is recursion. Because Q-learning "bootstraps" (estimating the value of a current state based on the estimated value of the next state), errors can accumulate. Specifically, the probability that a random sample is "optimistic" enough to encourage exploration dies out exponentially as the planning horizon gets longer.

Introducing PSQL

To overcome these challenges, the authors introduce PSQL, which treats Q-values as random variables with Gaussian distributions.

  • Bayesian Derivation: The authors provide a novel proof showing that the classic Q-learning update rule is actually the solution to a "regularized Evidence Lower Bound" (ELBO) optimization problem. This gives a formal Bayesian justification for the learning rates used in modern RL.
  • The "Optimistic" Target: To solve the problem of vanishing optimism, the algorithm uses a specific trick in its update step. When calculating the "target" value for the next state, instead of taking a single sample, it takes the maximum of $J$ samples. This ensures that the agent remains sufficiently optimistic about the future to keep exploring effectively.
  • Gaussian Posteriors: Unlike complex model-based methods that track transitions between every state, PSQL simply maintains a mean and variance for the Q-values of each state-action pair, making it computationally lightweight and model-free.

Key Insights and Results

Theoretical Guarantees

The paper proves a regret bound of $\tilde{O}(H^2\sqrt{SAT})$. In plain English: the "mistakes" the agent makes grow only with the square root of time, closely matching the theoretical lower limit ($\Omega(H\sqrt{SAT})$) for how fast any agent can learn this type of environment.

Theoretical Regret Bounds Comparison

Most posterior sampling proofs rely on "model-based" RL (building a full map of state transitions). PSQL achieves similar theoretical performance while being "model-free," which is much more scalable for complex systems.

Empirical Superiority

The authors evaluated PSQL on classic tabular RL benchmarks, including a one-dimensional "Chain" MDP and a two-dimensional "Grid-World". They compared PSQL against several heavyweights: UCBQL (the standard UCB-based Q-learner), RLSVI (Randomized Least-Squares Value Iteration), and Staged-RandQL.

Cumulative Regret Comparison

In head-to-head tests, PSQL (and its "vanilla" version, PSQL*) reached low regret much faster than UCBQL. It also showed much lower variance across different runs, suggesting it is more robust than other randomized exploration methods like RLSVI.

Limitations and Future Work

  • The "Vanilla" Gap: Interestingly, the "vanilla" version of the algorithm (using only one sample for the target) performed best in experiments, but the authors could only prove the near-optimal bounds for the version using $J$ samples. Closing this gap between the "provable" and "practical" versions is a key next step.
  • Horizon Dependence: The current bound has an $H^2$ dependence (where $H$ is the planning horizon). The authors suggest this might be improvable to $H$ or $H^{1.5}$ using more advanced concentration inequalities.
  • Scaling to Deep RL: This work focuses on "tabular" RL (where states and actions are discrete and finite). The ultimate goal is to extend these Bayesian insights to Deep Q-Networks (DQN) and other high-dimensional function approximation settings.

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