FlowX: Towards Explainable Graph Neural Networks via Message Flows
Shurui Gui, Hao Yuan, Jie Wang, Qicheng Lao, Kang Li, Shuiwang Ji
TL;DR
FlowX presents a novel, flow-centric framework for explaining Graph Neural Networks by attributing predictions to multi-hop message flows. It combines Shapley-value-inspired flow marginal contributions with a fair, permutation-based sampling scheme and a trainable refinement that enables both necessary and sufficient explanations, as well as a FlowMask variant for mutual-information driven explanations. The approach models GNNs as flow-based systems and converts flow attributions into layer-edge masks via stochastic normalization, enabling targeted explanations with quantified fidelity and sparsity. Empirical results across synthetic and real-world datasets show FlowX and its variants outperform edge- or node-centric baselines in both faithfulness (Fidelity+) and sufficiency (Fidelity-), while Flow-based explanations better capture multi-hop dependencies than traditional methods. The work highlights multi-hop correlation modeling as a core advantage of flow-based explanations and provides a scalable, flexible tool for producing human-interpretable GNN explanations with practical impact in domains requiring trustworthy AI.
Abstract
We investigate the explainability of graph neural networks (GNNs) as a step toward elucidating their working mechanisms. While most current methods focus on explaining graph nodes, edges, or features, we argue that, as the inherent functional mechanism of GNNs, message flows are more natural for performing explainability. To this end, we propose a novel method here, known as FlowX, to explain GNNs by identifying important message flows. To quantify the importance of flows, we propose to follow the philosophy of Shapley values from cooperative game theory. To tackle the complexity of computing all coalitions' marginal contributions, we propose a flow sampling scheme to compute Shapley value approximations as initial assessments of further training. We then propose an information-controlled learning algorithm to train flow scores toward diverse explanation targets: necessary or sufficient explanations. Experimental studies on both synthetic and real-world datasets demonstrate that our proposed FlowX and its variants lead to improved explainability of GNNs. The code is available at https://github.com/divelab/DIG.
