Abstract
Uncertainty quantification in reinforcement learning can greatly improve exploration and robustness. Approximate Bayesian approaches have recently been popularized to quantify uncertainty in model-free algorithms. However, so far the focus has been on improving the accuracy of the posterior approximation, instead of studying the accuracy of the prior and likelihood assumptions underlying the posterior. In this work, we demonstrate that there is a cold posterior effect in Bayesian deep Q-learning, where contrary to theory, performance increases when reducing the temperature of the posterior. To identify and overcome likely causes, we challenge common assumptions made on the likelihood and priors in Bayesian model-free algorithms. we empirically study prior distributions and show through statistical tests that the common Gaussian likelihood assumption is frequently violated. We argue that developing more suitable likelihoods and priors should be a key focus in future Bayesian reinforcement learning research and we offer simple, implementable solutions for better priors in deep Q-learning that lead to more performant Bayesian algorithms.
Introduction: The Cold Posterior Paradox
In theory, Bayesian methods represent the "gold standard" for reinforcement learning. By maintaining a posterior distribution over possible models, an agent can leverage Thompson sampling or optimism-based exploration to navigate complex environments. However, in practice, these methods often struggle to outperform simple ensembles of non-Bayesian estimators.
A primary culprit is the cold posterior effect in Deep Q-Learning (DQN). This phenomenon occurs when the algorithm performs best only when the posterior distribution is "cooled" (sharpened) by a temperature parameter $T < 1$, effectively ignoring the very uncertainty the Bayesian framework is designed to provide. This research investigates whether this gap stems from flawed mathematical frameworks or, more likely, incorrect assumptions regarding priors (initial beliefs) and likelihoods (data modeling).
Methodology
The study utilizes Parallel Q-learning (PQN) combined with a Gradient Guided Monte Carlo (GGMC) sampler. To diagnose and address performance gaps, the authors introduced several diagnostic and corrective components:
- Empirical Analysis: Using Q-Q plots and Kolmogorov-Smirnov (KS) tests, the researchers compared the actual distribution of neural network weights and temporal difference (TD) errors against standard Gaussian assumptions.
- Laplace Priors: As an alternative to standard Gaussian priors (L2 regularization), the authors proposed Laplace priors to better match the heavy-tailed weight distributions observed in trained networks.
- Meta-learned Priors: Using Normalizing Flows, the team learned prior distributions from weights of agents trained across various tasks (Gymnax suite) and applied these "learned priors" to new environments (MinAtar).
- Learned Likelihoods: The authors experimented with fitting normalizing flows directly to TD errors to create an "oracle" likelihood model.
Empirical Insights: Flawed Assumptions
The investigation revealed that standard assumptions in Bayesian RL are fundamentally misspecified:
- The Gaussian Assumption is Flawed: Trained Q-network weights are significantly more heavy-tailed than Gaussian distributions. Standard Gaussian priors "starve" the model of realistic parameter configurations.
- TD Errors are Non-Normal: Statistical tests confirmed that TD errors are rarely Gaussian or Logistic. These distributions vary significantly between environments and evolve throughout the training process.
- Priors Generalize: Interestingly, priors learned on one set of tasks (Gymnax) significantly improved performance on different tasks (MinAtar), suggesting that effective neural network weights share common statistical properties across RL problems.
Key Results
- Closing the Gap: Switching to a Laplace prior—a change requiring only one line of code—consistently outperformed Gaussian priors across MinAtar benchmarks.
- Meta-Learning Success: Meta-learned priors using normalizing flows nearly closed the "cold posterior gap" in environments like SpaceInvaders and Freeway, allowing agents to perform well at the theoretically correct temperature ($T=1$).
- Superior Exploration: In the Deep Sea environment, Bayesian DQN with improved priors demonstrated a significantly higher solve rate than standard Maximum A Posteriori (MAP) estimation, validating that better priors directly translate to more effective exploration.
Conclusion and Future Work
While this work successfully addresses prior misspecification, the likelihood remains a challenge. Experiments with "oracle" learned likelihoods occasionally hindered performance, as the resulting loss landscapes were too sharp for standard gradient-based optimizers. Future research should focus on developing likelihood functions that are both statistically accurate and optimization-friendly (smooth). Extending these insights from value-based methods to policy gradient and actor-critic architectures remains a vital next step for the field.
Summary updated