Evaluating Large Language Models for Line-Level Vulnerability Localization
Not on the map. Why?
Abstract (arXiv)
Recently, Automated Vulnerability Localization (AVL) has attracted growing attention, aiming to facilitate diagnosis by pinpointing the specific lines of code responsible for vulnerabilities. Large Language Models (LLMs) have shown potential in various domains, yet their effectiveness in line-level vulnerability localization remains underexplored. In this work, we present the first comprehensive empirical evaluation of LLMs for AVL. Our study examines 19 leading LLMs suitable for code analysis, including ChatGPT and multiple open-source models, spanning encoder-only, encoder-decoder, and decoder-only architectures, with model sizes from 60M to 70B parameters. We evaluate three paradigms including few-shot prompting, discriminative fine-tuning, and generative fine-tuning with and without Low-Rank Adaptation (LoRA), on both a BigVul-derived dataset for C/C++ and a smart contract vulnerability dataset.} Our results show that discriminative fine-tuning achieves substantial performance gains over existing learning-based AVL methods when sufficient training data is available. In low-data settings, prompting advanced LLMs such as ChatGPT proves more effective. We also identify challenges related to input length and unidirectional context during fine-tuning, and propose two remedial strategies: a sliding window approach and right-forward embedding, both of which yield significant improvements. Moreover, we provide the first assessment of LLM generalizability in AVL, showing that certain models can transfer effectively across Common Weakness Enumerations (CWEs) and projects. However, performance degrades notably for newly discovered vulnerabilities containing unfamiliar lexical or structural patterns, underscoring the need for continual adaptation.
Key facts. Cited by 7 papers in the map (data through 14 Oct 2026). First posted on arXiv 30 Mar 2024.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2024: 4; 2025: 3.
7 papers.
- 2025LLMs in Software Security: A Survey of Vulnerability Detection Techniques and Insightscited by 47
- 2024Source Code Summarization in the Era of Large Language Modelscited by 31
- 2025D-CIPHER: Dynamic Collaborative Intelligent Multi-Agent System with Planner and Heterogeneous Executors for Offensive Securitycited by 20
- 2025CRAKEN: Cybersecurity LLM Agent with Knowledge-Based Executioncited by 14
- 2024From Vulnerabilities to Remediation: A Systematic Literature Review of LLMs in Code Securitycited by 10
- 2024ESALE: Enhancing Code-Summary Alignment Learning for Source Code Summarizationcited by 8
- 2024Comparing Unidirectional, Bidirectional, and Word2vec Models for Discovering Vulnerabilities in Compiled Lifted Codecited by 1
- 2025CRAKEN: Cybersecurity LLM Agent with Knowledge-Based Execution21 May 2025
- 2025D-CIPHER: Dynamic Collaborative Intelligent Multi-Agent System with Planner and Heterogeneous Executors for Offensive Security15 Feb 2025
- 2025LLMs in Software Security: A Survey of Vulnerability Detection Techniques and Insights10 Feb 2025
- 2024From Vulnerabilities to Remediation: A Systematic Literature Review of LLMs in Code Security19 Dec 2024
- 2024Comparing Unidirectional, Bidirectional, and Word2vec Models for Discovering Vulnerabilities in Compiled Lifted Code26 Sep 2024
- 2024Source Code Summarization in the Era of Large Language Models9 Jul 2024
- 2024ESALE: Enhancing Code-Summary Alignment Learning for Source Code Summarization1 Jul 2024