Offline Policy Optimization in RL with Variance Regularizaton

Riashat Islam, Samarth Sinha, Homanga Bharadhwaj, Samin Yeasar Arnob, Zhuoran Yang, Animesh Garg, Zhaoran Wang, Lihong Li, Doina Precup · DOI

Abstract

Offline Reinforcement Learning (RL) is frequently hampered by over-optimistic value estimates for actions poorly represented in the training data. We present the Offline Variance Regularizer (OVR), a framework that leverages Fenchel duality to penalize high-variance value estimates. By enforcing a "pessimistic" lower bound on the objective, OVR effectively mitigates the risks of distributional shift. Empirical evaluations on the D4RL benchmark demonstrate that OVR significantly enhances the performance and stability of existing offline RL algorithms, particularly in scenarios with medium-quality or noisy data.

Introduction

In standard Reinforcement Learning, agents learn through active exploration and trial-and-error. However, in many real-world applications—such as robotics or healthcare—active exploration is costly or dangerous. Offline RL addresses this by training agents on fixed, pre-collected datasets.

The primary challenge in this setting is distributional shift. When an agent evaluates an action that is underrepresented in the dataset, the value function (the estimate of future rewards) often produces wildly inaccurate, over-optimistic numbers. The agent then "hallucinates" that these unknown actions are optimal, leading to catastrophic failure upon deployment. While current solutions attempt to keep the agent's policy close to the data-collection policy, they often suffer from high variance and training instability.

Methodology: The Offline Variance Regularizer (OVR)

To combat over-optimism, we introduce the Offline Variance Regularizer (OVR). This framework constrains the policy improvement step by explicitly penalizing the variance of the value function, forcing the agent to remain within the bounds of what the data can reliably support.

1. Stationary Distribution Corrections

Rather than relying on standard importance sampling, which is notoriously noisy in offline settings, OVR utilizes marginalized importance sampling. This allows for a more stable estimation of the ratio between the target policy and the original data-collection policy.

2. The Fenchel Duality Trick

A significant technical hurdle in variance-constrained RL is the "double-sampling" problem: calculating the gradient of a variance term typically requires two independent samples for the same state-action pair, which is impossible with a fixed dataset. OVR overcomes this using Fenchel duality. By transforming the variance minimization problem into a minimax optimization, the authors introduce dual variables that allow gradients to be computed using standard single-sample batches.

3. Implementation via Augmented Rewards

Practically, OVR is implemented as an augmented reward function. This allows it to be integrated into existing offline algorithms, such as Batch Constrained Q-learning (BCQ). By modifying the rewards the agent perceives based on variance estimates, the value function becomes a mathematically grounded lower bound of the true value, effectively enforcing a "pessimistic" safety rail.

Experimental Evaluation

The OVR framework was evaluated using the D4RL benchmark, a standard suite for offline RL across several domains:

  • OpenAI Gym: Classic control tasks (HalfCheetah, Hopper, Walker).
  • Adroit: Complex robotic hand manipulation (Pen, Hammer, Door, Relocate).
  • FrankaKitchen: Multi-step kitchen tasks.

The researchers tested these across various data qualities, including "Random," "Medium," "Expert," and "Mixed" datasets, to assess how the algorithm handles varying levels of signal-to-noise ratios.

Key Results and Insights

Performance Gains

OVR demonstrated consistent improvements when added to the BCQ baseline. The most significant gains were observed in "Medium" and "Mixed" datasets, where the data-collection policy is sub-optimal and contains significant variance:

  • Hopper-Medium: OVR improved the normalized score from 57.76 to 71.24.
  • Walker-Random: In a highly chaotic environment where standard BCQ failed to learn (0.48), OVR achieved a score of 5.16, demonstrating its ability to extract signal from noise.

Theoretical Grounding

The authors provided theoretical proof that their regularizer leads to a lower bound on the objective. This provides a formal mathematical guarantee for the "pessimism" observed in practice, ensuring the agent avoids regions of the state space where uncertainty is high.

Robustness

OVR proved particularly effective when rewards in the dataset were noisy or corrupted. By explicitly modeling variance, the algorithm can filter out noise that would otherwise lead standard offline RL agents to over-exploit erroneous value spikes.

Discussion and Limitations

While OVR provides a robust mechanism for offline optimization, it is not without limitations. Its performance is dependent on the accuracy of the density ratio estimation ($\omega$); if the initial estimate of this ratio is poor, the regularization may be ineffective. Additionally, on "Expert" datasets where there is very little variance to begin with, the benefits of OVR are marginal. Finally, the weighting factor ($\lambda$) for the variance term remains a hyperparameter that requires careful tuning for specific environments.

Future research may explore more sophisticated risk measures beyond simple variance, such as Conditional Value-at-Risk (CVaR), to provide even more granular safety guarantees in high-stakes offline settings.

Summary updated

BibTeX
@misc{islam2022offline,
  author = {Riashat Islam and Samarth Sinha and Homanga Bharadhwaj and Samin Yeasar Arnob and Zhuoran Yang and Animesh Garg and Zhaoran Wang and Lihong Li and Doina Precup},
  title = {{Offline Policy Optimization in RL with Variance Regularizaton}},
  year = {2022},
  eprint = {2212.14405},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2212.14405},
}
Figure