ACM Transactions on Software Engineering and Methodology

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

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

Key points

From the paper's conclusion
  • 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.

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 .

Read the paper

Discussion

Science Skim's AI key points, plus readers' public thoughts

Readers' thoughts

No reader thoughts yet.

Related papers

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