Iterative Reachability Estimation for Safe Reinforcement Learning

Milan Ganai, Zheng Gong, Chenning Yu, Sylvia Lee Herbert, Sicun Gao

Abstract

Reinforcement Learning (RL) has demonstrated remarkable scalability in high-dimensional tasks, yet providing rigorous safety guarantees remains a significant challenge. Traditional Constrained Markov Decision Processes (CMDPs) often settle for "average safety," while formal methods like Hamilton-Jacobi reachability suffer from the curse of dimensionality. This paper introduces RESPO (Reachability Estimation for Safe Policy Optimization), a framework that bridges this gap. By utilizing a novel Reachability Estimation Function (REF), RESPO predicts the probability of future constraint violations in stochastic environments and unifies reward maximization with a "safest-possible" recovery behavior. Experimental results across high-dimensional benchmarks demonstrate that RESPO achieves state-of-the-art performance while maintaining significantly stricter safety than traditional constrained RL methods.

Introduction

In the pursuit of deploying autonomous agents in real-world scenarios, safety is paramount. Safe RL aims to maximize cumulative rewards while satisfying specific constraints, such as a robot reaching a target without colliding with obstacles. However, existing methodologies often fall into two problematic categories. CMDP-based methods typically optimize for expected cost, which may allow for frequent catastrophic failures as long as the average cost remains below a threshold. Conversely, formal methods provide rigorous safety guarantees but are computationally intractable for systems beyond a few dimensions.

Furthermore, real-world environments are inherently stochastic. When noise pushes an agent into an unsafe state, many existing algorithms lack a principled mechanism to return to the feasible set. RESPO addresses these limitations by introducing a scalable, reachability-based approach that handles stochasticity and high-dimensional state spaces (up to 70+ dimensions) effectively.

The Reachability Estimation Function (REF)

At the core of RESPO is the Reachability Estimation Function (REF), denoted as $\phi^\pi(s)$. Unlike traditional reachability analysis that treats safety as a binary property, the REF estimates the probability ($[0, 1]$) that an agent will eventually violate a constraint starting from its current state $s$ under policy $\pi$.

Recursive Learning

The authors demonstrate that the REF can be learned through a Bellman-like recursive update: $$\phi^\pi(s) = \max\{\mathbb{1}_{s \in S_v}, \gamma \mathbb{E}[\phi^\pi(s')]\}$$ where $S_v$ represents the set of violating states. This formulation allows the agent to learn safety boundaries directly from experience, providing a smoother gradient for the policy to learn from compared to binary safety sets. This is particularly beneficial in high-dimensional spaces where the boundary between safe and unsafe states is often complex and "fuzzy."

Dual-Objective Optimization

RESPO employs a clever objective function that adapts based on the agent's current safety status. The optimization logic is bifurcated:

  1. Feasible State Optimization: When the agent is in a state with a low probability of violation, the objective is to maximize rewards while maintaining the violation probability at zero.
  2. Infeasible State Recovery: If the agent enters a state with a high probability of violation (often due to environmental stochasticity), the objective automatically switches to "safest behavior." In this mode, the agent minimizes the discounted sum of future violations to re-enter the safe set as quickly as possible.

To maintain stability and prevent oscillations between these objectives, RESPO utilizes a multi-timescale actor-critic architecture. This involves four distinct learning rates: the critics learn fastest, followed by the policy, then the REF, and finally the Lagrange multipliers.

Experimental Evaluation

The framework was evaluated on a diverse suite of high-dimensional, stochastic benchmarks, including Safety Gym (PointButton, CarGoal), Safety PyBullet (DroneCircle, BallRun), and Safety MuJoCo (HalfCheetah, Reacher). Additionally, a custom multi-drone tunnel navigation task was used to test multi-constraint handling.

Key Results

  • Performance and Safety Balance: Across Safety Gym and PyBullet, RESPO consistently achieved the highest rewards among algorithms that maintained low violation rates. Notably, in the HalfCheetah environment, RESPO achieved the highest reward among all safe baselines while maintaining zero violations.
  • Robustness to Stochasticity: In PyBullet environments with 5% added Gaussian noise, RESPO converged to nearly zero violations. In contrast, standard CMDP methods like PPO-Lagrangian struggled to remain within their cost budgets.
  • Multi-Constraint Prioritization: In the multi-drone task, which involved both hard constraints (wall avoidance) and soft constraints (communication range), RESPO successfully prioritized the hard constraints during conflicts, a feat that baselines like RCRL and FAC failed to achieve.

Discussion and Future Work

RESPO represents a significant step toward unifying control-theoretic safety with the scalability of RL. A key insight of the work is that in stochastic worlds, recovery is as important as avoidance; the ability to prioritize re-entrance into the safe set prevents the "infinite violation" loops common in prior reachability-based RL methods.

However, limitations remain. While the final learned policy is safe, RESPO does not guarantee safety during the training process, as the agent must experience violations to map the safety boundaries. Future research may explore learning low-dimensional latent representations to guide the REF or adapting the framework to non-stationary environments with dynamic obstacles.

Summary updated

BibTeX
@inproceedings{ganai2023iterative,
  author = {Milan Ganai and Zheng Gong and Chenning Yu and Sylvia Lee Herbert and Sicun Gao},
  title = {{Iterative Reachability Estimation for Safe Reinforcement Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=f2U4HCY8bg},
}
Figure