Back to Base: Towards Hands-Off Learning via Safe Resets with Reach-Avoid Safety Filters

Azra Begzadić, Nikhil Uday Shinde, Sander Tonkens, Dylan Hirsch, Kaleb Ugalde, Michael C. Yip, Jorge Cortes, Sylvia Lee Herbert

Introduction

Training Reinforcement Learning (RL) agents on physical hardware remains a significant challenge in robotics. While RL excels in simulation, two primary hurdles prevent its seamless application in the real world: safety and resets. In simulation, a robot can crash or reach an unrecoverable state thousands of times without consequence, and the environment can be instantly reset to a starting configuration. In the physical world, a single crash can be catastrophic, and the "reset" often requires a human operator to manually intervene, repositioning the robot for the next trial. This human-in-the-loop requirement makes training prohibitively expensive and slow.

Researchers at UCSD have proposed a novel solution to these problems by introducing a safety filter that ensures both operational safety and autonomous resets. By combining Hamilton-Jacobi (HJ) reachability analysis with a new class of Control Barrier Functions, they enable "hands-off" learning where the robot explores its environment safely and returns to a "home base" autonomously when an episode concludes.

The Reach-Avoid Challenge

To achieve autonomous training, a robot must satisfy two conditions simultaneously: it must avoid unsafe regions (safety) and it must be able to reach a designated reset state within a specific timeframe (liveness/reachability).

Traditional methods like Control Barrier Functions (CBFs) are excellent for keeping robots within safe boundaries, but they often struggle with complex non-linear dynamics and do not inherently guarantee that a robot can reach a target. Conversely, Hamilton-Jacobi (HJ) Reachability analysis is a formal method used to calculate "reach-avoid" sets—the volume of states from which a robot is guaranteed to reach a target while avoiding obstacles, even under worst-case disturbances. However, HJ reachability is typically used to derive optimal control policies rather than acting as a flexible filter for learning agents.

Innovation: Viscosity-Based Control Barrier Functions (VB-CBF)

The core contribution of this work is the bridge between HJ reachability and CBFs. The researchers introduced the Viscosity-Based Control Barrier Function (VB-CBF). They mathematically demonstrated that the value function derived from HJ reachability analysis can function as a specialized CBF.

This theoretical link allows for the implementation of a Reach-Avoid Safety Filter. During the training process, a standard RL agent (such as Soft Actor-Critic) proposes an action. This action is passed through a Quadratic Program (QP) filter. If the proposed action is safe and maintains the robot's ability to return to base within the allotted time, it is executed. If the action risks a safety violation or an inability to reset, the filter minimally modifies the action to keep the robot within the "reach-avoid" tube. This allows the RL agent to focus on task performance while the filter handles the underlying safety and reset requirements.

Experimental Evaluation

The researchers tested their approach, termed SAC-RACBF, using a modified Cartpole environment designed to simulate real-world constraints. This environment included specific "failure sets" (prohibited regions) and a narrow "target set" representing the home base. To further test the filter's robustness, they imposed a constraint where the pole could only swing up in a clockwise direction; any counter-clockwise path was marked as unsafe.

Key Results

The performance of the SAC-RACBF was compared against standard SAC and a version utilizing a traditional "avoid-only" CBF:

  • Safety Reliability: Standard SAC failed almost entirely, with 99.4% of trajectories entering unsafe regions. In contrast, the SAC-RACBF reduced safety violations to a mere 0.07%.
  • Autonomous Resets: While traditional CBF filters could keep the robot safe, they lacked the mechanism to ensure the robot returned to the start. The SAC-RACBF successfully guided the robot back to the target reset region at the end of every episode without human intervention.
  • Learning Efficiency: The safety filter proved to be "minimally invasive." The RL agent was still able to learn the primary swing-up task effectively, achieving rewards comparable to an unfiltered agent in a safe environment, indicating that the filter does not overly restrict exploration.

Limitations and Future Directions

Despite its success, the method faces challenges regarding scalability. HJ reachability analysis suffers from the "curse of dimensionality," making it computationally expensive for systems with many degrees of freedom, such as humanoid robots. Additionally, the filter relies on a reasonably accurate mathematical model of the robot's dynamics.

Future work aims to address these limitations by incorporating DeepReach, a neural network-based approximation of HJ reachability. This could potentially scale the reach-avoid safety filter to high-dimensional systems and environments where the dynamics are not fully known, bringing fully autonomous, hands-off robotic learning closer to reality.

Summary updated

Abstract

Designing controllers that accomplish tasks while guaranteeing safety constraints remains a significant challenge. We often want an agent to perform well in a nominal task, such as environment exploration, while ensuring it can avoid unsafe states and return to a desired target by a specific time. In particular we are motivated by the setting of safe, efficient, hands-off training for reinforcement learning in the real world. By enabling a robot to safely and autonomously reset to a desired region (e.g., charging stations) without human intervention, we can enhance efficiency and facilitate training. Safety filters, such as those based on control barrier functions, decouple safety from nominal control objectives and rigorously guarantee safety. Despite their success, constructing these functions for general nonlinear systems with control constraints and system uncertainties remains an open problem. This paper introduces a safety filter obtained from the value function associated with the reach-avoid problem. The proposed safety filter minimally modifies the nominal controller while avoiding unsafe regions and guiding the system back to the desired target set. By preserving policy performance while allowing safe resetting, we enable efficient hands-off reinforcement learning and advance the feasibility of safe training for real world robots. We demonstrate our approach using a modified version of soft actor-critic to safely train a swing-up task on a modified cartpole stabilization problem.
BibTeX
@inproceedings{begzadic2025back,
  author = {Azra Begzadić and Nikhil Uday Shinde and Sander Tonkens and Dylan Hirsch and Kaleb Ugalde and Michael C. Yip and Jorge Cortes and Sylvia Lee Herbert},
  title = {{Back to Base: Towards Hands-Off Learning via Safe Resets with Reach-Avoid Safety Filters}},
  booktitle = {SAFE-ROL @ CoRL},
  year = {2025},
  url = {https://openreview.net/forum?id=QJV5LGs0Pf},
}
Figure