Prompt-Enhanced Software Vulnerability Detection Using ChatGPT

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Zhang, Chenyuan, Liu, Hao, Zeng, Jiutian, Yang, Kejing, Li, Yuhong, Li, Hui
Format: Preprint
Published: 2023
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866911836745498624
author Zhang, Chenyuan
Liu, Hao
Zeng, Jiutian
Yang, Kejing
Li, Yuhong
Li, Hui
author_facet Zhang, Chenyuan
Liu, Hao
Zeng, Jiutian
Yang, Kejing
Li, Yuhong
Li, Hui
contents With the increase in software vulnerabilities that cause significant economic and social losses, automatic vulnerability detection has become essential in software development and maintenance. Recently, large language models (LLMs) like GPT have received considerable attention due to their stunning intelligence, and some studies consider using ChatGPT for vulnerability detection. However, they do not fully consider the characteristics of LLMs, since their designed questions to ChatGPT are simple without a specific prompt design tailored for vulnerability detection. This paper launches a study on the performance of software vulnerability detection using ChatGPT with different prompt designs. Firstly, we complement previous work by applying various improvements to the basic prompt. Moreover, we incorporate structural and sequential auxiliary information to improve the prompt design. Besides, we leverage ChatGPT's ability of memorizing multi-round dialogue to design suitable prompts for vulnerability detection. We conduct extensive experiments on two vulnerability datasets to demonstrate the effectiveness of prompt-enhanced vulnerability detection using ChatGPT. We also analyze the merit and demerit of using ChatGPT for vulnerability detection. Repository: https://github.com/KDEGroup/LLMVulnerabilityDetection.
format Preprint
id arxiv_https___arxiv_org_abs_2308_12697
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle Prompt-Enhanced Software Vulnerability Detection Using ChatGPT
Zhang, Chenyuan
Liu, Hao
Zeng, Jiutian
Yang, Kejing
Li, Yuhong
Li, Hui
Software Engineering
With the increase in software vulnerabilities that cause significant economic and social losses, automatic vulnerability detection has become essential in software development and maintenance. Recently, large language models (LLMs) like GPT have received considerable attention due to their stunning intelligence, and some studies consider using ChatGPT for vulnerability detection. However, they do not fully consider the characteristics of LLMs, since their designed questions to ChatGPT are simple without a specific prompt design tailored for vulnerability detection. This paper launches a study on the performance of software vulnerability detection using ChatGPT with different prompt designs. Firstly, we complement previous work by applying various improvements to the basic prompt. Moreover, we incorporate structural and sequential auxiliary information to improve the prompt design. Besides, we leverage ChatGPT's ability of memorizing multi-round dialogue to design suitable prompts for vulnerability detection. We conduct extensive experiments on two vulnerability datasets to demonstrate the effectiveness of prompt-enhanced vulnerability detection using ChatGPT. We also analyze the merit and demerit of using ChatGPT for vulnerability detection. Repository: https://github.com/KDEGroup/LLMVulnerabilityDetection.
title Prompt-Enhanced Software Vulnerability Detection Using ChatGPT
topic Software Engineering
url https://arxiv.org/abs/2308.12697