--- 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: 1.9981 - Accuracy: 0.8188 - F1 Macro: 0.7502 - Low Precision: 0.6490 - Low Recall: 0.5113 - Low F1: 0.572 - Medium Precision: 0.8488 - Medium Recall: 0.8681 - Medium F1: 0.8584 - High Precision: 0.8148 - High Recall: 0.8129 - High F1: 0.8138 - Critical Precision: 0.7592 - Critical Recall: 0.7543 - Critical F1: 0.7567 ### 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.9393 | 1.0 | 16760 | 2.5264 | 0.7363 | 0.6358 | 0.5562 | 0.3500 | 0.4297 | 0.7994 | 0.7985 | 0.7990 | 0.6842 | 0.7790 | 0.7286 | 0.7063 | 0.5008 | 0.5861 | | 2.3025 | 2.0 | 33520 | 2.2776 | 0.7710 | 0.6785 | 0.6646 | 0.3369 | 0.4471 | 0.7978 | 0.8607 | 0.8280 | 0.7771 | 0.7286 | 0.7520 | 0.6673 | 0.7073 | 0.6867 | | 1.7004 | 3.0 | 50280 | 2.1303 | 0.7911 | 0.7164 | 0.5839 | 0.4895 | 0.5325 | 0.8184 | 0.8623 | 0.8398 | 0.7968 | 0.7644 | 0.7803 | 0.7224 | 0.7041 | 0.7131 | | 1.3977 | 4.0 | 67040 | 2.0143 | 0.8087 | 0.7335 | 0.6898 | 0.4418 | 0.5386 | 0.8412 | 0.8622 | 0.8516 | 0.7999 | 0.8029 | 0.8014 | 0.7357 | 0.7489 | 0.7422 | | 1.5018 | 5.0 | 83800 | 1.9981 | 0.8188 | 0.7502 | 0.6490 | 0.5113 | 0.572 | 0.8488 | 0.8681 | 0.8584 | 0.8148 | 0.8129 | 0.8138 | 0.7592 | 0.7543 | 0.7567 | ### Framework versions - Transformers 5.10.2 - Pytorch 2.12.0+cu130 - Datasets 4.8.5 - Tokenizers 0.22.2