[Paper Review] CF-GNNExplainer: Counterfactual Explanations for Graph Neural Networks
CF-GNNExplainer generates minimal counterfactual explanations for GNN predictions by removing edges in the node's local subgraph until the prediction changes, achieving high accuracy with very few edge deletions.
Given the increasing promise of graph neural networks (GNNs) in real-world applications, several methods have been developed for explaining their predictions. Existing methods for interpreting predictions from GNNs have primarily focused on generating subgraphs that are especially relevant for a particular prediction. However, such methods are not counterfactual (CF) in nature: given a prediction, we want to understand how the prediction can be changed in order to achieve an alternative outcome. In this work, we propose a method for generating CF explanations for GNNs: the minimal perturbation to the input (graph) data such that the prediction changes. Using only edge deletions, we find that our method, CF-GNNExplainer, can generate CF explanations for the majority of instances across three widely used datasets for GNN explanations, while removing less than 3 edges on average, with at least 94\% accuracy. This indicates that CF-GNNExplainer primarily removes edges that are crucial for the original predictions, resulting in minimal CF explanations.
Motivation & Objective
- Formalize the problem of counterfactual explanations for GNNs at the instance level.
- Propose CF-GNNExplainer to automatically generate minimal counterfactual edge perturbations.
- Demonstrate that CF-GNNExplainer yields faithful counterfactuals with small perturbations across multiple datasets.
Proposed method
- Model-agnostic CF explanation framework that perturbs the adjacency submatrix A_v via a learnable sparsification mask P to obtain Ā_v = P ⊙ A_v.
- Define a counterfactual model g that uses P to perturb A_v while keeping the GNN weights fixed, enabling generation of CF examples.
- Optimize a loss combining a prediction-change objective L_pred and a distance objective L_dist to ensure minimal perturbation, with gradient-based updates to an intermediate real-valued P (thresholded to binary).
- Use a one-layer GCN as illustrative f, and derive g(A_v,X_v,W;P) to incorporate perturbed adjacency into the forward pass.
- Iteratively search for the minimal perturbation that flips the prediction, tracking the best (smallest) perturbation Δ_v^*.
Experimental results
Research questions
- RQ1Can we automatically generate minimal, actionable counterfactual explanations for GNN predictions by perturbing graph structure alone?
- RQ2How small a perturbation (in edges) is sufficient to change a GNN's prediction for a given node?
- RQ3Do edge deletions in the node's local subgraph yield accurate and faithful counterfactuals across diverse graph datasets?
Key findings
- CF-GNNExplainer achieves counterfactual explanations with at least 94% accuracy on motif nodes across three datasets.
- On average, CF-GNNExplainer removes fewer than 3 edges to obtain a counterfactual, indicating highly minimal explanations.
- CF-GNNExplainer outperforms baselines (random, 1-hop, rm-1hop) in explanation size and sparsity while maintaining high fidelity and accuracy.
- Compared to GNNExplainer, CF-GNNExplainer finds CF explanations automatically (no fixed S) and achieves higher fidelity and accuracy across datasets.
Better researchstarts right now
From reading papers to final review, dramatically reduce your research time.
No credit card · Free plan available
This review was created by AI and reviewed by human editors.