Penalizing Side Effects using Stepwise Relative Reachability

Victoria Krakovna, Laurent Orseau, Miljan Martic, Shane Legg

Reinforcement Learning (RL) agents are typically designed to be "reward-seeking missiles." However, if their reward functions are even slightly misspecified—for example, if an agent is told to "move a box" but not explicitly told "don't break the vase"—it may cause significant, unintended disruptions to the environment. This paper from DeepMind addresses the challenge of preventing such "side effects" without hindering the agent's ability to perform its primary task.

The Side-Effect Problem

Previous attempts to penalize environmental impact often rely on measuring irreversibility. However, these methods frequently suffer from three major failure modes:

  1. Interference: Comparing the current state to a static starting state can lead agents to prevent natural changes in the world (e.g., stopping a human from eating) because those changes make the initial state unreachable.
  2. Offsetting: If penalized for any deviation from a "do nothing" counterfactual, an agent might perform a task and then immediately undo it to return the environment to its "natural" state.
  3. Magnitude Insensitivity: Binary reachability checks often treat all irreversible actions as equal, giving the agent no incentive to minimize damage once an initial side effect has occurred.

Proposed Method: Stepwise Relative Reachability

The authors propose a novel impact penalty that combines two core components: a Stepwise Inaction Baseline and a Relative Reachability measure.

1. Stepwise Inaction Baseline

Instead of comparing the current state to the beginning of an episode, the authors propose comparing it to what would have happened if the agent had taken a "no-op" (no-operation) action only on the most recent step. This ensures the agent only cares about the marginal impact of its latest decision.

The Stepwise Inaction Baseline compares the agent's current state ($s_t$) to a counterfactual trajectory ($s_t^{(t-1)}$) where it remained inactive at the last step.

To account for delayed effects, the method uses "inaction rollouts," simulating the future state of the world if the agent stopped acting now versus if it had stopped one step earlier. This allows the agent to detect if an action set off a chain reaction, such as a vase falling off a conveyor belt several steps later.

2. Relative Reachability (RR)

To solve magnitude sensitivity, the authors introduce Relative Reachability. Rather than a binary check, RR calculates the average reduction in reachability across the entire state space.

The Relative Reachability (RR) measure compares the reachability of a general state $s$ from the current state $s_t$ versus the baseline state $s'_t$.

Under this measure, an action that makes many states unreachable (like smashing a vase) receives a much higher penalty than one that only affects a few states (like moving a box slightly). This allows the agent to distinguish between minor disruptions and major, irreversible damage.

Experimental Evaluation

The approach was evaluated using the AI Safety Gridworlds suite. Key tests included:

  • Conveyor Belt Sushi: Tests for interference by seeing if the agent stops a human from eating.
  • Conveyor Belt Vase: Tests for offsetting by seeing if the agent puts a saved vase back on a dangerous belt.
  • Box: Tests for magnitude sensitivity by comparing paths that push a box into a corner versus an open area.

Results and Discussion

The combination of Relative Reachability and the Stepwise Inaction Baseline was the only configuration to pass all gridworld tests. While standard "Unreachability" measures failed to distinguish between safe and unsafe paths in the Box environment, and starting-state baselines led to interference in the Sushi environment, the proposed method successfully balanced goal-seeking with safety.

Despite these successes, challenges remain regarding scalability. Calculating reachability for all possible states is computationally expensive in high-dimensional environments. Future work may involve learning state weights to prioritize the reachability of "useful" states over trivial environmental details.

Summary updated

BibTeX
@inproceedings{krakovna2019penalizing,
  author = {Victoria Krakovna and Laurent Orseau and Miljan Martic and Shane Legg},
  title = {{Penalizing Side Effects using Stepwise Relative Reachability}},
  booktitle = {AISafety @ IJCAI},
  year = {2019},
}
Figure