Exterior Penalty Policy Optimization with Penalty Metric Network under Constraints

Shiqing Gao, Jiaxin Ding, Luoyi Fu, Xinbing Wang, Chenghu Zhou

Abstract

In Constrained Reinforcement Learning (CRL), agents must maximize rewards while strictly adhering to safety constraints. Traditional penalty-based methods often struggle with balancing these objectives, leading to instability or poor performance. We introduce Exterior Penalty Policy Optimization (EPO), a first-order method that utilizes a Penalty Metric Network (PMN) to adaptively generate penalties. By employing a dual-stream architecture with linear and quadratic critics, EPO provides a nuanced response to constraint violations. Our theoretical analysis guarantees convergence and monotonic improvement in constraint satisfaction. Experimental results on Safety Gymnasium and Safety MuJoCo benchmarks demonstrate that EPO significantly outperforms state-of-the-art baselines in both reward maximization and safety stability.

Introduction

In real-world applications like robotics, reinforcement learning agents must operate within safe boundaries. This is typically modeled as a Constrained Markov Decision Process (CMDP). However, existing CRL algorithms face significant hurdles. Second-order methods like Constrained Policy Optimization (CPO) are computationally expensive, while primal-dual methods like PPO-Lagrangian often exhibit oscillatory behavior. Furthermore, simple penalty functions like ReLU can lead to gradient vanishing or insufficient pushback against severe violations. EPO addresses these issues by providing a stable, first-order optimization framework with adaptive, multi-scale penalties.

Methodology

The core of EPO is the Penalty Metric Network (PMN), which adaptively scales penalties based on the severity of constraint violations.

The EPO architecture featuring the dual-stream Penalty Metric Network (PMN) and the overall policy optimization flow.

As shown in the architecture above, the PMN consists of two primary components:

  1. Dual-Stream Critics: A linear critic ($V_N$) handles minor violations near the boundary, providing steady guidance. A quadratic critic ($V_F$) imposes much harsher penalties for severe violations, acting as an "emergency brake" to pull the agent back into the feasible region quickly.
  2. Adaptive Weighting and Filtering: These streams are combined using a weighting layer. A filter layer ensures that penalties are exactly zero when the agent is within the safe region, preventing interference with reward optimization during exploration.

To ensure compatibility with first-order optimizers like Adam, EPO utilizes a smooth, differentiable log-sum-exp surrogate function. This avoids the "dead zones" associated with non-smooth functions and ensures continuous gradient information for learning.

Experimental Results

We evaluated EPO against several baselines, including CPO, PPO-Lagrangian, and IPO, across various tasks in Safety Gymnasium and Safety MuJoCo.

Performance comparison of EPO against baselines across four Safety Gymnasium tasks. Top row shows Returns; bottom row shows Constraint costs (dashed line is the limit).

Key findings from the experiments include:

  • Superior Performance and Safety: In complex tasks like PointGoal2-v0, EPO achieved the highest returns while maintaining costs strictly below the threshold. Baselines often failed to reach the goal or consistently violated constraints.
  • Training Stability: Unlike Lagrangian methods that oscillate as they struggle to balance reward and safety, EPO exhibits smooth convergence in both metrics.
  • Efficiency: EPO provides safety comparable to second-order methods but with significantly lower computational overhead, training more than twice as fast as CPO.
  • Handling Infeasible Starts: EPO’s aggressive quadratic penalty is specifically designed to handle cases where the initial policy is highly unsafe, successfully guiding the agent back to the feasible region.

Conclusion

EPO offers a robust and efficient solution for Constrained RL by leveraging an adaptive Penalty Metric Network. Its ability to handle severe violations through quadratic penalties while maintaining first-order efficiency makes it highly suitable for complex, high-dimensional tasks. Future work will explore extending this framework to off-policy algorithms and handling more diverse constraint types.

Summary updated

BibTeX
@inproceedings{gao2024exterior,
  author = {Shiqing Gao and Jiaxin Ding and Luoyi Fu and Xinbing Wang and Chenghu Zhou},
  title = {{Exterior Penalty Policy Optimization with Penalty Metric Network under Constraints}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2024},
  url = {https://openreview.net/forum?id=p2t5t7HlPF},
}
Figure