arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2310.07958cs.SEcs.CRcs.LGstat.ME
收藏

面向漏洞检测的因果深度学习研究

Towards Causal Deep Learning for Vulnerability Detection

Iowa State University(爱荷华州立大学);Columbia University(哥伦比亚大学);Microsoft Research(微软研究院)

Md Mahbubur Rahman, Ira Ceka, Chengzhi Mao, Saikat Chakraborty, Baishakhi Ray, Wei Le

AI总结:

本文提出CausalVul方法,通过扰动发现虚假特征并结合do演算因果学习,在深度学习漏洞检测中提升模型准确率、鲁棒性与分布外泛化能力。

摘要:

近年来,深度学习漏洞检测已展现出有前景的结果。然而,一个重要的挑战仍然阻碍其在实践中发挥更大作用:模型在扰动下不够鲁棒,并且无法在分布外(OOD)数据上良好泛化,例如将训练好的模型应用于现实世界中未见过的项目。我们假设这是因为模型学习了与标签存在虚假相关性的非鲁棒特征,例如变量名。当扰动数据集和OOD数据集不再具有相同的虚假特征时,模型预测就会失败。为应对这一挑战,本文首次将因果性引入深度学习漏洞检测。我们提出的方法CausalVul包含两个阶段。第一,我们设计了新颖的扰动方式来发现模型可能用于预测的虚假特征。第二,我们在现有深度学习模型之上应用因果学习算法,具体为do演算(do-calculus),以系统性地消除虚假特征的使用,从而促进基于因果的预测。我们的结果表明,在我们实验的所有最先进模型和数据集上,CausalVul一致地提升了模型准确率、鲁棒性和OOD性能。据我们所知,这是第一项将基于do演算的因果学习引入软件工程模型的工作,并表明其确实有助于提升模型准确率、鲁棒性和泛化能力。我们的复现包位于https://figshare.com/s/0ffda320dcb96c249ef2。

英文摘要:

Deep learning vulnerability detection has shown promising results in recent years. However, an important challenge that still blocks it from being very useful in practice is that the model is not robust under perturbation and it cannot generalize well over the out-of-distribution (OOD) data, e.g., applying a trained model to unseen projects in real world. We hypothesize that this is because the model learned non-robust features, e.g., variable names, that have spurious correlations with labels. When the perturbed and OOD datasets no longer have the same spurious features, the model prediction fails. To address the challenge, in this paper, we introduced causality into deep learning vulnerability detection. Our approach CausalVul consists of two phases. First, we designed novel perturbations to discover spurious features that the model may use to make predictions. Second, we applied the causal learning algorithms, specifically, do-calculus, on top of existing deep learning models to systematically remove the use of spurious features and thus promote causal based prediction. Our results show that CausalVul consistently improved the model accuracy, robustness and OOD performance for all the state-of-the-art models and datasets we experimented. To the best of our knowledge, this is the first work that introduces do calculus based causal learning to software engineering models and shows it's indeed useful for improving the model accuracy, robustness and generalization. Our replication package is located at https://figshare.com/s/0ffda320dcb96c249ef2.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑