Trial without Error: Towards Safe Reinforcement Learning via Human Intervention

William Saunders, Girish Sastry, Andreas Stuhlmüller, Owain EvansAAMAS 2017

TL;DR

This paper introduces HIRL, a novel scheme for safe reinforcement learning (RL) training that uses human intervention to prevent catastrophic actions. By training a "Blocker" to imitate human oversight, HIRL aims to enable RL agents to learn complex tasks without causing harm, though it faces scalability challenges with more complex environments and adversarial agents.

What Problem Does This Paper Address?

Reinforcement learning (RL) agents learn through trial and error, which can be dangerous during training when the agent hasn't yet learned to avoid actions that cause serious harm, destroy property, or damage the environment. This is particularly problematic for real-world applications like self-driving cars or AI systems interacting with humans. While human intervention can act as a safeguard, it's infeasible for a human to constantly monitor an RL agent for millions or billions of timesteps. The paper addresses the challenge of how to train RL agents safely, preventing all catastrophic mistakes, without requiring continuous, prohibitively expensive human oversight.

Methods

The core of the proposed solution is the Human Intervention Reinforcement Learning (HIRL) scheme. HIRL involves two main phases:

  1. Human Oversight Phase: A human overseer directly monitors the RL agent's actions. If the agent proposes a "catastrophic" action (defined by the human), the human intervenes, blocks the action, and replaces it with a safe alternative. The human also provides a negative reward penalty for the catastrophic action. During this phase, data is collected: state-action pairs and whether the human intervened.
  2. Blocker Oversight Phase: A supervised learning model, termed the "Blocker," is trained to imitate the human's intervention decisions. This Blocker then takes over the oversight role, allowing the RL agent to train at full speed without continuous human presence. The Blocker aims to achieve near-perfect reliability in identifying and preventing catastrophic actions.

The paper also introduces a Human-trained Reward Shaping baseline. This baseline uses the same negative reward penalty for catastrophic actions but does not block them, relying solely on the reward signal to discourage such behavior.

Datasets

The experiments were conducted using the OpenAI Gym implementation of Atari Learning Environment. Specifically, three Atari games were used:

  • Pong: Catastrophe defined as the paddle entering a "Catastrophe Zone" at the bottom of the screen.
  • Space Invaders: Catastrophe defined as the agent shooting its own defensive barriers.
  • Road Runner: Catastrophe defined as the agent losing a life on Level 1.

The data for training the Blocker was generated during the Human Oversight phase of HIRL, consisting of state-action pairs labeled by the human as either catastrophic or safe.

Key Insights and Ideas

  • Human intervention is crucial for initial safety: The paper strongly suggests that for model-free RL, human intervention is currently the only reliable way to prevent any catastrophes during the initial learning phases.
  • Imitation learning can automate oversight: Training a "Blocker" to mimic human intervention is a viable strategy to scale human oversight, making it more feasible than continuous human monitoring.
  • Catastrophic forgetting is a major hurdle for RL safety: The Reward Shaping baseline failed to eliminate catastrophes due to catastrophic forgetting, where agents need to re-experience negative events to learn from them, highlighting a fundamental limitation of standard RL for safety-critical tasks.
  • Blocker robustness is key, especially against adversarial agents: The success of HIRL hinges on the Blocker's ability to generalize and not be fooled by novel, potentially adversarial actions discovered by the RL agent, as demonstrated by the failure in Road Runner.
  • Complexity of catastrophes matters: HIRL was highly successful with simple, "locally avoidable" catastrophes (like in Pong and Space Invaders) but struggled with more complex, "non-local" ones (like in Road Runner), indicating that the nature of the danger significantly impacts the effectiveness of the approach.

Key Results

  • Pong and Space Invaders: HIRL achieved zero catastrophes during training and maintained impressive performance, comparable to or better than baselines. The Blocker transferred perfectly to different RL agents in Pong.
  • Road Runner: HIRL significantly reduced catastrophes (by a factor of 50) but did not eliminate them. An early version of the Blocker failed due to an adversarial "Score Exploit" discovered by the agent, which was visually distinct from training examples. A corrected Blocker reduced the death rate from 0.002 to 0.0001 deaths per frame.
  • Reward Shaping Baseline: This baseline consistently failed to achieve zero catastrophes across all games, with rates converging to a low but non-zero level, attributed to catastrophic forgetting.
  • Human Time Cost: Extrapolations suggest that for more complex environments or games like Montezuma's Revenge, the human time cost for HIRL could be infeasible (e.g., over a year), highlighting scalability issues.

Limitations and Future Work

  • Scalability of Human Oversight: The primary limitation identified is the infeasible amount of human labor required for complex environments or games with rare catastrophes. The paper suggests several avenues for future work to address this:
  • More Data-Efficient Blockers: Developing classifiers that can learn from smaller training sets.
  • More Data-Efficient RL Agents: Reducing the overall training time needed for the RL agent to learn.
  • Seeking Out Catastrophes: Designing agents that actively seek out and trigger catastrophes early in training to generate more relevant data for the Blocker.
  • Selective Human Querying (Active Learning): Allowing the human overseer to take breaks when the agent is in safe regions of the state space and only intervening when the agent approaches dangerous areas.
  • Explaining Catastrophes: Augmenting binary "catastrophe/safe" labels with explanations to improve Blocker learning from limited data.
  • Model-Based RL for Safe Learning: Exploring model-based approaches where agents might learn about dangerous states without directly experiencing them.
  • Adversarial Agents: The failure in Road Runner highlights the challenge of training Blockers that are robust to adversarial examples discovered by the RL agent.
  • Complexity of Catastrophes: The current HIRL scheme is more effective for "locally avoidable" catastrophes. Future work may need to address "non-local" catastrophes which require deeper environmental understanding.

Summary updated

BibTeX
@inproceedings{saunders2017trial,
  author = {William Saunders and Girish Sastry and Andreas Stuhlmüller and Owain Evans},
  title = {{Trial without Error: Towards Safe Reinforcement Learning via Human Intervention}},
  booktitle = {AAMAS},
  year = {2017},
  url = {https://openreview.net/forum?id=J4vsmm4D5EA},
}
Figure