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

SeCodePLT:一个用于评估代码生成人工智能安全性的统一平台

SeCodePLT: A Unified Platform for Evaluating the Security of Code GenAI

UC Santa Barbara(加州大学圣巴巴拉分校);UC Berkeley(加州大学伯克利分校);VirtueAI;UIUC(伊利诺伊大学香槟分校);UChicago(芝加哥大学);University of Oxford(牛津大学);UK AI Safety Institute(英国人工智能安全研究所)

Yuzhou Nie, Zhun Wang, Yu Yang, Ruizhe Jiang, Yuheng Tang, Xander Davies, Yarin Gal, Bo Li, Wenbo Guo, Dawn Song

AI总结:

本文提出SeCodePLT基准构建框架,通过人工验证种子与定向变异生成超5.9k样本,覆盖44类CWE风险和三种安全能力,用于动态评估代码LLM的安全性与漏洞处理能力。

摘要:

现有的用于评估代码生成大语言模型(LLMs)的安全风险与能力(例如漏洞检测)的基准面临若干关键局限:(1)风险与能力的覆盖范围有限;(2)依赖静态评估指标,如LLM判断或基于规则的检测,缺乏动态分析的精确性;(3)在数据质量与基准规模之间存在权衡。为应对这些挑战,我们引入了一个通用且可扩展的基准构建框架,该框架从经过人工验证的高质量种子示例开始,并通过有针对性的变异进行扩展。我们的方法提供了一套全面的工件,使基准能够利用动态指标支持全面的风险评估和安全能力评估。通过将专家见解与自动化生成相结合,我们在人工工作量、数据质量和基准规模之间取得了平衡。将该框架应用于Python、C/C++和Java,我们构建了SeCodePLT,这是一个包含超过5.9k个样本的数据集,涵盖44个基于CWE的风险类别和三种安全能力。与最先进的基准相比,SeCodePLT提供了更广泛的覆盖范围、更高的数据保真度以及显著更大的规模。我们使用SeCodePLT评估了领先的代码LLM和智能体,揭示了它们在生成安全代码以及识别或修复漏洞方面的优势与不足。

英文摘要:

Existing benchmarks for evaluating the security risks and capabilities (e.g., vulnerability detection) of code-generating large language models (LLMs) face several key limitations: (1) limited coverage of risk and capabilities; (2) reliance on static evaluation metrics such as LLM judgments or rule-based detection, which lack the precision of dynamic analysis; and (3) a trade-off between data quality and benchmark scale. To address these challenges, we introduce a general and scalable benchmark construction framework that begins with manually validated, high-quality seed examples and expands them via targeted mutations. Our approach provides a comprehensive suite of artifacts so the benchmark can support comprehensive risk assessment and security capability evaluation using dynamic metrics. By combining expert insights with automated generation, we strike a balance between manual effort, data quality, and benchmark scale. Applying this framework to Python, C/C++, and Java, we build SeCodePLT, a dataset of more than 5.9k samples spanning 44 CWE-based risk categories and three security capabilities. Compared with state-of-the-art benchmarks, SeCodePLT offers broader coverage, higher data fidelity, and substantially greater scale. We use SeCodePLT to evaluate leading code LLMs and agents, revealing their strengths and weaknesses in both generating secure code and identifying or fixing vulnerabilities.

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

↑