Artificial Intelligence (AI)-driven code generation tools are increasingly used throughout the software development lifecycle to accelerate coding tasks. However, the security of AI-generated code using Large Language Models (LLMs) remains underexplored, with studies revealing various risks and weaknesses. This paper analyzes the security of code generated by LLMs across different programming languages. We introduce a dataset of 200 tasks grouped into six categories to evaluate the performance of LLMs in generating secure and maintainable code. Our research shows that while LLMs can automate code creation, their security effectiveness varies by language. Many models fail to utilize modern security features in recent compiler and toolkit updates, such as Java 17. Moreover, outdated methods are still commonly used, particularly in C++. This highlights the need for advancing LLMs to enhance security and quality while incorporating emerging best practices in programming languages.


翻译:人工智能驱动的代码生成工具正日益广泛地应用于软件开发生命周期中,以加速编码任务。然而,基于大语言模型生成的代码的安全性仍未得到充分探索,已有研究揭示了多种风险与缺陷。本文分析了LLM在不同编程语言中生成代码的安全性。我们构建了一个包含六类共200项任务的评估数据集,用以评估LLM生成安全且可维护代码的性能。研究表明,虽然LLM能够实现代码自动生成,但其安全有效性因语言而异。许多模型未能充分利用现代编译器与工具包(如Java 17)的最新安全特性。此外,过时的方法仍被普遍使用,尤其在C++语言中。这凸显了推进LLM发展以提升安全性与质量的必要性,同时需要融入编程语言领域新兴的最佳实践。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
158页!天大等最新《大型语言模型安全:全面综述》
专知会员服务
50+阅读 · 2024年12月24日
揭示生成式人工智能 / 大型语言模型(LLMs)的军事潜力
专知会员服务
31+阅读 · 2024年9月26日
大型语言模型代理的安全与隐私综述
专知会员服务
30+阅读 · 2024年8月5日
生成式人工智能大型语言模型的安全性:概述
专知会员服务
35+阅读 · 2024年7月30日
《大型语言模型代码生成》综述
专知会员服务
70+阅读 · 2024年6月4日
自动编程:大型语言模型及其他
专知会员服务
36+阅读 · 2024年5月12日
大型语言模型网络安全综述
专知会员服务
68+阅读 · 2024年5月12日
自然语言生成资源列表
专知
17+阅读 · 2020年1月4日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
VIP会员
最新内容
《新兴技术武器化及其对全球风险的影响》
专知会员服务
3+阅读 · 今天4:27
《帕兰泰尔平台介绍:信息分析平台》
专知会员服务
12+阅读 · 今天4:20
智能体化世界建模:基础、能力、规律及展望
专知会员服务
8+阅读 · 4月28日
美海警海上态势感知无人系统
专知会员服务
6+阅读 · 4月28日
《复杂系统数据驱动预测建模的数值框架》报告
专知会员服务
12+阅读 · 4月28日
从“会话式人工智能”角度看“Maven智能系统”
专知会员服务
11+阅读 · 4月28日
相关VIP内容
158页!天大等最新《大型语言模型安全:全面综述》
专知会员服务
50+阅读 · 2024年12月24日
揭示生成式人工智能 / 大型语言模型(LLMs)的军事潜力
专知会员服务
31+阅读 · 2024年9月26日
大型语言模型代理的安全与隐私综述
专知会员服务
30+阅读 · 2024年8月5日
生成式人工智能大型语言模型的安全性:概述
专知会员服务
35+阅读 · 2024年7月30日
《大型语言模型代码生成》综述
专知会员服务
70+阅读 · 2024年6月4日
自动编程:大型语言模型及其他
专知会员服务
36+阅读 · 2024年5月12日
大型语言模型网络安全综述
专知会员服务
68+阅读 · 2024年5月12日
相关基金
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员