Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,199 +1,113 @@
|
|
| 1 |
---
|
| 2 |
-
library_name:
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
---
|
| 5 |
|
| 6 |
-
#
|
| 7 |
|
| 8 |
-
|
| 9 |
|
|
|
|
| 10 |
|
|
|
|
| 11 |
|
| 12 |
-
|
|
|
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
- **Model type:** [More Information Needed]
|
| 24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
| 25 |
-
- **License:** [More Information Needed]
|
| 26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
| 27 |
-
|
| 28 |
-
### Model Sources [optional]
|
| 29 |
-
|
| 30 |
-
<!-- Provide the basic links for the model. -->
|
| 31 |
-
|
| 32 |
-
- **Repository:** [More Information Needed]
|
| 33 |
-
- **Paper [optional]:** [More Information Needed]
|
| 34 |
-
- **Demo [optional]:** [More Information Needed]
|
| 35 |
-
|
| 36 |
-
## Uses
|
| 37 |
-
|
| 38 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
| 39 |
-
|
| 40 |
-
### Direct Use
|
| 41 |
-
|
| 42 |
-
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
| 43 |
-
|
| 44 |
-
[More Information Needed]
|
| 45 |
-
|
| 46 |
-
### Downstream Use [optional]
|
| 47 |
-
|
| 48 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
| 49 |
-
|
| 50 |
-
[More Information Needed]
|
| 51 |
-
|
| 52 |
-
### Out-of-Scope Use
|
| 53 |
-
|
| 54 |
-
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
| 55 |
-
|
| 56 |
-
[More Information Needed]
|
| 57 |
-
|
| 58 |
-
## Bias, Risks, and Limitations
|
| 59 |
-
|
| 60 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
| 61 |
-
|
| 62 |
-
[More Information Needed]
|
| 63 |
-
|
| 64 |
-
### Recommendations
|
| 65 |
-
|
| 66 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
| 67 |
-
|
| 68 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
| 69 |
-
|
| 70 |
-
## How to Get Started with the Model
|
| 71 |
-
|
| 72 |
-
Use the code below to get started with the model.
|
| 73 |
-
|
| 74 |
-
[More Information Needed]
|
| 75 |
|
| 76 |
## Training Details
|
| 77 |
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
#### Speeds, Sizes, Times [optional]
|
| 98 |
-
|
| 99 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
| 100 |
-
|
| 101 |
-
[More Information Needed]
|
| 102 |
-
|
| 103 |
-
## Evaluation
|
| 104 |
-
|
| 105 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 106 |
-
|
| 107 |
-
### Testing Data, Factors & Metrics
|
| 108 |
-
|
| 109 |
-
#### Testing Data
|
| 110 |
-
|
| 111 |
-
<!-- This should link to a Dataset Card if possible. -->
|
| 112 |
-
|
| 113 |
-
[More Information Needed]
|
| 114 |
-
|
| 115 |
-
#### Factors
|
| 116 |
-
|
| 117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
| 118 |
-
|
| 119 |
-
[More Information Needed]
|
| 120 |
-
|
| 121 |
-
#### Metrics
|
| 122 |
-
|
| 123 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
| 124 |
-
|
| 125 |
-
[More Information Needed]
|
| 126 |
-
|
| 127 |
-
### Results
|
| 128 |
-
|
| 129 |
-
[More Information Needed]
|
| 130 |
-
|
| 131 |
-
#### Summary
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
## Model Examination [optional]
|
| 136 |
-
|
| 137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
| 138 |
-
|
| 139 |
-
[More Information Needed]
|
| 140 |
-
|
| 141 |
-
## Environmental Impact
|
| 142 |
-
|
| 143 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
| 144 |
-
|
| 145 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
| 146 |
-
|
| 147 |
-
- **Hardware Type:** [More Information Needed]
|
| 148 |
-
- **Hours used:** [More Information Needed]
|
| 149 |
-
- **Cloud Provider:** [More Information Needed]
|
| 150 |
-
- **Compute Region:** [More Information Needed]
|
| 151 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 152 |
-
|
| 153 |
-
## Technical Specifications [optional]
|
| 154 |
-
|
| 155 |
-
### Model Architecture and Objective
|
| 156 |
-
|
| 157 |
-
[More Information Needed]
|
| 158 |
-
|
| 159 |
-
### Compute Infrastructure
|
| 160 |
-
|
| 161 |
-
[More Information Needed]
|
| 162 |
-
|
| 163 |
-
#### Hardware
|
| 164 |
-
|
| 165 |
-
[More Information Needed]
|
| 166 |
|
| 167 |
-
##
|
| 168 |
|
| 169 |
-
|
| 170 |
|
| 171 |
-
|
|
|
|
| 172 |
|
| 173 |
-
|
| 174 |
|
| 175 |
-
|
| 176 |
|
| 177 |
-
|
| 178 |
|
| 179 |
-
|
|
|
|
|
|
|
| 180 |
|
| 181 |
-
|
|
|
|
| 182 |
|
| 183 |
-
|
|
|
|
|
|
|
| 184 |
|
| 185 |
-
|
|
|
|
|
|
|
|
|
|
| 186 |
|
| 187 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 188 |
|
| 189 |
-
##
|
| 190 |
|
| 191 |
-
|
|
|
|
|
|
|
|
|
|
| 192 |
|
| 193 |
-
##
|
| 194 |
|
| 195 |
-
|
|
|
|
|
|
|
|
|
|
| 196 |
|
| 197 |
-
## Model Card
|
| 198 |
|
| 199 |
-
|
|
|
|
| 1 |
---
|
| 2 |
+
library_name: peft
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
base_model: Qwen/Qwen2.5-7B-Instruct
|
| 5 |
+
tags:
|
| 6 |
+
- veris
|
| 7 |
+
- cybersecurity
|
| 8 |
+
- incident-classification
|
| 9 |
+
- lora
|
| 10 |
+
- qlora
|
| 11 |
+
- qwen2
|
| 12 |
+
datasets:
|
| 13 |
+
- vibesecurityguy/veris-classifier-training
|
| 14 |
+
- vibesecurityguy/veris-incident-classifications
|
| 15 |
+
language:
|
| 16 |
+
- en
|
| 17 |
+
pipeline_tag: text-generation
|
| 18 |
---
|
| 19 |
|
| 20 |
+
# VERIS Classifier v1
|
| 21 |
|
| 22 |
+
A fine-tuned [Qwen2.5-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-7B-Instruct) model that classifies cybersecurity incident descriptions into the [VERIS](http://veriscommunity.net/) (Vocabulary for Event Recording and Incident Sharing) framework.
|
| 23 |
|
| 24 |
+
Given a plain-English incident description, the model outputs structured JSON with the correct VERIS categories for **action**, **actor**, **asset**, and **attribute**.
|
| 25 |
|
| 26 |
+
## Example
|
| 27 |
|
| 28 |
+
**Input:**
|
| 29 |
+
> An employee at a hospital clicked a phishing email, which installed ransomware that encrypted patient records.
|
| 30 |
|
| 31 |
+
**Output:**
|
| 32 |
+
```json
|
| 33 |
+
{
|
| 34 |
+
"action": {"hacking": {"variety": ["Ransomware"]}, "social": {"variety": ["Phishing"]}},
|
| 35 |
+
"actor": {"external": {"variety": ["Unaffiliated"], "motive": ["Financial"]}},
|
| 36 |
+
"asset": {"assets": [{"variety": "S - Database"}]},
|
| 37 |
+
"attribute": {"availability": {"variety": ["Obscuration"]}}
|
| 38 |
+
}
|
| 39 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
## Training Details
|
| 42 |
|
| 43 |
+
| Parameter | Value |
|
| 44 |
+
|-----------|-------|
|
| 45 |
+
| **Base model** | Qwen/Qwen2.5-7B-Instruct |
|
| 46 |
+
| **Method** | QLoRA (4-bit NF4 quantization + LoRA) |
|
| 47 |
+
| **LoRA rank (r)** | 16 |
|
| 48 |
+
| **LoRA alpha** | 32 |
|
| 49 |
+
| **LoRA dropout** | 0.05 |
|
| 50 |
+
| **Target modules** | All linear (q, k, v, o, gate, up, down) |
|
| 51 |
+
| **Trainable parameters** | 40.4M / 4.4B (0.92%) |
|
| 52 |
+
| **Training examples** | 9,813 train / 517 eval |
|
| 53 |
+
| **Epochs** | 3 |
|
| 54 |
+
| **Batch size** | 2 x 4 gradient accumulation = 8 effective |
|
| 55 |
+
| **Learning rate** | 2e-4 (cosine schedule, 10% warmup) |
|
| 56 |
+
| **Precision** | bf16 |
|
| 57 |
+
| **Optimizer** | AdamW |
|
| 58 |
+
| **Max sequence length** | 2,048 tokens |
|
| 59 |
+
| **Hardware** | NVIDIA A10G (24GB VRAM) |
|
| 60 |
+
| **Adapter size** | 162 MB |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
+
## Training Data
|
| 63 |
|
| 64 |
+
Fine-tuned on [vibesecurityguy/veris-classifier-training](https://huggingface.co/datasets/vibesecurityguy/veris-classifier-training), which contains:
|
| 65 |
|
| 66 |
+
- **10,019 classification examples** — synthetic incident descriptions generated from real [VCDB](https://github.com/vz-risk/VCDB) (Verizon Community Database) records, paired with their ground-truth VERIS classifications
|
| 67 |
+
- **311 Q&A pairs** — questions and answers about the VERIS framework itself
|
| 68 |
|
| 69 |
+
The source classifications come from 8,559 real-world incidents in VCDB, spanning healthcare, finance, retail, government, and other industries.
|
| 70 |
|
| 71 |
+
## How to Use
|
| 72 |
|
| 73 |
+
### With Transformers + PEFT
|
| 74 |
|
| 75 |
+
```python
|
| 76 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 77 |
+
from peft import PeftModel
|
| 78 |
|
| 79 |
+
base_model = "Qwen/Qwen2.5-7B-Instruct"
|
| 80 |
+
adapter = "vibesecurityguy/veris-classifier-v1"
|
| 81 |
|
| 82 |
+
tokenizer = AutoTokenizer.from_pretrained(base_model)
|
| 83 |
+
model = AutoModelForCausalLM.from_pretrained(base_model, device_map="auto")
|
| 84 |
+
model = PeftModel.from_pretrained(model, adapter)
|
| 85 |
|
| 86 |
+
messages = [
|
| 87 |
+
{"role": "system", "content": "You are a VERIS classification expert..."},
|
| 88 |
+
{"role": "user", "content": "Classify this incident: An employee lost a laptop containing unencrypted customer data."}
|
| 89 |
+
]
|
| 90 |
|
| 91 |
+
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 92 |
+
inputs = tokenizer(text, return_tensors="pt").to(model.device)
|
| 93 |
+
outputs = model.generate(**inputs, max_new_tokens=512)
|
| 94 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 95 |
+
```
|
| 96 |
|
| 97 |
+
## Intended Use
|
| 98 |
|
| 99 |
+
This model is designed for:
|
| 100 |
+
- Classifying cybersecurity incidents into the VERIS framework
|
| 101 |
+
- Answering questions about VERIS categories and taxonomy
|
| 102 |
+
- Assisting incident response teams with structured data entry
|
| 103 |
|
| 104 |
+
## Limitations
|
| 105 |
|
| 106 |
+
- **VCDB bias**: Training data over-represents healthcare (HIPAA mandatory disclosure) and US-based incidents
|
| 107 |
+
- **Schema version**: Trained primarily on VERIS 1.3.x schema; may not cover all 1.4 additions
|
| 108 |
+
- **Not a replacement for human analysis**: Output should be reviewed by a security analyst
|
| 109 |
+
- **English only**: Trained on English-language incident descriptions
|
| 110 |
|
| 111 |
+
## Model Card Authors
|
| 112 |
|
| 113 |
+
Peter Shamoon ([@vibesecurityguy](https://huggingface.co/vibesecurityguy))
|