ReVul-CoT:通过检索增强生成与链式推理提示实现有效的软件漏洞评估
ReVul-CoT: Towards Effective Software Vulnerability Assessment with Retrieval-Augmented Generation and Chain-of-Thought Prompting
AI总结:
ReVul-CoT通过整合检索增强生成与链式推理提示,提升软件漏洞评估的准确性和效率。
摘要:
软件漏洞评估(SVA)在评估和排序软件系统中的漏洞以确保其安全性和可靠性方面起着至关重要的作用。目标:尽管大型语言模型(LLMs)最近在SVA中显示出显著的潜力,但它们仍然面临两个主要限制。首先,大多数LLMs是在通用语料库上训练的,因此缺乏用于有效SVA的领域特定知识。其次,它们倾向于依赖浅层模式匹配而不是深度上下文推理,这使得完全理解复杂代码语义及其安全影响具有挑战性。方法:为了缓解这些限制,我们提出了一种新的框架ReVul-CoT,它集成了检索增强生成(RAG)与链式推理(COT)提示。在ReVul-CoT中,RAG模块动态地从构建的本地知识库中检索上下文相关的信息,该知识库整合了来自权威来源(如NVD和CWE)的漏洞数据,以及相应的代码片段和描述信息。基于DeepSeek-V3.1,COT提示引导LLM对可利用性、影响范围和相关因素进行逐步推理。结果:我们在12,070个漏洞的数据集上评估了ReVul-CoT。实验结果表明,ReVul-CoT在MCC方面比最先进的SVA基线高出16.50%-42.26%,并在准确性、F1分数和MCC方面分别比最佳基线高出10.43%、15.86%和16.50%。我们的消融研究进一步验证了考虑动态检索、知识整合和基于COT的推理的贡献。结论:我们的结果表明,结合RAG和COT提示显著增强了基于LLM的SVA,并指出了未来研究的有希望的方向。
英文摘要:
Context: Software Vulnerability Assessment (SVA) plays a vital role in evaluating and ranking vulnerabilities in software systems to ensure their security and reliability. Objective: Although Large Language Models (LLMs) have recently shown remarkable potential in SVA, they still face two major limitations. First, most LLMs are trained on general-purpose corpora and thus lack domain-specific knowledge essential for effective SVA. Second, they tend to rely on shallow pattern matching instead of deep contextual reasoning, making it challenging to fully comprehend complex code semantics and their security implications. Method: To alleviate these limitations, we propose a novel framework ReVul-CoT that integrates Retrieval-Augmented Generation (RAG) with Chain-of-Thought (COT) prompting. In ReVul-CoT, the RAG module dynamically retrieves contextually relevant information from a constructed local knowledge base that consolidates vulnerability data from authoritative sources (such as NVD and CWE), along with corresponding code snippets and descriptive information. Building on DeepSeek-V3.1, CoT prompting guides the LLM to perform step-by-step reasoning over exploitability, impact scope, and related factors Results: We evaluate ReVul-CoT on a dataset of 12,070 vulnerabilities. Experimental results show that ReVul-CoT outperforms state-of-the-art SVA baselines by 16.50%-42.26% in terms of MCC, and outperforms the best baseline by 10.43%, 15.86%, and 16.50% in Accuracy, F1-score, and MCC, respectively. Our ablation studies further validate the contributions of considering dynamic retrieval, knowledge integration, and CoT-based reasoning. Conclusion: Our results demonstrate that combining RAG with CoT prompting significantly enhances LLM-based SVA and points out promising directions for future research.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。