From LLMs to Agents: A Comparative Evaluation of LLMs and LLM-based Agents in Security Patch Detection
Junxiao Han, Zheng Yu, Lingfeng Bao, Jiakun Liu, Yao Wan, Jianwei Yin, Shuiguang Deng, and Song Han
开源软件(OSS)的广泛采用加速了软件创新,但也增加了由于漏洞的快速传播和无声补丁发布而增加了安全风险。 近年来,大型语言模型(LLM)和基于LLM的代理在各种软件工程(SE)任务中表现出显着的能力,使他们能够有效地应对漏洞检测等软件安全挑战。 然而,对LLM和基于LLM的代理在安全补丁检测方面的能力的系统评估仍然有限。 为了弥补这一差距,我们对 LLM 和基于 LLM 的代理的性能进行了全面的评估,用于安全补丁检测。 具体来说,我们研究三种方法:Plain LLM(具有系统提示的单个LLM),Data-Aug LLM(基于Plain LLM的数据增强)和ReAct Agent(利用思想作用观察机制)。 我们还根据这些方法评估商业和开源LLM的性能,并将这些结果与现有基线的结果进行比较。 此外,我们分析了这些方法在各种漏洞类型的检测性能,并检查了不同提示策略和上下文窗口大小对结果的影响。 我们的研究结果表明,Data-Aug LLM取得了最佳的整体性能,而ReAct Agent则展示了最低的误报率(FPR)。 虽然基线方法表现出很强的准确性,但它们的假阳性率明显更高。 相比之下,我们评估的方法实现了可比的准确性,同时大大减少了FPR。 这些发现为LLM和基于LLM的代理在安全补丁检测中的实际应用提供了宝贵的见解,突出了他们在保持稳健性能的同时最大限度地减少误报率方面的优势。
The widespread adoption of open-source software (OSS) has accelerated software innovation but also increased security risks due to the rapid propagation of vulnerabilities and silent patch releases. In recent years, large language models (LLMs) and LLM-based agents have demonstrated remarkable capabilities in various software engineering (SE) tasks, enabling them to effectively address software security challenges such as vulnerability detection. However, systematic evaluation of the capabilitie...