Entropy-regularized Diffusion Policy with Q-Ensembles for Offline Reinforcement Learning

Ruoqi Zhang, Ziwei Luo, Jens Sjölund, Thomas B. Schön, Per Mattsson

This paper, presented at NeurIPS 2024, introduces a robust framework for training diffusion-based policies in offline reinforcement learning (RL). By leveraging a mean-reverting stochastic differential equation (SDE) and a large ensemble of Q-networks, the authors provide a way to balance exploration and pessimism, leading to state-of-the-art results on challenging benchmarks like D4RL.

TL;DR

The authors propose an entropy-regularized diffusion policy for offline RL that makes policy entropy tractable via a mean-reverting SDE. Combined with a pessimistic Q-ensemble approach, this method significantly improves training stability and performance, particularly in sparse-reward environments like AntMaze.

What Problem Does This Paper Address?

Offline RL involves learning optimal behaviors from a fixed, pre-collected dataset without any further environment interaction. This is notoriously difficult due to distribution shift: when a learned policy attempts an action not well-represented in the training data, the Q-value function (which estimates the expected reward) often produces wildly overestimated values.

While diffusion models have emerged as powerful tools for representing the complex, multi-modal action distributions found in offline datasets, they face two major hurdles:

  1. Intractable Entropy: Standard diffusion models make it nearly impossible to calculate the log-probability of a policy, which is required for the "Maximum Entropy" framework that helps agents explore and "stitch" together suboptimal trajectories.
  2. Overestimation: Without proper regularization, diffusion policies can still overfit to noise or gravitate toward high-uncertainty, out-of-distribution (OOD) actions.

Methods

The authors introduce three core innovations to solve these problems:

  1. Mean-Reverting SDE: Instead of standard diffusion, they use a mean-reverting SDE (based on the Ornstein-Uhlenbeck process). This process gradually injects noise into an action until it reaches a standard Gaussian distribution. Crucially, this formulation is analytically tractable.
  2. Tractable Entropy Approximation: The authors prove that the log-probability of their diffusion policy can be approximated using the conditional reverse marginal distribution. This allows them to add an entropy regularization term ($\alpha \log \pi$) to the policy objective, encouraging the agent to maintain diversity in its actions.
  3. Pessimistic Q-Ensembles: To counter overestimation, they employ an ensemble of $M=64$ Q-networks. They use the Lower Confidence Bound (LCB)—calculated as the mean prediction minus a weighted standard deviation—to guide the policy. This ensures the agent is "cautious" about actions where the ensemble disagrees.

To make the system practical, they also propose an optimal sampling strategy (Proposition 3.1) that allows for high-quality action generation in just 5 diffusion steps, compared to the 30+ steps typically required by standard reverse-time SDEs.

Comparison of the reverse-time SDE and optimal sampling process in data reconstruction.

Datasets

The method was evaluated on the D4RL benchmark, covering four distinct domains:

  • Gym: Standard locomotion tasks (HalfCheetah, Hopper, Walker2d).
  • AntMaze: Navigation tasks requiring the agent to "stitch" together paths in a maze to reach a goal (notoriously difficult due to sparse rewards).
  • Adroit: High-dimensional robotic hand manipulation.
  • Kitchen: Multitask simulated kitchen environment.

Key Insights and Ideas

  • Entropy as a "Stitcher": In offline RL, entropy isn't just for exploration; it helps the agent combine different suboptimal segments of data into a single successful trajectory. As shown in Figure 1, adding entropy regularization helps the agent find the "peaks" of the reward function more reliably.
  • Stability through Ensembles: One of the most striking findings is the training stability. While previous diffusion-based methods (like Diffusion-QL) often see performance drop as training progresses, the proposed method remains stable and continues to improve.
  • The Power of Pessimism: By using a large ensemble (64 critics), the model gains a much more nuanced view of uncertainty. The LCB approach effectively "grounds" the agent, preventing it from chasing phantom high rewards in OOD regions.
Learning curves showing the stability of the proposed method vs Diffusion-QL.

Key Results

  • AntMaze Superiority: The method significantly outperforms existing baselines in AntMaze. For example, on antmaze-large-play-v0, it achieves a score of 81.2, compared to 46.4 for Diffusion-QL and 0.0 for traditional methods like Decision Transformer (DT).
  • Efficiency: The 5-step optimal sampling strategy achieves SOTA results while remaining computationally manageable, though still slower than simple Gaussian policies.
  • Ablation Success: The authors show that increasing the ensemble size $M$ from 2 to 64 consistently improves performance and reduces variance across different random seeds.

Limitations and Future Work

  • Computational Overhead: Even with the 5-step optimization, diffusion policies are more computationally expensive than standard MLP-based policies. The authors note that training takes about 8 hours per task on an A100 GPU.
  • Real-Time Constraints: The current model may struggle in real-time robotics applications where sub-millisecond inference is required.
  • Future Directions: The authors suggest investigating policy distillation—compressing the complex diffusion policy into a faster, simpler model—to address these latency issues for edge devices.

Summary updated

BibTeX
@inproceedings{zhang2024entropy,
  author = {Ruoqi Zhang and Ziwei Luo and Jens Sjölund and Thomas B. Schön and Per Mattsson},
  title = {{Entropy-regularized Diffusion Policy with Q-Ensembles for Offline Reinforcement Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=hWRVbdAWiS},
}
Figure