VulBERTa: Simplified Source Code Pre-Training for Vulnerability Detection

Hazim Hanif, Sergio Maffeis
5/25/2022
cs.CRcs.AIcs.LG

Official code: ICL-ml4csec/VulBERTa (121 stars, Jupyter Notebook, MIT, last commit 2025-12-04).

Abstract

This paper presents VulBERTa, a deep learning approach to detect security vulnerabilities in source code. Our approach pre-trains a RoBERTa model with a custom tokenisation pipeline on real-world code from open-source C/C++ projects.

Show full abstract

The model learns a deep knowledge representation of the code syntax and semantics, which we leverage to train vulnerability detection classifiers. We evaluate our approach on binary and multi-class vulnerability detection tasks across several datasets (Vuldeepecker, Draper, REVEAL and muVuldeepecker) and benchmarks (CodeXGLUE and D2A). The evaluation results show that VulBERTa achieves state-of-the-art performance and outperforms existing approaches across different datasets, despite its conceptual simplicity, and limited cost in terms of size of training data and number of model parameters.

View on arXivView PDF

Code Implementations(1)

MIT

Simplified Source Code Pre-Training for Vulnerability Detection

12127Jupyter Notebook, PythonMay 24, 202212 months agoMIT

Similar Papers

Cite this paper

@article{hanif2022vulberta,
  title  = {VulBERTa: Simplified Source Code Pre-Training for Vulnerability Detection},
  author = {Hazim Hanif and Sergio Maffeis},
  year   = {2022},
  eprint = {2205.12424},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2205.12424}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2205.12424.svg)](https://codeofpaper.com/paper/2205.12424)

Discussion