Evaluating line-level localization ability of learning-based code vulnerability detection models
Marco Pintore, Giorgio Piras, Angelo Sotgiu, Maura Pintor, Battista Biggio
University of Cagliari
Key points
From the paper's conclusion- Our approach, defined as Detection Alignment (DA), quantifies the agreement between the input source code lines that most influence the prediction and the actual localization of the vulnerability as per the ground truth.
Abstract
Abstract To address the extremely concerning problem of software vulnerability, system security is often entrusted to Machine Learning (ML) algorithms. Despite their now established detection capabilities, such models are limited by design to flagging the entire input source code function as vulnerable, rather than precisely localizing the concerned code lines. However, the detection granularity is crucial to support human operators during software development, ensuring that such predictions reflect the true code semantics to help debug, evaluate, and fix the detected vulnerabilities. To address this issue, recent work made progress toward improving the detector’s localization ability, thus narrowing down the vulnerability detection “window” and providing more fine-grained predictions. Such approaches, however, implicitly disregard the presence of spurious correlations and biases in the data, which often predominantly influence the performance of ML algorithms. In this work, we investigate how detectors comply with this requirement by proposing an explainability-based evaluation procedure. Our approach, defined as Detection Alignment (DA), quantifies the agreement between the input source code lines that most influence the prediction and the actual localization of the vulnerability as per the ground truth. Through DA, which is model-agnostic and adaptable to different detection tasks, not limited to our use case, we analyze multiple learning-based vulnerability detectors and datasets. As a result, we show how the predictions of such models are consistently biased by non-vulnerable lines, ultimately highlighting the high impact of biases and spurious correlations.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- ObliVul: Alert-Conditioned Safety Obligation Modeling and Bidirectional Counterfactual Validation for Code Vulnerability DetectionarXiv · 2026
- Right Verdict, Right Reason? An Execution-Grounded Study of Whether LLM Vulnerability Detectors Understand VulnerabilitiesarXiv · 2026
- GRAML: Graph-Grounded Reasoning and Multi-Task Learning for LLM-Based Software Vulnerability DetectionarXiv · 2026
- Context-Enhanced Vulnerability Detection Based on Large Language ModelsACM Transactions on Software Engineering and Methodology · 2025
- Beyond the Diff - VulSpot: A Vulnerability Dataset Where No Vulnerability Goes UnlocalizedarXiv · 2026
- Vul-RAG: Enhancing LLM-based Vulnerability Detection via Knowledge-level RAGACM Transactions on Software Engineering and Methodology · 2026