NVD-trained security patch detectors lose up to 90% F1 on real-world patches
Models trained only on NVD-linked patches perform poorly on in-the-wild security patches, with up to a 90% drop in F1 score
Software arXiv 18 Mar 2026 Measurement Simulation evidence
Published as “Revisiting Vulnerability Patch Identification on Data in the Wild”
Why it matters
Practitioners should augment NVD-trained detectors with a modest amount of in-the-wild labeled patches to maintain detection effectiveness in real deployments.
Summary
Models trained only on NVD-linked security patches lose up to 90% F1 when evaluated on in-the-wild patches such as JavaVFC, PatchDB, and Devign. This degradation is consistent across several architectures (CodeBERT, GRAPE, CommitBART, UniXcoder, CodeT5) and languages. Adding even a small fraction of manually curated wild patches restores performance, showing that mixed-source training is needed for reliable detection.
What they found 1
- NVD-trained models suffer severe performance degradation on wild patches
“Surprisingly, the NVD-trained models exhibited significant performance degradation when applied to all in-the-wild datasets. Specifically, when evaluated on the JavaVFC dataset, we observed a substantial decrease in F1-scores of up to 90%.”
Caveats 1
- including a small proportion of commits from the JavaVFC data is already sufficient to significantly improve the performance of the model.
What’s new here 4
- First large-scale evaluation of security-patch detectors on truly in-the-wild datasets (JavaVFC, PatchDB, Devign).
- Systematic analysis showing lexical and vulnerability-type differences between NVD-linked and undisclosed patches.
- Demonstration that mixing a modest amount of wild-patch data with NVD data mitigates the performance drop.
- Assessment of various LLMs with chain-of-thought prompting and fine-tuning for the task.