NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Visual Rationalizations in Deep Reinforcement Learning for Atari Games

Laurens Weitkamp, Elise van der Pol, Zeynep Akata

TL;DR

This paper adapts Grad-CAM, a popular computer vision explanation technique, to Deep Reinforcement Learning (DRL) to create "visual rationalizations" for agent behavior. By highlighting which parts of a game screen trigger specific actions, the authors reveal whether an agent is truly "playing the game" or simply exploiting specific pixel patterns.

What Problem Does This Paper Address?

Deep Reinforcement Learning (DRL) agents have achieved superhuman performance in complex environments like Atari 2600 games. However, these models are notorious "black boxes." A high-scoring agent might be making decisions based on the "wrong" features—a lack of robustness that only becomes apparent when the agent suddenly fails in non-obvious ways.

The authors address the need for Explainable AI (XAI) in reinforcement learning. They argue that for humans to trust and interact with these agents, we need post-hoc explanations (rationalizations) that justify an action after it has been taken.

Methods

The researchers utilize the Asynchronous Advantage Actor-Critic (A3C) architecture, a standard DRL model that consists of an "actor" (which chooses actions) and a "critic" (which estimates the value of a state).

To explain the actor's decisions, they adapt Grad-CAM (Gradient-weighted Class Activation Mapping):

  1. Gradient Flow: They take the gradient of the logit score for a specific action (before the softmax layer) and flow it back to the final convolutional layer of the neural network.
  2. Importance Weights: These gradients are global-average-pooled to determine which "neurons" in the high-level feature map are most important for that specific action.
  3. Heatmap Generation: They produce a coarse localization map (a heatmap) and overlay it on the original game frame.
  4. The ELU Tweak: Unlike the original Grad-CAM which uses ReLU, the authors use ELU (Exponential Linear Unit) to avoid the "dying ReLU" problem, ensuring smoother and more informative activation maps in the RL context.

Datasets

The study evaluates agents on three diverse Atari 2600 games via the OpenAI Gym:

  • Pong: A simple game used to compare basic tracking vs. strategic exploitation.
  • BeamRider: A complex shooter with multiple moving enemies and limited resources (torpedoes).
  • Seaquest: A multi-objective game requiring the agent to manage a depleting oxygen bar while rescuing swimmers and fighting sharks.

Key Insights and Ideas

  • Strategy vs. Reaction: In Pong, the "Full Agent" (highly trained) often ignores the ball entirely, focusing its attention on a specific corner of the screen to exploit a known winning trajectory. In contrast, the "Half Agent" (less trained) actively tracks the ball, showing a more reactive but less efficient "human-like" behavior.
  • Identifying "Blind Spots": The visualizations explain why agents fail. In Seaquest, the agent often dies from running out of oxygen. The Grad-CAM maps show that the agent never "looks" at the oxygen bar, suggesting it never learned the correlation between that UI element and the end of a game episode.
  • Feature Confusion: In BeamRider, the agent sometimes fails to distinguish between a dangerous "green bounce craft" and harmless green debris because they share similar visual features, leading to avoidable deaths.
  • UI Bias: Interestingly, the agent often maintains high attention on the "torpedo count" in BeamRider even when taking actions unrelated to firing, suggesting the model might be over-relying on static UI elements for its internal state representation.

Key Results

  • Qualitative Success: The model successfully produces high-quality heatmaps that highlight relevant game objects (the ball in Pong, enemies in BeamRider) that motivate specific actions.
  • Performance Gap: The "Full Agent" (trained on 40M+ frames) significantly outperformed the "Half Agent" (20M frames). For example, in BeamRider, the Full Agent averaged a score of ~4659 vs. the Half Agent's ~1597.
  • Rationalizing Failure: The authors demonstrated that visual rationalizations are most useful when the agent fails, as they highlight exactly which environmental cues the agent missed or misinterpreted.

Limitations and Future Work

The authors acknowledge several hurdles:

  • Ambiguity: Sometimes the heatmaps are "noisy," highlighting static objects or seemingly random empty space, making them difficult for humans to interpret.
  • Lack of Quantitative Metrics: The evaluation is primarily qualitative (visual inspection). The authors suggest that future work should include user studies to measure if these heatmaps actually improve human trust or task performance.
  • Temporal Explanations: Current rationalizations are frame-by-frame. Since RL is inherently about sequences, developing explanations that account for time and "memory" (e.g., for LSTM-based agents) is a logical next step.

Summary updated

BibTeX
@inproceedings{weitkamp2018visual,
  author = {Laurens Weitkamp and Elise van der Pol and Zeynep Akata},
  title = {{Visual Rationalizations in Deep Reinforcement Learning for Atari Games}},
  booktitle = {BNCAI},
  year = {2018},
  url = {https://openreview.net/forum?id=v8lTgYpXbj},
}
Figure