GRACE: Empowering LLM-based software vulnerability detection with graph structure and in-context learning

计算机科学 图形 脆弱性(计算) 软件 背景(考古学) 软件工程 工程类 计算机安全 理论计算机科学 程序设计语言 地理 考古
作者
Guilong Lu,Xiaolin Ju,Xiang Chen,Wenlong Pei,Zhilong Cai
出处
期刊:Journal of Systems and Software [Elsevier BV]
卷期号:212: 112031-112031 被引量:55
标识
DOI:10.1016/j.jss.2024.112031
摘要

Software vulnerabilities inflict considerable economic and societal harm. Therefore, timely and accurate detection of these flaws has become vital. Large language models (LLMs) have emerged as a promising tool for vulnerability detection in recent studies. However, their effectiveness suffers when limited to plain text source code, which may ignore the syntactic and semantic information of the code. To address this limitation, we propose a novel vulnerability detection approach GRACE that empowers LLM-based software vulnerability detection by incorporating graph structural information in the code and in-context learning. We also design an effective demonstration retrieval approach that identifies highly relevant code examples by considering semantic, lexical, and syntactic similarities for the target code to provide better demonstrations for in-context learning. To evaluate the effectiveness of GRACE, we conducted an empirical study on three vulnerability detection datasets (i.e., Devign, Reveal, and Big-Vul). The results demonstrate that GRACE outperforms six state-of-the-art vulnerability detection baselines by at least 28.65% in terms of the F1 score across these three datasets. Therefore, our study highlights the effectiveness of integrating graph structural information and in-context learning in LLMs for vulnerability detection. These findings motivate further investigation into tailoring such approaches for specific vulnerability types or adapting them to other security tasks.
最长约 10秒,即可获得该文献文件

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
Hello应助CYT采纳,获得10
刚刚
CodeCraft应助111采纳,获得10
刚刚
123完成签到,获得积分20
1秒前
1秒前
羽化天霜发布了新的文献求助10
1秒前
科目三应助宋一丹采纳,获得10
1秒前
2秒前
科研菜鸡发布了新的文献求助10
3秒前
可爱向卉发布了新的文献求助10
3秒前
ding应助随风沙ZYX采纳,获得10
3秒前
3秒前
淡定的小懒猪完成签到,获得积分10
3秒前
3秒前
3秒前
dll发布了新的文献求助20
4秒前
第一百零一个完成签到,获得积分10
4秒前
5秒前
Gu完成签到,获得积分10
5秒前
cdercder应助Kevin采纳,获得10
5秒前
小二郎应助博学为农采纳,获得10
5秒前
研友_Z7XoE8完成签到,获得积分10
6秒前
文艺点点完成签到,获得积分10
6秒前
五条悟发布了新的文献求助10
6秒前
7秒前
7秒前
7秒前
画凌烟发布了新的文献求助10
8秒前
不弃完成签到,获得积分10
8秒前
Youngsy发布了新的文献求助10
9秒前
爱lx发布了新的文献求助10
9秒前
hhh关注了科研通微信公众号
9秒前
10秒前
10秒前
11秒前
11秒前
ly发布了新的文献求助10
11秒前
12秒前
13秒前
8888完成签到,获得积分10
13秒前
13秒前
高分求助中
(应助此贴封号)【重要!!请各用户(尤其是新用户)详细阅读】【科研通的精品贴汇总】 10000
China Pluperfect I: Epistemology of Past and Outside in Chinese Art 520
Matrix Methods in Data Mining and Pattern Recognition Second Edition 510
Governing Growth: Us Industrial Policy from Hamilton to Trump 500
The fast track to determining transfer functions of linear circuits: The student guide 500
The Analytical and Numerical Solution of Electric and Magnetic Fields 500
Synthesis of P-Chiral Phosphine Ligands and Their Applications in Asymmetric Catalysis 400
热门求助领域 (近24小时)
化学 材料科学 医学 生物 纳米技术 工程类 有机化学 化学工程 生物化学 计算机科学 内科学 物理 复合材料 催化作用 细胞生物学 无机化学 光电子学 物理化学 电极 基因
热门帖子
关注 科研通微信公众号,转发送积分 7623564
求助须知:如何正确求助?哪些是违规求助? 9198895
关于积分的说明 19720751
捐赠科研通 7195024
什么是DOI,文献DOI怎么找? 3273369
关于科研通互助平台的介绍 2435560
邀请新用户注册赠送积分活动 2268978