arrow
返回

Towards Explainable Vulnerability Detection With Large Language Models

delete2025-10-01
delete0
PRE
AI
M
Mao, Qi
Z
Zhenhao Li
X
Xing Hu
刘
刘逵 (Kui Liu)
X
Xin Xia *
J
Jianling Sun
DOI:10.1109/TSE.2025.3605442delete
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

En 中文
Software vulnerabilities pose significant risks to the security and integrity of software systems. Although prior studies have explored vulnerability detection using deep learning and pre-trained models, these approaches often fail to provide the detailed explanations necessary for developers to understand and remediate vulnerabilities effectively. The advent of large language models (LLMs) has introduced transformative potential due to their advanced generative capabilities and ability to comprehend complex contexts, offering new possibilities for addressing these challenges. In this paper, we propose LLMVulExp, an automated framework designed to specialize LLMs for the dual tasks of vulnerability detection and explanation. To address the challenges of acquiring high-quality annotated data and injecting domain-specific knowledge, LLMVulExp leverages prompt-based techniques for annotating vulnerability explanations and fine-tunes LLMs using instruction tuning with Low-Rank Adaptation (LoRA), enabling LLMVulExp to detect vulnerability types in code while generating detailed explanations, including the cause, location, and repair suggestions. Additionally, we employ a Chain-of-Thought (CoT) based key code extraction strategy to focus LLMs on analyzing vulnerability-prone code, further enhancing detection accuracy and explanatory depth. We conducted experiments across multiple vulnerability detection settings on three benchmark datasets, demonstrating the effectiveness of our method. This study highlights the feasibility of utilizing LLMs for real-world vulnerability detection and explanation tasks, providing critical insights into their adaptation and application in software security.
Keyword:
Codes
Security
Tuning
Training
Large language models
Accuracy
Semantics
Location awareness
Data models
Reviews
Vulnerability detection
vulnerability explanation
large language model
instruction tuning

期刊

IEEE Transactions on Software Engineering 封面图
IEEE Transactions on Software Engineering
IF:
5.6
论文数:
2.9K
被引数:
1.1W

机构

Z
Zhejiang University
学者数:
1.5W
论文数: 5.2K
被引数: 17.8W
Y
york university - canada
学者数:
8.3K
论文数: 9.0K
被引数: 10
引用论文

引用论文

BLEU布卢
err2001-01-01
err0
errOAAI
errKishore Papineni; Salim Roukos; Todd Ward; Wei-Jing Zhu
err分享
err收藏
A Survey on In-context Learning情境学习研究综述
err2024-01-01
err0
PREAI
errQingxiu Dong; Lei Li; Damai Dai; Ce Zheng; Jingyuan Ma; Rui Li; Heming Xia; Jingjing Xu; Zhiyong Wu; Baobao Chang; Xu Sun; Lei Li; Zhifang Sui
err分享
err收藏
Vulnerability Detection with Code Language Models: How Far are We?
err2025-04-26
err0
PREAI
errDing,Yangruibo; Fu,Yanjun; Ibrahim,Omniyyah; Sitawarin,Chawin; Chen,Xinyun; Alomair,Basel; Wagner,David; Ray,Baishakhi; Chen,Yizheng
err分享
err收藏
LineVD
err2022-10-17
err0
errOAAI
errDavid Hin; Andrey Kan; Huaming Chen; M. Ali Babar
err分享
err收藏
学者 查看更多内容