POLICEd RL: Learning Closed-Loop Robot Control Policies with Provable Satisfaction of Hard Constraints

Jean-Baptiste Bouvier, Kartik Nagpal, Negar Mehr

TL;DR

This paper introduces POLICEd RL, a novel reinforcement learning framework that guarantees robots will never violate hard safety constraints. By learning an "affine buffer" around unsafe regions, POLICEd RL ensures that robot trajectories are pushed away from danger, providing provable safety guarantees for closed-loop systems.

What Problem Does This Paper Address?

Reinforcement learning (RL) has shown great promise in robotics, but its application to safety-critical tasks is hindered by a lack of safety guarantees. Existing "safe RL" methods often rely on penalizing constraint violations (soft constraints), which don't offer verifiable safety. For tasks like autonomous driving or human-robot interaction, inviolable "hard constraints" are paramount. The challenge is to train an RL policy that guarantees these hard constraints are met in a closed-loop system with a black-box robot model, where the robot's internal dynamics are unknown.

Methods

The core of POLICEd RL is the creation of a "repulsive buffer" around the unsafe region. This buffer is enforced by a learned policy that is specifically designed to be affine within this buffer region. This affine property is crucial because it allows for analytical verification of the policy's behavior. The authors leverage the "POLICE" algorithm, which can constrain neural network outputs to be affine over a user-specified region.

Here's a breakdown of the key steps:

  1. Buffer Definition: A buffer region $B$ is defined around the unsafe set, acting as a safety margin.
  2. Affine Policy Learning: The RL policy is trained to be affine within this buffer region using the POLICE framework. This means the policy's output (actions) can be expressed as a linear function of the state within the buffer.
  3. Approximation Measure: Since robot dynamics are often nonlinear, an affine approximation of the dynamics within the buffer is used. An "approximation measure" $\epsilon$ quantifies how well this affine approximation captures the true dynamics.
  4. Repulsion Condition: A key condition is derived that, if met by the affine policy within the buffer, guarantees that trajectories will be pushed away from the unsafe region and remain within the safe set. This condition is checked at the vertices of the buffer, making it computationally tractable.
  5. Existence Condition: The paper also formulates conditions under which a safe policy is guaranteed to exist, allowing for verification before training.

Datasets

The paper uses simulated environments for training and evaluation:

  • Continuous 2D environment: A point mass moving in a 2D space with a target and an obstacle (constraint). This environment is used to demonstrate the core POLICEd RL algorithm.
  • Inverted Pendulum: The OpenAI Gym inverted pendulum environment is used to test the framework on a more complex, higher-dimensional system with realistic dynamics.
  • Robotic Arm: A 7-DOF KUKA robotic arm simulation (using MuJoCo) is employed to showcase the method's scalability and effectiveness on a challenging, high-fidelity task.

No new datasets were introduced; existing simulators were utilized.

Key Insights and Ideas

  • Affine Buffers for Provable Safety: The core insight is that by forcing the learned policy to be affine within a specific "buffer" region around unsafe states, we can analytically guarantee that the robot will be pushed away from danger. This is a significant departure from methods that only penalize violations.
  • Leveraging POLICE for RL: The paper effectively adapts the POLICE algorithm, originally for neural network constraint enforcement, to the RL setting, enabling provable safety guarantees for closed-loop systems.
  • Tractable Verification: The affine property of the policy within the buffer allows for checking safety conditions at a finite set of points (vertices of the buffer), making verification computationally feasible.
  • Bridging Theory and Practice: The work demonstrates that provable safety can be achieved even with black-box dynamics, which is a common scenario in real-world robotics.

Key Results

  • Guaranteed Constraint Satisfaction: POLICEd RL demonstrably guarantees constraint satisfaction in simulated environments, outperforming baselines in terms of safety.
  • Improved Rewards: In scenarios where safety is guaranteed, POLICEd RL also achieves higher rewards compared to baselines that do not offer such guarantees.
  • Scalability: The method is shown to be effective on higher-dimensional systems like the inverted pendulum and a 7-DOF robotic arm.
  • Sample Efficiency: The POLICEd approach exhibited significantly greater sample efficiency in training compared to some baseline methods. For instance, it converged within 4000 episodes for the safe arm task, while others required tens of thousands.
  • Robotic Arm Performance: On the robotic arm task, POLICEd RL achieved 93.4% completion without violations and 100% constraint satisfaction, with a reward of -16.22. This significantly outperformed baselines like TD3 (12.0% completion w/o violation) and CPO (2.0% completion w/o violation).

Limitations and Future Work

  • Training Convergence: While the paper provides conditions for the existence of a safe policy, it doesn't guarantee that the training process will converge to such a policy.
  • High Dimensionality: For very high-dimensional state spaces, the number of vertices in the buffer region can grow exponentially, potentially making verification computationally prohibitive.
  • Approximation Measure Estimation: Accurately estimating the approximation measure $\epsilon$ for the dynamics can be challenging, and an underestimation can invalidate the safety guarantees.
  • Future Work: The authors plan to extend the method to higher relative-degree constraints and to enforce multiple constraints simultaneously. They also aim to investigate methods for estimating upper bounds of $\epsilon$ in high-dimensional settings.

Summary updated

Abstract

In this paper, we seek to learn a robot policy guaranteed to satisfy state constraints. To encourage constraint satisfaction, existing RL algorithms typically rely on Constrained Markov Decision Processes and discourage constraint violations through reward shaping. However, such soft constraints cannot offer verifiable safety guarantees. To address this gap, we propose POLICEd RL, a novel RL algorithm explicitly designed to enforce affine hard constraints in closed-loop with a black-box environment. Our key insight is to force the learned policy to be affine around the unsafe set and use this affine region as a repulsive buffer to prevent trajectories from violating the constraint. We prove that such policies exist and guarantee constraint satisfaction. Our proposed framework is applicable to both systems with continuous and discrete state and action spaces and is agnostic to the choice of the RL training algorithm. Our results demonstrate the capacity of POLICEd RL to enforce hard constraints in robotic tasks while significantly outperforming existing methods.
BibTeX
@misc{bouvier2024policed,
  author = {Jean-Baptiste Bouvier and Kartik Nagpal and Negar Mehr},
  title = {{POLICEd RL: Learning Closed-Loop Robot Control Policies with Provable Satisfaction of Hard Constraints}},
  year = {2024},
  eprint = {2403.13297},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.13297},
}
Figure