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

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

Abstract

Offline reinforcement learning (RL) requires agents to learn optimal behaviors from fixed datasets without environment interaction. This paradigm faces two primary challenges: distribution shift leading to over-optimistic value estimates and the difficulty of "stitching" sub-optimal trajectories into a coherent policy. While entropy maximization is a standard tool for exploration and regularization in online RL, it is traditionally difficult to apply to diffusion-based policies due to the intractability of their probability densities. This paper introduces EDP-Q, a framework that utilizes a mean-reverting Stochastic Differential Equation (SDE) to enable tractable entropy regularization, combined with a pessimistic Q-ensemble to mitigate distribution shift.

Introduction

In Offline RL, the agent is restricted to a pre-collected dataset, making it susceptible to overestimating the value of out-of-distribution (OOD) actions. Diffusion policies have emerged as a powerful solution for modeling complex, multi-modal action distributions. However, these models often struggle with the "stitching" problem—the ability to combine segments of different trajectories to reach a goal more efficiently than any single demonstration in the dataset.

To address these issues, this work proposes a novel approach that integrates Maximum Entropy RL principles into the diffusion framework. By regularizing the policy with an entropy term, the agent maintains a degree of diversity that prevents it from collapsing into over-fitted, sub-optimal actions.

Methodology

The EDP-Q framework is built upon three technical pillars designed to improve the robustness and efficiency of diffusion-based offline RL.

1. Tractable Entropy via Mean-Reverting SDEs

Standard diffusion models often use variance-preserving or variance-exploding SDEs, where calculating the exact entropy of the resulting policy is mathematically complex. The authors instead employ a mean-reverting SDE that drifts toward a standard Gaussian distribution. This specific mathematical structure allows for a tractable approximation of the policy's entropy. By making entropy calculable, the authors can incorporate it directly into the training objective, encouraging the policy to remain expressive and diverse while staying grounded in the data distribution.

2. Pessimistic Q-Ensembles

To combat the overestimation of OOD actions, the framework utilizes an ensemble of 64 Q-networks. Rather than using a simple average of these critics, the model employs a Lower Confidence Bound (LCB) approach. The target value is calculated as the mean estimate minus a weighted multiple of the standard deviation across the ensemble. This "cautious" estimation ensures that the agent avoids regions of the action space where the critics disagree, effectively penalizing uncertainty.

3. Optimal 5-Step Sampling

Diffusion models are notoriously slow during inference because they typically require many iterative steps to generate an action. EDP-Q introduces an optimal sampling strategy based on the posterior distribution. This method reduces the generation process to just 5 steps, significantly increasing the policy's real-time viability without sacrificing the accuracy of the action reconstruction.

Experimental Evaluation

The model was benchmarked using the D4RL suite, focusing on tasks that require high-level reasoning and trajectory stitching:

  • AntMaze: A quadruped robot navigating complex mazes. This is the primary test for "stitching" capabilities.
  • Gym Locomotion: Standard tasks like HalfCheetah and Hopper with varying data quality (Medium, Expert, Replay).
  • Adroit & Kitchen: High-dimensional manipulation tasks.

Key Results

EDP-Q demonstrates state-of-the-art performance, particularly in sparse-reward environments:

  • AntMaze Dominance: In the "Large-Play" and "Large-Diverse" AntMaze tasks, EDP-Q achieved scores of 81.2 and 76.4, respectively. This represents a massive improvement over the previous state-of-the-art, Diffusion-QL, which scored 46.4 and 56.6 on the same tasks.
  • General Performance: In Gym benchmarks, the model reached an average normalized score of 89.9, outperforming established baselines like IQL (77.0) and CQL (77.6).
  • Efficiency: The 5-step sampling process maintained high performance while being significantly faster than traditional reverse-time SDE sampling.

Discussion and Limitations

The success of EDP-Q highlights that entropy is not just an exploration tool for online RL; in the offline setting, it serves as a critical regularizer that prevents policy collapse. The combination of entropy and pessimism allows the agent to effectively "stitch" sub-optimal data into near-optimal behavior.

However, challenges remain. Training an ensemble of 64 Q-networks introduces a significant memory and computational burden during the training phase. Additionally, the model's performance is sensitive to hyperparameters such as the entropy temperature ($\alpha$) and the pessimism coefficient ($\beta$). Future work may focus on policy distillation to compress these complex models for use on hardware-constrained robotic platforms.

Conclusion

EDP-Q represents a significant step forward for offline RL. By solving the mathematical challenges of entropy regularization in diffusion processes and combining them with robust ensemble-based pessimism, the authors have created an agent capable of navigating complex, sparse-reward environments that were previously insurmountable for diffusion-based methods.

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