arXiv:2411.06493cs.CRcs.AI2024-11被引 33

用GPT-4o和RAG实现代码漏洞自动检测,效果优于现有方法

LProtector: An LLM-driven Vulnerability Detection System

  • 基于GPT-4o与RAG,通过上下文检索增强代码理解能力
  • 在Big-Vul数据集上F1分数超越两个主流基线模型
  • 适合安全研究者与开发团队快速识别高危代码漏洞

本文提出LProtector,一个由大语言模型GPT-4o与检索增强生成(RAG)驱动的C/C++代码库漏洞自动化检测系统。随着软件复杂度提升,传统检测方法面临效率与准确率瓶颈。LProtector利用GPT-4o强大的代码理解与生成能力,对目标代码进行二分类并识别漏洞。我们在Big-Vul数据集上开展实验,结果表明,LProtector在F1分数上优于两种当前最先进的基线方法,验证了将LLM与漏洞检测结合的潜力。

原文摘要 · Abstract (English)

This paper presents LProtector, an automated vulnerability detection system for C/C++ codebases driven by the large language model (LLM) GPT-4o and Retrieval-Augmented Generation (RAG). As software complexity grows, traditional methods face challenges in detecting vulnerabilities effectively. LProtector leverages GPT-4o's powerful code comprehension and generation capabilities to perform binary classification and identify vulnerabilities within target codebases. We conducted experiments on the Big-Vul dataset, showing that LProtector outperforms two state-of-the-art baselines in terms of F1 score, demonstrating the potential of integrating LLMs with vulnerability detection.

漏洞检测大模型代码安全

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