Uncertainty-Based Offline Reinforcement Learning with Diversified Q-Ensemble

Gaon An, Seungyong Moon, Jang-Hyun Kim, Hyun Oh Song

Overview

Researchers have discovered that the "extrapolation error" in offline reinforcement learning—where agents overconfidently chase hallucinated rewards—can be mitigated by simply increasing the number of Q-networks in an ensemble. By introducing a novel "gradient diversification" penalty, their proposed algorithm, EDAC (Ensemble-Diversified Actor-Critic), achieves state-of-the-art performance using 90% fewer networks than a naive ensemble, all without needing to estimate the original behavior policy.

Introduction & Motivation

In standard "online" Reinforcement Learning (RL), an agent learns by trial and error, receiving immediate feedback from the environment. In Offline RL, however, the agent is handed a static dataset and tasked with finding the optimal policy without ever interacting with the environment during training.

The primary obstacle in offline RL is extrapolation error. When the agent evaluates an action not present in the dataset (Out-of-Distribution, or OOD), the neural networks (Q-functions) often predict erroneously high rewards. Unable to "fact-check" these values with the environment, the agent gets trapped in a feedback loop of overoptimism, leading to catastrophic policy failure.

Previous solutions, such as CQL, attempt to force the agent to stay close to the data or explicitly penalize OOD actions. However, these methods often require complex estimations of the "behavior policy" (how the data was originally collected) or expensive sampling of OOD points.

Methods: From SAC-N to EDAC

The authors propose a surprisingly simple starting point based on Clipped Q-learning. In online RL, it is common practice to use two Q-networks and take the minimum of their predictions to prevent slight overestimation. The authors hypothesized: What if we scaled up the number of networks significantly?

  1. SAC-N (Naive Ensemble): They first tested a naive ensemble approach where they increased the number of Q-networks ($N$) to 10, 20, or even 500. By taking the minimum across a massive ensemble, the agent becomes highly pessimistic about any action where the networks disagree (indicating high uncertainty).
Training performance of SAC-N across different ensemble sizes compared to CQL.
  1. EDAC (Ensemble-Diversified Actor-Critic): While SAC-N is effective, running 500 neural networks is computationally prohibitive. The authors observed that the ensemble only functions effectively if the networks "disagree" in useful ways. If all networks share similar gradients, they fail to penalize OOD actions properly.
  2. The Diversification Trick: To solve this, EDAC introduces a penalty term that minimizes the cosine similarity between the gradients of the Q-networks. This forces the networks to learn diverse features. This engineered "disagreement" allows EDAC to achieve the same level of pessimism and performance with only 10–50 networks that SAC-N achieved with 500.

Key Insights and Mechanisms

  • Pessimism via Uncertainty: The "min" operation in an ensemble mathematically approximates a Lower Confidence Bound (LCB). It naturally penalizes actions with high epistemic uncertainty—regions where the model lacks data.
The clip penalty gap between OOD and in-distribution actions increases with larger ensemble sizes.
  • The Gradient Alignment Problem: The paper identifies a specific failure mode in standard ensembles: when Q-networks are trained on the exact same data, their gradients tend to align. When gradients align, the variance of their predictions for OOD actions remains low, tricking the agent into believing those unexplored actions are safe.
  • No Behavior Modeling Needed: Unlike many leading offline RL algorithms, EDAC does not need to learn a model of the behavior policy. This makes it significantly more robust in complex environments where the original data-collection strategy is unknown, suboptimal, or multi-modal.

Experimental Setup and Results

The researchers evaluated their methods on the D4RL benchmark, the standard for offline RL, which includes MuJoCo Gym tasks (HalfCheetah, Hopper, Walker2d) and highly complex Adroit robotic hand manipulation tasks.

  • New State-of-the-Art: EDAC and SAC-N outperformed the previous leading method (CQL) across almost all D4RL Gym tasks. In certain "Random" and "Medium" datasets, they reduced the performance gap to an online expert by 40%.
  • Efficiency: On the "Hopper" task, SAC-N required 500 networks to succeed. EDAC achieved the same result with fewer than 50 networks.
  • Speed and Memory: Despite utilizing an ensemble, EDAC is actually faster to train than CQL. CQL requires expensive "logsumexp" sampling to penalize OOD actions, whereas EDAC’s ensemble operations are embarrassingly parallelizable on modern GPUs.

Limitations and Future Work

While EDAC drastically reduces the required number of networks, it still demands more memory and computation than a single-network approach. Scaling this methodology to massive, high-resolution vision-based RL tasks remains a challenge. Additionally, the diversification weight and the number of networks ($N$) introduce new hyperparameters to tune. Finally, while the paper provides a strong empirical foundation, the authors suggest that formal theoretical analysis regarding how gradient diversification affects the Bellman operator's contraction would be a valuable next step.

Summary updated

BibTeX
@inproceedings{an2021uncertainty,
  author = {Gaon An and Seungyong Moon and Jang-Hyun Kim and Hyun Oh Song},
  title = {{Uncertainty-Based Offline Reinforcement Learning with Diversified Q-Ensemble}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=dON7nRSe_Xe},
}
Figure