Fine-Grained Reasoning Enhanced Vulnerability Patch Generation with Multi-View Fix Knowledge

With the rapid advancement of deep learning, numerous large language models (LLMs) have been developed, achieving remarkable performance across a wide range of code generation tasks. However, in the domain of vulnerability patch generation, existing approaches suffer from two critical limitations: (1) limited reasoning capability, which hampers the modeling of fine-grained fix logic; and (2) insufficient utilization of fix knowledge, with minimal consideration of vulnerability intent. To address these challenges, we propose FraMe, a novel automated approach that integrates F ine-g r ained re a soning paths with M ulti-vi e w fix knowledge to enhance LLM-based vulnerability patch generation. FraMe consists of two modules: stepwise fix-reasoning path collection and multi-view knowledge augmented patch generation. The first module extracts detailed vulnerability–fix context and constructs augmented prompt templates to generate stepwise fix-reasoning paths, enabling the model to capture fine-grained fix logic. The second module leverages multi-view fix knowledge from a vulnerability knowledge graph to model vulnerability intent and supplement code semantics, thereby facilitating the selection of effective few-shot examples and enabling the LLM to generate more accurate patches. We evaluated FraMe on a widely used real-world C/C++ vulnerability dataset. Experimental results demonstrate that FraMe consistently outperforms both existing prompting methods and non-LLM-based techniques, achieving an improvement of 9.4% in the Correct metric at a beam size of 10 compared with the best baseline. The source code and datasets are available at https://github.com/VulDet/FraMe .

Authors

Institutions

Publication Details

Journal
ACM Transactions on Software Engineering and Methodology
Published
2026-11-16
DOI
https://doi.org/10.1145/3861081
Primary Topic
Software Engineering Research
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

Fine-Grained Reasoning Enhanced Vulnerability Patch Generation with Multi-View Fix Knowledge

Guoqing Zhu, Yang Xiao, Cuiyun Gao, Miaomiao Shao et al.
ACM Transactions on Software Engineering and Methodology
Software Engineering Research
article

Fine-Grained Reasoning Enhanced Vulnerability Patch Generation with Multi-View Fix Knowledge

Guoqing Zhu, Yang Xiao, Cuiyun Gao, Miaomiao Shao, Yuxin Ding
article en

Abstract

With the rapid advancement of deep learning, numerous large language models (LLMs) have been developed, achieving remarkable performance across a wide range of code generation tasks. However, in the domain of vulnerability patch generation, existing approaches suffer from two critical limitations: (1) limited reasoning capability, which hampers the modeling of fine-grained fix logic; and (2) insufficient utilization of fix knowledge, with minimal consideration of vulnerability intent. To address these challenges, we propose FraMe, a novel automated approach that integrates F ine-g r ained re a soning paths with M ulti-vi e w fix knowledge to enhance LLM-based vulnerability patch generation. FraMe consists of two modules: stepwise fix-reasoning path collection and multi-view knowledge augmented patch generation. The first module extracts detailed vulnerability–fix context and constructs augmented prompt templates to generate stepwise fix-reasoning paths, enabling the model to capture fine-grained fix logic. The second module leverages multi-view fix knowledge from a vulnerability knowledge graph to model vulnerability intent and supplement code semantics, thereby facilitating the selection of effective few-shot examples and enabling the LLM to generate more accurate patches. We evaluated FraMe on a widely used real-world C/C++ vulnerability dataset. Experimental results demonstrate that FraMe consistently outperforms both existing prompting methods and non-LLM-based techniques, achieving an improvement of 9.4% in the Correct metric at a beam size of 10 compared with the best baseline. The source code and datasets are available at https://github.com/VulDet/FraMe .

ACM Transactions on Software Engineering and Methodology
Chinese Academy of Sciences (CN), Harbin Institute of Technology (CN)
Software Engineering Research
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon