Enhancing LLM-Based Vulnerability Detection via Representation-Aware Logical Ensemble
Francesco Crescenzo Grasso, Pietro Liguori, Roberto Natella, Domenico Cotroneo
Abstract
Automated vulnerability detection in C source code is a long-standing challenge, as traditional static analysis tools often trade precision for scalability and struggle with complex vulnerability patterns. Recently, large language models (LLMs) have shown promising results; yet, most approaches rely on a single code representation, implicitly assuming uniform suitability across vulnerability types. In this work, we systematically study LLM-based vulnerability detection under multiple code representations, including raw source code, Abstract Syntax Trees (AST), and Control Flow Graphs (CFG). Through extensive empirical analysis, we show that different representations exhibit complementary strengths, with specific views being more effective for particular classes of vulnerabilities. Building on these findings, we propose a Representation-Aware Logical Ensemble (RALE) that integrates LLMs trained on different code representations through explicit logical rules and majority voting. While single-representation models achieve up to 73% F1-score, our integrated approach reaches 78% F1-score, with commensurate gains in accuracy, precision, and recall, consistently outperforming individual models. These results highlight the importance of explicitly leveraging complementary code representations when combining LLMs for effective vulnerability detection.
Create a lesson
Metadata
- Comments
- Accepted for publication at QRS 2026
Related papers
Hardening JavaScript Programs against LLM-Based Vulnerability Detection
Shared title terminologycs.CRZhenhao Tian, Jintong Yu, Jingwei Feng et al.
Enhancing Metaverse Security using Explainable AI-based Intrusion Detection Framework
Shared title terminologycs.CREsha Kuppanda, Shalaka Mahadik, Pranav M. Pawar et al.
Mitigating fix reversal: Counterfactual constraints for function-level vulnerability detection
Shared title terminologycs.CRYun Bian, Shihao Li, Haiquan Wang et al.
PairWatch: Pair-Aware Anomaly Transformer for Detecting Adversarial Rendezvous in Public Satellite Catalogs
Shared title terminologycs.CRYoung Eun Kwon, Ji Won Yoon
A Defense-Aware Explainable AI Framework for Feature-Level Vulnerability Analysis in Optimal Power Flow
Shared title terminologycs.CRS. M. Monzurul Hoque Chowdhury, Qinghua Li, Jianhui Wang
Scan Before You Install: Detecting and Mitigating Local and Composite Vulnerabilities in Skills
Shared title terminologycs.CRParth A. Gandhi, Avital Aviv, Prasanna N. Wudali et al.