Regularizing a Model-based Policy Stationary Distribution to Stabilize Offline Reinforcement Learning

Shentao Yang, Yihao Feng, Shujian Zhang, Mingyuan Zhou

Abstract

Offline reinforcement learning (RL) extends the paradigm of classical RL algorithms to purely learning from static datasets, without interacting with the underlying environment during the learning process. A key challenge of offline RL is the instability of policy training, caused by the mismatch between the distribution of the offline data and the undiscounted stationary state-action distribution of the learned policy. To avoid the detrimental impact of distribution mismatch, we regularize the undiscounted stationary distribution of the current policy towards the offline data during the policy optimization process. Further, we train a dynamics model to both implement this regularization and better estimate the stationary distribution of the current policy, reducing the error induced by distribution mismatch. On a wide range of continuous-control offline RL datasets, our method indicates competitive performance, which validates our algorithm.

Introduction

In Offline RL, an agent must learn an optimal policy entirely from a static dataset of pre-recorded interactions. This paradigm is essential for high-stakes domains such as healthcare or autonomous driving, where real-world exploration is prohibitively dangerous or expensive. However, standard RL algorithms frequently fail in this setting due to distribution mismatch.

During training, the algorithm evaluates actions not present in the dataset (out-of-distribution, or OOD). Because the value function has not been trained on these OOD actions, it often pathologically overestimates their value. The policy then exploits these errors, steering the agent into states where the dynamics model or value function is inaccurate, leading to catastrophic performance degradation. While prior works constrain immediate actions, this paper argues for a broader constraint: the stationary state-action distribution—the long-term, overall footprint of the policy.

Methodology

Stationary Distribution Matching via GAN (SDM-GAN)

We propose SDM-GAN, a model-based offline RL algorithm designed to match the policy's long-term behavior to the offline data distribution. The framework consists of four key components:

  1. Model-Based Rollouts: We train a neural network to approximate environment dynamics (transitions, rewards, and terminations). This model generates short-horizon synthetic rollouts to estimate the current policy's trajectory.
  2. Tractable Mathematical Bound: Estimating a stationary distribution typically requires infinite trajectories. We derive an upper bound for the distance between the dataset distribution and the policy distribution using a "change of variable" trick. This bound only requires single-step transitions, making it computationally feasible.
  3. GAN-Based Regularization: The derived bound is implemented via a Generative Adversarial Network (GAN). A discriminator distinguishes between "true" state-action pairs from the dataset and "fake" pairs generated by the policy within the dynamics model. The policy is penalized for failing to fool this discriminator.
  4. Implicit Policy: To capture complex, multi-modal behaviors in the offline data, we utilize an implicit policy (similar to a conditional GAN generator) that maps random noise to actions, rather than a standard Gaussian distribution.

Multi-modality and Implicit Policies

A core insight of this work is that standard deterministic or Gaussian policies fail to learn from datasets where multiple different actions are equally valid. In toy experiments, we demonstrate that while baseline methods often collapse to a single mode, our implicit policy captures the full complexity of the target distribution.

Target distribution in a toy multi-modal task.

Experimental Results

Performance on Complex Benchmarks

SDM-GAN was evaluated on the D4RL benchmark, showing state-of-the-art (SOTA) results on high-dimensional and sparse-reward tasks:

  • Maze2D: In the maze2d-large task, SDM-GAN achieved a score of 207.7, significantly outperforming baselines like OptiDICE (130.7).
  • Adroit Hand Manipulation: On the pen-expert task, it scored 135.8, compared to the baseline's 95.9.
  • Gym-MuJoCo: The method remains competitive with existing model-free (CQL) and model-based (MOPO) SOTA methods on standard locomotion tasks.

Key Insights

  • Single-Step Efficiency: We proved that infinite-horizon behavior can be effectively constrained by evaluating relative value functions over single steps.
  • Data Composition: A 50/50 mix of real and synthetic data was found to be optimal, balancing the need for policy distribution estimation with the risk of dynamics model inaccuracies.
  • Divergence Metrics: Ablation studies indicated that Jensen-Shannon Divergence (standard GAN) provided more stability and higher returns than Wasserstein distance (WGAN-GP) in this context.

Conclusion and Future Work

SDM-GAN addresses the distribution mismatch in offline RL by regularizing the stationary distribution. While the current implementation uses a single network to approximate theoretical bounds, future work could involve separating these estimates for tighter guarantees. Additionally, integrating more advanced dynamics models, such as Transformer-based sequence models, could further enhance performance in complex temporal domains.

Summary updated

BibTeX
@misc{yang2022regularizing,
  author = {Shentao Yang and Yihao Feng and Shujian Zhang and Mingyuan Zhou},
  title = {{Regularizing a Model-based Policy Stationary Distribution to Stabilize Offline Reinforcement Learning}},
  year = {2022},
  eprint = {2206.07166},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2206.07166},
}
Figure