arrow
Return

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
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

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.
Keywords:
Codes
Security
Tuning
Training
Large language models
Accuracy
Semantics
Location awareness
Data models
Reviews
Vulnerability detection
vulnerability explanation
large language model
instruction tuning

Journal

IEEE Transactions on Software Engineering cover
IEEE Transactions on Software Engineering
IF:
5.6
Papers:
2.9K
Citations:
1.1W

Organization

Z
Zhejiang University
Scholars:
1.5W
Papers: 5.2K
Citations: 17.8W
Y
york university - canada
Scholars:
8.3K
Papers: 9.0K
Citations: 10
Cited Papers

Cited Papers

BLEU
err2001-01-01
err0
errOAAI
errKishore Papineni; Salim Roukos; Todd Ward; Wei-Jing Zhu
errShare
errSave
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
errShare
errSave
VulDeeLocator: A Deep Learning-Based Fine-Grained Vulnerability Detector
err2022-07-01
err87
errOAAI
errLi, Zhen; Zou, Deqing; Xu, Shouhuai; Chen, Zhaoxuan; Zhu, Yawei; Jin, Hai
errShare
errSave
SySeVR: A Framework for Using Deep Learning to Detect Software Vulnerabilities
err2022-07-01
err261
errOAAI
errLi, Zhen; Zou, Deqing; Xu, Shouhuai; Jin, Hai; Zhu, Yawei; Chen, Zhaoxuan
errShare
errSave
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
errShare
errSave
Vulnerability Detection by Learning From Syntax-Based Execution Paths of Code
err2023-08-01
err15
PREAI
errZhang, Junwei; Liu, Zhongxin; Hu, Xing; Xia, Xin; Li, Shanping
errShare
errSave
LineVD
err2022-10-17
err0
errOAAI
errDavid Hin; Andrey Kan; Huaming Chen; M. Ali Babar
errShare
errSave
researcher View more