With increasing computational power, deep learning methods have been widely applied to software vulnerability detection. Compared to traditional machine learning, deep learning offers low computational overhead, high accuracy, and eliminates the need for manual feature engineering. However, many existing approaches lack sufficient utilization of code syntax and semantics, limiting performance. This study proposes VDDA (Vulnerability Detection based on Deep learning and Attention mechanisms), an effective model that combines deep learning with attention mechanisms. VDDA employs a Bidirectional Long Short-Term Memory (BLSTM) network to capture code features automatically. Source code is transformed into Code Property Graphs (CPG) using the Joern tool to retain rich syntactic and semantic information. To enhance feature representation, several strategies are applied: depth-first traversal-based CPG optimization, three-directional code slicing, code block-based slice organization, and separation of function and variable names during symbolization. These methods convert source code into vector representations suitable as input to the deep model. An attention mechanism is integrated with BLSTM to emphasize the most relevant parts of the input vectors for improved vulnerability detection. Experiments on two datasets of varying sizes demonstrate that VDDA achieves superior detection performance compared to existing methods, validating its effectiveness and generalizability in software vulnerability detection tasks.
No takes yet. Share an insight, caveat, or question.
Zhu et al. (2026) studied this question.
Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context: