mlsanityData to 7 Oct 2026

ANVIL: Anomaly-based Vulnerability Identification without Labelled Training Data

arXiv 2408.16028 ↗First posted 28 Aug 2024cs.CR cs.LG cs.SEcited by 1

Not on the map. Why?

Abstract (arXiv)

Supervised-learning-based vulnerability detectors often fall short due to limited labelled training data. In contrast, Large Language Models (LLMs) are trained on vast unlabelled code corpora, yet perform only marginally better than coin flips when directly prompted to detect vulnerabilities. In this paper, we reframe vulnerability detection as anomaly detection, based on the premise that vulnerable code is rare and thus anomalous relative to patterns learned by LLMs. We introduce ANVIL, which performs a masked code reconstruction task: The LLM reconstructs a masked line of code, and deviations from the original are scored as anomalies. We propose a hybrid anomaly score that combines exact match, cross-entropy loss, prediction confidence, and structural complexity. We evaluate our approach across multiple LLM families, scoring methods, and context sizes, and against vulnerabilities after the LLM's training cut-off. On the PrimeVul dataset, ANVIL outperforms state-of-the-art supervised detectors - LineVul, LineVD, and LLMAO - achieving up to 2x higher Top-3 accuracy, 75% better Normalized MFR, and a significant improvement on ROC-AUC. Finally, by integrating ANVIL with fuzzers, we uncover two previously unknown vulnerabilities, demonstrating the practical utility of anomaly-guided detection.

Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 26 of its 72 references that are in the map. First posted on arXiv 28 Aug 2024.

Builds on

26 of 72 references.

References · 26

  1. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
  2. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  3. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  4. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,154
  5. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
  6. 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
  7. 2023StarCoder: may the source be with you!cited by 790
  8. 2024StarCoder 2 and The Stack v2: The Next Generationcited by 484
  9. 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 266
  10. 2022Efficient Training of Language Models to Fill in the Middlecited by 248
  11. 2020Deep Learning based Vulnerability Detection: Are We There Yet?cited by 142
  12. 2024Vulnerability Detection with Code Language Models: How Far Are We?cited by 133
14 more
  1. 2018Automated Vulnerability Detection in Source Code Using Deep Representation Learningcited by 114
  2. 2023DiverseVul: A New Vulnerable Source Code Dataset for Deep Learning Based Vulnerability Detectioncited by 98
  3. 2021CVEfixes: Automated Collection of Vulnerabilities and Their Fixes from Open-Source Softwarecited by 89
  4. 2023Large Language Models for Test-Free Fault Localizationcited by 67
  5. 2023GPTScan: Detecting Logic Vulnerabilities in Smart Contracts by Combining GPT with Program Analysiscited by 65
  6. 2021Vulnerability Detection with Fine-grained Interpretationscited by 56
  7. 2023Prompt-Enhanced Software Vulnerability Detection Using ChatGPTcited by 51
  8. 2015On the "Naturalness" of Buggy Codecited by 35
  9. 2022LineVD: Statement-level Vulnerability Detection using Graph Neural Networkscited by 35
  10. 2024SCALE: Constructing Structured Natural Language Comment Trees for Software Vulnerability Detectioncited by 17
  11. 2020Magma: A Ground-Truth Fuzzing Benchmarkcited by 16
  12. 2023VGX: Large-Scale Sample Generation for Boosting Learning-Based Software Vulnerability Analysescited by 9
  13. 2023FLAG: Finding Line Anomalies (in code) with Generative AIcited by 7
  14. 2020MEUZZ: Smart Seed Scheduling for Hybrid Fuzzingcited by 2

Built on by

Cited by year

Citing papers per year: 2025: 1.

1 paper.