HyperAIHyperAI

Command Palette

Search for a command to run...

3 months ago

Finetuning Large Language Models for Vulnerability Detection

Alexey Shestov Rodion Levichev Ravil Mussabayev Evgeny Maslov Anton Cheshkov Pavel Zadorozhny

Finetuning Large Language Models for Vulnerability Detection

Abstract

This paper presents the results of finetuning large language models (LLMs) for the task of detecting vulnerabilities in source code. We leverage WizardCoder, a recent improvement of the state-of-the-art LLM StarCoder, and adapt it for vulnerability detection through further finetuning. To accelerate training, we modify WizardCoder's training procedure, also we investigate optimal training regimes. For the imbalanced dataset with many more negative examples than positive, we also explore different techniques to improve classification performance. The finetuned WizardCoder model achieves improvement in ROC AUC and F1 measures on balanced and imbalanced vulnerability datasets over CodeBERT-like model, demonstrating the effectiveness of adapting pretrained LLMs for vulnerability detection in source code. The key contributions are finetuning the state-of-the-art code LLM, WizardCoder, increasing its training speed without the performance harm, optimizing the training procedure and regimes, handling class imbalance, and improving performance on difficult vulnerability detection datasets. This demonstrates the potential for transfer learning by finetuning large pretrained language models for specialized source code analysis tasks.

Code Repositories

rmusab/vul-llm-finetune
Official
pytorch
Mentioned in GitHub

Benchmarks

BenchmarkMethodologyMetrics
vulnerability-detection-on-vulnerability-javaContraBERT
AUC: 0.85
F1: 0.22
vulnerability-detection-on-vulnerability-javaWizardCoder
AUC: 0.86
F1: 0.27

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp
Finetuning Large Language Models for Vulnerability Detection | Papers | HyperAI