mlsanityData to 14 Oct 2026

Graph Neural Networks for Vulnerability Detection: A Counterfactual Explanation

arXiv 2404.15687 ↗First posted 24 Apr 2024cs.SE cs.AI cs.CRcited by 12

Not on the map. Why?

Abstract (arXiv)

Vulnerability detection is crucial for ensuring the security and reliability of software systems. Recently, Graph Neural Networks (GNNs) have emerged as a prominent code embedding approach for vulnerability detection, owing to their ability to capture the underlying semantic structure of source code. However, GNNs face significant challenges in explainability due to their inherently black-box nature. To this end, several factual reasoning-based explainers have been proposed. These explainers provide explanations for the predictions made by GNNs by analyzing the key features that contribute to the outcomes. We argue that these factual reasoning-based explanations cannot answer critical what-if questions: What would happen to the GNN's decision if we were to alter the code graph into alternative structures? Inspired by advancements of counterfactual reasoning in artificial intelligence, we propose CFExplainer, a novel counterfactual explainer for GNN-based vulnerability detection. Unlike factual reasoning-based explainers, CFExplainer seeks the minimal perturbation to the input code graph that leads to a change in the prediction, thereby addressing the what-if questions for vulnerability detection. We term this perturbation a counterfactual explanation, which can pinpoint the root causes of the detected vulnerability and furnish valuable insights for developers to undertake appropriate actions for fixing the vulnerability. Extensive experiments on four GNN-based vulnerability detection models demonstrate the effectiveness of CFExplainer over existing state-of-the-art factual reasoning-based explainers.

Key facts. Cited by 12 papers in the map (data through 14 Oct 2026). Builds on 30 of its 64 references that are in the map. First posted on arXiv 24 Apr 2024.

Builds on

30 of 64 references.

References · 30

  1. 2014Adam: A Method for Stochastic Optimizationcited by 37,240
  2. 2016Semi-Supervised Classification with Graph Convolutional Networkscited by 11,361
  3. 2016Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localizationcited by 6,733
  4. 2018How Powerful are Graph Neural Networks?cited by 4,393
  5. 2017Learning Important Features Through Propagating Activation Differencescited by 1,458
  6. 2015Gated Graph Sequence Neural Networkscited by 796
  7. 2019GNNExplainer: Generating Explanations for Graph Neural Networkscited by 737
  8. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
  9. 2020Explainability in Graph Neural Networks: A Taxonomic Surveycited by 384
  10. 2021On Explainability of Graph Neural Networks via Subgraph Explorationscited by 281
  11. 2020Higher-Order Explanations of Graph Neural Networks via Relevant Walkscited by 138
  12. 2021Generative Causal Explanations for Graph Neural Networkscited by 124
18 more
  1. 2022Learning and Evaluating Graph Neural Network Explanations based on Counterfactual and Factual Reasoningcited by 79
  2. 2021Counterfactual Explainable Recommendationcited by 60
  3. 2021Vulnerability Detection with Fine-grained Interpretationscited by 56
  4. 2022What Do They Capture? -- A Structural Analysis of Pre-Trained Language Models for Source Codecited by 50
  5. 2022CLEAR: Generative Counterfactual Explanations on Graphscited by 48
  6. 2019Multi-Modal Attention Network Learning for Semantic Source Code Retrievalcited by 41
  7. 2021Counterfactual Graphs for Explainable Classification of Brain Networkscited by 33
  8. 2021MEG: Generating Molecular Counterfactual Explanations for Deep Graph Networkscited by 32
  9. 2021ReGVD: Revisiting Graph Neural Networks for Vulnerability Detectioncited by 32
  10. 2022Global Counterfactual Explainer for Graph Neural Networkscited by 30
  11. 2021Counterfactual Explanations for Models of Codecited by 25
  12. 2021Understanding Neural Code Intelligence Through Program Simplificationcited by 22
  13. 2021VELVET: a noVel Ensemble Learning approach to automatically locate VulnErable sTatementscited by 20
  14. 2020Probing Model Signal-Awareness via Prediction-Preserving Input Minimizationcited by 14
  15. 2022Reinforced Path Reasoning for Counterfactual Explainable Recommendationcited by 13
  16. 2016Spectrum-based Software Fault Localization: A Survey of Techniques, Advances, and Challengescited by 9
  17. 2021Be Causal: De-biasing Social Network Confounding in Recommendationcited by 9
  18. 2019Competitive Multi-Agent Deep Reinforcement Learning with Counterfactual Thinkingcited by 5

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2024: 2; 2025: 7; 2026: 3.

12 papers.