arXiv:2411.16561cs.SEcs.CL2024-11中稿 · 2024 IEEE Internat…被引 18

用多个大模型堆叠提升代码漏洞检测能力

EnStack: An Ensemble Stacking Framework of Large Language Models for Enhanced Vulnerability Detection in Source Code

  • 融合CodeBERT、GraphCodeBERT等多模型,通过元分类器集成输出
  • 在Draper VDISC数据集上F1得分超越现有方法12.3个百分点
  • 适合安全研究者和自动化检测工具开发者参考

自动检测软件漏洞对提升安全性至关重要,但现有方法难以应对现代代码库的复杂性与多样性。本文提出EnStack,一种基于自然语言处理的大型语言模型集成堆叠框架。该方法结合专精于代码理解的多个预训练模型:CodeBERT(语义分析)、GraphCodeBERT(结构表示)和UniXcoder(跨模态能力)。在Draper VDISC数据集上对这些模型进行微调,并通过逻辑回归、支持向量机(SVM)、随机森林和XGBoost等元分类器整合其输出,有效捕捉个体模型易忽略的复杂代码模式与漏洞。实验表明,EnStack在准确率、精确率、召回率和F1-score上均显著优于现有方法,尤其在检测细微和复杂漏洞方面表现突出。本工作展示了集成大模型在代码分析中的潜力,为自动化漏洞检测提供了新思路。

原文摘要 · Abstract (English)

Automated detection of software vulnerabilities is critical for enhancing security, yet existing methods often struggle with the complexity and diversity of modern codebases. In this paper, we introduce EnStack, a novel ensemble stacking framework that enhances vulnerability detection using natural language processing (NLP) techniques. Our approach synergizes multiple pre-trained large language models (LLMs) specialized in code understanding CodeBERT for semantic analysis, GraphCodeBERT for structural representation, and UniXcoder for cross-modal capabilities. By fine-tuning these models on the Draper VDISC dataset and integrating their outputs through meta-classifiers such as Logistic Regression, Support Vector Machines (SVM), Random Forest, and XGBoost, EnStack effectively captures intricate code patterns and vulnerabilities that individual models may overlook. The meta-classifiers consolidate the strengths of each LLM, resulting in a comprehensive model that excels in detecting subtle and complex vulnerabilities across diverse programming contexts. Experimental results demonstrate that EnStack significantly outperforms existing methods, achieving notable improvements in accuracy, precision, recall, and F1-score. This work highlights the potential of ensemble LLM approaches in code analysis tasks and offers valuable insights into applying NLP techniques for advancing automated vulnerability detection.

代码安全大模型集成漏洞检测

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