NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Generating Robust Counterfactual Witnesses for Graph Neural Networks

Dazhuo Qiu, Mengying Wang, Arijit Khan, Yinghui Wu

Abstract: This paper introduces a new class of explanation structures, called robust counterfactual witnesses (RCWs), to provide robust, both counterfactual and factual explanations for graph neural networks. Given a graph neural network M, a robust counterfactual witness refers to the fraction of a graph G that are counterfactual and factual explanation of the results of M over G, but also remains so for any "disturbed" G by flipping up to k of its node pairs. We establish the hardness results, from tractable results to co-NP-hardness, for verifying and generating robust counterfactual witnesses. We study such structures for GNN-based node classification, and present efficient algorithms to verify and generate RCWs. We also provide a parallel algorithm to verify and generate RCWs for large graphs with scalability guarantees. We experimentally verify our explanation generation process for benchmark datasets, and showcase their applications.

Introduction

As Graph Neural Networks (GNNs) are increasingly deployed in high-stakes fields like drug discovery and cybersecurity, the "black box" nature of these models becomes a liability. We need to know why a GNN labeled a molecule as mutagenic or a network node as vulnerable. However, existing GNN explanation methods (like GNNExplainer or SubgraphX) often struggle with three specific requirements: Factuality (sufficiency), Counterfactuality (necessity), and Robustness (resilience to noise).

The Problem of Fragile Explanations

Most current tools provide "fragile" explanations that change drastically with tiny perturbations, making them unreliable for domain experts who need to identify stable, "invariant" structures like toxicophores in chemistry. For instance, in cybersecurity, deceptive "noise" can easily fool standard explainers into missing the true attack path.

Figure 1: Motivation for robust explanations. Top (G1) shows molecular structures where explanations must identify invariant toxicophores. Bottom (G2) illustrates a cyberattack graph where deceptive attacks can mislead non-robust explainers.

Formalizing Robust Counterfactual Witnesses (RCWs)

The authors formalize the RCW as a subgraph that preserves a GNN's result, flips it if removed, and remains a valid explanation even if up to $k$ node pairs in the rest of the graph are "flipped" (added or deleted). The formal framework relies on several key symbols and definitions to handle node classification and graph disturbances.

Figure 3: Summary of symbols and formal meanings used to define and verify Robust Counterfactual Witnesses (RCWs).

Methods: The RoboGExp Algorithm

Key technical contributions include a complexity analysis proving that verifying if a subgraph is an RCW is generally NP-hard. However, the authors identify a tractable case for APPNPs (a class of PageRank-based GNNs) by introducing a "local budget" constraint on disturbances.

To generate these witnesses, the authors propose RoboGExp, a greedy "expand-verify" approach. It starts with a minimal set of test nodes and iteratively grows the explanation subgraph. It specifically targets and includes edges that are "most likely" to change the node's label if disturbed—a concept known as the Worst-Case Margin—effectively "securing" the classification. To handle massive graphs, they developed paraRoboGExp, a coordinator-worker architecture that partitions the graph and synchronizes verified disturbances across threads.

Key Results and Insights

The researchers evaluated their approach on four diverse datasets: BAHouse (synthetic), PPI (biological), CiteSeer (citation network), and Reddit (social network).

  • Robustness: RoboGExp outperformed state-of-the-art methods (CF2 and CF-GNNExp) in Graph Edit Distance (GED), producing explanations that were 2x to 2.3x more stable under graph disturbances.
  • Fidelity: It achieved higher "Fidelity+" scores, meaning its counterfactuals were more effective at actually flipping the model's labels when removed.
  • Speed & Scalability: RoboGExp was remarkably efficient, taking only 12.03% of the time required by CF2. The parallel version, paraRoboGExp, showed a 70.7% speedup when scaled from 2 to 10 threads on the large Reddit dataset.
  • Invariance: In molecular case studies, the RCW successfully ignored "noisy" hydrogen atoms and focused on the aldehyde group—a known toxicophore—demonstrating its ability to find common, invariant structures across similar instances.

Conclusion

By introducing Robust Counterfactual Witnesses, this work provides a path toward more reliable and interpretable GNNs. While the current optimized procedures are tailored toward APPNP-style architectures, the framework establishes a foundation for robust, search-based explanations that outperform traditional gradient-based or learning-based methods in both stability and efficiency.

Summary updated

BibTeX
@inproceedings{qiu2024generating,
  author = {Dazhuo Qiu and Mengying Wang and Arijit Khan and Yinghui Wu},
  title = {{Generating Robust Counterfactual Witnesses for Graph Neural Networks}},
  booktitle = {ICDE},
  year = {2024},
  doi = {10.1109/icde60146.2024.00259},
}
Figure