Table of Contents
Fetching ...

QGShap: Quantum Acceleration for Faithful GNN Explanations

Haribandhu Jena, Jyotirmaya Shivottam, Subhankar Mishra

TL;DR

QGShap tackles the problem of producing exact Shapley explanations for GNN predictions, which is computationally prohibitive with classical methods. It introduces a quantum-accelerated framework based on amplitude estimation to compute Shapley values exactly while achieving near-quadratic speedups over Monte Carlo approaches. Through experiments on synthetic graph benchmarks (Bridge and BA2-Motif) with a GIN backbone, QGShap demonstrates faithful, stable, and structure-aligned explanations and outperforms several baselines on multiple fidelity-based metrics. The work also discusses current hardware limitations and provides open-source code to foster further development of quantum-ready explainability for graphs.

Abstract

Graph Neural Networks (GNNs) have become indispensable in critical domains such as drug discovery, social network analysis, and recommendation systems, yet their black-box nature hinders deployment in scenarios requiring transparency and accountability. While Shapley value-based methods offer mathematically principled explanations by quantifying each component's contribution to predictions, computing exact values requires evaluating $2^n$ coalitions (or aggregating over $n!$ permutations), which is intractable for real-world graphs. Existing approximation strategies sacrifice either fidelity or efficiency, limiting their practical utility. We introduce QGShap, a quantum computing approach that leverages amplitude amplification to achieve quadratic speedups in coalition evaluation while maintaining exact Shapley computation. Unlike classical sampling or surrogate methods, our approach provides fully faithful explanations without approximation trade-offs for tractable graph sizes. We conduct empirical evaluations on synthetic graph datasets, demonstrating that QGShap achieves consistently high fidelity and explanation accuracy, matching or exceeding the performance of classical methods across all evaluation metrics. These results collectively demonstrate that QGShap not only preserves exact Shapley faithfulness but also delivers interpretable, stable, and structurally consistent explanations that align with the underlying graph reasoning of GNNs. The implementation of QGShap is available at https://github.com/smlab-niser/qgshap.

QGShap: Quantum Acceleration for Faithful GNN Explanations

TL;DR

QGShap tackles the problem of producing exact Shapley explanations for GNN predictions, which is computationally prohibitive with classical methods. It introduces a quantum-accelerated framework based on amplitude estimation to compute Shapley values exactly while achieving near-quadratic speedups over Monte Carlo approaches. Through experiments on synthetic graph benchmarks (Bridge and BA2-Motif) with a GIN backbone, QGShap demonstrates faithful, stable, and structure-aligned explanations and outperforms several baselines on multiple fidelity-based metrics. The work also discusses current hardware limitations and provides open-source code to foster further development of quantum-ready explainability for graphs.

Abstract

Graph Neural Networks (GNNs) have become indispensable in critical domains such as drug discovery, social network analysis, and recommendation systems, yet their black-box nature hinders deployment in scenarios requiring transparency and accountability. While Shapley value-based methods offer mathematically principled explanations by quantifying each component's contribution to predictions, computing exact values requires evaluating coalitions (or aggregating over permutations), which is intractable for real-world graphs. Existing approximation strategies sacrifice either fidelity or efficiency, limiting their practical utility. We introduce QGShap, a quantum computing approach that leverages amplitude amplification to achieve quadratic speedups in coalition evaluation while maintaining exact Shapley computation. Unlike classical sampling or surrogate methods, our approach provides fully faithful explanations without approximation trade-offs for tractable graph sizes. We conduct empirical evaluations on synthetic graph datasets, demonstrating that QGShap achieves consistently high fidelity and explanation accuracy, matching or exceeding the performance of classical methods across all evaluation metrics. These results collectively demonstrate that QGShap not only preserves exact Shapley faithfulness but also delivers interpretable, stable, and structurally consistent explanations that align with the underlying graph reasoning of GNNs. The implementation of QGShap is available at https://github.com/smlab-niser/qgshap.

Paper Structure

This paper contains 20 sections, 13 equations, 4 figures, 1 table, 1 algorithm.

Figures (4)

  • Figure 1: QGShap Workflow: The input graph $\mathcal{G}$ is mapped to node coalitions $\mathcal{C}$, each scored by the trained GNN $f_{\theta}$ via a masking oracle to obtain coalition values. A quantum module prepares three registers: a Partition register encoding Shapley weights, a Player register encoding coalition indices, and a Utility register encoding normalized coalition scores. Quantum amplitude estimation over the Utility register aggregates weighted marginal contributions, yielding node-level Shapley attributions as the final explanations.
  • Figure 2: Circuit of the QGShap utility oracle $U^{(\pm)}_{\text{val}}$. The player register $Q_{\text{pl}}$ encodes coalitions $S \subseteq V \setminus \{p_j\}$, while the auxiliary register $Q_{\text{aux}}$ and utility register $Q_{\text{ut}}$ store normalized cooperative values $\hat{v}(S)$ and $\hat{v}(S \cup \{p_j\})$. The quantum oracles $U^{(-)}_{\text{val}}$ and $U^{(+)}_{\text{val}}$ correspond to evaluating coalitions without and with node $p_j$, respectively. Quantum Amplitude Estimation (QAE) is then applied to $Q_{\text{ut}}$ to obtain the expected contributions $\phi^{(+)}(p_j)$ and $\phi^{(-)}(p_j)$, which are combined to reconstruct the exact Shapley value $\phi(p_j)$ as described in Section \ref{['sec:quantum_shapley']}.
  • Figure 3: Bridge: Subgraph explanations using SubgraphX and QGShap. Left - SubgraphX . Right - QGShap
  • Figure 4: BA2-Motif: Subgraph explanations using SubgraphX and QGShap. Left - SubgraphX . Right - QGShap