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 Cortés, Sylvia Herbert

TL;DR

This paper introduces a novel safety filter that guarantees both obstacle avoidance and timely recovery to a designated target set (like a charging station). By framing the Hamilton-Jacobi reachability value function as a relaxed "viscosity-based" control barrier function, the authors enable reinforcement learning agents to train safely in the real world and autonomously reset themselves without human intervention.

What Problem Does This Paper Address?

Reinforcement Learning (RL) has shown immense promise in simulation, but deploying it on physical robots remains notoriously difficult and expensive. Two major hurdles stand in the way:

  1. Safety: An exploring agent can easily damage itself or its environment.
  2. The Reset Problem: Standard RL algorithms assume that when an episode ends, the environment instantly resets to an initial state. In the real world, a human operator usually has to step in to physically move the robot back to base, untangle it, or plug it in.

While traditional Control Barrier Functions (CBFs) excel at keeping systems safe by preventing them from entering unsafe states, they don't guarantee liveness—meaning they cannot ensure the robot will actually make it back to a target reset zone before running out of time or battery. Conversely, reachability methods can guide a robot to a target but typically lack a framework to minimally modify a flexible, learning-based nominal policy. This paper bridges that gap to enable truly "hands-off" real-world learning.

Methods

The authors introduce Viscosity-Based Control Barrier Functions (VB-CBFs). Traditional CBFs require the barrier function to be continuously differentiable, which is rarely the case for complex, non-linear systems with control constraints. VB-CBFs relax this assumption by utilizing viscosity solutions, allowing them to handle non-smooth functions.

The core recipe of the paper is as follows:

  1. Hamilton-Jacobi Reachability (HJR) Analysis: The authors compute a time-varying value function ($V_0$) that solves a reach-avoid differential game. This function determines the "reach-avoid tube"—the set of all states from which a controller can guarantee the robot safely reaches the target within a specific timeframe, despite worst-case disturbances.
  2. Value Function as a VB-CBF: They mathematically prove that this HJR reach-avoid value function satisfies the conditions of a VB-CBF.
  3. Quadratic Program (QP) Safety Filter: For control-affine systems, they formulate a real-time safety filter as a QP. This filter monitors the nominal RL policy (in this case, Soft Actor-Critic). If the RL agent behaves safely, the filter does nothing. If the agent approaches the boundary of the reach-avoid tube, the filter minimally intervenes to keep the system safe and force it back toward the target reset state before time expires.
Figure 1: Our modified cartpole environment based on the Deepmind control suite. The green region in the left figure depicts the target region that we desire to reach, the center image depicts the swung up position that yields the highest reward and the red regions in the right image depict unsafe regions in the state space.

Datasets

The approach was evaluated on a simulated Modified Cartpole Environment based on the DeepMind Control Suite.

To make the task representative of real-world challenges, the environment was modified so that:

  • All mass is concentrated at the end of the pole, and damping/friction are removed, making energy dissipation difficult.
  • Unsafe regions are introduced in both position ($x$) and angular position ($\theta$), restricting the safe swing-up behavior to a clockwise direction.
  • A specific target region is defined at the bottom-inverted position where the robot must safely return ("reset") at the end of each training episode.

Key Insights and Ideas

  • The Reach-Avoid Tube as a Safe Set: Instead of using HJR solely to execute a rigid, time-optimal trajectory, the authors treat the entire reach-avoid tube as a time-varying safe zone. This gives the RL agent maximum freedom to explore and learn within the tube, only intervening when absolutely necessary.
  • Differentiability is Not a Dealbreaker: Proving that the reach-avoid value function works as a viscosity-based CBF means practitioners can use standard, non-smooth HJR value functions directly in optimization-based safety filters without needing complex smoothing approximations.
  • Autonomous Resets Enable Continuous Learning: By ensuring the agent always returns to the target set by the end of the episode, the system can seamlessly chain episodes together without human intervention, unlocking continuous, automated real-world training.

Key Results

The authors compared their method, SAC-RACBF (Soft Actor-Critic with Reach-Avoid VB-CBF), against standard SAC and an avoid-only baseline (SAC-CBF). They evaluated two versions: one with standard episodic resets and one without any external environment resets (SAC-RACBF-noreset).

  • Safety Violations: Standard SAC resulted in 99.437% unsafe trajectories during training. The avoid-only SAC-CBF reduced this to 0.563% but failed to return to the reset base. The proposed SAC-RACBF-noreset achieved 0.000% unsafe trajectories.
  • Task Performance: As shown in the paper's reward curves, the safety-filtered agents accumulated rewards closely comparable to standard SAC, proving that the filter is minimally invasive and does not cripple the agent's ability to learn the primary task.
  • Target Alignment: At the end of every episode, the proposed methods successfully brought the cartpole's state ($\Delta x, \Delta \theta, \Delta \dot{x}, \Delta \dot{\theta}$) close to 0 relative to the target region, whereas baseline methods left the system scattered randomly across the state space.

Limitations and Future Work

  • The Curse of Dimensionality: Computing exact HJR value functions grid-by-grid is computationally expensive and generally limited to lower-dimensional systems (typically $\le 4$ or $5$ dimensions).
  • Filter Dependency: The trained policy remains dependent on the safety filter during deployment to guarantee safety.
  • Future Directions: The authors plan to integrate DeepReach (a deep learning approach to approximate high-dimensional reachability) to scale this method to complex, high-dimensional robotic systems and handle partially unknown dynamics using online updates.

Summary updated

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 Cortés and Sylvia 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