LLM-based Vulnerability Discovery through the Lens of Code Metrics

Felix Weissberg, Lukas Pirch, Erik Imgrund, Jonas Möller, Thorsten Eisenhofer +1 more
9/23/2025
cs.CRcs.LGcs.SE

No confident code implementation found for this paper.

Abstract

Large language models (LLMs) excel in many tasks of software engineering, yet progress in leveraging them for vulnerability discovery has stalled in recent years. To understand this phenomenon, we investigate LLMs through the lens of classic code metrics. Surprisingly, we find that a classifier trained solely on these metrics performs on par with state-of-the-art LLMs for vulnerability discovery. A root-cause analysis reveals a strong correlation and a causal effect between LLMs and code metrics: When the value of a metric is changed, LLM predictions tend to shift by a corresponding magnitude. This dependency suggests that LLMs operate at a similarly shallow level as code metrics, limiting their ability to grasp complex patterns and fully realize their potential in vulnerability discovery. Based on these findings, we derive recommendations on how research should more effectively address this challenge.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{weissberg2025llmbased,
  title  = {LLM-based Vulnerability Discovery through the Lens of Code Metrics},
  author = {Felix Weissberg and Lukas Pirch and Erik Imgrund and Jonas Möller and Thorsten Eisenhofer and Konrad Rieck},
  year   = {2025},
  eprint = {2509.19117},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2509.19117v1}
}

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/2509.19117.svg)](https://codeofpaper.com/paper/2509.19117)

Discussion