Downloads · 30 days
4
19% of all-time downloads
sushanrai/CVE_BERT_DMSV
CVE_BERT_DMSV is a machine learning model from sushanrai. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Model Name: CVE-BERT-DMSV Model Type: SentenceTransformer for semantic search over CVE descriptions Base Model: google-bert/bert-base-uncased Training Framework: SentenceTransformers Fine-tuned By: HACKDMSV
Downloads · 30 days
4
19% of all-time downloads
All-time downloads
21
Public
Parameters
109M
444 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors438 MB · 98%
From the Hugging Face model README
sushanrai/CVE_BERT_DMSVgoogle-bert/bert-base-uncasedThis model is a fine-tuned version of google-bert/bert-base-uncased using the SentenceTransformers framework. It is trained on Common Vulnerabilities and Exposures (CVE) data for semantic search and similarity tasks. The model maps CVE descriptions into dense vector embeddings to facilitate information retrieval, similarity detection, and clustering.
Input Format: A natural language query or CVE description sentence Output Format: 768-dimensional dense vector embedding
import torch
from sentence_transformers import SentenceTransformer, util
# Load the model and embeddings
device = "cuda" if torch.cuda.is_available() else "cpu"
model = SentenceTransformer("sushanrai/CVE_BERT_DMSV", device=device)
data = torch.load("cve_embeddings.pt")
cve_embeddings = data["embeddings"]
cve_texts = data["cve_texts"]
# Encode a query
query = "buffer overflow in FTP server"
query_embedding = model.encode(query, convert_to_tensor=True)
# Semantic search
cos_scores = util.pytorch_cos_sim(query_embedding, cve_embeddings)[0]
top_results = torch.topk(cos_scores, k=5)
for score, idx in zip(top_results.values, top_results.indices):
print(f"CVE: {cve_texts[idx]}, Score: {score:.4f}")
The model was trained using CVE description texts curated from the NVD (National Vulnerability Database). The training samples consist of similar and dissimilar CVE pairs, designed to teach the model to distinguish relevant vulnerabilities.
Fine-tuning was done using the MultipleNegativesRankingLoss, a contrastive loss suitable for semantic search and retrieval tasks. This enables the model to learn meaningful vector representations that place similar descriptions closer in vector space.
The model has been tested with various security-related queries, and shows high relevance in top-k matches (e.g., k=5). In the example below, a query about "buffer overflow in FTP server" returned:
@misc{sushanrai2025cvebert,
title={CVE-BERT-DMSV: A SentenceTransformer Model for Semantic Search over CVEs},
author={HACKDMSV},
year={2025},
url={https://huggingface.co/sushanrai/CVE_BERT_DMSV}
}
sentence-transformers cve cybersecurity semantic-search bert vulnerability