arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.01320cs.SEcs.AI
收藏

自适应层次评估LLM和SAST工具用于Python中的CWE预测

Adaptive Hierarchical Evaluation of LLMs and SAST tools for CWE Prediction in Python

Open Source Institute Faculty of Science(开源研究所科学学院);Technology University of Canberra Canberra, Australia(技术大学堪培拉澳大利亚)

Muntasir Adnan, Carlos C. N. Kuhn

AI总结:

本文提出ALPHA基准,通过层次化惩罚评估LLM和SAST工具在Python中CWE预测的性能,发现LLM在整体表现上优于SAST,但SAST在检测发生时精度更高,且模型间预测一致性差异显著。

摘要:

大型语言模型已成为软件开发的重要组成部分,但它们经常生成有缺陷的代码。现有的代码漏洞检测基准采用二元分类,缺乏用于迭代纠正系统中可行反馈所需的CWE级别特异性。我们提出了ALPHA(通过惩罚的自适应学习在层次评估中),这是第一个功能级别的Python基准,使用层次意识的、针对CWE的惩罚来评估LLM和SAST工具。ALPHA区分过度泛化、过度指定和横向错误,反映诊断效用的实际差异。评估七种LLM和两种SAST工具,我们发现LLM在SAST上表现显著更好,尽管当检测发生时,SAST显示出更高的精度。关键的是,预测一致性在模型之间变化很大(8.26%-81.87%的一致性),这对反馈驱动的系统有重大影响。我们进一步概述了一条未来工作的路径,将ALPHA惩罚纳入监督微调,这可能提供一种有原则的层次意识漏洞检测,有待经验验证。

英文摘要:

Large Language Models have become integral to software development, yet they frequently generate vulnerable code. Existing code vulnerability detection benchmarks employ binary classification, lacking the CWE-level specificity required for actionable feedback in iterative correction systems. We present ALPHA (Adaptive Learning via Penalty in Hierarchical Assessment), the first function-level Python benchmark that evaluates both LLMs and SAST tools using hierarchically aware, CWE-specific penalties. ALPHA distinguishes between over-generalisation, over-specification, and lateral errors, reflecting practical differences in diagnostic utility. Evaluating seven LLMs and two SAST tools, we find LLMs substantially outperform SAST, though SAST demonstrates higher precision when detections occur. Critically, prediction consistency varies dramatically across models (8.26%-81.87% agreement), with significant implications for feedback-driven systems. We further outline a pathway for future work incorporating ALPHA penalties into supervised fine-tuning, which could provide principled hierarchy-aware vulnerability detection pending empirical validation.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑