收藏切换
Source Code Vulnerability Detection Methods Based on Large Language Models
收藏切换
Mingsheng Cao1, 2, Qiaolong Ding1, 2, Wenqing Zhang1, Yanbin Li3, Di Lin1, Hui Xu4, *
Journal of Computer Research and Development | 2026, 63(9) : 2302 - 2318
Less
收藏切换
Journal of Computer Research and Development | 2026, 63(9): 2302-2318
• Special Issue on Frontier Technologies and Applications of Knowledge-Enhanced Artificial Intelligence •
Source Code Vulnerability Detection Methods Based on Large Language Models
Full
Mingsheng Cao1, 2, Qiaolong Ding1, 2, Wenqing Zhang1, Yanbin Li3, Di Lin1, Hui Xu4, *
Affiliations
  • 1School of Information and Software Engineering, University of Electronic Science and Technology of China, Chengdu 610054
  • 2Network and Data Security Key Laboratory of Sichuan Province(University of Electronic Science and Technology of China),Chengdu610054
  • 3School of Software, Shandong University, Jinan 250101
  • 4Shenzhen Institute for Advanced Study, University of Electronic Science and Technology of China, Shenzhen 518000
  • born in 1986. PhD, associate professor, master supervisor. His main research interests include artificial intelligence, information security, and privacy protection

    born in 2001. Master candidate. His main research interests include deep learning, large language models, and vulnerability detection

    born in 1990. PhD. His main research interests include artificial intelligence and information security

    born in 1992. PhD, associate professor, master supervisor. His main research interests include information security and privacy protection

    born in 1985. PhD, professor, and PhD supervisor. His main research interests include big data analytics, and information security

    born in 1986. PhD, associate professor, master supervisor. His main research interests include artificial intelligence, LLM, and reinforcement learning

About Author:

born in 1986. PhD, associate professor, master supervisor. His main research interests include artificial intelligence, information security, and privacy protection

born in 2001. Master candidate. His main research interests include deep learning, large language models, and vulnerability detection

born in 1990. PhD. His main research interests include artificial intelligence and information security

born in 1992. PhD, associate professor, master supervisor. His main research interests include information security and privacy protection

born in 1985. PhD, professor, and PhD supervisor. His main research interests include big data analytics, and information security

born in 1986. PhD, associate professor, master supervisor. His main research interests include artificial intelligence, LLM, and reinforcement learning

Published: 2026-09-01 doi: 10.7544/issn1000-1239.202660229
Outline
收藏切换

To address the limitations of large language models (LLMs) in source code vulnerability detection—namely insufficient utilization of program structural information, unstable reasoning processes, and high fine-tuning costs—we propose a vulnerability detection framework that integrates graph-based representations with LLM reasoning capabilities. The proposed method constructs data flow graphs (DFGs) from source code to model variable dependencies and semantic propagation paths, and aligns graph features with the semantic embedding space of LLMs through a cross-modal mapping module, enabling effective injection of structural knowledge into the language model. Furthermore, a progressive pretraining strategy based on code reconstruction tasks is designed to enhance the graph encoder’s ability to capture vulnerability-related structural patterns. On this basis, structured reasoning distillation and parameter-efficient fine-tuning via low-rank adaptation (LoRA) are incorporated to transfer vulnerability analysis knowledge from teacher models to student models, improving detection performance while reducing training overhead. In addition, a chain-of-thought reasoning process tailored for vulnerability detection is introduced to improve interpretability and reasoning consistency. Experimental results demonstrate that the proposed method significantly improves both the accuracy and robustness of source code vulnerability detection while maintaining low fine-tuning cost.

source code vulnerability detection  /  large language model  /  graph neural network  /  parameter-efficient fine-tuning  /  chain-of-thought reasoning
曹明生, 丁桥隆, 张文清, 李延斌, 林迪, 许辉. 基于大语言模型的源代码漏洞检测方法. 计算机研究与发展, 2026 , 63 (9) : 2302 -2318 . DOI: 10.7544/issn1000-1239.202660229
Mingsheng Cao, Qiaolong Ding, Wenqing Zhang, Yanbin Li, Di Lin, Hui Xu. Source Code Vulnerability Detection Methods Based on Large Language Models[J]. Journal of Computer Research and Development, 2026 , 63 (9) : 2302 -2318 . DOI: 10.7544/issn1000-1239.202660229
Year 2026 volume 63 Issue 9
81
40
Cite this Article
BibTeX
Article Info
doi: 10.7544/issn1000-1239.202660229
  • Receive Date:2026-04-16
  • Online Date:2026-11-17
  • Published:2026-09-01
Article Data
Affiliations
History
  • Received:2026-04-16
  • Revised:2026-07-16
Affiliations
    1School of Information and Software Engineering, University of Electronic Science and Technology of China, Chengdu 610054
    2Network and Data Security Key Laboratory of Sichuan Province(University of Electronic Science and Technology of China),Chengdu610054
    3School of Software, Shandong University, Jinan 250101
    4Shenzhen Institute for Advanced Study, University of Electronic Science and Technology of China, Shenzhen 518000
References
Share
https://castjournals.cast.org.cn/joweb/jsjyjyfz/EN/10.7544/issn1000-1239.202660229
Share to
QR

Scan QR to access full text

Cite this article
BibTeX
Citations
表12种不同金属材料的力学参数
科
Family
属数
Number of
genus
种数
Number of
species
占总种数比例
Percentage of
total species (%)
属
Genus
种数
Number of
species
占总种数比例
Percentage of total
species (%)
鹅膏菌科Amanitaceae 2 11 5.26 鹅膏菌属 Amanita 10 4.78
小菇科 Mycenaceae 2 12 5.74 丝盖伞属 Inocybe 5 2.39
多孔菌科 Polyporaceae 8 14 6.70 蜡蘑属 Laccaria 5 2.39
红菇科 Russulaceae 3 23 11.00 小皮伞属 Marasmius 6 2.87
小菇属 Mycena 11 5.26
光柄菇属 Pluteus 5 2.39
红菇属 Russula 17 8.13
栓菌属 Trametes 5 2.39
关闭全屏
  • BibTeX
  • EndNote
  • RefWorks
  • TxT