TL;DR
Explaining Graph Neural Networks (GNNs) via higher-order feature interactions (like walks) has historically been bottlenecked by exponential computational complexity. This paper introduces sGNN-LRP, a novel message-passing algorithm that leverages sum-product decomposition to reduce subgraph attribution complexity from exponential to linear time relative to network depth. This enables efficient, scalable, and highly accurate higher-order explanations for deep GNNs operating on large graphs.
What Problem Does This Paper Address?
Graph Neural Networks (GNNs) are powerful but notoriously act as "black boxes." To trust their predictions in safety-critical domains like drug discovery or social network analysis, we need to understand why they make certain decisions.
While simple explanation methods highlight individual nodes or edges, complex properties (like the toxicity of a molecule) usually emerge from the joint interaction of multiple features within a subgraph. A state-of-the-art method called GNN-LRP (Layer-wise Relevance Propagation) can capture these higher-order interactions by tracking "walks" (sequences of nodes) across the network's layers.
However, calculating the total relevance of a specific subgraph requires summing over all possible walks contained within it. As the network gets deeper, the number of walks explodes exponentially ($O(|S|^L)$ where $L$ is the network depth). This computational wall has limited higher-order explanations to tiny subgraphs and very shallow networks.
Methods
The authors overcome the exponential complexity barrier with two key innovations:
- LRP as Message Passing: The core breakthrough is realizing that tracking walk relevances through GNN layers shares the exact same decomposable mathematical structure as computing marginal probabilities in a Markov chain. Instead of naively enumerating every single walk, the authors apply the sum-product algorithm (commonly known as belief propagation). This allows them to aggregate walk relevances layer-wise in a single backward pass, dropping the complexity from exponential to linear ($O(|S|^2 \cdot N^2 L)$).
- The Forward-Hook Trick: To make the algorithm practical and easy to implement, the authors adapt a forward-hook technique. By modifying the forward pass with a constant mask matrix and utilizing standard automatic differentiation (Autograd), they can compute the subgraph relevance efficiently without manually coding complex backward message-passing routines.
- Generalized Subgraph Attribution: The original definition of subgraph relevance strictly looks at walks that never leave the subgraph. The authors generalize this by introducing a discounting parameter $\alpha \in [0, 1]$. Walks that step outside the subgraph are penalized rather than completely ignored, allowing the explanation to capture how a subgraph interacts with its surrounding context.
Datasets
The authors evaluated their approach across five diverse datasets:
- BA-2motif: A synthetic dataset with ground-truth motif structures, ideal for verifying explanation accuracy.
- MUTAG & Mutagenicity: Molecular datasets where the task is to predict whether a molecule is mutagenic (a property heavily reliant on higher-order functional groups like $NO_2$).
- REDDIT-BINARY: A social network dataset containing large graphs (averaging over 400 nodes per graph).
- Graph-SST2: A natural language processing sentiment dataset where sentences are mapped into parse tree graphs.
Key Insights and Ideas
- The Markov Chain Connection: The ultimate "aha moment" of the paper is mapping relevance propagation to a virtual stochastic system. Viewing relevance as a particle moving through a Markov chain unlocks decades of established message-passing algorithms for explainable AI.
- Isolating Subgraphs is Suboptimal: Subgraphs do not exist in a vacuum. The authors discover that setting $\alpha > 0$ (allowing walks to briefly step outside the subgraph) yields significantly better explanations in real-world datasets. This proves that a subgraph's boundary interactions with the rest of the graph are crucial to the GNN's prediction strategy.
Key Results
- Massive Speedups: On a 7-layer Graph Isomorphism Network (GIN) using the BA-2motif dataset, the Naive GNN-LRP method takes a sluggish 142,000 milliseconds. The proposed
sGNN-LRPfinishes the exact same calculation in just 9.81 milliseconds. - Scalability to Large Graphs: For the REDDIT-BINARY dataset, the naive method completely fails due to Out-of-Memory (OOM) errors.
sGNN-LRPhandles it easily, running in under 200 milliseconds. - Superior Explanation Quality: When evaluating node-ordering performance via Area Under the Activation Curve (AUAC) and Area Under the Pruning Curve (AUPC), the generalized sGNN-LRP method consistently outperformed strong baselines like GNNExplainer and Grad-CAM in 6 out of 8 evaluation scenarios.
Limitations and Future Work
While the generalized subgraph attribution method shows clear performance benefits, it introduces the discounting parameter $\alpha$, which currently requires manual tuning or grid searching depending on the dataset and task. The authors note that developing automated, data-driven tuning procedures for $\alpha$ is a primary direction for future work. Additionally, they plan to explore the application of these efficient algorithms to adjacent domains like NLP and neuroimaging.
Summary updated