mlsanityData to 7 Oct 2026

Llama-based source code vulnerability detection: Prompt engineering vs Fine tuning

arXiv 2512.09006 ↗First posted 9 Dec 2025cs.SE cs.AI cs.CRcited by 2

Not on the map. Why?

Abstract (arXiv)

The significant increase in software production, driven by the acceleration of development cycles over the past two decades, has led to a steady rise in software vulnerabilities, as shown by statistics published yearly by the CVE program. The automation of the source code vulnerability detection (CVD) process has thus become essential, and several methods have been proposed ranging from the well established program analysis techniques to the more recent AI-based methods. Our research investigates Large Language Models (LLMs), which are considered among the most performant AI models to date, for the CVD task. The objective is to study their performance and apply different state-of-the-art techniques to enhance their effectiveness for this task. We explore various fine-tuning and prompt engineering settings. We particularly suggest one novel approach for fine-tuning LLMs which we call Double Fine-tuning, and also test the understudied Test-Time fine-tuning approach. We leverage the recent open-source Llama-3.1 8B, with source code samples extracted from BigVul and PrimeVul datasets. Our conclusions highlight the importance of fine-tuning to resolve the task, the performance of Double tuning, as well as the potential of Llama models for CVD. Though prompting proved ineffective, Retrieval augmented generation (RAG) performed relatively well as an example selection technique. Overall, some of our research questions have been answered, and many are still on hold, which leaves us many future work perspectives. Code repository is available here: https://github.com/DynaSoumhaneOuchebara/Llama-based-vulnerability-detection.

Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Builds on 23 of its 44 references that are in the map. First posted on arXiv 9 Dec 2025.

Builds on

23 of 44 references.

References · 23

  1. 2024The Llama 3 Herd of Modelscited by 14,192
  2. 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,084
  3. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  4. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
  5. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  6. 2023A Survey on Evaluation of Large Language Modelscited by 1,227
  7. 2020Deep Learning based Vulnerability Detection: Are We There Yet?cited by 142
  8. 2024Vulnerability Detection with Code Language Models: How Far Are We?cited by 133
  9. 2023DiverseVul: A New Vulnerable Source Code Dataset for Deep Learning Based Vulnerability Detectioncited by 98
  10. 2021CVEfixes: Automated Collection of Vulnerabilities and Their Fixes from Open-Source Softwarecited by 89
  11. 2024The Surprising Effectiveness of Test-Time Training for Few-Shot Learningcited by 88
  12. 2022VulBERTa: Simplified Source Code Pre-Training for Vulnerability Detectioncited by 51
11 more
  1. 2024Efficiently Learning at Test-Time: Active Fine-Tuning of LLMscited by 42
  2. 2024Large Language Model for Vulnerability Detection and Repair: Literature Review and the Road Aheadcited by 41
  3. 2024Chain-of-Thought Prompting of Large Language Models for Discovering and Fixing Software Vulnerabilitiescited by 31
  4. 2024Generalization-Enhanced Code Vulnerability Detection via Multi-Task Instruction Fine-Tuningcited by 30
  5. 2022Dataflow Analysis-Inspired Deep Learning for Efficient Vulnerability Detectioncited by 18
  6. 2024To Err is Machine: Vulnerability Detection Challenges LLM Reasoningcited by 17
  7. 2023Distinguishing Look-Alike Innocent and Vulnerable Code by Subtle Semantic Representation Learning and Explanationcited by 11
  8. 2024Investigating Large Language Models for Code Vulnerability Detection: An Experimental Studycited by 11
  9. 2023A Survey on Automated Software Vulnerability Detection Using Machine Learning and Deep Learningcited by 7
  10. 2024Code Vulnerability Detection: A Comparative Analysis of Emerging Large Language Modelscited by 3
  11. 2025CGP-Tuning: Structure-Aware Soft Prompt Tuning for Code Vulnerability Detectioncited by 2

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 2.

2 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026An Empirical Evaluation of LLM-Based Approaches for Code Vulnerability Detection: RAG, SFT, and Dual-Agent Systems
  2. 2025A Systematic Study of Code Obfuscation Against LLM-based Vulnerability Detection
  3. 2025Reasoning with LLMs for Zero-Shot Vulnerability Detection
  4. 2026Revisiting Vul-RAG: Reproducibility and Replicability of RAG-based Vulnerability Detection with Open-Weight Models
  5. 2024Software Vulnerability and Functionality Assessment using LLMs
  6. 2024Towards Explainable Vulnerability Detection with Large Language Models
  7. 2024LLM4Vuln: A Unified Evaluation Framework for Decoupling and Enhancing LLMs' Vulnerability Reasoning
  8. 2024VulScribeR: Exploring RAG-based Vulnerability Augmentation with LLMs