CoolFace
Modelpublic

drorrabin/cvss_score_pred

sourceHugging Facellama3.1updated 1y agoView on Hugging Face
0likes4downloads
Model Card

<!-- This model card has been generated automatically according to the information the Trainer had access to. You should probably proofread and complete it, then remove this comment. -->

<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="200" height="32"/>

cvssbasescore-2025-06-28_12.55.51

๐Ÿ›ก๏ธ CVSS v3 Base Score Estimation Model

This model is a fine-tuned version of meta-llama/Meta-Llama-3.1-8B designed to predict CVSS v3 base scores based on vulnerability descriptions.


๐Ÿ” Model Details

  • โ€”Base Model: Meta-Llama 3.1 8B (4-bit QLoRA fine-tuning)
  • โ€”Task: Regression-style score prediction (0.0 to 10.0)
  • โ€”Output Format: The model generates a numeric CVSS base score as part of its response
  • โ€”Quantization: 4-bit using QLoRA for memory-efficient fine-tuning
  • โ€”LoRA Config:
  • โ€”r = 32
  • โ€”alpha = 64
  • โ€”target_modules = ["q_proj", "v_proj", "k_proj", "o_proj"]
  • โ€”dropout = 0.1

๐Ÿ“ฆ Intended Use

This model is intended for assisting security analysts, vulnerability management platforms, or automated tools to estimate the CVSS v3 base score given a detailed vulnerability description.

Example Prompt

What is the CVSS v3 base score of the following vulnerability

CVE Description: admin/limits.php in Dolibarr 7.0.2 allows HTML injection, as demonstrated by the MAINMAXDECIMALS_TOT parameter.

Weakness Type: CWE-79 (Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'))

Affected Product: dolibarr_erp/crm

Reported by: cve@mitre.org in 2022

The CVSS v3 base score is

-------------------------------------------------

The model is expected to output the score (e.g., 5.4).

-------------------------------------------------

Framework versions

  • โ€”PEFT 0.15.2
  • โ€”Transformers 4.52.4
  • โ€”Pytorch 2.6.0+cu124
  • โ€”Datasets 3.6.0
  • โ€”Tokenizers 0.21.2

๐Ÿ“Š Training Details

  • โ€”Dataset: Crafted dataset of CVE descriptions and corresponding CVSS v3 base scores
  • โ€”Training Framework: Hugging Face Transformers, TRL's SFTTrainer, PEFT with QLoRA
  • โ€”Hardware: Colab with 4-bit quantization for efficient resource usage
Training hyperparameters

The following hyperparameters were used during training:

  • โ€”learning_rate: 0.0001
  • โ€”trainbatchsize: 4
  • โ€”evalbatchsize: 1
  • โ€”seed: 42
  • โ€”optimizer: Use OptimizerNames.PAGEDADAMW with betas=(0.9,0.999) and epsilon=1e-08 and optimizerargs=No additional optimizer arguments
  • โ€”lrschedulertype: cosine
  • โ€”lrschedulerwarmup_ratio: 0.03
  • โ€”num_epochs: 1

โš ๏ธ Limitations
  • โ€”The model does not perform strict numerical regression โ€” it generates a number as text
  • โ€”May produce invalid outputs if the prompt is incomplete or malformed
  • โ€”Should not be relied upon as the sole authority for CVSS scoring โ€” use as an assistive tool only

โœ… How to Use

python
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "your-hf-username/your-model-name"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)

prompt = "What is the CVSS v3 base score of the following vulnerability\n\nCVE Description: Example vulnerability ...\nThe CVSS v3 base score is "

inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=10)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))