paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Graph Neural Networks for Vulnerability Detection: A Counterfactual Explanation

面向漏洞检测的图神经网络:一种反事实解释
ISSTA Proceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis2024匹配度 3/10 · 论文属于机器学习用于程序安全检测(GNN漏洞检测)的交叉方向,与PL+AI有泛化关联,但不涉及用户核心关注的Agentic程序、LLM/Agent改进静态分析、浮点程序分析或贝叶斯程序分析。其反事实解释方法也未聚焦静态分析在ML系统中的应用,因此匹配度较低。引用 26 inbox
Zhaoyang Chu, Yao Wan, Qian Li, Yang Wu, Hongyu Zhang, Yulei Sui, Guandong Xu, Hai Jin
crossref: 2026-09-12

AI 速览

一句话:提出 CFExplainer,用反事实解释 GNN 漏洞检测,通过最小图扰动揭示漏洞根因。

漏洞检测对软件系统安全与可靠性至关重要,图神经网络(GNN)因能捕捉源代码语义结构而成为主流代码嵌入方法,但其黑箱特性导致可解释性不足。已有基于事实推理的解释器只能分析促成预测的关键特征,无法回答“若将代码图改为其他结构,GNN 决策会如何变化”这类反事实问题。为此,本文提出 CFExplainer,一种面向 GNN 漏洞检测的反事实解释器。它寻找对输入代码图的最小扰动,使模型预测发生改变,并将该扰动作为反事实解释,从而定位检测到的漏洞的根本原因,为开发者修复漏洞提供有价值的信息。在四个基于 GNN 的漏洞检测模型上进行的大量实验表明,CFExplainer 优于现有最先进的事实推理型解释器。

问题
基于 GNN 的漏洞检测模型缺乏可解释性,现有事实推理型解释器无法回答改变代码图结构后预测会如何变化的反事实问题。
方法
提出 CFExplainer,通过搜索对输入代码图的最小扰动使 GNN 预测改变,并将该扰动作为反事实解释来定位漏洞根因。
评估
在四个基于 GNN 的漏洞检测模型上进行实验,并与现有最先进的事实推理型解释器比较,验证 CFExplainer 的有效性。
原文摘要(Abstract)

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.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot8481,
  title = {Graph Neural Networks for Vulnerability Detection: A Counterfactual Explanation},
  author = {Zhaoyang Chu and Yao Wan and Qian Li and Yang Wu and Hongyu Zhang and Yulei Sui and Guandong Xu and Hai Jin},
  booktitle = {ISSTA},
  year = {2024},
  doi = {10.1145/3650212.3652136}
}