本文提出全自动方法 ACCA,利用符号执行评估 AI 生成安全相关汇编代码的正确性,实验表明其优于基线方案并与人工评估高度相关,且评估速度显著快于人工分析。
摘要:
评估 AI 生成代码的正确性是一个具有挑战性的开放问题。本文提出了一种名为 ACCA 的全自动方法,用于以安全为目的评估 AI 生成代码的正确性。该方法使用符号执行来评估 AI 生成代码的行为是否与参考实现一致。我们使用 ACCA 评估了四个最先进的、经过训练可生成面向安全的汇编代码的模型,并将评估结果与不同的基线方案进行比较,包括该领域广泛使用的输出相似度指标,以及由 OpenAI 开发的著名 AI 语言模型 ChatGPT。实验表明,我们的方法优于基线方案,并且对 AI 生成代码正确性的评估结果与基于人工的评估相似,而人工评估被视为该领域评估的 ground truth。此外,ACCA 与人工评估之间具有非常强的相关性(平均 Pearson 相关系数 r=0.84)。最后,由于该方法是一种不需要任何人工干预的全自动解决方案,因此对每个代码片段进行评估平均仅需约 0.17 秒,根据我们的经验,这明显低于人工分析人员手动检查代码所需的平均时间。
英文摘要:
Evaluating the correctness of code generated by AI is a challenging open problem. In this paper, we propose a fully automated method, named ACCA, to evaluate the correctness of AI-generated code for security purposes. The method uses symbolic execution to assess whether the AI-generated code behaves as a reference implementation. We use ACCA to assess four state-of-the-art models trained to generate security-oriented assembly code and compare the results of the evaluation with different baseline solutions, including output similarity metrics, widely used in the field, and the well-known ChatGPT, the AI-powered language model developed by OpenAI. Our experiments show that our method outperforms the baseline solutions and assesses the correctness of the AI-generated code similar to the human-based evaluation, which is considered the ground truth for the assessment in the field. Moreover, ACCA has a very strong correlation with the human evaluation (Pearson's correlation coefficient r=0.84 on average). Finally, since it is a fully automated solution that does not require any human intervention, the proposed method performs the assessment of every code snippet in ~0.17s on average, which is definitely lower than the average time required by human analysts to manually inspect the code, based on our experience.
VISOR: A Vision-Language Model-based Test Oracle for Testing Robots
Simula Research Laboratory(Simula研究实验室);Oslo Metropolitan University(奥斯陆理工大学);Mondragon University(蒙dragon大学);National Institute of Informatics(国立信息研究所)
SysMoBench: Evaluating AI on Formally Modeling Complex Real-World Systems
Nanjing University(南京大学);Microsoft Research Asia(微软亚洲研究院);University of British Columbia(不列颠哥伦比亚大学);University of Illinois Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校)