InduCE: Inductive Counterfactual Explanations for Graph Neural Networks

Samidha Verma, Burouj Armgaan, Sourav Medya, Sayan Ranu

Abstract

Graph Neural Networks (GNNs) are powerful but opaque "black-box" models. Counterfactual explanations—identifying the minimal graph perturbations required to flip a model's prediction—offer a path to interpretability. However, existing methods are often transductive, limited to edge deletions, and computationally inefficient. We present InduCE (Inductive Counterfactual Explanations), a reinforcement learning-based framework that generates both additive and subtractive counterfactuals. By modeling the marginal impact of perturbations, InduCE achieves up to a 79x speedup over transductive baselines while maintaining high fidelity and scalability to million-node graphs.

Introduction

As GNNs are increasingly deployed in critical domains like drug discovery and social network analysis, the need for human-understandable explanations becomes paramount. Counterfactual reasoning asks: "What is the minimal change required to alter this prediction?" In a chemical context, this might involve identifying which bonds to add or remove to change a molecule's property from toxic to safe.

Counterfactual reasoning in molecular graphs: transforming Ethene to Ethane through structural additions.

Current GNN explainers suffer from three primary limitations:

  1. Transductivity: Most models require retraining for every new node or graph.
  2. Deletion-only constraints: Many algorithms cannot suggest adding edges, which is often the most natural explanation.
  3. Inefficient Search: One-shot masking techniques fail to account for the dependencies between multiple perturbations.

The InduCE Framework

InduCE addresses these challenges through an inductive architecture and a sequential decision-making process.

Inductive Architecture

By utilizing a Graph Attention Network (GAT), InduCE learns node representations that are invariant to graph size. This allows the explainer to be trained on a subset of data and then applied to unseen graphs without further optimization, a significant advantage for real-time applications.

Reinforcement Learning for Marginal Impact

InduCE treats counterfactual generation as a Markov Decision Process (MDP). A policy network, trained via reinforcement learning, selects actions (adding or deleting edges) within a target node's $h$-hop neighborhood.

  • State: Encodes the local neighborhood structure, node features, and current prediction entropy.
  • Reward: Balances the goal of flipping the GNN's label with a penalty for the number of edits, ensuring "minimal" explanations.

Unlike one-shot methods, InduCE's sequential approach models the marginal impact of each edit. This prevents "over-explanation" by stopping as soon as the decision boundary is crossed.

Experimental Evaluation

The researchers evaluated InduCE across synthetic benchmarks and large-scale real-world datasets, including ogbn-arxiv (1.1M edges).

Synthetic benchmark setup: Node classification is determined by structural motifs (e.g., Wheel Motif) and connectivity logic.

Key Results

  • Efficiency: InduCE is up to 79x faster than transductive methods in the inductive setting, requiring only a forward pass of the policy network.
  • Fidelity: The model consistently achieved 0% fidelity (perfect success in finding counterfactuals) on multiple datasets, outperforming baselines like CF-GNNExplainer.
  • Sparsity: On the BA-Shapes dataset, InduCE identified counterfactuals with an average of 1.30 edges, compared to hundreds of edges suggested by less sophisticated methods.
  • Scalability: By operating on local neighborhoods, InduCE avoids the memory bottlenecks of dense adjacency matrices, enabling its use on massive citation networks.

Discussion and Future Work

InduCE demonstrates that edge additions are often more informative than deletions. However, the current model is limited to the $h$-hop neighborhood for computational tractability. Future research will explore global counterfactuals and the integration of continuous feature perturbations. As a model-agnostic tool, InduCE's utility remains tied to the underlying GNN's quality; if the GNN's logic is flawed, the counterfactuals will reflect those flaws.

Summary updated

BibTeX
@article{verma2024induce,
  author = {Samidha Verma and Burouj Armgaan and Sourav Medya and Sayan Ranu},
  title = {{InduCE: Inductive Counterfactual Explanations for Graph Neural Networks}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2024},
  url = {https://openreview.net/forum?id=a2TAWF6xGj},
}
Figure