Enhancing LLM-Based Vulnerability Detection via Representation-Aware Logical Ensemble
Francesco Crescenzo Grasso, Pietro Liguori, Roberto Natella, Domenico Cotroneo
Key points
From the paper's conclusion- 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.
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.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Modern Approaches to Software Vulnerability Detection: A Survey of Machine Learning, Deep Learning, and Large Language ModelsElectronics · 2025
- Assessing and Improving Prompting Large Language Models for Software Vulnerability AnalysisACM Transactions on Software Engineering and Methodology · 2026
- Context-Enhanced Vulnerability Detection Based on Large Language ModelsACM Transactions on Software Engineering and Methodology · 2025
- Vul-RAG: Enhancing LLM-based Vulnerability Detection via Knowledge-level RAGACM Transactions on Software Engineering and Methodology · 2026
- When Models Know but Can't Linearly Say: Relational Encoding Limits Linear Vulnerability Classification in Code LLMsarXiv · 2026
- GRAML: Graph-Grounded Reasoning and Multi-Task Learning for LLM-Based Software Vulnerability DetectionarXiv · 2026