Revisiting Pre-trained Language Models for Vulnerability Detection
Not on the map. Why?
Abstract (arXiv)
The rapid advancement of pre-trained language models (PLMs) has demonstrated promising results for various code-related tasks. However, their effectiveness in detecting real-world vulnerabilities remains a critical challenge. While existing empirical studies evaluate PLMs for vulnerability detection (VD), they suffer from data leakage, limited scope, and superficial analysis, hindering the accuracy and comprehensiveness of evaluations. This paper begins by revisiting the common issues in existing research on PLMs for VD through the evaluation pipeline. It then proceeds with an accurate and extensive evaluation of 18 PLMs on high-quality datasets that feature accurate labeling, diverse vulnerability types, and various projects. Specifically, we compare the performance of PLMs under both fine-tuning and prompt engineering, assess their effectiveness and generalizability across various training and testing settings, and analyze their robustness to a series of perturbations. Our findings reveal that PLMs incorporating pre-training tasks designed to capture the syntactic and semantic patterns of code outperform both general-purpose PLMs and those solely pre-trained or fine-tuned on large code corpora. However, these models face notable challenges in real-world scenarios, such as difficulties in detecting vulnerabilities with complex dependencies, handling perturbations introduced by code normalization and abstraction, and identifying semantic-preserving vulnerable code transformations. Also, the truncation caused by the limited context windows of PLMs can lead to a non-negligible number of labeling errors, which is overlooked by previous work. This study underscores the importance of thorough evaluations of model performance in practical scenarios and outlines future directions to help enhance the effectiveness of PLMs for realistic VD applications.
Key facts. Cited by 3 papers in the map (data through 14 Oct 2026). Builds on 52 of its 85 references that are in the map. First posted on arXiv 22 Jul 2025.
Builds on
52 of 85 references.
References · 52
- 2017Attention Is All You Needcited by 60,361
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,434
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
- 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 733
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
38 more
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 361
- 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 272
- 2022Efficient Training of Language Models to Fill in the Middlecited by 255
- 2023Large Language Models for Code: Security Hardening and Adversarial Testingcited by 155
- 2020Deep Learning based Vulnerability Detection: Are We There Yet?cited by 144
- 2024Vulnerability Detection with Code Language Models: How Far Are We?cited by 139
- 2023DiverseVul: A New Vulnerable Source Code Dataset for Deep Learning Based Vulnerability Detectioncited by 102
- 2023LLMs Cannot Reliably Identify and Reason About Security Vulnerabilities (Yet?): A Comprehensive Evaluation, Framework, and Benchmarkscited by 97
- 2018SySeVR: A Framework for Using Deep Learning to Detect Software Vulnerabilitiescited by 92
- 2021CVEfixes: Automated Collection of Vulnerabilities and Their Fixes from Open-Source Softwarecited by 91
- 2022Natural Attack for Pre-trained Models of Codecited by 75
- 2022Rethinking the Role of Scale for In-Context Learning: An Interpretability-based Case Study at 66 Billion Scalecited by 64
- 2023Understanding the Effectiveness of Large Language Models in Detecting Security Vulnerabilitiescited by 59
- 2024LLM4Vuln: A Unified Evaluation Framework for Decoupling and Enhancing LLMs' Vulnerability Reasoningcited by 59
- 2023Data Quality for Software Vulnerability Datasetscited by 51
- 2023Prompt-Enhanced Software Vulnerability Detection Using ChatGPTcited by 51
- 2022An Empirical Study of Deep Learning Models for Vulnerability Detectioncited by 46
- 2024Large Language Model for Vulnerability Detection: Emerging Results and Future Directionscited by 45
- 2023ChatGPT for Vulnerability Detection, Classification, and Repair: How Far Are We?cited by 44
- 2024Finetuning Large Language Models for Vulnerability Detectioncited by 40
- 2022Transformer-Based Language Models for Software Vulnerability Detectioncited by 39
- 2020VulDeeLocator: A Deep Learning-based Fine-grained Vulnerability Detectorcited by 37
- 2023Uncovering the Limits of Machine Learning for Automatic Vulnerability Detectioncited by 30
- 2024Generalization-Enhanced Code Vulnerability Detection via Multi-Task Instruction Fine-Tuningcited by 30
- 2023How Far Have We Gone in Vulnerability Detection Using Large Language Modelscited by 27
- 2024MegaVul: A C/C++ Vulnerability Dataset with Comprehensive Code Representationcited by 27
- 2024Multitask-based Evaluation of Open-Source LLM on Software Vulnerabilitycited by 23
- 2024VulEval: Towards Repository-Level Evaluation of Software Vulnerability Detectioncited by 19
- 2024To Err is Machine: Vulnerability Detection Challenges LLM Reasoningcited by 18
- 2024Comparison of Static Application Security Testing Tools and Large Language Models for Repo-level Vulnerability Detectioncited by 18
- 2024Pre-training by Predicting Program Dependencies for Vulnerability Analysis Taskscited by 17
- 2024Outside the Comfort Zone: Analysing LLM Capabilities in Software Vulnerability Detectioncited by 16
- 2021Challenging Machine Learning-based Clone Detectors via Semantic-preserving Code Transformationscited by 15
- 2025Everything You Wanted to Know About LLM-based Vulnerability Detection But Were Afraid to Askcited by 15
- 2023SecureFalcon: Are We There Yet in Automated Software Vulnerability Detection with LLMs?cited by 13
- 2024Investigating Large Language Models for Code Vulnerability Detection: An Experimental Studycited by 12
- 2024VulDetectBench: Evaluating the Deep Capability of Vulnerability Detection with Large Language Modelscited by 11
- 2024VulnLLMEval: A Framework for Evaluating Large Language Models in Software Vulnerability Detection and Patchingcited by 9
50 most cited of 52 All 52 (JSON)
Built on by
Citing papers per year: 2025: 1; 2026: 2.
3 papers.
- 2025MAVUL: Multi-Agent Vulnerability Detection via Contextual Reasoning and Interactive Refinementcited by 6
- 2026From SFT to RL: Demystifying the Post-Training Pipeline for LLM-based Vulnerability Detectioncited by 4
- 2026Themis: Training Robust Multilingual Code Reward Models for Flexible Multi-Criteria Scoringcited by 1
- 2026Themis: Training Robust Multilingual Code Reward Models for Flexible Multi-Criteria Scoring1 May 2026
- 2026From SFT to RL: Demystifying the Post-Training Pipeline for LLM-based Vulnerability Detection15 Feb 2026
- 2025MAVUL: Multi-Agent Vulnerability Detection via Contextual Reasoning and Interactive Refinement30 Sep 2025