Towards Empathic Deep Q-Learning

Bart Bussmann, Jacqueline Heinerman, Joel Lehman

Abstract

Standard Reinforcement Learning (RL) agents are typically "selfish" optimizers that pursue reward functions without regard for unintended negative side effects on their environment or other agents. This paper introduces Empathic DQN, an extension to Deep Q-Networks that encourages agents to minimize harm by "imagining" themselves in the position of others. By operationalizing the "Golden Rule"—treating the perceived state of another agent as if it were its own—the agent learns to avoid causing harm and to share resources more equitably. Experimental results in gridworld environments demonstrate that empathy can serve as an effective safety prior, leading to emergent fairness and reduced collateral damage.

Introduction

A fundamental challenge in AI safety is the difficulty of hard-coding every possible constraint into a reward function. A robot tasked with cleaning a room might inadvertently cause harm to a pet if "avoid the cat" was not explicitly specified. This research explores whether an agent can leverage its own internal reward models to "empathize" with others. By recognizing that actions causing "pain" to itself would likely be detrimental to others, the agent can adopt a more socially responsible policy without exhaustive manual reward shaping.

Methodology: The Empathic DQN

The proposed Empathic DQN modifies the standard Deep Q-Network architecture to incorporate the perspectives of other agents.

  1. The Empathic State ($s^{emp}$): The agent generates a "swapped" version of the current state. For instance, if the agent is at position A and another agent is at position B, the empathic state represents the world as if the agent were at position B.
  2. Value Augmentation: The agent utilizes two Q-networks. While $Q(s, a)$ represents standard self-centered value estimation, $Q_{emp}(s, a)$ estimates a weighted average of the agent's own value and the value it imagines the other agent is experiencing. This is achieved by passing the "swapped" state through the agent's own value function.
  3. The Selfishness Parameter ($\beta$): A hyperparameter $\beta \in [0, 1]$ controls the trade-off between self-interest and empathy. A value of $\beta = 1.0$ corresponds to a standard selfish DQN, while $\beta = 0.5$ weighs self-interest and imagined external value equally.

Experimental Setup

The framework was evaluated in two distinct "Gridworld" scenarios:

  • Coexistence Environment: A robot and a cat navigate a shared grid. Collisions result in "harm" to the cat. The robot's objective is to remain operative while minimizing these negative side effects.
  • Sharing Environment: A robot and a human compete for limited resources (batteries). The environment features diminishing returns for resource collection, testing the agent's propensity for hoarding versus equitable sharing.
The Sharing Environment gridworld setup featuring a robot (R), a human (H), and batteries (B).

Key Results and Discussion

The experiments revealed that empathy significantly influences agent behavior, often leading to safer and more cooperative outcomes.

Survival and Harm Mitigation

In the Coexistence environment, purely selfish agents ($\beta=1.0$) frequently collided with the cat to optimize their own survival time. In contrast, empathic agents ($\beta=0.25$) learned to navigate the environment while significantly reducing harm to the cat. Although these agents initially showed slower learning progress, they eventually developed sophisticated strategies to stay operative without causing collisions.

Average steps survived in the Coexistence environment across different selfishness levels ($\beta$).

Emergent Fairness

In the Sharing environment, the most equitable resource distribution occurred at $\beta=0.5$. At this setting, the robot naturally ceased hoarding batteries once its marginal utility fell below the imagined utility the human would gain from their first battery. This suggests that empathy can act as a flexible alternative to manual reward shaping, such as hard-coded "harm penalties."

Conclusion and Future Directions

Empathic DQN demonstrates that an agent's own internal experiences can serve as a powerful safety prior. By assuming that "what is bad for me is bad for you," agents can avoid universal harms like physical collisions. However, several challenges remain. The current implementation requires "omniscience" regarding the state of other agents and assumes that all agents share identical preferences. Future work will focus on integrating world models to infer others' perspectives and extending the framework to handle diverse agent types with subjective preferences.

Summary updated

BibTeX
@inproceedings{bussmann2019towards,
  author = {Bart Bussmann and Jacqueline Heinerman and Joel Lehman},
  title = {{Towards Empathic Deep Q-Learning}},
  booktitle = {AISafety @ IJCAI},
  year = {2019},
}
Figure