Handling Long-Term Safety and Uncertainty in Safe Reinforcement Learning

Jonas Guenster, Puze Liu, Jan Peters, Davide Tateo · DOI

Abstract

Reinforcement Learning (RL) holds significant promise for robotic control, yet the deployment of learning agents in real-world environments is often hindered by safety concerns. Traditional Safe RL methods frequently struggle with long-term safety consequences or rely on perfectly defined, static constraints. This paper introduces D-ATACOM, a framework that integrates model-based safe exploration with distributional reinforcement learning. By accounting for environmental uncertainty and learning safety boundaries from data, D-ATACOM ensures robots remain safe throughout the duration of a task, even in noisy or stochastic settings.

Introduction

In the real world, the "trial and error" nature of Reinforcement Learning is a liability. A robot cannot afford to collide with obstacles or exceed mechanical limits during its learning phase. While the field of Safe RL has attempted to address this, existing solutions typically fall into two categories: model-free methods that suffer from thousands of safety violations during training, or model-based methods that assume safety constraints are perfectly known and fixed.

In practice, constraints are often uncertain due to sensor noise, and an agent may find itself in a state that is safe in the immediate term but leads to an inevitable violation in the future. This research addresses these gaps by proposing a method that handles long-term safety and uncertainty without requiring hand-coded safety boundaries for every possible scenario.

Methodology: The D-ATACOM Framework

The researchers build upon ATACOM (Acting on the TAngent Space of the COnstraint Manifold), a technique that projects a robot's desired actions into a mathematically safe subspace. The proposed extension, D-ATACOM (Distributional ATACOM), introduces three critical components to manage risk and uncertainty:

  1. Feasibility Value Function (FVF): Unlike standard safety filters that look only at the current state, the FVF estimates the cumulative future constraint violations. This allows the agent to anticipate and avoid "dead ends" where a future crash becomes unavoidable.
  2. Distributional Reinforcement Learning: Rather than predicting a single average safety risk, D-ATACOM models a distribution of potential outcomes. By utilizing Conditional Value-at-Risk (CVaR), the agent can focus on the "worst-case" tail of the distribution, leading to more conservative and robust decision-making.
  3. Adaptive Thresholding: To balance the trade-off between safety and exploration, the framework includes an automated mechanism to tune the safety threshold ($\delta$) based on real-time performance, reducing the need for manual hyperparameter optimization.

Experimental Setup

The framework was evaluated across three distinct robotic simulations designed to test different aspects of safety and control:

  • Extended Cartpole: A benchmark task with strict constraints on pole angle and cart position.
  • Stochastic Navigation: A TIAGo++ mobile robot tasked with reaching a goal while avoiding a moving Fetch robot. This environment tests the agent's ability to handle stochasticity, as the obstacle's movements are not perfectly predictable.
  • 3-DoF Robot Air Hockey: A high-speed manipulation task requiring the robot to hit a puck while respecting joint limits and table boundaries.

Key Insights and Results

Learning the Safety Boundary

Unlike traditional model-based methods, D-ATACOM does not require pre-defined safety "walls." It learns the boundaries of the safe manifold by observing its own limited failures, which are stored in a specialized Failure Buffer. This allows the agent to adapt to task-specific constraints that may not be known a priori.

Proactive vs. Reactive Safety

In the navigation task, D-ATACOM demonstrated "active avoidance." While baseline methods often reacted only when a collision was imminent, D-ATACOM planned paths around moving obstacles well in advance. This behavior is a direct result of the Feasibility Value Function accounting for long-term trajectories.

Robustness and Performance

Experimental results indicate that D-ATACOM significantly reduces both the frequency and severity of safety violations during training compared to state-of-the-art baselines like LagSAC and WCSAC. Furthermore, the method proved robust to "model mismatch"—situations where the robot's internal mathematical model does not perfectly align with the environment's physics—because the FVF is learned from actual noisy data. Despite these strict safety constraints, the agent achieved final performance levels competitive with or superior to less-safe alternatives.

Discussion and Limitations

While D-ATACOM represents a significant step forward, it is not without limitations. The framework currently requires a reasonably accurate model of the robot's own kinematics and dynamics, which may be difficult to obtain for soft robotics. Additionally, the agent must experience a small number of initial violations to learn the safety boundaries. Future work may involve integrating offline datasets to provide a "warm start," potentially eliminating training-time crashes entirely. Finally, while the method excels at inequality constraints (e.g., staying within a boundary), further refinement is needed to handle complex equality constraints (e.g., following a specific line) with the same level of efficiency.

Conclusion

D-ATACOM provides a robust framework for Safe RL by combining the geometric guarantees of tangent space projections with the risk-aware nature of distributional learning. By prioritizing long-term feasibility and accounting for environmental uncertainty, it moves Reinforcement Learning closer to safe, reliable deployment on physical robotic hardware.

Summary updated

BibTeX
@inproceedings{guenster2024handling,
  author = {Jonas Guenster and Puze Liu and Jan Peters and Davide Tateo},
  title = {{Handling Long-Term Safety and Uncertainty in Safe Reinforcement Learning}},
  booktitle = {Conference on Robot Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=fWj7JMqlfm},
}
Figure