Table of Contents
Fetching ...

Exact Computation of Any-Order Shapley Interactions for Graph Neural Networks

Maximilian Muschalik, Fabian Fumagalli, Paolo Frazzetto, Janine Strotherm, Luca Hermes, Alessandro Sperduti, Eyke Hüllermeier, Barbara Hammer

TL;DR

This work addresses the interpretability of Graph Neural Networks (GNNs) by extending Shapley values to Shapley Interactions (SIs) and introducing GraphSHAP-IQ for exact computation of any-order SIs in graph predictions. By formulating a GNN-induced graph game $ u_g$ and node game $ u_i$, and assuming linear global pooling and a linear output layer, the authors show that non-trivial Möbius Interactions (MI) are confined to the nodes’ local $ ext{ℓ}$-hop neighborhoods, reducing the previously intractable $2^{n}$ complexity to a bound dependent on receptive fields. GraphSHAP-IQ efficiently computes exact MI and converts them to SI, with a lambda-based approximation that preserves the recovery property and distributes missing interaction mass to lower-order terms. The method is demonstrated on real-world datasets (molecules and water distribution networks), where the resulting SI-Graphs reveal meaningful substructures (e.g., benzene rings, NO$_2$ groups) and interaction dynamics aligned with domain knowledge, while substantially reducing computational requirements compared to model-agnostic baselines. This yields practical, faithful explanations for graph predictions and enables insight-driven analysis in chemistry and infrastructure domains.

Abstract

Albeit the ubiquitous use of Graph Neural Networks (GNNs) in machine learning (ML) prediction tasks involving graph-structured data, their interpretability remains challenging. In explainable artificial intelligence (XAI), the Shapley Value (SV) is the predominant method to quantify contributions of individual features to a ML model's output. Addressing the limitations of SVs in complex prediction models, Shapley Interactions (SIs) extend the SV to groups of features. In this work, we explain single graph predictions of GNNs with SIs that quantify node contributions and interactions among multiple nodes. By exploiting the GNN architecture, we show that the structure of interactions in node embeddings are preserved for graph prediction. As a result, the exponential complexity of SIs depends only on the receptive fields, i.e. the message-passing ranges determined by the connectivity of the graph and the number of convolutional layers. Based on our theoretical results, we introduce GraphSHAP-IQ, an efficient approach to compute any-order SIs exactly. GraphSHAP-IQ is applicable to popular message passing techniques in conjunction with a linear global pooling and output layer. We showcase that GraphSHAP-IQ substantially reduces the exponential complexity of computing exact SIs on multiple benchmark datasets. Beyond exact computation, we evaluate GraphSHAP-IQ's approximation of SIs on popular GNN architectures and compare with existing baselines. Lastly, we visualize SIs of real-world water distribution networks and molecule structures using a SI-Graph.

Exact Computation of Any-Order Shapley Interactions for Graph Neural Networks

TL;DR

This work addresses the interpretability of Graph Neural Networks (GNNs) by extending Shapley values to Shapley Interactions (SIs) and introducing GraphSHAP-IQ for exact computation of any-order SIs in graph predictions. By formulating a GNN-induced graph game and node game , and assuming linear global pooling and a linear output layer, the authors show that non-trivial Möbius Interactions (MI) are confined to the nodes’ local -hop neighborhoods, reducing the previously intractable complexity to a bound dependent on receptive fields. GraphSHAP-IQ efficiently computes exact MI and converts them to SI, with a lambda-based approximation that preserves the recovery property and distributes missing interaction mass to lower-order terms. The method is demonstrated on real-world datasets (molecules and water distribution networks), where the resulting SI-Graphs reveal meaningful substructures (e.g., benzene rings, NO groups) and interaction dynamics aligned with domain knowledge, while substantially reducing computational requirements compared to model-agnostic baselines. This yields practical, faithful explanations for graph predictions and enables insight-driven analysis in chemistry and infrastructure domains.

Abstract

Albeit the ubiquitous use of Graph Neural Networks (GNNs) in machine learning (ML) prediction tasks involving graph-structured data, their interpretability remains challenging. In explainable artificial intelligence (XAI), the Shapley Value (SV) is the predominant method to quantify contributions of individual features to a ML model's output. Addressing the limitations of SVs in complex prediction models, Shapley Interactions (SIs) extend the SV to groups of features. In this work, we explain single graph predictions of GNNs with SIs that quantify node contributions and interactions among multiple nodes. By exploiting the GNN architecture, we show that the structure of interactions in node embeddings are preserved for graph prediction. As a result, the exponential complexity of SIs depends only on the receptive fields, i.e. the message-passing ranges determined by the connectivity of the graph and the number of convolutional layers. Based on our theoretical results, we introduce GraphSHAP-IQ, an efficient approach to compute any-order SIs exactly. GraphSHAP-IQ is applicable to popular message passing techniques in conjunction with a linear global pooling and output layer. We showcase that GraphSHAP-IQ substantially reduces the exponential complexity of computing exact SIs on multiple benchmark datasets. Beyond exact computation, we evaluate GraphSHAP-IQ's approximation of SIs on popular GNN architectures and compare with existing baselines. Lastly, we visualize SIs of real-world water distribution networks and molecule structures using a SI-Graph.

Paper Structure

This paper contains 58 sections, 9 theorems, 36 equations, 19 figures, 4 tables, 4 algorithms.

Key Result

Theorem 3.3

For a graph $g$ and an $\ell$-Layer GNN $f_g$, let $\nu_i$ be the GNN-induced node game with $i \in N$. Then, $\nu_i$ satisfies the invariance $\nu_i(T) = \nu_i(T \cap \mathcal{N}_i^{(\ell)})$ for $T \subseteq N$.

Figures (19)

  • Figure 1: SI-Graphs overlayed on a molecule graph showing exact SI for a molecule with $30$ atoms from MTG. A GNN correctly identifies it as mutagenic. The SI, in line with ground-truth knowledge, highlight the $\text{NO}_{2}$ groups. Computing exact SI requires $2^{30} \approx 10^9$ model calls. GraphSHAP-IQ needs $7\,693$.
  • Figure 2: Illustration of the graph game $\nu_g$. Masked nodes (grey) are imputed by baseline $\mathbf{b}$, and embeddings are determined by the receptive field (left). Subsequently, a linear pooling ($\Psi$) and output layer ($\sigma$) yield the GNN-induced graph game output.
  • Figure 3: Complexity of GraphSHAP-IQ in model calls (in $\log10$) by number of nodes for all graphs of BZR (left) and MTG (middle, right) visualized by number of convolutional layers (left, middle) and graph density GNN (right). While model-agnostic baselines scale exponentially (dashed lines), GrahpSHAP-IQ scales approximately linearly with graph sizes ($R^2$ of log-curves in braces).
  • Figure 4: Approximation of SI with GraphSHAP-IQ (green) and model-agnostic baselines for MTG (left). At budgets, where GraphSHAP-IQ reaches exact SI, the baselines achieve varying estimation qualities and computational costs (middle) which leads to different estimated explanations, especially without interaction-informed baselines (right).
  • Figure 5: Exact SI values for three example graph structures. SV illustrate the trajectory of chlorination levels in a WDN (a). STII (order 2) values showcase that a Pyridine molecule is not classified as benzene (b), and the largest positive MI for a benzene molecule is the benzene ring (c).
  • ...and 14 more figures

Theorems & Definitions (19)

  • Definition 3.1: SI-Graph
  • Definition 3.2: GNN-induced Graph and Node Game
  • Theorem 3.3: Node Game Invariance
  • Lemma 3.5: Trivial Node Game Interactions
  • Proposition 3.6: Trivial Graph Game Interactions
  • Theorem 3.7: Complexity
  • proof
  • proof
  • proof
  • Lemma B.1
  • ...and 9 more