--- library_name: transformers license: cc-by-4.0 base_model: roberta-base metrics: - accuracy tags: - generated_from_trainer - text-classification - classification - nlp - vulnerability model-index: - name: vulnerability-severity-classification-roberta-base results: [] datasets: - CIRCL/vulnerability-scores --- # VLAI: A RoBERTa-Based Model for Automated Vulnerability Severity Classification # Severity classification This model is a fine-tuned version of [roberta-base](https://huggingface.co/roberta-base) on the dataset [CIRCL/vulnerability-scores](https://huggingface.co/datasets/CIRCL/vulnerability-scores). The model was presented in the paper [VLAI: A RoBERTa-Based Model for Automated Vulnerability Severity Classification](https://huggingface.co/papers/2507.03607) [[arXiv](https://arxiv.org/abs/2507.03607)]. **Abstract:** VLAI is a transformer-based model that predicts software vulnerability severity levels directly from text descriptions. Built on RoBERTa, VLAI is fine-tuned on over 600,000 real-world vulnerabilities and achieves over 82% accuracy in predicting severity categories, enabling faster and more consistent triage ahead of manual CVSS scoring. The model and dataset are open-source and integrated into the Vulnerability-Lookup service. You can read [this page](https://www.vulnerability-lookup.org/user-manual/ai/) for more information. ## Model description It is a classification model and is aimed to assist in classifying vulnerabilities by severity based on their descriptions. ## How to get started with the model ```python from transformers import AutoModelForSequenceClassification, AutoTokenizer import torch labels = ["low", "medium", "high", "critical"] model_name = "CIRCL/vulnerability-severity-classification-roberta-base" tokenizer = AutoTokenizer.from_pretrained(model_name) model = AutoModelForSequenceClassification.from_pretrained(model_name) model.eval() print("Model revision:", model.config._commit_hash) test_description = "SAP NetWeaver Visual Composer Metadata Uploader is not protected with a proper authorization, allowing unauthenticated agent to upload potentially malicious executable binaries \ that could severely harm the host system. This could significantly affect the confidentiality, integrity, and availability of the targeted system." inputs = tokenizer(test_description, return_tensors="pt", truncation=True, padding=True) # Run inference with torch.no_grad(): outputs = model(**inputs) predictions = torch.nn.functional.softmax(outputs.logits, dim=-1) # Print results print("Predictions:", predictions) predicted_class = torch.argmax(predictions, dim=-1).item() print("Predicted severity:", labels[predicted_class]) ``` ## Training procedure ### Training hyperparameters The following hyperparameters were used during training: - learning_rate: 3e-05 - train_batch_size: 32 - eval_batch_size: 32 - seed: 42 - optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments - lr_scheduler_type: linear - num_epochs: 5 It achieves the following results on the evaluation set: - Loss: 2.0411 - Accuracy: 0.8164 - F1 Macro: 0.7491 - Low Precision: 0.6536 - Low Recall: 0.5148 - Low F1: 0.5759 - Medium Precision: 0.8377 - Medium Recall: 0.8712 - Medium F1: 0.8541 - High Precision: 0.8236 - High Recall: 0.8077 - High F1: 0.8156 - Critical Precision: 0.7561 - Critical Recall: 0.7457 - Critical F1: 0.7509 ### Training results | Training Loss | Epoch | Step | Validation Loss | Accuracy | F1 Macro | Low Precision | Low Recall | Low F1 | Medium Precision | Medium Recall | Medium F1 | High Precision | High Recall | High F1 | Critical Precision | Critical Recall | Critical F1 | |:-------------:|:-----:|:-----:|:---------------:|:--------:|:--------:|:-------------:|:----------:|:------:|:----------------:|:-------------:|:---------:|:--------------:|:-----------:|:-------:|:------------------:|:---------------:|:-----------:| | 2.6595 | 1.0 | 18151 | 2.5896 | 0.7341 | 0.6285 | 0.6716 | 0.2567 | 0.3714 | 0.7917 | 0.7991 | 0.7954 | 0.7002 | 0.7492 | 0.7239 | 0.6326 | 0.6141 | 0.6232 | | 2.4978 | 2.0 | 36302 | 2.3990 | 0.7614 | 0.6814 | 0.5762 | 0.4255 | 0.4895 | 0.7779 | 0.8556 | 0.8149 | 0.7881 | 0.7133 | 0.7488 | 0.6681 | 0.6771 | 0.6726 | | 1.7617 | 3.0 | 54453 | 2.1975 | 0.7879 | 0.7097 | 0.6682 | 0.4156 | 0.5125 | 0.8119 | 0.8615 | 0.8360 | 0.8056 | 0.7546 | 0.7793 | 0.6775 | 0.7484 | 0.7112 | | 1.7304 | 4.0 | 72604 | 2.0677 | 0.8075 | 0.7366 | 0.6663 | 0.4761 | 0.5554 | 0.8389 | 0.8588 | 0.8487 | 0.8077 | 0.8021 | 0.8049 | 0.7248 | 0.7506 | 0.7375 | | 1.4189 | 5.0 | 90755 | 2.0411 | 0.8164 | 0.7491 | 0.6536 | 0.5148 | 0.5759 | 0.8377 | 0.8712 | 0.8541 | 0.8236 | 0.8077 | 0.8156 | 0.7561 | 0.7457 | 0.7509 | ### Framework versions - Transformers 5.15.0 - Pytorch 2.13.0+cu130 - Datasets 4.8.5 - Tokenizers 0.22.2