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

多LLM协作 + 以数据为中心的创新 = 性能提升2倍的漏洞修复方法

Multi-LLM Collaboration + Data-Centric Innovation = 2x Better Vulnerability Repair

Xin Zhou, Kisub Kim, Bowen Xu, DongGyun Han, David Lo

AI总结:

针对现有深度学习漏洞修复方法的三大局限,提出结合多源数据与CodeT5、ChatGPT双LLM协作的VulMaster模型,在真实C/C++数据集上多项指标提升近一倍。

摘要:

深度学习(DL)的发展为软件漏洞自动修复方法铺平了道路,这类方法可有效学习从漏洞代码到修复后代码的映射关系。然而,现有基于深度学习的漏洞修复方法存在显著局限性:1)难以处理长漏洞代码;2)将代码视为自然语言文本,忽略了其固有结构;3)未挖掘专家系统中蕴含的宝贵专家知识。\n 为解决上述问题,我们提出VulMaster,这是一种基于Transformer的神经网络模型,通过以数据为中心的创新实现出色的漏洞修复生成效果。具体而言,VulMaster引入并组合利用多种类型的输入数据,包括任意长度的完整漏洞代码、漏洞代码结构,以及来自CWE系统的专家知识。此外,VulMaster利用两个大语言模型(LLM)——CodeT5和ChatGPT之间的协作:CodeT5作为可定制的骨干LLM,使用训练数据进行微调,而ChatGPT则通过为CodeT5提供缺失的相关输入来发挥补充作用。我们在一个真实世界C/C++漏洞修复数据集上评估了VulMaster,该数据集包含1754个项目、共5800个漏洞函数。实验结果表明,与基于学习的最先进漏洞修复方法相比,VulMaster实现了大幅性能提升。具体来说,VulMaster将EM、BLEU和CodeBLEU分数分别从10.2%提升至20.0%、从21.3%提升至29.3%、从32.5%提升至40.9%。

英文摘要:

The advances of deep learning (DL) have paved the way for automatic software vulnerability repair approaches, which effectively learn the mapping from the vulnerable code to the fixed code. Nevertheless, existing DL-based vulnerability repair methods face notable limitations: 1) they struggle to handle lengthy vulnerable code, 2) they treat code as natural language texts, neglecting its inherent structure, and 3) they do not tap into the valuable expert knowledge present in the expert system. To address this, we propose VulMaster, a Transformer-based neural network model that excels at generating vulnerability repairs through data-centric innovation. Specifically, VulMaster introduces the utilization and combination of various types of input data, including complete vulnerable code of any size, vulnerable code structures, and expert knowledge from the CWE system. Additionally, VulMaster leverages the collaboration between two Large Language Models (LLMs), CodeT5 and ChatGPT: CodeT5 acts as the customizable backbone LLM, fine-tuned with the training data, while ChatGPT supplements by providing missing relevant inputs to CodeT5. We evaluated VulMaster on a real-world C/C++ vulnerability repair dataset comprising 1,754 projects with 5,800 vulnerable functions. The experimental results demonstrated that VulMaster exhibits substantial improvements compared to the learning-based state-of-the-art vulnerability repair approach. Specifically, VulMaster improves the EM, BLEU, and CodeBLEU scores from 10.2\% to 20.0\%, 21.3\% to 29.3\%, and 32.5\% to 40.9\%, respectively.

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

↑