Amortized Variational Deep Q Network

Haotian Zhang, Yuhao Wang, Jianyong Sun, Zongben XuarXiv 2020

Abstract

The Amortized Variational Deep Q Network (AVDQN) introduces a computationally efficient approach to Bayesian Reinforcement Learning. By treating the action-value function ($Q$) as a random variable and employing an inference network to predict its distribution parameters, AVDQN avoids the parameter-heavy overhead of traditional Bayesian Neural Networks. Combined with a two-stage training schedule utilizing heavy-tailed Cauchy distributions for exploration, AVDQN achieves state-of-the-art performance in deep exploration tasks with significantly reduced training time and parameter counts compared to existing methods.

Introduction

In Deep Reinforcement Learning (DRL), "exploration" is the critical process of discovering novel strategies to maximize rewards. Standard algorithms, such as the original Deep Q Network (DQN), typically rely on "dithering" strategies like $\epsilon$-greedy, which add local noise to actions. While effective for simple environments, these methods often fail in complex scenarios requiring "deep exploration"—a long, specific sequence of actions necessary to encounter a reward.

Previous solutions utilized Bayesian Neural Networks (BNNs) to model uncertainty by treating every network weight as a random variable. However, BNNs are computationally expensive, slow to train, and often double the number of parameters. AVDQN addresses these challenges by applying the "amortization" trick—commonly used in Variational Autoencoders—to the Q-function itself.

Methods: Amortized Variational Inference

The core innovation of AVDQN is Amortized Variational Inference (AVI). Unlike Variational DQN (VDQN), which learns distributions for every weight, AVDQN uses a standard neural network to output the parameters (mean $\mu$ and variance $\sigma$) of the $Q$-value distribution directly.

Comparison of VDQN and AVDQN architectures. AVDQN uses an inference network to output distribution parameters directly, avoiding the weight-sampling overhead of traditional Bayesian RL.

Two-Stage Training Schedule

To balance the exploration-exploitation trade-off, the authors propose a two-stage sampling schedule:

  1. Pre-train Stage (Exploration): The agent samples $Q$-values from a Cauchy distribution. The heavy-tailed nature of the Cauchy distribution produces extreme values more frequently, forcing the agent to explore the state space widely.
  2. Fine-tune Stage (Exploitation): The agent switches to a Gaussian distribution, which is more concentrated, allowing the policy to converge on the best-discovered actions.

Additionally, the authors incorporate an entropy bonus into the loss function, mathematically proving that minimizing this modified DQN loss is equivalent to performing variational inference.

Experimental Results

The model was evaluated on OpenAI Gym benchmarks (CartPole, MountainCar) and a specialized Chain Markov Decision Process (MDP). The Chain MDP is a rigorous test for deep exploration where an agent must traverse $N$ states to reach a significant reward; any deviation results in a minor, distracting reward.

Performance on the Chain MDP (N=100). AVDQN successfully navigates the long sequence of states to find the global optimum, whereas standard DQN and NoisyNet fail to explore deeply enough.

Key Findings

  • Efficiency: AVDQN is 2x to 8x faster to train than VDQN and NoisyNet. Because it does not double the weights like a BNN, it maintains a parameter count similar to a standard DQN.
  • Superior Exploration: In the Chain MDP ($N=100$), AVDQN successfully reached the global optimum, while standard DQN and NoisyNet failed.
  • Benchmark Performance: In OpenAI Gym tasks like CartPole-v1, AVDQN consistently reached higher final rewards (achieving a perfect score of 500) faster than all baselines.

Discussion and Future Work

AVDQN demonstrates that making only the output ($Q$-values) probabilistic, rather than the entire network, provides the benefits of Bayesian exploration with a fraction of the computation. The use of heavy-tailed Cauchy noise provides a robust mathematical framework for encouraging "leaps of faith" during early training.

Future research may focus on automating the transition point between Cauchy and Gaussian sampling, which currently requires manual tuning. Additionally, while AVDQN excels in discrete action spaces, extending this amortized approach to continuous control and high-resolution visual inputs (such as the Atari suite) remains a promising direction.

Summary updated

BibTeX
@misc{zhang2020amortized,
  author = {Haotian Zhang and Yuhao Wang and Jianyong Sun and Zongben Xu},
  title = {{Amortized Variational Deep Q Network}},
  year = {2020},
  eprint = {2011.01706},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2011.01706},
}
Figure