Avoiding Side Effects By Considering Future Tasks

Victoria Krakovna, Laurent Orseau, Richard Ngo, Miljan Martic, Shane Legg

Designing reward functions for reinforcement learning agents is notoriously difficult. If you instruct a robot to "mop the floor," it might knock over a priceless vase because you didn't explicitly tell it not to. This is known as the side effects problem: how do we specify what an agent should not do without manually listing every possible undesirable outcome?

Previous attempts to solve this, such as penalizing "irreversibility," often fail when a task inherently requires an irreversible action (e.g., you must break eggs to make an omelet). Furthermore, agents rewarded simply for "keeping options open" often develop interference incentives. For instance, a robot might stop a human from eating a sandwich simply because that sandwich could be "useful" for a hypothetical future task. This paper introduces a principled way to penalize side effects that works even when tasks are irreversible, while avoiding meddling in the environment's natural dynamics.

The Future Task Approach

The authors propose that side effects are undesirable primarily because they reduce the agent's ability to perform other tasks in the future. To formalize this, they introduce an auxiliary reward ($r_{aux}$). Beyond the main task reward, the agent receives a bonus based on its ability to reach various potential goal states in the environment after the current task is completed.

Breaking an object during the current task renders future tasks involving that object unachievable.

The most elegant insight here is that we don't need to define "harm." We only need to define "reachability." If an agent breaks a vase, it can no longer complete any future task that involves that vase. This automatically creates a penalty for destruction, acting as a natural deterrent against unnecessary side effects.

Filtering Interference with a Baseline Policy

To solve the interference problem—where the agent meddles with natural environment dynamics to preserve future options—the authors introduce a baseline policy ($\pi'$).

The agent's state after the current task ($s_T$) is compared against a baseline state ($s'_T$) to evaluate future task reachability.

The baseline policy acts as a reference or "default" course of action (such as doing nothing). The agent is only penalized if it makes a future task less achievable than it would have been if the agent had just followed this baseline policy from the start of the episode. This acts as a "moral" filter: if a sushi roll was going to be eaten by a human anyway (the default outcome), the agent isn't penalized for it, effectively eliminating the incentive to interfere.

The paper also argues for an initial mode baseline. Instead of comparing the current state to the previous state (stepwise), it compares the current state to what the state would have been if the agent had never intervened from the very beginning ($s_0$). This is crucial for catching "delayed" side effects, incentivizing the agent to "clean up" after itself (e.g., closing a door it had to open).

To handle the computational burden of evaluating many possible future goals, the authors utilize Universal Value Function Approximators (UVFAs), allowing a single neural network to estimate values across different goal states simultaneously.

Key Results in AI Safety Gridworlds

The method was evaluated on several specialized AI Safety Gridworlds:

  • Vase: A classic side-effect test where the shortest path to a goal involves bumping into a fragile object.
  • Box & Soko-coin: Tasks requiring irreversible moves (pushing boxes, collecting coins) to reach a goal, testing if the agent can distinguish between necessary and unnecessary irreversible actions.
  • Sushi: Tests for interference, where a conveyor belt moves sushi toward a human.

Superiority over Reversibility: In the "Box" and "Soko-coin" environments, baseline agents relying on reversibility penalties failed because they couldn't handle tasks requiring any irreversible steps. The Future Task agent succeeded by only penalizing unnecessary irreversibility.

Eliminating Interference: In the "Sushi" environment, the basic future task approach (without a baseline) showed high interference, constantly snatching sushi off the belt to "save" it. Adding the baseline policy reduced these meddling behaviors to near zero. Furthermore, while the "exact" version of the algorithm performed best, the UVFA approximation successfully learned to avoid side effects, proving the method's potential to scale.

Limitations and Future Work

While promising, the approach has limitations. It assumes a baseline policy (like "stay put") is given, but defining "doing nothing" in complex environments is non-trivial. Additionally, the theoretical proofs for avoiding interference currently hold for deterministic environments; extending this to stochastic worlds remains an open challenge. Finally, the authors used a uniform distribution over all possible states as future goals. Future work could involve learning a more "human-centric" distribution of tasks to align the side-effect penalty more closely with human values.

Summary updated

BibTeX
@inproceedings{krakovna2020avoiding,
  author = {Victoria Krakovna and Laurent Orseau and Richard Ngo and Miljan Martic and Shane Legg},
  title = {{Avoiding Side Effects By Considering Future Tasks}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
  url = {https://openreview.net/forum?id=YJJyWsNCZOa},
}
Figure