arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2401.17010cs.CRcs.AIcs.LG
收藏

微调大型语言模型用于漏洞检测

Finetuning Large Language Models for Vulnerability Detection

Sber AI Lab(Sber AI实验室);Huawei Russian Research Institute(华为俄罗斯研究院);Satbayev University(萨特拜耶夫大学)

Alexey Shestov, Rodion Levichev, Ravil Mussabayev, Evgeny Maslov, Anton Cheshkov, Pavel Zadorozhny

AI总结:

本文通过微调WizardCoder模型,优化训练流程并处理类别不平衡,在漏洞检测任务上提升了ROC AUC和F1指标,展示了预训练LLM在源代码分析中的迁移学习潜力。

摘要:

本文介绍了微调大型语言模型(LLMs)用于检测源代码中漏洞的结果。我们利用WizardCoder(最新改进的先进LLM StarCoder),并通过进一步微调使其适应漏洞检测。为加速训练,我们修改了WizardCoder的训练过程,并研究了最优训练方案。针对负样本远多于正样本的不平衡数据集,我们还探索了不同技术以提升分类性能。微调后的WizardCoder模型在平衡和不平衡的漏洞数据集上,相比于CodeBERT类模型,在ROC AUC和F1指标上均有提升,证明了将预训练LLM用于源代码漏洞检测的有效性。关键贡献包括:微调先进的代码LLM WizardCoder、在不损害性能的前提下提高其训练速度、优化训练流程和方案、处理类别不平衡,以及在困难的漏洞检测数据集上提升性能。这展示了通过微调大型预训练语言模型进行专门源代码分析任务的迁移学习潜力。

英文摘要:

This paper presents the results of finetuning large language models (LLMs) for the task of detecting vulnerabilities in source code. We leverage WizardCoder, a recent improvement of the state-of-the-art LLM StarCoder, and adapt it for vulnerability detection through further finetuning. To accelerate training, we modify WizardCoder's training procedure, also we investigate optimal training regimes. For the imbalanced dataset with many more negative examples than positive, we also explore different techniques to improve classification performance. The finetuned WizardCoder model achieves improvement in ROC AUC and F1 measures on balanced and imbalanced vulnerability datasets over CodeBERT-like model, demonstrating the effectiveness of adapting pretrained LLMs for vulnerability detection in source code. The key contributions are finetuning the state-of-the-art code LLM, WizardCoder, increasing its training speed without the performance harm, optimizing the training procedure and regimes, handling class imbalance, and improving performance on difficult vulnerability detection datasets. This demonstrates the potential for transfer learning by finetuning large pretrained language models for specialized source code analysis tasks.

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

↑