Abstract
Deploying Reinforcement Learning (RL) in real-world settings requires strict safety guarantees during training, yet current methods often violate constraints during exploration. This paper introduces Lyapunov Barrier Policy Optimization (LBPO), a novel safe RL algorithm that utilizes a Lyapunov-based barrier function to proactively restrict policy updates to a safe set. LBPO achieves near-zero constraint violations during training on complex continuous control tasks, significantly outperforming state-of-the-art baselines while maintaining competitive reward performance.
Introduction
Standard deep reinforcement learning learns by trial and error. While acceptable in simulated environments, a physical robot exploring unsafe actions can cause irreparable damage. To address this, researchers utilize Constrained Markov Decision Processes (CMDPs), where an agent maximizes rewards while keeping expected costs (e.g., collisions) below a threshold.
However, popular CMDP solvers, such as Lagrangian approaches, typically only guarantee safety asymptotically. Other methods like Constrained Policy Optimization (CPO) and SDDPG aim for safety during learning but often fail in practice. This work investigates the root causes of these failures and proposes LBPO to genuinely prevent constraint violations throughout the entire training process.
Methods
LBPO formulates the policy update as an unconstrained optimization problem augmented by a logarithmic barrier function. The approach consists of three main components:
- Lyapunov Constraints: Trajectory-based safety constraints are converted into simpler, per-state constraints using a Lyapunov function.
- Barrier Function: A logarithmic barrier penalty is added to the policy objective. As a proposed update approaches the safety threshold (the estimated cost Q-value limit), the penalty increases toward infinity, proactively repelling the optimizer from unsafe regions.
- Trust Region: Similar to PPO, LBPO employs a KL-divergence trust region to ensure policy stability and the validity of Q-function approximations.
LBPO also introduces a parameter ($\beta$) that controls the steepness of the barrier, allowing for tunable risk aversion.
Evaluation
The authors evaluated LBPO using the OpenAI Safety Gym, featuring 12 continuous control tasks with three robots (Point, Car, Doggo) and various obstacles (hazards, vases, pillars). Additionally, a didactic 2D MDP was used to test robustness against Q-function estimation errors.
Key Results and Insights
Near-Zero Constraint Violations
Across nearly all Safety Gym environments, LBPO achieved near-zero constraint violations (0.00 to 0.04 fraction). In contrast, baselines like PPO-Lagrangian and CPO exhibited violation fractions as high as 0.89. LBPO successfully trades a marginal amount of reward for significant gains in safety.
Robustness and Heuristics
The authors found that prior methods like CPO often rely on a "backtracking" heuristic—simply minimizing cost when unsafe—rather than their theoretical projections. LBPO's smooth barrier function makes it significantly more robust to Q-function approximation errors. In experiments with limited on-policy samples, while baseline violations skyrocketed, LBPO remained safe.
Limitations and Future Work
LBPO requires a safe initial policy, typically obtained through pre-training on cost objectives. In extremely complex environments with severe trade-offs, such as the quadrupedal Doggo tasks, achieving both high performance and safety remains a challenge for all current methods. Future research should focus on safe initialization and scaling to highly complex robotic dynamics.
Summary updated