arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.00249cs.CRcs.SE
收藏

通过语义保持的数据增强提升用于漏洞检测的预训练语言模型

Enhancing Pre-Trained Language Models for Vulnerability Detection via Semantic-Preserving Data Augmentation

Weiliang Qi, Jiahao Cao, Darsh Poddar, Sophia Li, Xinda Wang

AI总结:

本文提出一种语义保持的程序变换数据增强方法,通过扩充漏洞数据集微调 CodeBERT、GraphCodeBERT、UnixCoder 和 PDBERT 等预训练模型,显著提升漏洞检测的准确率与 F1,并优于现有增强方法。

摘要:

随着先进网络系统的快速发展和广泛应用,软件漏洞对安全通信与网络构成了重大威胁。基于学习的漏洞检测系统,尤其是利用预训练语言模型的系统,在及时识别通信网络中的漏洞并降低被利用风险方面展现出显著潜力。然而,准确标注的漏洞数据集短缺阻碍了该领域的进一步发展。现有数据增强方法未能表征真实世界漏洞数据的多样性,也无法保持漏洞语义,因此对模型训练的贡献有限,甚至产生反作用。本文提出了一种数据增强技术,旨在提升用于漏洞检测的预训练语言模型的性能。给定漏洞数据集,我们的方法执行自然的语义保持程序变换,以生成大量具有更丰富数据多样性和变化性的新样本。通过将增强后的数据集用于微调一系列代表性代码预训练模型(即 CodeBERT、GraphCodeBERT、UnixCoder 和 PDBERT),在漏洞检测任务中准确率最高可提升 10.1%,F1 最高可提升 23.6%。对比结果还表明,我们提出的方法能够显著优于其他主流的漏洞数据增强方法。

英文摘要:

With the rapid development and widespread use of advanced network systems, software vulnerabilities pose a significant threat to secure communications and networking. Learning-based vulnerability detection systems, particularly those leveraging pre-trained language models, have demonstrated significant potential in promptly identifying vulnerabilities in communication networks and reducing the risk of exploitation. However, the shortage of accurately labeled vulnerability datasets hinders further progress in this field. Failing to represent real-world vulnerability data variety and preserve vulnerability semantics, existing augmentation approaches provide limited or even counterproductive contributions to model training. In this paper, we propose a data augmentation technique aimed at enhancing the performance of pre-trained language models for vulnerability detection. Given the vulnerability dataset, our method performs natural semantic-preserving program transformation to generate a large volume of new samples with enriched data diversity and variety. By incorporating our augmented dataset in fine-tuning a series of representative code pre-trained models (i.e., CodeBERT, GraphCodeBERT, UnixCoder, and PDBERT), up to 10.1% increase in accuracy and 23.6% increase in F1 can be achieved in the vulnerability detection task. Comparison results also show that our proposed method can substantially outperform other prominent vulnerability augmentation approaches.

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

↑