Evaluating Line-level Localization Ability of Learning-based Code Vulnerability Detection Models
Not on the map. Why?
Abstract (arXiv)
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. The code is available at https://github.com/pralab/vuln-localization-eval.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 22 of its 34 references that are in the map. First posted on arXiv 13 Oct 2025.
Builds on
22 of 34 references.
References · 22
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2017Axiomatic Attribution for Deep Networkscited by 3,350
- 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,898
- 2013Visualizing and Understanding Convolutional Networkscited by 2,278
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
- 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 417
- 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 266
- 2020Deep Learning based Vulnerability Detection: Are We There Yet?cited by 142
10 more
- 2024Vulnerability Detection with Code Language Models: How Far Are We?cited by 133
- 2020Ground Truth Evaluation of Neural Network Explanations with CLEVR-XAIcited by 125
- 2024AttnLRP: Attention-Aware Layer-Wise Relevance Propagation for Transformerscited by 116
- 2020Dos and Don'ts of Machine Learning in Computer Securitycited by 98
- 2021Do Feature Attribution Methods Correctly Attribute Features?cited by 98
- 2021Vulnerability Detection with Fine-grained Interpretationscited by 56
- 2019Evaluating Explanation Methods for Deep Learning in Securitycited by 38
- 2020VulDeeLocator: A Deep Learning-based Fine-grained Vulnerability Detectorcited by 37
- 2022LineVD: Statement-level Vulnerability Detection using Graph Neural Networkscited by 35
- 2020Fuzzy Jaccard Index: A robust comparison of ordered listscited by 5
Built on by
Not cited yet.