Skip to main content
QUICK REVIEW

[论文解读] LLMs in Code Vulnerability Analysis: A Proof of Concept

Shaznin Sultana, Sadia Afreen|arXiv (Cornell University)|Jan 13, 2026
Software Engineering Research被引用 0
一句话总结

该论文在 Big-Vul 和 VulRepair 数据集上评估开源代码聚焦与通用大型语言模型在漏洞检测、严重性与访问复杂性预测以及修复生成方面的表现,并将微调与基于提示的方法进行对比。

ABSTRACT

Context: Traditional software security analysis methods struggle to keep pace with the scale and complexity of modern codebases, requiring intelligent automation to detect, assess, and remediate vulnerabilities more efficiently and accurately. Objective: This paper explores the incorporation of code-specific and general-purpose Large Language Models (LLMs) to automate critical software security tasks, such as identifying vulnerabilities, predicting severity and access complexity, and generating fixes as a proof of concept. Method: We evaluate five pairs of recent LLMs, including both code-based and general-purpose open-source models, on two recognized C/C++ vulnerability datasets, namely Big-Vul and Vul-Repair. Additionally, we compare fine-tuning and prompt-based approaches. Results: The results show that fine-tuning uniformly outperforms both zero-shot and few-shot approaches across all tasks and models. Notably, code-specialized models excel in zero-shot and few-shot settings on complex tasks, while general-purpose models remain nearly as effective. Discrepancies among CodeBLEU, CodeBERTScore, BLEU, and ChrF highlight the inadequacy of current metrics for measuring repair quality. Conclusions: This study contributes to the software security community by investigating the potential of advanced LLMs to improve vulnerability analysis and remediation.

研究动机与目标

  • 评估代码专用或通用型 LLMs 在漏洞分析任务中的最佳支持能力。
  • 比较微调与零-shot 和少量-shot 提示方法。
  • 在公认的代码修复评估指标和数据集上评估开源 LLMs 的性能。
  • 研究当前代码相似性度量在修复评估中的可靠性。

提出的方法

  • 从排行榜中选取五对代码专用与通用开源 LLMs。
  • 在三个任务类别上评估模型:检测、严重性预测和访问复杂性分类,以及修复生成。
  • 使用 Big-Vul 与 VulRepair 数据集对模型进行训练与测试。
  • 应用 LoRA PEFT 进行带有确定超参数的微调。
  • 比较零-shot、少-shot 与微调在各任务与模型上的表现。
Figure 1. Prompt Design
Figure 1. Prompt Design

实验结果

研究问题

  • RQ1RQ1:微调与基于提示的方法在漏洞检测方面的表现如何对比?
  • RQ2RQ2:代码专用模型在各任务与方法下是否普遍优于通用模型?
  • RQ3RQ3:哪一对模型在各任务与方法上表现更优?
  • RQ4RQ4:现有的代码相似性度量是否足以用于评估代码修复生成?

主要发现

  • 微调在大多数任务与模型中持续优于零-shot 与少-shot 方法。
  • 代码专用模型并不普遍优于通用模型;性能取决于任务与方法。
  • Llama 与 DeepSeek 对在多种设置中都属于表现最强的对,与所有任务并无唯一胜者。
  • CodeBERTScore 与 Rouge-L 在各任务中相对鲁棒,而 BLEU-4 与 CodeBLEU 在代码修复评估中可能不可靠。
  • 在大多数修复评估中,零-shot 结果弱于少-shot,且指标不一致引发对评估有效性的担忧。
  • 该研究提供了一个基线,揭示了开源 LLM 在漏洞工作流程中的价值与局限性。
Figure 2. Model Performance Comparison based on Zero-Shot and Few-Shot approach for task 1
Figure 2. Model Performance Comparison based on Zero-Shot and Few-Shot approach for task 1

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。