First Order Optimization in Policy Space for Constrained Deep Reinforcement Learning

Yiming Zhang, Quan Vuong, Keith W. RossarXiv 2020

Introduction

Deep reinforcement learning (DRL) agents are typically designed to maximize a reward signal through unconstrained exploration. In real-world applications like robotics, this can lead to unsafe behaviors that damage hardware or harm humans. Constrained Markov Decision Processes (CMDPs) provide a framework for enforcing safety by introducing cost constraints. However, state-of-the-art methods like Constrained Policy Optimization (CPO) rely on complex second-order approximations and matrix inversions, which are computationally intensive and prone to approximation errors that lead to constraint violations.

Methodology: The FOCOPS Algorithm

This paper introduces First Order Constrained Optimization in Policy Space (FOCOPS), a novel two-step approach that achieves safe policy updates using simple first-order gradients. Instead of solving the constrained optimization directly in the high-dimensional parameter space of a neural network, FOCOPS decomposes the problem:

  1. Nonparametric Optimization: The algorithm first finds an optimal update policy in the space of all stationary policies. This step yields a near-closed-form solution that naturally balances reward maximization with cost penalties.
  2. Parametric Projection: The ideal nonparametric policy is then projected back into the neural network's parameter space by minimizing the KL divergence between the parameterized policy and the target distribution.
The FOCOPS algorithm outline, showing the two-step update process.

By using this decomposition, FOCOPS avoids the need for second-order Taylor approximations. It also employs a primal-dual heuristic to dynamically adjust the penalty weight (\nu) for constraint violations, ensuring the agent prioritizes safety when costs exceed defined thresholds.

Experimental Evaluation

The authors evaluated FOCOPS using the MuJoCo physical simulator across two categories of tasks:

  • Locomotion with Speed Limits: Standard agents (Ant, HalfCheetah, Hopper, Humanoid, Swimmer, Walker2d) were tasked with moving forward while keeping their speed below a specific limit.
  • Circle Tasks: Ant and Humanoid agents were required to walk along a circular path while remaining within a geofenced safe region.

Key Results and Insights

FOCOPS demonstrated significant improvements over baselines such as CPO, PPO-Lagrangian, and TRPO-Lagrangian in both reward performance and constraint satisfaction.

Learning curves for reward and cost across six MuJoCo environments. FOCOPS (blue) consistently achieves higher rewards while maintaining costs near the threshold (dashed line).
  • Higher Rewards: FOCOPS outperformed all baselines in 5 out of 6 locomotion tasks and both circle tasks. For instance, in the complex Humanoid-v3 task, FOCOPS achieved a reward of ~4529, significantly higher than CPO's ~3952.
  • Strict Constraint Adherence: Despite its simplicity, FOCOPS consistently kept agents within safety thresholds, whereas methods like TRPO-Lagrangian frequently exhibited large cost spikes.
  • Robustness and Generalization: Sensitivity analysis showed that FOCOPS is stable across various hyperparameter settings and generalizes better to unseen random seeds than its competitors.

Conclusion and Future Work

FOCOPS proves that first-order optimization can be more effective and easier to implement than complex second-order methods for constrained RL. The algorithm's theoretical grounding in nonparametric policy space provides a robust foundation for safety. Future research directions include extending FOCOPS to off-policy learning to improve sample efficiency and exploring more complex, non-scalar safety constraints derived from natural language or human preferences.

Summary updated

BibTeX
@misc{zhang2020first,
  author = {Yiming Zhang and Quan Vuong and Keith W. Ross},
  title = {{First Order Optimization in Policy Space for Constrained Deep Reinforcement Learning}},
  year = {2020},
  eprint = {2002.06506},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2002.06506},
}
Figure