[Paper Review] LLMs in Software Security: A Survey of Vulnerability Detection Techniques and Insights
A comprehensive survey of how large language models are used for vulnerability detection in software, covering architectures, benchmarks, datasets, evaluation metrics, techniques, and future challenges. It highlights current trends, datasets, and gaps for cross-language and repository-level detection.
Large Language Models (LLMs) are emerging as transformative tools for software vulnerability detection, addressing critical challenges in the security domain. Traditional methods, such as static and dynamic analysis, often falter due to inefficiencies, high false positive rates, and the growing complexity of modern software systems. By leveraging their ability to analyze code structures, identify patterns, and generate repair suggestions, LLMs, exemplified by models like GPT, BERT, and CodeBERT, present a novel and scalable approach to mitigating vulnerabilities. This paper provides a detailed survey of LLMs in vulnerability detection. It examines key aspects, including model architectures, application methods, target languages, fine-tuning strategies, datasets, and evaluation metrics. We also analyze the scope of current research problems, highlighting the strengths and weaknesses of existing approaches. Further, we address challenges such as cross-language vulnerability detection, multimodal data integration, and repository-level analysis. Based on these findings, we propose solutions for issues like dataset scalability, model interpretability, and applications in low-resource scenarios. Our contributions are threefold: (1) a systematic review of how LLMs are applied in vulnerability detection; (2) an analysis of shared patterns and differences across studies, with a unified framework for understanding the field; and (3) a summary of key challenges and future research directions. This work provides valuable insights for advancing LLM-based vulnerability detection. We also maintain and regularly update latest selected paper on https://github.com/OwenSanzas/LLM-For-Vulnerability-Detection
Motivation & Objective
- Assess which LLM architectures are used for vulnerability detection and why they are suited for security tasks.
- Evaluate the datasets, benchmarks, and metrics designed to assess LLM-based vulnerability detection.
- Identify effective techniques, prompting strategies, and evaluation practices in current studies.
- Highlight challenges and propose directions to advance LLM-based vulnerability detection in real-world contexts.
Proposed method
- Systematic review of over 80 papers (58 highly related) published 2019-2024 on LLMs for vulnerability detection.
- Classification of LLM architectures into encoder-only, encoder-decoder, and decoder-only groups.
- Analysis of datasets and benchmarks across function-, file-, commit-, and repository-level granularities.
- Synthesis of evaluation metrics into classification, generation, and efficiency categories.
- Identification of patterns, best practices, and gaps across languages and contexts.
- Proposal of future research directions and resource needs.
Experimental results
Research questions
- RQ1RQ1: What LLMs have been applied to vulnerability detection?
- RQ2RQ2: What benchmarks, datasets and metrics have been designed to evaluate vulnerability detection?
- RQ3RQ3: What techniques have been used in LLM for vulnerability detection?
- RQ4RQ4: What are the challenges that LLMs are facing in detecting vulnerabilities and potential directions to solve them?
Key findings
- C/C++, Java, and Solidity are the dominant target languages; memory-related vulnerabilities in C/C++ are a primary focus.
- Decoder-only models (e.g., GPT series, CodeLlama) account for the majority of usage in fine-tuning studies, while encoder-only models remain common for understanding tasks.
- GPT-4 and GPT-3.5 are the most frequently used LLMs across studies; GPT-4 is noted for strong performance in several reports.
- Benchmark datasets span function-level, file-level, commit-level, and repository-level scales, with BigVul, CVEfixes, Devign, Juliet, and CWE-Bench-Java among commonly used datasets.
- There is a language imbalance in available datasets (roughly 50-60% C/C++, Java underrepresented) and a lack of comprehensive repository-level datasets for real-world scenarios.
- Current datasets often rely on narrower scopes and exhibit data leakage risks; there is a need for larger, more realistic, repository-scale data and better cross-file context modeling.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.