Online Safety Assurance for Deep Reinforcement Learning

Noga H. Rotman, Michael Schapira, Aviv Tamar

Abstract

Deep Reinforcement Learning (DRL) offers peak performance in controlled environments but often fails catastrophically when faced with real-world conditions it wasn't trained for. This paper proposes a framework for "Online Safety Assurance," which detects model uncertainty in real-time and automatically switches to a reliable, "battle-tested" heuristic whenever the DRL agent gets confused. We evaluate several uncertainty signals, including novelty detection and ensembles, showing that safety can be maintained with negligible overhead and without sacrificing in-distribution performance gains.

Introduction: The Generalization Challenge

In the world of networking, DRL has shown incredible promise for tasks like video streaming and congestion control. However, a major hurdle remains: generalization. A DRL agent trained on a specific set of network traces (e.g., 4G in Belgium) might perform worse than a random coin flip when deployed on a different network (e.g., 3G in Norway).

The authors identify this as the Online Safety Assurance Problem (OSAP). The challenge isn't just making models better; it’s building a system that knows when it doesn't know what to do. Currently, most DRL systems are "all-in"—they make decisions regardless of whether they are operating within their "comfort zone" or in completely alien territory.

Vanilla DRL (Pensieve) exhibits catastrophic failure when deployed on out-of-distribution network traces like Norway or Exponential distributions, falling far below even a random baseline.

Methods: A Safety Net Architecture

The researchers propose a "safety net" architecture that monitors a DRL agent using one of three uncertainty signals. If uncertainty crosses a calibrated threshold, the system defaults to a simple, robust heuristic (Buffer-Based, or BB).

Three methods for measuring uncertainty were explored:

  1. Novelty Detection ($U_S$): Uses a One-Class Support Vector Machine (OC-SVM) to flag input states that look nothing like the training data (Out-of-Distribution).
  2. Agent Ensembles ($U_\pi$): Measures disagreement (KL divergence) between multiple DRL agents with different initializations.
  3. Value Ensembles ($U_V$): Monitors variance in predicted future rewards across an ensemble of value functions.

To prevent "jitter" (constant flipping between the DRL and the heuristic), a thresholding strategy requires uncertainty to be detected for several consecutive time steps before switching.

Key Results and Insights

The evaluation revealed several critical findings regarding the trade-offs between performance and safety:

  • The Ensemble Paradox: Surprisingly, Agent Ensembles ($U_\pi$) performed the worst. Different agents can learn distinct but equally valid policies, leading to disagreement even in familiar territory. This makes them noisy and unreliable as safety signals.
  • Conservative vs. Opportunistic Safety: Novelty Detection (ND) is the most conservative, switching to safety immediately upon encountering a "weird" environment. Value Ensembles ($U_V$) are more "opportunistic," potentially staying with the DRL agent if reward predictions remain certain, even in new environments.
  • Safety without Sacrifice: In-distribution, safety-enhanced DRL still significantly outperformed the standalone BB heuristic. This proves that a safety net can be implemented without ruining the benefits of ML.
Cumulative Distribution Function (CDF) of average normalized rewards. Safety-enhanced methods (ND, V-Ensemble) significantly reduce the probability of catastrophic low-reward outcomes compared to vanilla Pensieve.

As shown in the CDF above, while vanilla Pensieve (dash-dotted blue line) occasionally achieves very high rewards, it also suffers from a long tail of extreme failures. The safety-enhanced versions (ND and V-Ensemble) effectively truncate this tail, ensuring "survival" in OOD conditions by pivoting to the BB heuristic when necessary.

Conclusion

Online Safety Assurance provides a practical path for deploying DRL in mission-critical systems. By acknowledging the limitations of generalization and providing a robust fallback mechanism, we can leverage the high performance of DRL while mitigating the risks of catastrophic failure. The uncertainty checks are incredibly fast (0.5ms to 4ms), making this approach feasible for real-time applications like video streaming.

Summary updated

BibTeX
@misc{rotman2020online,
  author = {Noga H. Rotman and Michael Schapira and Aviv Tamar},
  title = {{Online Safety Assurance for Deep Reinforcement Learning}},
  year = {2020},
  eprint = {2010.03625},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2010.03625},
}

Loading related content...

Figure