Skip to content
XUPT-SSSPublic

About

No description, website, or topics provided.

Resources

Stars

8 stars

Watchers

0 watching

Forks

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Enhancing Vulnerability Detection by Fusing Code Semantic Features with LLM-Generated Interpretations

The rising prevalence of software vulnerabilities highlights the critical need for more effective detection techniques. Although recent deep learning (DL) approaches have made notable progress, they primarily rely on code-centric modalities, such as token sequences, abstract syntax trees (ASTs), and graph-based representations, while largely neglecting complementary semantic cues available from natural language artifacts like code explanations. This paper proposes FuSEVul, a novel multi-modal framework that integrates code semantics with automatically generated natural language explanations to enhance vulnerability detection. FuSEVul consists of three key components: (1) a code semantic encoder that leverages pre-trained model to capture structural and semantic features from source code; (2) an explanation generation module that prompts a large language model (LLM) to produce functional and risk-aware textual descriptions, subsequently encoded using RoBERTa; and (3) a self-attention-based fusion mechanism that dynamically aligns and integrates cross-modal features, emphasizing signals most indicative of vulnerabilities. Extensive experimental evaluations across three public datasets demonstrate that FuSEVul outperforms 18 state-of-the-art baselines, yielding average relative gains of 7.3% in accuracy and 52.2% in F1 score. Ablation studies further confirm the effectiveness of incorporating LLM-generated explanations and the proposed fusion strategy.

Design of FuSEVul

Datasets

The dataset can be downloaded at: https://drive.google.com/file/d/1EU3wztfOpmbQdvZoMDAqtnvSEmLT1iL9/view?usp=sharing

Source

Step1:Code normalization

Normalize source code using normalization.py

cd Normalization
python normalization.py

Step2:Code Explanation Generation

Generate source code explanation using comment.py

cd model
python comment.py

Step3:Train models

python run.py

About

No description, website, or topics provided.

Resources

Stars

8 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages