Long-Term Safe Reinforcement Learning with Binary Feedback

Akifumi Wachi, Wataru Hashimoto, Kazumune Hashimoto

Abstract

Reinforcement learning (RL) in safety-critical domains requires guarantees that go beyond average performance. Most existing safe RL methods rely on precise numerical safety costs and focus on immediate safety. We present LoBiSaRL (Long-term Binary feedback Safe RL), a framework that ensures long-term safety—guaranteeing an agent remains safe throughout its mission—using only binary "safe/unsafe" feedback. By combining Generalized Linear Models with Lipschitz continuity and a conservative anchor policy, LoBiSaRL maintains safety even in stochastic environments with unknown dynamics. Experimental results in a grid-world environment demonstrate that LoBiSaRL achieves zero safety violations, outperforming baselines that only consider instantaneous safety.

Introduction

In high-stakes applications like autonomous driving or robotic surgery, "safety on average" is insufficient; a single mistake can be catastrophic. Existing safe RL research faces three major hurdles. First, most models require fine-grained numerical "safety costs," whereas real-world feedback is often binary (e.g., a sensor trigger or a human supervisor's "Stop!"). Second, many algorithms are short-sighted, ensuring only that the next action is safe without considering if that action leads to a future "dead end." Finally, real-world environments are stochastic, and their transition dynamics are often unknown beforehand.

Comparison of instantaneous safety feedback versus long-term trajectory safety requirements.

LoBiSaRL addresses these challenges by ensuring long-term safety—guaranteeing a safe path to the end of an episode with high probability—using only binary feedback while navigating unknown, random state transitions.

Methodology

LoBiSaRL (Long-term Binary feedback Safe RL) utilizes three core components to maintain safety throughout an agent's trajectory:

Dual-Safety Modeling

To estimate the safety of a state-action pair, the algorithm merges two distinct mathematical approaches:

  1. Generalized Linear Models (GLMs): Similar to logistic regression, this component learns the safety boundary from binary data, increasing in accuracy as the agent collects more experience.
  2. Lipschitz Continuity: By assuming that similar actions in similar states yield similar safety outcomes, the agent maintains a "pessimistic" safety buffer. This is critical during the "cold start" phase of training when the GLM has insufficient data.
The evolution of safety bounds from a conservative policy to early-phase Lipschitz bounds and finally accurate GLM-based estimation.

The Conservative Anchor and Optimization

The algorithm assumes the existence of a conservative policy ($\pi^\sharp$), a known, safe-but-suboptimal behavior (such as a vehicle crawling at minimal speed). LoBiSaRL uses this as a safety net, ensuring it never deviates so far from this policy that it cannot return to a safe state. The agent solves a max-min problem using Lagrangian Optimization, maximizing rewards while a Lagrange multiplier penalizes actions that increase the risk of future safety violations.

Experimental Evaluation

The algorithm was evaluated in a synthetic 20x20 grid-world environment with stochastic transitions (80% success rate for intended moves). The safety zones were structured to follow a GLM distribution. LoBiSaRL was compared against several baselines, including reward-only agents and agents that only consider instantaneous (one-step) safety.

Key Results

  • Zero Violations: LoBiSaRL was the only algorithm to achieve 0.0 unsafe actions across 100 different random environments.
  • Long-term vs. Instantaneous: The "Instantaneous" baseline failed occasionally because it could not account for how environment randomness might push the agent into dangerous territory several steps later.
  • Performance Trade-off: While LoBiSaRL is more conservative (achieving a normalized reward of 0.76 vs. 0.86 for the less-safe instantaneous agent), it provides the absolute safety guarantees required for critical systems.

Discussion and Limitations

The core insight of LoBiSaRL is that for an action to be truly safe, there must exist at least one sequence of future actions that keeps the agent safe until the end of the mission. By adopting a pessimistic stance—using the lower bound of safety estimates—the agent avoids dangerous exploration.

However, some challenges remain. LoBiSaRL requires a known conservative policy to act as a reference, which may be difficult to define in highly complex, unknown environments. Additionally, solving long-term safety constraints at every step increases computational complexity. Future work will focus on improving the "tightness" of safety bounds to recover performance lost to extreme conservatism without sacrificing the zero-violation guarantee.

Summary updated

BibTeX
@inproceedings{wachi2024long,
  author = {Akifumi Wachi and Wataru Hashimoto and Kazumune Hashimoto},
  title = {{Long-Term Safe Reinforcement Learning with Binary Feedback}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i19.30164},
}
Figure