跳到正文
EasyXiv 检索
投稿 关于 登录

按回车检索 · 直接输入编号(如 1706.03762)可跳转到论文

计算机科学 > 密码学与安全

arXiv:2410.14321 (cs)
[提交于 2024年10月18日]

标题:From Solitary Directives to Interactive Encouragement! LLM Secure Code Generation by Natural Language Prompting

作者:Shigang Liu, Bushra Sabir, Seung Ick Jang, Yuval Kansal, Yansong Gao, Kristen Moore, Alsharif Abuadbba, Surya Nepal
查看论文《From Solitary Directives to Interactive Encouragement! LLM Secure Code Generation by Natural Language Prompting》的 PDF
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读
摘要:Large Language Models (LLMs) have shown remarkable potential in code generation, making them increasingly important in the field. However, the security issues of generated code have not been fully addressed, and the usability of LLMs in code generation still requires further exploration. This work introduces SecCode, a framework that leverages an innovative interactive encouragement prompting (EP) technique for secure code generation with \textit{only NL} prompts. This approach ensures that the prompts can be easily shared and understood by general users. SecCode functions through three stages: 1) Code Generation using NL Prompts; 2) Code Vulnerability Detection and Fixing, utilising our proposed encouragement prompting; 3) Vulnerability Cross-Checking and Code Security Refinement. These stages are executed in multiple interactive iterations to progressively enhance security. By using both proprietary LLMs (i.e., GPT-3.5 Turbo, GPT-4 and GPT-4o) and open-source LLMs (i.e., Llama 3.1 8B Instruct, DeepSeek Coder V2 Lite Instruct) evaluated on three benchmark datasets, extensive experimental results show that our proposed SecCode greatly outperforms compared baselines, generating secure code with a high vulnerability correction rate. For example, SecCode exhibits a high fix success rate of over 76\% after running 5 automated EP interactive iterations and over 89\% after running 10 automated EP interactive iterations. To the best of our knowledge, this work is the first to formulate secure code generation with NL prompts only. We have open-sourced our code and encourage the community to focus on secure code generation.
主题: 密码学与安全 (cs.CR); 程序设计语言 (cs.PL); 软件工程 (cs.SE)
引用方式: arXiv:2410.14321 [cs.CR]
  (或者 arXiv:2410.14321v1 [cs.CR] 对于此版本)
  https://doi.org/10.48550/arXiv.2410.14321

提交历史

来自:Shigang Liu
[v1] 2024年10月18日 星期五 09:32:08 UTC
全文链接:

访问论文:

  • 查看原文 PDF
  • 中文 PDF (下批处理)
  • EasyResearch 阅读
  • TeX 源文件
  • arXiv 原文页面
查看许可

当前浏览上下文:

cs.CR
< 上一篇   |   下一篇 >
最新 | 近期 | 2024-10
切换浏览方式为:
cs
cs.PL
cs.SE

参考文献与引用

  • Google Scholar
  • Semantic Scholar

BibTeX 格式的引用

EasyXiv 是独立运营的中文预印本站点,与 arXiv 及康奈尔大学无隶属关系。 论文元数据与原文来自 arXiv.org,感谢 arXiv 提供开放获取服务。
关于 · 帮助 · 投稿指南 · 版权 · arXiv 原站