arXiv:2503.07770cs.LGcs.AI2025-03被引 8

用优化后的数据集微调LLaMA 3.2,提升漏洞检测准确率。

Evaluating LLaMA 3.2 for Software Vulnerability Detection

  • 基于真实项目构建并优化了DiverseVul数据集用于训练。
  • 微调后模型F1分数达66%,较基线47%显著提升。
  • 适合关注代码安全与大模型应用的研究者参考。

深度学习(DL)已成为漏洞检测的强大工具,常优于传统方法。但构建有效模型需大量真实数据,获取困难。为此,研究者构建了目前最大的真实项目中提取的C/C++函数漏洞数据集DiverseVul,旨在提供高质量、大规模样本。然而在预处理过程中发现原始数据存在若干不一致问题,亟需优化版本。本文提出一个经修正的DiverseVul数据集,并用于微调大型语言模型LLaMA 3.2以实现漏洞检测。实验表明,采用预处理技术后模型性能显著提升,最终达到66%的F1分数,相较基线47%有明显改进,表现具有竞争力。

原文摘要 · Abstract (English)

Deep Learning (DL) has emerged as a powerful tool for vulnerability detection, often outperforming traditional solutions. However, developing effective DL models requires large amounts of real-world data, which can be difficult to obtain in sufficient quantities. To address this challenge, DiverseVul dataset has been curated as the largest dataset of vulnerable and non-vulnerable C/C++ functions extracted exclusively from real-world projects. Its goal is to provide high-quality, large-scale samples for training DL models. However, during our study several inconsistencies were identified in the raw dataset while applying pre-processing techniques, highlighting the need for a refined version. In this work, we present a refined version of DiverseVul dataset, which is used to fine-tune a large language model, LLaMA 3.2, for vulnerability detection. Experimental results show that the use of pre-processing techniques led to an improvement in performance, with the model achieving an F1-Score of 66%, a competitive result when compared to our baseline, which achieved a 47% F1-Score in software vulnerability detection.

漏洞检测LLaMA代码安全

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。