Skip to main content
QUICK REVIEW

[Paper Review] Explaining Reinforcement Learning with Shapley Values

Daniel Beechey, Thomas M. S. Smith|arXiv (Cornell University)|Jun 9, 2023
Explainable Artificial Intelligence (XAI)Computer Science6 citations
TL;DR

This paper introduces SVERL (Shapley Values for Explaining Reinforcement Learning), a theoretically grounded framework that uses Shapley values to attribute contributions of individual state features to an agent's performance in reinforcement learning. By modeling feature contributions via policy-based characteristic functions and leveraging on-manifold sampling for approximation, SVERL produces intuitive, accurate explanations that align with human intuition across multiple environments.

ABSTRACT

For reinforcement learning systems to be widely adopted, their users must understand and trust them. We present a theoretical analysis of explaining reinforcement learning using Shapley values, following a principled approach from game theory for identifying the contribution of individual players to the outcome of a cooperative game. We call this general framework Shapley Values for Explaining Reinforcement Learning (SVERL). Our analysis exposes the limitations of earlier uses of Shapley values in reinforcement learning. We then develop an approach that uses Shapley values to explain agent performance. In a variety of domains, SVERL produces meaningful explanations that match and supplement human intuition.

Motivation & Objective

  • To address the lack of principled, post-hoc explanation methods for high-capacity reinforcement learning agents using function approximators like deep neural networks.
  • To identify and correct theoretical flaws in prior uses of Shapley values in reinforcement learning, which often misapplied the framework.
  • To develop a new framework that explains agent performance by quantifying the contribution of individual state features to expected return.
  • To ensure the explanation method is theoretically sound, satisfying fairness axioms from game theory while remaining computationally feasible.
  • To validate that the resulting explanations align with human intuition and improve interpretability in real-world RL applications.

Proposed method

  • Proposes SVERL, a framework that formulates reinforcement learning explanation as a cooperative game where state features are players and performance is the outcome.
  • Defines a characteristic value function $ v(C) $ as the expected return when only features in set $ C $ are observable, with full policy behavior conditioned on those features.
  • Uses the standard Shapley value formula $ \phi_i(v) = \sum_{C \subseteq \mathcal{F} \setminus \{i\}} \frac{|C|!(|\mathcal{F}| - |C| - 1)!}{|\mathcal{F}|!} \cdot \delta(i, C) $, where $ \delta(i, C) $ is the marginal gain of adding feature $ i $ to coalition $ C $.
  • Applies on-manifold sampling to approximate the characteristic function values, sampling state transitions conditioned on subsets of features to estimate expected returns.
  • Employs Monte Carlo rollouts to estimate expected returns under different partial-observation policies, enabling scalable computation of Shapley values.
  • Introduces SVERL-P, a variant that explicitly models policy changes when features are removed, ensuring accurate attribution of performance impact.
Figure 2 : Top panel: Shapley values applied to a state-action value function in Gridworld-A ( Figure 1(a) ). Bottom panel: SVERL-P, presented in Section 4 , for the same domain. The optimal action is always North so we intuitively expect contributions to performance to be zero for all state feature
Figure 2 : Top panel: Shapley values applied to a state-action value function in Gridworld-A ( Figure 1(a) ). Bottom panel: SVERL-P, presented in Section 4 , for the same domain. The optimal action is always North so we intuitively expect contributions to performance to be zero for all state feature

Experimental results

Research questions

  • RQ1How can Shapley values be correctly and consistently applied to explain reinforcement learning policies, avoiding prior theoretical errors?
  • RQ2What aspects of reinforcement learning are most valuable to explain, and why is agent performance a critical but overlooked target?
  • RQ3Can Shapley-based explanations of state features produce intuitive and meaningful insights that align with human understanding?
  • RQ4How can Shapley values be efficiently approximated in high-dimensional state spaces common in real-world RL tasks?
  • RQ5What are the practical implications of using feature attribution for improving trust, debugging, and policy design in RL systems?

Key findings

  • SVERL provides a theoretically sound explanation framework that satisfies the fairness axioms of Shapley values, correcting earlier incorrect or incomplete applications in RL.
  • The SVERL-P variant, which models policy changes upon feature removal, produces explanations that are both accurate and aligned with human intuition in gridworld and other domains.
  • Approximate computation via on-manifold sampling enables feasible deployment of SVERL in large state spaces, with convergence guarantees similar to those in supervised learning.
  • The method successfully identifies which state features contribute most to agent performance, offering actionable insights for policy improvement and debugging.
  • SVERL's explanations are interpretable and extendable, allowing users to hypothesize on feature roles—though such hypotheses require empirical validation.
  • The framework is generalizable and compatible with existing advances in Shapley value methods, such as groupShapley, for scalable and grouped feature attribution.
Figure 3 : On the left: Shapley values applied to a state-value function in a Tic-Tac-Toe state. On the right: SVERL-P, presented in Section 4 , for the same state. Shapley values are represented using a color scale projected onto each cell. There are 9 state features, corresponding to each position
Figure 3 : On the left: Shapley values applied to a state-value function in a Tic-Tac-Toe state. On the right: SVERL-P, presented in Section 4 , for the same state. Shapley values are represented using a color scale projected onto each cell. There are 9 state features, corresponding to each position

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.