VOCE: Variational Optimization with Conservative Estimation for Offline Safe Reinforcement Learning

Jiayi Guan, Guang Chen, Jiaming Ji, Long Yang, Ao Zhou, Zhijun Li, changjun jiang

TL;DR

VOCE (Variational Optimization with Conservative Estimation) is a novel framework for offline safe reinforcement learning (RL) that reframes policy optimization as a probabilistic inference problem. By combining flexible variational distributions with pessimistic value estimation for both rewards and costs, VOCE enables agents to learn high-performing, safety-compliant policies from static datasets without risking real-world failures during training.

The Challenge of Offline Safe RL

Reinforcement Learning traditionally learns through trial and error. While effective in simulated environments like video games, this approach is prohibitively dangerous for real-world applications such as autonomous driving or robotics, where a single mistake can be catastrophic. Offline Safe RL addresses this by training agents entirely on pre-collected datasets, ensuring they never interact with the live environment during the learning phase.

However, offline RL faces a significant hurdle: extrapolation error. When an agent evaluates an action not present in the dataset (an out-of-distribution, or OOD, action), it often overestimates the potential reward or underestimates the associated risk. Previous methods have struggled to balance high rewards with strict safety constraints because they could not effectively manage these OOD actions.

The VOCE Approach

To overcome these limitations, the authors introduce VOCE, which tackles the problem through two primary innovations:

  1. Probabilistic Inference Framework: Instead of directly optimizing a parameterized neural network policy, VOCE reframes the objective as finding an optimal "variational distribution." This non-parametric approach makes the optimization problem convex and highly flexible, decoupling the complex task of finding the best actions from the task of training the neural network.
  2. Conservative (Pessimistic) Estimation: To combat extrapolation error, VOCE applies a "double pessimism" strategy. It calculates a lower bound for rewards (preventing the agent from being lured by falsely optimistic OOD actions) and an upper bound for costs (ensuring the agent never underestimates the danger of unknown actions).

Once the optimal variational distribution is identified using these conservative estimates, the final policy is trained via supervised learning to mimic that distribution.

Experimental Setup and Key Insights

The researchers evaluated VOCE on continuous control tasks from the safety-focused RL community, including Point-Goal, Car-Goal, Point-Button, and Car-Button. These tasks require agents to navigate around hazards and moving obstacles to reach targets or press buttons.

Crucially, the datasets were not perfectly safe. The authors created datasets with varying proportions of safe trajectories ($\phi = 0.4, 0.6, 0.8, 1.0$) to test how the algorithm handles messy, real-world data containing both safe and unsafe behaviors.

Reward vs. Cost distribution across different safe trajectory proportions ($\phi$) in the Car-Goal task.

Key Insights: * The Power of Decoupling: Using a variational distribution as an intermediate step turns a difficult, non-convex policy search into a more stable optimization problem. * Pessimism is a Two-Way Street: While most offline RL research focuses solely on reward pessimism, VOCE demonstrates that cost pessimism is equally critical in safe RL to prevent the agent from exploiting dangerous states. * The "Goldilocks" Dataset: Surprisingly, a dataset consisting of 100% safe trajectories ($\phi=1.0$) did not always produce the best policy. VOCE often performed best on datasets with 70-90% safety. Seeing a few "near-misses" or failures helps the agent better understand where the actual safety boundaries lie.

Key Results

VOCE was compared against state-of-the-art baselines, including BCQ-Lag, C-CRR, and CoptiDICE, as well as off-policy safe RL methods.

Training curves showing reward and cost performance of various RL algorithms over time.
  • Superior Safety: VOCE consistently outperformed baselines in terms of safety, strictly adhering to cost limits even when trained on highly unsafe data ($\phi=0.4$).
  • Higher Rewards: In the "Goal" tasks, VOCE achieved significantly higher reward returns than its competitors while maintaining a superior safety profile.
  • Efficiency: Although VOCE requires slightly longer training times due to its additional networks, its inference time during testing is lightning-fast (under 1ms), making it highly suitable for real-time applications like robotics and autonomous driving.

Limitations and Future Work

The authors note that VOCE remains heavily dependent on the quality and coverage of the offline dataset. If the data is too sparse, the agent cannot accurately estimate environmental transitions. Furthermore, the current model struggles in non-stationary environments where the rules or dynamics change over time. Future work will likely focus on improving the algorithm's robustness to limited data and adapting it for dynamic, shifting environments.

Summary updated

BibTeX
@inproceedings{guan2023voce,
  author = {Jiayi Guan and Guang Chen and Jiaming Ji and Long Yang and Ao Zhou and Zhijun Li and changjun jiang},
  title = {{VOCE: Variational Optimization with Conservative Estimation for Offline Safe Reinforcement Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=sIU3WujeSl},
}
Figure