mlsanityData to 14 Oct 2026

Revisiting Pre-trained Language Models for Vulnerability Detection

arXiv 2507.16887 ↗First posted 22 Jul 2025cs.CR cs.AI cs.LGcited by 3

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

  1. 2017Attention Is All You Needcited by 60,361
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  3. 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
  4. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
  5. 2023Code Llama: Open Foundation Models for Codecited by 2,139
  6. 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,434
  7. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
  8. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
  9. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
  10. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
  11. 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 733
  12. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
38 more
  1. 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 361
  2. 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 272
  3. 2022Efficient Training of Language Models to Fill in the Middlecited by 255
  4. 2023Large Language Models for Code: Security Hardening and Adversarial Testingcited by 155
  5. 2020Deep Learning based Vulnerability Detection: Are We There Yet?cited by 144
  6. 2024Vulnerability Detection with Code Language Models: How Far Are We?cited by 139
  7. 2023DiverseVul: A New Vulnerable Source Code Dataset for Deep Learning Based Vulnerability Detectioncited by 102
  8. 2023LLMs Cannot Reliably Identify and Reason About Security Vulnerabilities (Yet?): A Comprehensive Evaluation, Framework, and Benchmarkscited by 97
  9. 2018SySeVR: A Framework for Using Deep Learning to Detect Software Vulnerabilitiescited by 92
  10. 2021CVEfixes: Automated Collection of Vulnerabilities and Their Fixes from Open-Source Softwarecited by 91
  11. 2022Natural Attack for Pre-trained Models of Codecited by 75
  12. 2022Rethinking the Role of Scale for In-Context Learning: An Interpretability-based Case Study at 66 Billion Scalecited by 64
  13. 2023Understanding the Effectiveness of Large Language Models in Detecting Security Vulnerabilitiescited by 59
  14. 2024LLM4Vuln: A Unified Evaluation Framework for Decoupling and Enhancing LLMs' Vulnerability Reasoningcited by 59
  15. 2023Data Quality for Software Vulnerability Datasetscited by 51
  16. 2023Prompt-Enhanced Software Vulnerability Detection Using ChatGPTcited by 51
  17. 2022An Empirical Study of Deep Learning Models for Vulnerability Detectioncited by 46
  18. 2024Large Language Model for Vulnerability Detection: Emerging Results and Future Directionscited by 45
  19. 2023ChatGPT for Vulnerability Detection, Classification, and Repair: How Far Are We?cited by 44
  20. 2024Finetuning Large Language Models for Vulnerability Detectioncited by 40
  21. 2022Transformer-Based Language Models for Software Vulnerability Detectioncited by 39
  22. 2020VulDeeLocator: A Deep Learning-based Fine-grained Vulnerability Detectorcited by 37
  23. 2023Uncovering the Limits of Machine Learning for Automatic Vulnerability Detectioncited by 30
  24. 2024Generalization-Enhanced Code Vulnerability Detection via Multi-Task Instruction Fine-Tuningcited by 30
  25. 2023How Far Have We Gone in Vulnerability Detection Using Large Language Modelscited by 27
  26. 2024MegaVul: A C/C++ Vulnerability Dataset with Comprehensive Code Representationcited by 27
  27. 2024Multitask-based Evaluation of Open-Source LLM on Software Vulnerabilitycited by 23
  28. 2024VulEval: Towards Repository-Level Evaluation of Software Vulnerability Detectioncited by 19
  29. 2024To Err is Machine: Vulnerability Detection Challenges LLM Reasoningcited by 18
  30. 2024Comparison of Static Application Security Testing Tools and Large Language Models for Repo-level Vulnerability Detectioncited by 18
  31. 2024Pre-training by Predicting Program Dependencies for Vulnerability Analysis Taskscited by 17
  32. 2024Outside the Comfort Zone: Analysing LLM Capabilities in Software Vulnerability Detectioncited by 16
  33. 2021Challenging Machine Learning-based Clone Detectors via Semantic-preserving Code Transformationscited by 15
  34. 2025Everything You Wanted to Know About LLM-based Vulnerability Detection But Were Afraid to Askcited by 15
  35. 2023SecureFalcon: Are We There Yet in Automated Software Vulnerability Detection with LLMs?cited by 13
  36. 2024Investigating Large Language Models for Code Vulnerability Detection: An Experimental Studycited by 12
  37. 2024VulDetectBench: Evaluating the Deep Capability of Vulnerability Detection with Large Language Modelscited by 11
  38. 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

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 1; 2026: 2.

3 papers.