Exterior Penalty Policy Optimization with Penalty Metric Network under Constraints

Shiqing Gao, Jiaxin Ding, Luoyi Fu

TL;DR

Exterior Penalty Policy Optimization (EPO) is a new framework for Constrained Reinforcement Learning (CRL) that uses a dual-stream "Penalty Metric Network" to apply adaptive penalties to safety violations. By combining linear and quadratic cost critics with a smooth, differentiable surrogate function, EPO achieves faster constraint satisfaction and higher rewards than traditional Lagrangian or second-order methods, all while remaining computationally efficient.

What Problem Does This Paper Address?

In Reinforcement Learning, we often want an agent to maximize a reward (like speed) while respecting constraints (like not crashing). This is known as Constrained RL (CRL).

Existing approaches usually fall into three camps, each with a "catch":

  1. Primal-Dual (Lagrangian) methods: These are simple but suffer from massive oscillations—the agent's safety performance bounces wildly during training.
  2. Second-order methods (like CPO): These are stable and theoretically sound but computationally "expensive" because they require calculating and inverting massive matrices (Hessians).
  3. Penalty methods: These turn constraints into penalties in the objective function. However, choosing the right penalty is a "Goldilocks" problem: too small, and the agent stays unsafe; too large, and the agent becomes too "scared" to explore and learn.

The authors tackle this by proposing a way to automatically generate "just right" penalties that respond to the severity of the violation.

Methods

The core innovation is the Penalty Metric Network (PMN) and the EPO algorithm.

  • The PMN Architecture: Instead of a single penalty value, the PMN uses two streams:
  • Linear Critic ($V_N$): Provides steady, incremental pressure for small violations near the boundary.
  • Quadratic Critic ($V_F$): Imposes much harsher penalties for major violations, forcing the agent back to the "feasible" (safe) region quickly.
  • Weighting & Filtering: A weighting layer ($\alpha$) blends these two streams based on how far the agent is from safety, while a filter layer ensures zero penalty when the agent is behaving safely.
  • Exterior Penalty Function: Unlike "interior" methods that try to keep the agent far away from the boundary, EPO allows the agent to explore right up to the edge, only pushing back once a violation occurs.
  • Smooth Surrogate Function: To make this work with standard first-order optimizers (like PPO), the authors designed a differentiable "smooth" penalty function. This avoids the mathematical "kinks" (non-differentiability) found in simpler operators like ReLU, leading to more stable gradient updates.

Datasets

The authors evaluated EPO on two standard, high-dimensional benchmarks for safe RL:

  • Safety Gymnasium: Navigation tasks (Point and Car) where agents must reach goals while avoiding hazards, gremlins, and vases. They specifically tested "Goal2" and "Button2" variants, which are notoriously difficult for baseline algorithms.
  • Safety MuJoCo: Physics-based locomotion tasks (HalfCheetah, Ant, Humanoid, Swimmer) where agents are rewarded for speed but constrained by a velocity limit to ensure stability.

Key Insights and Ideas

  • The "Near vs. Far" Strategy: The most important insight is that not all violations are equal. A small slip-up near the boundary needs a gentle nudge, while a catastrophic failure needs a massive "kick" (the quadratic penalty) to correct the policy immediately.
  • First-Order Efficiency, Second-Order Stability: EPO manages to achieve the training stability usually associated with complex second-order methods (like CPO) while using the much faster first-order optimization logic of PPO.
  • Handling Infeasible Starts: Many CRL algorithms fail if the agent starts in an "illegal" state. Because of its aggressive quadratic penalty for far-away violations, EPO is particularly good at pulling an initially unsafe policy back into the feasible region.
  • Differentiability Matters: The transition from a hard ReLU-based penalty to a smooth log-sum-exp style function significantly reduced training "jitters" and improved convergence.

Key Results

  • Superior Performance: In Safety Gymnasium, EPO consistently reached higher cumulative rewards than baselines like PPO-Lagrangian, CPO, and IPO, while keeping the cost (violations) strictly under the limit.
  • Stability in Complex Tasks: In the "Swimmer-v4" task, most baselines failed to stay within the safety budget or failed to learn entirely. EPO maintained a stable training process within the feasible region.
  • Computational Speed: EPO is significantly faster to train than CPO. In the "Ant-v4" task, CPO took more than twice as long as EPO to train due to the overhead of calculating Fisher Information Matrices.
  • Robustness: The "Cost Limit Sensitivity" experiments showed that EPO remains effective across various safety threshold levels (e.g., setting the cost limit to 15 vs. 30).

Limitations and Future Work

  • Hyperparameter Tuning: While EPO reduces the need for manual penalty tuning, it still introduces new hyperparameters (like the penalty factor $\mu$ and the weighting $\alpha$) that require scheduling or adjustment.
  • On-Policy Focus: The current implementation is designed for on-policy optimization. Extending this to off-policy methods (which are often more sample-efficient) remains an open challenge.
  • Constraint Variety: The paper focuses on cumulative cost constraints. Future work could explore how this architecture handles "instantaneous" constraints (safety requirements that must be met at every single timestep).

Summary updated

BibTeX
@inproceedings{gao2024exterior,
  author = {Shiqing Gao and Jiaxin Ding and Luoyi Fu},
  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