arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2310.09810cs.SEcs.CR
收藏

ChatGPT在漏洞检测、分类与修复中的应用:我们进展如何?

ChatGPT for Vulnerability Detection, Classification, and Repair: How Far Are We?

Michael Fu, Chakkrit Tantithamthavorn, Van Nguyen, Trung Le

AI总结:

本研究评估ChatGPT在漏洞预测、分类、严重性评估和修复中的表现,发现其性能有限,需微调以提升泛化能力。

摘要:

大型语言模型(LLMs)如ChatGPT(即gpt-3.5-turbo和gpt-4)在源代码相关的软件工程任务(如代码审查和代码生成)中展现了显著的进步。本文通过指导ChatGPT执行四项常见的漏洞任务进行了全面研究:函数级和行级漏洞预测、漏洞分类、严重性评估以及漏洞修复。我们将ChatGPT与专为软件漏洞目的设计的最先进语言模型进行了比较。通过使用包含超过190,000个C/C++函数的广泛真实世界数据集进行实证评估,我们发现ChatGPT性能有限,在漏洞相关任务中显著落后于其他语言模型。实验结果凸显了漏洞预测任务的挑战性,需要领域特定的专业知识。尽管ChatGPT的模型规模庞大,比源代码预训练语言模型(如CodeBERT)大14,000倍,但微调过程对于ChatGPT在漏洞预测任务中的泛化仍然至关重要。我们已在https://github.com/awsm-research/ChatGPT4Vul发布了研究数据集、用于ChatGPT的实验提示及实验结果。

英文摘要:

Large language models (LLMs) like ChatGPT (i.e., gpt-3.5-turbo and gpt-4) exhibited remarkable advancement in a range of software engineering tasks associated with source code such as code review and code generation. In this paper, we undertake a comprehensive study by instructing ChatGPT for four prevalent vulnerability tasks: function and line-level vulnerability prediction, vulnerability classification, severity estimation, and vulnerability repair. We compare ChatGPT with state-of-the-art language models designed for software vulnerability purposes. Through an empirical assessment employing extensive real-world datasets featuring over 190,000 C/C++ functions, we found that ChatGPT achieves limited performance, trailing behind other language models in vulnerability contexts by a significant margin. The experimental outcomes highlight the challenging nature of vulnerability prediction tasks, requiring domain-specific expertise. Despite ChatGPT's substantial model scale, exceeding that of source code-pre-trained language models (e.g., CodeBERT) by a factor of 14,000, the process of fine-tuning remains imperative for ChatGPT to generalize for vulnerability prediction tasks. We publish the studied dataset, experimental prompts for ChatGPT, and experimental results at https://github.com/awsm-research/ChatGPT4Vul.

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

↑