--- 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() 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.0132 - Accuracy: 0.8191 - F1 Macro: 0.7488 - Low Precision: 0.6601 - Low Recall: 0.5006 - Low F1: 0.5694 - Medium Precision: 0.8440 - Medium Recall: 0.8767 - Medium F1: 0.8601 - High Precision: 0.8195 - High Recall: 0.8112 - High F1: 0.8153 - Critical Precision: 0.7618 - Critical Recall: 0.7392 - Critical F1: 0.7503 ### 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.3936 | 1.0 | 16180 | 2.5423 | 0.7404 | 0.6271 | 0.6925 | 0.2372 | 0.3534 | 0.7777 | 0.8359 | 0.8057 | 0.7237 | 0.7233 | 0.7235 | 0.6416 | 0.6110 | 0.6259 | | 2.5847 | 2.0 | 32360 | 2.2926 | 0.7674 | 0.6790 | 0.6162 | 0.3880 | 0.4762 | 0.7899 | 0.8604 | 0.8237 | 0.7640 | 0.7458 | 0.7548 | 0.7115 | 0.6175 | 0.6612 | | 2.0935 | 3.0 | 48540 | 2.1257 | 0.7920 | 0.7086 | 0.6727 | 0.4017 | 0.5030 | 0.8166 | 0.8670 | 0.8411 | 0.7907 | 0.7774 | 0.7840 | 0.7206 | 0.6927 | 0.7064 | | 1.4077 | 4.0 | 64720 | 2.0427 | 0.8080 | 0.7367 | 0.5928 | 0.5203 | 0.5542 | 0.8334 | 0.8691 | 0.8509 | 0.8127 | 0.7952 | 0.8038 | 0.7583 | 0.7185 | 0.7379 | | 1.0097 | 5.0 | 80900 | 2.0132 | 0.8191 | 0.7488 | 0.6601 | 0.5006 | 0.5694 | 0.8440 | 0.8767 | 0.8601 | 0.8195 | 0.8112 | 0.8153 | 0.7618 | 0.7392 | 0.7503 | ### Framework versions - Transformers 5.6.2 - Pytorch 2.11.0+cu130 - Datasets 4.8.5 - Tokenizers 0.22.2