Existing literature heavily relies on static analysis tools to evaluate LLMs for secure code generation and vulnerability detection. We reviewed 1,080 LLM-generated code samples, built a human-validated ground-truth, and compared the outputs of two widely used static security tools, CodeQL and Semgrep, against this corpus. While 61% of the samples were genuinely secure, Semgrep and CodeQL classified 60% and 80% as secure, respectively. Despite the apparent agreement in aggregate statistics, per-sample analysis reveals substantial discrepancies: only 65% of Semgrep's and 61% of CodeQL's reports correctly matched the ground truth. These results question the reliability of static analysis tools as sole evaluators of code security and underscore the need for expert feedback. Building on this insight, we propose a conceptual framework that persistently stores human feedback in a dynamic retrieval-augmented generation pipeline, enabling LLMs to reuse past feedback for secure code generation and vulnerability detection.


翻译:现有文献严重依赖静态分析工具来评估LLM在安全代码生成与漏洞检测方面的性能。本研究审查了1,080个LLM生成的代码样本,构建了经人工验证的基准真值,并将两种广泛使用的静态安全工具(CodeQL与Semgrep)的输出结果与该语料库进行对比。虽然61%的样本确实安全,但Semgrep和CodeQL分别将60%和80%的样本归类为安全。尽管聚合统计数据呈现表面一致性,但逐样本分析揭示了显著差异:Semgrep仅65%、CodeQL仅61%的检测报告与基准真值准确匹配。这些结果对静态分析工具作为代码安全性唯一评估指标的可靠性提出质疑,并凸显了专家反馈的必要性。基于此发现,我们提出一个概念框架,将人类反馈持久存储在动态检索增强生成流程中,使LLM能够复用历史反馈以提升安全代码生成与漏洞检测能力。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
揭示生成式人工智能 / 大型语言模型(LLMs)的军事潜力
专知会员服务
31+阅读 · 2024年9月26日
生成式人工智能大型语言模型的安全性:概述
专知会员服务
35+阅读 · 2024年7月30日
如何检测LLM内容?UCSB等最新首篇《LLM生成内容检测》综述
文本生成公开数据集/开源工具/经典论文详细列表分享
深度学习与NLP
30+阅读 · 2019年9月22日
NLP-Progress记录NLP最新数据集、论文和代码: 助你紧跟NLP前沿
中国人工智能学会
12+阅读 · 2018年11月15日
深度学习文本分类方法综述(代码)
中国人工智能学会
28+阅读 · 2018年6月16日
网络安全态势感知浅析
计算机与网络安全
18+阅读 · 2017年10月13日
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
19+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
19+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员