A language model that has already read large amounts of general text needs few examples to read security reports. FewVuln fine-tunes such a model on 576 labeled sentences and nearly matches the best earlier system, VIEM, which was trained on 5,758. On 12 more categories of reports, 64 labeled sentences per category were enough to come within 0.003 of VIEM on F1, a 0-to-1 accuracy score where higher is better.
FewVuln is the first of the four studies in my dissertation. It was published at MLHat 2021, a workshop on machine learning for security held at KDD 2021, a major data mining conference.

In this post
Why Patch Decisions Depend on Free Text
How FewVuln Works
What the Results Show
3.1 One-Tenth of the Labels, Nearly the Same Accuracy
3.2 Simple Fine-Tuning Beat a Specialized Few-Shot Method
3.3 Software Names Are Harder Than Version Numbers
Where the Result Stops
What It Means for Your Team
Questions Readers Ask
Read and Cite the Paper
1. Why Patch Decisions Depend on Free Text
Every publicly disclosed vulnerability gets a CVE record. The US National Vulnerability Database (NVD) published 48,152 new records in 2025, about 132 per day, according to a count I ran against the NVD’s public API on 15 October 2026. Each record describes the flaw in free text. Before a team can decide whether to patch, someone must extract which software and which versions are affected.
The records do not always agree with each other either. A 2019 study by Dong and colleagues found that only 59.82% of reports listed the same vulnerable versions as the NVD. Tools that extract these fields automatically exist, including VIEM from that same study. But they need people with security knowledge to label thousands of sentences word by word before they work.

2. How FewVuln Works
The task is named entity recognition (NER): the model labels each word as a vulnerable software name, a vulnerable version, or neither. FewVuln starts from a pre-trained language model. The study compared three widely used ones, BERT, RoBERTa, and ELECTRA. Training and testing take three steps:
Fine-tune the model on the largest category of reports, memory corruption, with 576 labeled sentences, 10% of the 5,758 sentences VIEM used.
Continue training on the 12 other categories with 64 labeled sentences from each, 768 in total. VIEM used 7,016 for the same categories.
Test each category separately and compare with VIEM’s published results.

3. What the Results Show
3.1 One-Tenth of the Labels, Nearly the Same Accuracy
ELECTRA scored highest of the three models in both steps. Its results, against VIEM’s:
On memory corruption, with 576 labeled sentences, ELECTRA reached an F1 of 0.9715 for software names and 0.9860 for versions. VIEM, with 5,758, reached 0.9844 and 0.9901.
On the 12 other categories, with 768 labeled sentences, ELECTRA reached 0.9214 for names and 0.9369 for versions. VIEM, with 7,016, reached 0.9235 and 0.9396.
The label savings were 90% in the first step and about 89% in the second.
ELECTRA was also the only base-size model among the three. The two others were large versions, which suggests that model size was not what decided the result.
3.2 Simple Fine-Tuning Beat a Specialized Few-Shot Method
The study also tested StructShot, a published few-shot method that labels each word by comparing it with a small set of labeled examples. Using StructShot in place of the second training step lowered ELECTRA’s F1 for software names from 0.9214 to 0.7274. Adding StructShot after the second step also lowered F1 for every model. In one category, the paper reports that adding a single example to StructShot’s reference set cut its F1 for software names by about 70%.
3.3 Software Names Are Harder Than Version Numbers
With only 58 labeled sentences, all three models found versions with an F1 around 0.95, but stayed below 0.92 for software names. Versions follow patterns such as “1.0” or “before 9.3”, and names do not. Many names are also new. In VIEM’s memory-corruption test data, 47 of 205 software names (22.9%) never appear in the training data, according to the 2019 study.
The errors lean toward false alarms. Recall, the share of true names and versions found, was usually higher than precision, the share of flagged words that were correct. The paper argues this is the safer direction, because a false alarm costs a manual check while a miss can leave a system unpatched.
4. Where the Result Stops
FewVuln is a first study, and four limits matter:
It comes close to VIEM but does not beat it on F1. FewVuln scores higher only on recall.
VIEM can also use a dictionary of known software names. With that dictionary, VIEM reaches an F1 of about 0.95 for names on the 12 categories, above FewVuln’s 0.92. The comparison above uses VIEM without the dictionary, since FewVuln uses none.
All results come from one dataset, the one released with VIEM.
FewVuln still needs a few hundred labeled sentences, and its results depend on careful tuning of training settings.
5. What It Means for Your Team
FewVuln dates from 2021, before the large language models released from 2023 onward. Its main lesson still applies when a team adapts any model to its own documents:
Start from a pre-trained model. Here it cut labeling work by about 90%.
Label a small set first and measure. In FewVuln, results stopped improving after about 64 labeled sentences per category.
Try simple fine-tuning before a specialized few-shot method. The simple method won by up to 0.19 F1.
Keep a person checking new software names, the part the model finds hardest.
6. Questions Readers Ask
How many labeled examples does AI need to extract software names and versions from CVE reports?
In this study, 576 sentences for the largest category and 64 per category for 12 others were enough. With them, FewVuln came within 0.02 F1 of a system trained on about ten times as many.
Which model worked best?
ELECTRA, the only base-size model tested, scored highest. BERT and RoBERTa, both in large versions, were close behind.
Is the code available?
Yes. The code is on GitHub. FewVuln is the name used there and in the dissertation. The paper itself does not name the system.
7. Read and Cite the Paper
Guanqun Yang, Shay Dineen, Zhipeng Lin, and Xueqing Liu. “Few-Sample Named Entity Recognition for Security Vulnerability Reports by Fine-Tuning Pre-trained Language Models.” In Deployable Machine Learning for Security Defense (MLHat 2021), Communications in Computer and Information Science, volume 1482, Springer, 2021. Free version on arXiv, Springer, code.
FewVuln is the first of four studies in my dissertation. The overview post explains how they fit together.
To cite the paper:
@inproceedings{yang2021fewsample,
author = {Guanqun Yang and Shay Dineen and Zhipeng Lin and Xueqing Liu},
title = {Few-Sample Named Entity Recognition for Security Vulnerability Reports by Fine-Tuning Pre-trained Language Models},
booktitle = {Deployable Machine Learning for Security Defense (MLHat 2021)},
series = {Communications in Computer and Information Science},
volume = {1482},
pages = {55--78},
publisher = {Springer},
year = {2021},
doi = {10.1007/978-3-030-87839-9_3}
}
Guanqun Yang, LLM Researcher. More work at guanqun-yang.com and on Google Scholar.

