Code vulnerability detection method based on optimized large language model reasoning

Tang Xiaoyu1
Liu Luping1,2
Liu Qiang1
Tian Weijia3
Wang Chao1
Tang Yong4
1. School of Artificial Intelligence, Chengdu University of Information Technology, Chengdu 610225, China
2. National Key Laboratory of Internet Architecture, Beijing 100084, China
3. Cyber Security Detachment, Chengdu Municipal Public Security Bureau, Chengdu 610000, China
4. University of Electronic Science and Technology of China, Chengdu 610000, China

Abstract

Current deep learning models for code vulnerability detection often focus on binary classification and lack deep logical analysis of causes and locations. To address these issues, this study proposed a detection method based on Large Language Model reasoning optimization. The study first constructed a Reason dataset containing rich logical chains and trained the model via Supervised Fine-Tuning to generate structured analysis results. It then introduced the Group Relative Policy Optimization algorithm for reinforcement learning. Multi-objective reward functions, covering detection accuracy, vulnerability type matching, and location prediction, collaboratively optimized the model outputs. Experimental results show that the method achieves an F1 score of 91.18% in vulnerability detection tasks. The F1 scores for vulnerability localization and type identification reach 41.61% and 49.33%, respectively. This research generates stable and interpretable analysis conclusions, providing an effective path for precise code vulnerability detection and assisted repair.

Foundation Support

四川省自然科学基金项目(2024YFFK0119、2024YFFK0122)
互联网体系架构重点实验室开放课题(HLW2025MS09)

Publish Information

DOI: 10.19734/j.issn.1001-3695.2026.04.0104
Publish at: Application Research of Computers Accepted Paper, Vol. 43, 2026 No. 12

Publish History

[2026-08-12] Accepted Paper

Cite This Article

唐晓瑜, 刘露平, 刘强, 等. 基于大语言模型推理优化的代码漏洞检测方法 [J]. 计算机应用研究, 2026, 43 (12). (2026-08-25). https://doi.org/10.19734/j.issn.1001-3695.2026.04.0104. (Tang Xiaoyu, Liu Luping, Liu Qiang, et al. Code vulnerability detection method based on optimized large language model reasoning [J]. Application Research of Computers, 2026, 43 (12). (2026-08-25). https://doi.org/10.19734/j.issn.1001-3695.2026.04.0104. )

About the Journal

  • Application Research of Computers Monthly Journal
  • Journal ID ISSN 1001-3695
    CN  51-1196/TP

Application Research of Computers, founded in 1984, is an academic journal of computing technology sponsored by Sichuan Institute of Computer Sciences under the Science and Technology Department of Sichuan Province.

Aiming at the urgently needed cutting-edge technology in this discipline, Application Research of Computers reflects the mainstream technology, hot technology and the latest development trend of computer application research at home and abroad in a timely manner. The main contents of the journal include high-level academic papers in this discipline, the latest scientific research results and major application results. The contents of the columns involve new theories of computer discipline, basic computer theory, algorithm theory research, algorithm design and analysis, blockchain technology, system software and software engineering technology, pattern recognition and artificial intelligence, architecture, advanced computing, parallel processing, database technology, computer network and communication technology, information security technology, computer image graphics and its latest hot application technology.

Application Research of Computers has many high-level readers and authors, and its readers are mainly senior and middle-level researchers and engineers engaged in the field of computer science, as well as teachers and students majoring in computer science and related majors in colleges and universities. Over the years, the total citation frequency and Web download rate of Application Research of Computers have been ranked among the top of similar academic journals in this discipline, and the academic papers published are highly popular among the readers for their novelty, academics, foresight, orientation and practicality.


Indexed & Evaluation

  • The Second National Periodical Award 100 Key Journals
  • Double Effect Journal of China Journal Formation
  • the Core Journal of China (Peking University 2023 Edition)
  • the Core Journal for Science
  • Chinese Science Citation Database (CSCD) Source Journals
  • RCCSE Chinese Core Academic Journals
  • Journal of China Computer Federation
  • 2020-2022 The World Journal Clout Index (WJCI) Report of Scientific and Technological Periodicals
  • Full-text Source Journal of China Science and Technology Periodicals Database
  • Source Journal of China Academic Journals Comprehensive Evaluation Database
  • Source Journals of China Academic Journals (CD-ROM Version), China Journal Network
  • 2017-2019 China Outstanding Academic Journals with International Influence (Natural Science and Engineering Technology)
  • Source Journal of Top Academic Papers (F5000) Program of China's Excellent Science and Technology Journals
  • Source Journal of China Engineering Technology Electronic Information Network and Electronic Technology Literature Database
  • Source Journal of British Science Digest (INSPEC)
  • Japan Science and Technology Agency (JST) Source Journal
  • Russian Journal of Abstracts (AJ, VINITI) Source Journals
  • Full-text Journal of EBSCO, USA
  • Cambridge Scientific Abstracts (Natural Sciences) (CSA(NS)) core journals
  • Poland Copernicus Index (IC)
  • Ulrichsweb (USA)