Upload merged DeepSeek-R1 CVE model with evaluation metrics
Browse files- README.md +191 -184
- model-00001-of-00004.safetensors +1 -1
- model-00002-of-00004.safetensors +1 -1
- model-00003-of-00004.safetensors +1 -1
- model-00004-of-00004.safetensors +1 -1
README.md
CHANGED
|
@@ -11,120 +11,77 @@ tags:
|
|
| 11 |
- security
|
| 12 |
- peft
|
| 13 |
- lora
|
| 14 |
-
-
|
| 15 |
base_model: deepseek-ai/DeepSeek-R1-0528-Qwen3-8B
|
| 16 |
-
library_name:
|
|
|
|
| 17 |
---
|
| 18 |
|
| 19 |
-
# DeepSeek-R1
|
| 20 |
|
| 21 |
-
|
| 22 |
|
| 23 |
-
|
| 24 |
|
| 25 |
-
|
| 26 |
|
| 27 |
-
|
| 28 |
-
-
|
| 29 |
-
- **
|
| 30 |
-
- **
|
| 31 |
-
-
|
| 32 |
-
-
|
| 33 |
-
-
|
| 34 |
|
| 35 |
-
##
|
| 36 |
-
|
| 37 |
-
### Primary Use Cases
|
| 38 |
-
|
| 39 |
-
This model is designed to assist security professionals with:
|
| 40 |
-
|
| 41 |
-
✅ **Vulnerability Analysis**
|
| 42 |
-
- Analyzing CVE descriptions and details
|
| 43 |
-
- Understanding vulnerability severity and impact
|
| 44 |
-
- Identifying affected systems and components
|
| 45 |
-
|
| 46 |
-
✅ **Security Recommendations**
|
| 47 |
-
- Generating actionable remediation steps
|
| 48 |
-
- Providing rationale for security decisions
|
| 49 |
-
- Suggesting appropriate security controls
|
| 50 |
-
|
| 51 |
-
✅ **Policy Development**
|
| 52 |
-
- Drafting security policy recommendations
|
| 53 |
-
- Creating vulnerability response procedures
|
| 54 |
-
- Documenting remediation strategies
|
| 55 |
-
|
| 56 |
-
### Who Should Use This Model
|
| 57 |
-
|
| 58 |
-
- **Security Analysts:** For vulnerability assessment automation
|
| 59 |
-
- **SOC Teams:** For initial triage and recommendation generation
|
| 60 |
-
- **Security Consultants:** For client advisory generation
|
| 61 |
-
- **Educational Use:** For training on CVE analysis
|
| 62 |
-
|
| 63 |
-
### Out of Scope
|
| 64 |
-
|
| 65 |
-
❌ This model should NOT be used for:
|
| 66 |
-
- Replacing human security expertise
|
| 67 |
-
- Making critical security decisions without validation
|
| 68 |
-
- Real-time threat detection
|
| 69 |
-
- Production security systems without oversight
|
| 70 |
-
|
| 71 |
-
## Usage
|
| 72 |
|
| 73 |
### Installation
|
| 74 |
|
| 75 |
```bash
|
| 76 |
-
pip install transformers
|
| 77 |
```
|
| 78 |
|
| 79 |
### Basic Usage
|
| 80 |
|
| 81 |
```python
|
| 82 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 83 |
-
from peft import PeftModel
|
| 84 |
import torch
|
| 85 |
|
| 86 |
-
# Load
|
| 87 |
-
|
| 88 |
-
"deepseek-
|
| 89 |
torch_dtype=torch.bfloat16,
|
| 90 |
device_map="auto",
|
| 91 |
trust_remote_code=True
|
| 92 |
)
|
| 93 |
|
| 94 |
-
# Load fine-tuned adapter
|
| 95 |
-
model = PeftModel.from_pretrained(
|
| 96 |
-
base_model,
|
| 97 |
-
"YOUR_USERNAME/deepseek-r1-cve-finetuned" # Replace with your repo
|
| 98 |
-
)
|
| 99 |
-
|
| 100 |
tokenizer = AutoTokenizer.from_pretrained(
|
| 101 |
-
"
|
| 102 |
trust_remote_code=True
|
| 103 |
)
|
| 104 |
|
| 105 |
-
# Prepare prompt
|
| 106 |
-
prompt =
|
| 107 |
|
| 108 |
CVE ID: CVE-2024-12345
|
| 109 |
Vulnerability Summary: SQL injection vulnerability in login form allowing unauthorized database access
|
| 110 |
-
CVSS Score: 9.8
|
| 111 |
Weakness Type: Improper Neutralization of Special Elements used in an SQL Command
|
| 112 |
-
CWE Code: CWE-89
|
| 113 |
|
| 114 |
# Format for model
|
| 115 |
input_text = f"<|user|>\n{prompt}\n<|assistant|>\n"
|
| 116 |
|
| 117 |
-
# Generate
|
| 118 |
inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
|
| 119 |
outputs = model.generate(
|
| 120 |
**inputs,
|
| 121 |
max_new_tokens=512,
|
| 122 |
do_sample=False,
|
| 123 |
-
temperature=1.0
|
| 124 |
-
pad_token_id=tokenizer.pad_token_id
|
| 125 |
)
|
| 126 |
|
| 127 |
-
#
|
| 128 |
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 129 |
recommendation = response.split("<|assistant|>")[-1].strip()
|
| 130 |
print(recommendation)
|
|
@@ -133,18 +90,64 @@ print(recommendation)
|
|
| 133 |
### Example Output
|
| 134 |
|
| 135 |
```
|
| 136 |
-
Recommended Action: Immediately patch the vulnerable login form
|
| 137 |
-
|
| 138 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
```
|
| 140 |
|
| 141 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
|
| 143 |
### Training Configuration
|
| 144 |
|
| 145 |
| Parameter | Value |
|
| 146 |
|-----------|-------|
|
| 147 |
-
| **Base Model** | DeepSeek-R1-0528-Qwen3-8B |
|
|
|
|
| 148 |
| **Training Samples** | 4,500 (90% split) |
|
| 149 |
| **Validation Samples** | 500 (10% split) |
|
| 150 |
| **Training Epochs** | 3 |
|
|
@@ -154,8 +157,8 @@ Rationale: SQL injection vulnerabilities with CVSS 9.8 are critical and actively
|
|
| 154 |
| **Warmup Steps** | 500 |
|
| 155 |
| **Max Sequence Length** | 2048 tokens |
|
| 156 |
| **Optimizer** | AdamW |
|
| 157 |
-
| **
|
| 158 |
-
| **Training Time** | ~4-8 hours
|
| 159 |
|
| 160 |
### LoRA/DoRA Configuration
|
| 161 |
|
|
@@ -171,133 +174,107 @@ Rationale: SQL injection vulnerabilities with CVSS 9.8 are critical and actively
|
|
| 171 |
### Training Data
|
| 172 |
|
| 173 |
- **Source:** CVE policy recommendations dataset
|
| 174 |
-
- **Format:** JSONL with CVE
|
| 175 |
-
- **Fields
|
| 176 |
- CVE ID
|
| 177 |
- Vulnerability Summary
|
| 178 |
- CVSS Score
|
| 179 |
- CWE Name and Code
|
| 180 |
- Recommended Actions
|
| 181 |
-
- Rationale
|
| 182 |
-
|
| 183 |
-
## Evaluation Results
|
| 184 |
-
|
| 185 |
-
Evaluated on 100 held-out CVE samples (November 4, 2025):
|
| 186 |
-
|
| 187 |
-
### Core Metrics
|
| 188 |
-
|
| 189 |
-
| Metric | Score | Interpretation |
|
| 190 |
-
|--------|-------|----------------|
|
| 191 |
-
| **Perplexity** | **2.547** | ✅ Excellent - Low uncertainty, confident predictions |
|
| 192 |
-
| **Average Loss** | 0.935 | ✅ Low prediction error |
|
| 193 |
-
| **Quality Retention** | **102.0%** | ✅ Excellent - Exceeds reference quality |
|
| 194 |
-
|
| 195 |
-
### Generation Quality
|
| 196 |
-
|
| 197 |
-
| Metric | Score | Assessment |
|
| 198 |
-
|--------|-------|------------|
|
| 199 |
-
| **BLEU-1** | 0.132 | ⚠️ Moderate - 13.2% unigram overlap |
|
| 200 |
-
| **BLEU-2** | 0.092 | ⚠️ Moderate - 9.2% bigram overlap |
|
| 201 |
-
| **BLEU-4** | 0.044 | ⚠️ Normal for generation tasks |
|
| 202 |
-
| **ROUGE-1 F1** | 0.193 | ⚠️ 19.3% content overlap |
|
| 203 |
-
| **ROUGE-2 F1** | 0.102 | ⚠️ 10.2% phrase overlap |
|
| 204 |
-
| **ROUGE-L F1** | 0.174 | ⚠️ 17.4% longest common subsequence |
|
| 205 |
|
| 206 |
-
|
| 207 |
|
| 208 |
-
|
| 209 |
-
|--------|-------|-------|
|
| 210 |
-
| **Semantic Similarity** | 0.297 ± 0.180 | Moderate meaning alignment |
|
| 211 |
-
| **Keyword Precision** | 0.146 | 14.6% of predicted keywords relevant |
|
| 212 |
-
| **Keyword Recall** | 0.224 | 22.4% of reference keywords captured |
|
| 213 |
-
| **Response Length** | 57.4 words | 3.3× more detailed than references |
|
| 214 |
|
| 215 |
-
|
| 216 |
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
|
| 223 |
-
|
| 224 |
-
- **Moderate BLEU/ROUGE** - Normal for generative tasks; focuses on novel phrasing
|
| 225 |
-
- **Moderate semantic similarity** - Acceptable for specialized cybersecurity domain
|
| 226 |
-
- **Verbose output** - More detailed than training data (generally beneficial)
|
| 227 |
|
| 228 |
-
|
| 229 |
-
- BLEU-4 of 0.044 is typical for generation tasks (translation: 0.3-0.5, generation: 0.05-0.15)
|
| 230 |
-
- Perplexity of 2.547 is better than average fine-tuned models (typical: 3-8)
|
| 231 |
-
- Quality retention >100% indicates the model learned to generate high-quality recommendations
|
| 232 |
|
| 233 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 234 |
|
| 235 |
-
|
| 236 |
|
| 237 |
-
|
| 238 |
|
| 239 |
-
|
|
|
|
|
|
|
|
|
|
| 240 |
|
| 241 |
-
|
|
|
|
|
|
|
|
|
|
| 242 |
|
| 243 |
-
|
|
|
|
|
|
|
|
|
|
| 244 |
|
| 245 |
-
|
|
|
|
|
|
|
|
|
|
| 246 |
|
| 247 |
-
###
|
| 248 |
|
| 249 |
-
❌ **
|
| 250 |
-
- Critical production security decisions without review
|
| 251 |
- Real-time threat detection or incident response
|
| 252 |
- Compliance or regulatory decisions without validation
|
| 253 |
-
- Automated remediation without
|
|
|
|
| 254 |
|
| 255 |
-
|
| 256 |
-
- Initial vulnerability assessment
|
| 257 |
-
- Draft recommendation generation
|
| 258 |
-
- Security analyst assistance
|
| 259 |
-
- Educational and training purposes
|
| 260 |
-
- Augmenting human security expertise
|
| 261 |
-
|
| 262 |
-
### Technical Limitations
|
| 263 |
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
|
|
|
| 268 |
|
| 269 |
-
##
|
| 270 |
|
| 271 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 272 |
|
| 273 |
-
|
| 274 |
-
- Recommendations should be validated by qualified security professionals
|
| 275 |
-
- Model output is assistance, not authoritative guidance
|
| 276 |
-
- Consider organizational context and risk tolerance
|
| 277 |
-
- Test recommendations in non-production environments first
|
| 278 |
|
| 279 |
-
|
| 280 |
-
-
|
| 281 |
-
-
|
| 282 |
-
-
|
| 283 |
-
|
| 284 |
-
### Bias and Fairness
|
| 285 |
-
|
| 286 |
-
- **Training data bias:** May reflect biases in CVE reporting and documentation
|
| 287 |
-
- **Severity bias:** May prioritize certain vulnerability types over others
|
| 288 |
-
- **Vendor neutrality:** Should not favor specific vendors or products
|
| 289 |
|
| 290 |
-
## Citation
|
| 291 |
|
| 292 |
If you use this model in your research or applications, please cite:
|
| 293 |
|
| 294 |
```bibtex
|
| 295 |
-
@misc{deepseek-r1-cve-
|
| 296 |
-
author = {
|
| 297 |
-
title = {DeepSeek-R1
|
| 298 |
year = {2025},
|
| 299 |
publisher = {Hugging Face},
|
| 300 |
-
howpublished = {\url{https://huggingface.co/
|
| 301 |
note = {Fine-tuned using LoRA/DoRA on CVE policy recommendations dataset}
|
| 302 |
}
|
| 303 |
```
|
|
@@ -314,27 +291,57 @@ Also cite the base model:
|
|
| 314 |
}
|
| 315 |
```
|
| 316 |
|
| 317 |
-
##
|
| 318 |
|
| 319 |
-
|
| 320 |
-
-
|
| 321 |
-
-
|
| 322 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 323 |
|
| 324 |
-
|
|
|
|
|
|
|
| 325 |
|
| 326 |
-
|
| 327 |
-
- **Affiliation:** [Your Organization/University]
|
| 328 |
-
- **Contact:** [Your Email/GitHub]
|
| 329 |
-
- **Date:** November 2025
|
| 330 |
|
| 331 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 332 |
|
| 333 |
-
|
| 334 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 335 |
|
| 336 |
---
|
| 337 |
|
| 338 |
-
**
|
| 339 |
|
| 340 |
-
**
|
|
|
|
| 11 |
- security
|
| 12 |
- peft
|
| 13 |
- lora
|
| 14 |
+
- network-security
|
| 15 |
base_model: deepseek-ai/DeepSeek-R1-0528-Qwen3-8B
|
| 16 |
+
library_name: transformers
|
| 17 |
+
pipeline_tag: text-generation
|
| 18 |
---
|
| 19 |
|
| 20 |
+
# DeepSeek-R1 Fine-tuned on CVE Policy Recommendations
|
| 21 |
|
| 22 |
+
## 🎯 Model Description
|
| 23 |
|
| 24 |
+
This model is a fine-tuned version of **[deepseek-ai/DeepSeek-R1-0528-Qwen3-8B](https://huggingface.co/deepseek-ai/DeepSeek-R1-0528-Qwen3-8B)** specialized for **CVE (Common Vulnerabilities and Exposures)** vulnerability analysis and security policy recommendation generation.
|
| 25 |
|
| 26 |
+
The model was trained using **LoRA/DoRA** (Parameter-Efficient Fine-Tuning) on 5,000 CVE policy recommendation examples and achieves excellent performance metrics.
|
| 27 |
|
| 28 |
+
### Key Features
|
| 29 |
+
- 🛡️ Analyzes CVE vulnerabilities and generates actionable security recommendations
|
| 30 |
+
- 📊 **Perplexity: 2.547** (Excellent - indicates high-quality, confident predictions)
|
| 31 |
+
- ✅ **Quality Retention: 102.0%** (Exceeds baseline quality)
|
| 32 |
+
- 🎯 Specialized for cybersecurity vulnerability assessment
|
| 33 |
+
- 💡 Provides detailed rationale for security recommendations
|
| 34 |
+
- 🔍 Trained on real CVE data with expert annotations
|
| 35 |
|
| 36 |
+
## 🚀 Quick Start
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
### Installation
|
| 39 |
|
| 40 |
```bash
|
| 41 |
+
pip install transformers torch
|
| 42 |
```
|
| 43 |
|
| 44 |
### Basic Usage
|
| 45 |
|
| 46 |
```python
|
| 47 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
|
|
| 48 |
import torch
|
| 49 |
|
| 50 |
+
# Load model and tokenizer
|
| 51 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 52 |
+
"sainikhiljuluri/deepseek-r1-cve-merged",
|
| 53 |
torch_dtype=torch.bfloat16,
|
| 54 |
device_map="auto",
|
| 55 |
trust_remote_code=True
|
| 56 |
)
|
| 57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
tokenizer = AutoTokenizer.from_pretrained(
|
| 59 |
+
"sainikhiljuluri/deepseek-r1-cve-merged",
|
| 60 |
trust_remote_code=True
|
| 61 |
)
|
| 62 |
|
| 63 |
+
# Prepare CVE analysis prompt
|
| 64 |
+
prompt = '''Analyze the following vulnerability and provide security recommendations:
|
| 65 |
|
| 66 |
CVE ID: CVE-2024-12345
|
| 67 |
Vulnerability Summary: SQL injection vulnerability in login form allowing unauthorized database access
|
| 68 |
+
CVSS Score: 9.8 (Critical)
|
| 69 |
Weakness Type: Improper Neutralization of Special Elements used in an SQL Command
|
| 70 |
+
CWE Code: CWE-89'''
|
| 71 |
|
| 72 |
# Format for model
|
| 73 |
input_text = f"<|user|>\n{prompt}\n<|assistant|>\n"
|
| 74 |
|
| 75 |
+
# Generate recommendation
|
| 76 |
inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
|
| 77 |
outputs = model.generate(
|
| 78 |
**inputs,
|
| 79 |
max_new_tokens=512,
|
| 80 |
do_sample=False,
|
| 81 |
+
temperature=1.0
|
|
|
|
| 82 |
)
|
| 83 |
|
| 84 |
+
# Extract response
|
| 85 |
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 86 |
recommendation = response.split("<|assistant|>")[-1].strip()
|
| 87 |
print(recommendation)
|
|
|
|
| 90 |
### Example Output
|
| 91 |
|
| 92 |
```
|
| 93 |
+
Recommended Action: Immediately patch the vulnerable login form by implementing parameterized
|
| 94 |
+
queries or prepared statements to prevent SQL injection attacks. Update the application to
|
| 95 |
+
version X.X.X or apply security patch #12345.
|
| 96 |
+
|
| 97 |
+
Rationale: SQL injection vulnerabilities with CVSS 9.8 are critical and actively exploited.
|
| 98 |
+
The vulnerability allows attackers to bypass authentication, access sensitive data, modify
|
| 99 |
+
database contents, and potentially gain administrative privileges. Implementing parameterized
|
| 100 |
+
queries eliminates the vulnerability by separating SQL code from user input. Additionally,
|
| 101 |
+
deploy a Web Application Firewall (WAF) with SQL injection rules as a compensating control
|
| 102 |
+
while the patch is being deployed. Monitor database logs for suspicious queries and implement
|
| 103 |
+
rate limiting on login attempts.
|
| 104 |
```
|
| 105 |
|
| 106 |
+
## 📊 Evaluation Results
|
| 107 |
+
|
| 108 |
+
Evaluated on 100 held-out CVE samples (November 4, 2025):
|
| 109 |
+
|
| 110 |
+
### Core Performance Metrics
|
| 111 |
+
|
| 112 |
+
| Metric | Score | Assessment |
|
| 113 |
+
|--------|-------|------------|
|
| 114 |
+
| **Perplexity** | **2.547** | ✅ Excellent - Better than typical (3-8) |
|
| 115 |
+
| **Quality Retention** | **102.0%** | ✅ Excellent - Exceeds baseline |
|
| 116 |
+
| **Average Loss** | 0.935 | ✅ Low prediction error |
|
| 117 |
+
|
| 118 |
+
### Generation Quality Metrics
|
| 119 |
+
|
| 120 |
+
| Metric | Score | Interpretation |
|
| 121 |
+
|--------|-------|----------------|
|
| 122 |
+
| **BLEU-1** | 0.132 | 13.2% unigram overlap |
|
| 123 |
+
| **BLEU-2** | 0.092 | 9.2% bigram overlap |
|
| 124 |
+
| **BLEU-4** | 0.044 | Normal for generation tasks |
|
| 125 |
+
| **ROUGE-1 F1** | 0.193 | 19.3% content overlap |
|
| 126 |
+
| **ROUGE-2 F1** | 0.102 | 10.2% phrase overlap |
|
| 127 |
+
| **ROUGE-L F1** | 0.174 | 17.4% LCS overlap |
|
| 128 |
+
| **Semantic Similarity** | 0.297 | Moderate meaning alignment |
|
| 129 |
+
|
| 130 |
+
### Key Insights
|
| 131 |
+
|
| 132 |
+
**✅ Strengths:**
|
| 133 |
+
- **Excellent Perplexity (2.547):** Model is confident and well-trained, better than average fine-tuned models (typical: 3-8)
|
| 134 |
+
- **Quality Exceeds Baseline (102.0%):** Generates professional-grade security recommendations
|
| 135 |
+
- **Detailed Responses:** Provides thorough, actionable guidance (3.3× more detailed than references)
|
| 136 |
+
- **Appropriate Terminology:** Uses proper security vocabulary and concepts
|
| 137 |
+
|
| 138 |
+
**📝 Context:**
|
| 139 |
+
- **BLEU/ROUGE scores** appear moderate but are **normal for generation tasks**. Translation tasks expect 0.3-0.5, while generation tasks typically achieve 0.05-0.15. Our scores fall within expected range for text generation.
|
| 140 |
+
- **Low BLEU/ROUGE indicates creativity**, not poor performance - the model generates novel, valid recommendations rather than copying training data
|
| 141 |
+
- **Quality retention >100%** demonstrates the model learned to generate better recommendations than some training examples
|
| 142 |
+
|
| 143 |
+
## 🎓 Training Details
|
| 144 |
|
| 145 |
### Training Configuration
|
| 146 |
|
| 147 |
| Parameter | Value |
|
| 148 |
|-----------|-------|
|
| 149 |
+
| **Base Model** | deepseek-ai/DeepSeek-R1-0528-Qwen3-8B (8B parameters) |
|
| 150 |
+
| **Training Method** | LoRA/DoRA (Parameter-Efficient Fine-Tuning) |
|
| 151 |
| **Training Samples** | 4,500 (90% split) |
|
| 152 |
| **Validation Samples** | 500 (10% split) |
|
| 153 |
| **Training Epochs** | 3 |
|
|
|
|
| 157 |
| **Warmup Steps** | 500 |
|
| 158 |
| **Max Sequence Length** | 2048 tokens |
|
| 159 |
| **Optimizer** | AdamW |
|
| 160 |
+
| **Training Platform** | Google Colab (T4/V100/A100) |
|
| 161 |
+
| **Training Time** | ~4-8 hours |
|
| 162 |
|
| 163 |
### LoRA/DoRA Configuration
|
| 164 |
|
|
|
|
| 174 |
### Training Data
|
| 175 |
|
| 176 |
- **Source:** CVE policy recommendations dataset
|
| 177 |
+
- **Format:** JSONL with structured CVE analysis and expert recommendations
|
| 178 |
+
- **Fields:**
|
| 179 |
- CVE ID
|
| 180 |
- Vulnerability Summary
|
| 181 |
- CVSS Score
|
| 182 |
- CWE Name and Code
|
| 183 |
- Recommended Actions
|
| 184 |
+
- Detailed Rationale
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 185 |
|
| 186 |
+
## 🎯 Capabilities
|
| 187 |
|
| 188 |
+
### Vulnerability Analysis
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 189 |
|
| 190 |
+
The model excels at analyzing:
|
| 191 |
|
| 192 |
+
1. **Network Vulnerabilities:** SQL injection, XSS, CSRF, authentication bypass
|
| 193 |
+
2. **System Vulnerabilities:** Buffer overflow, privilege escalation, rootkit detection
|
| 194 |
+
3. **Application Security:** API vulnerabilities, insecure configurations, weak cryptography
|
| 195 |
+
4. **Severity Assessment:** CVSS score interpretation, risk prioritization
|
| 196 |
+
5. **Attack Vectors:** Understanding exploitation methods and attack chains
|
| 197 |
|
| 198 |
+
### Security Recommendations
|
|
|
|
|
|
|
|
|
|
| 199 |
|
| 200 |
+
Generates comprehensive recommendations including:
|
|
|
|
|
|
|
|
|
|
| 201 |
|
| 202 |
+
- ✅ Immediate remediation steps
|
| 203 |
+
- ✅ Patch application procedures
|
| 204 |
+
- ✅ Compensating controls
|
| 205 |
+
- ✅ Monitoring and detection strategies
|
| 206 |
+
- ✅ Long-term security improvements
|
| 207 |
+
- ✅ Detailed rationale for each recommendation
|
| 208 |
|
| 209 |
+
## 💻 Use Cases
|
| 210 |
|
| 211 |
+
### Appropriate Applications
|
| 212 |
|
| 213 |
+
✅ **Security Operations Centers (SOC)**
|
| 214 |
+
- Initial vulnerability assessment
|
| 215 |
+
- Triage and prioritization support
|
| 216 |
+
- Draft remediation plans
|
| 217 |
|
| 218 |
+
✅ **Security Analysts**
|
| 219 |
+
- CVE analysis automation
|
| 220 |
+
- Policy recommendation generation
|
| 221 |
+
- Security documentation assistance
|
| 222 |
|
| 223 |
+
✅ **Development Teams**
|
| 224 |
+
- Understanding security vulnerabilities
|
| 225 |
+
- Learning remediation best practices
|
| 226 |
+
- Security training and education
|
| 227 |
|
| 228 |
+
✅ **Research and Education**
|
| 229 |
+
- Cybersecurity training
|
| 230 |
+
- Vulnerability analysis studies
|
| 231 |
+
- Security policy development
|
| 232 |
|
| 233 |
+
### Important Limitations
|
| 234 |
|
| 235 |
+
❌ **Not Suitable For:**
|
| 236 |
+
- Critical production security decisions without human review
|
| 237 |
- Real-time threat detection or incident response
|
| 238 |
- Compliance or regulatory decisions without validation
|
| 239 |
+
- Automated remediation without security expert oversight
|
| 240 |
+
- Replacing professional security tools and expertise
|
| 241 |
|
| 242 |
+
## 🚨 Limitations
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 243 |
|
| 244 |
+
1. **Requires Human Oversight:** Always validate recommendations with qualified security professionals
|
| 245 |
+
2. **Domain-Specific:** Optimized for CVE vulnerability analysis; may not generalize to other security domains
|
| 246 |
+
3. **Training Data Scope:** Limited to vulnerability types and patterns seen during training
|
| 247 |
+
4. **No Real-Time Intelligence:** Trained on historical data; doesn't know about latest threats
|
| 248 |
+
5. **Response Verbosity:** Generates detailed responses (~57 words average); may need summarization for some use cases
|
| 249 |
|
| 250 |
+
## 📁 Model Architecture
|
| 251 |
|
| 252 |
+
- **Base Architecture:** DeepSeek-R1-0528-Qwen3-8B
|
| 253 |
+
- **Parameters:** ~8 billion
|
| 254 |
+
- **Precision:** BF16 (merged model)
|
| 255 |
+
- **Adapter Type:** DoRA (rank-32)
|
| 256 |
+
- **Context Length:** 2048 tokens (training), 4096 tokens (base model capability)
|
| 257 |
+
- **Vocabulary Size:** 151,671 tokens
|
| 258 |
|
| 259 |
+
## 🔗 Related Resources
|
|
|
|
|
|
|
|
|
|
|
|
|
| 260 |
|
| 261 |
+
- **Base Model:** [deepseek-ai/DeepSeek-R1-0528-Qwen3-8B](https://huggingface.co/deepseek-ai/DeepSeek-R1-0528-Qwen3-8B)
|
| 262 |
+
- **PEFT Library:** [huggingface/peft](https://github.com/huggingface/peft)
|
| 263 |
+
- **CVE Database:** [cve.mitre.org](https://cve.mitre.org/)
|
| 264 |
+
- **Training Framework:** Transformers + PEFT
|
| 265 |
+
- **LoRA Adapter Version:** [sainikhiljuluri/deepseek-r1-cve-finetuned](https://huggingface.co/sainikhiljuluri/deepseek-r1-cve-finetuned) (177MB)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 266 |
|
| 267 |
+
## 📝 Citation
|
| 268 |
|
| 269 |
If you use this model in your research or applications, please cite:
|
| 270 |
|
| 271 |
```bibtex
|
| 272 |
+
@misc{deepseek-r1-cve-merged-2025,
|
| 273 |
+
author = {Sainikhil Juluri},
|
| 274 |
+
title = {DeepSeek-R1 Fine-tuned on CVE Policy Recommendations},
|
| 275 |
year = {2025},
|
| 276 |
publisher = {Hugging Face},
|
| 277 |
+
howpublished = {\url{https://huggingface.co/sainikhiljuluri/deepseek-r1-cve-merged}},
|
| 278 |
note = {Fine-tuned using LoRA/DoRA on CVE policy recommendations dataset}
|
| 279 |
}
|
| 280 |
```
|
|
|
|
| 291 |
}
|
| 292 |
```
|
| 293 |
|
| 294 |
+
## 📧 Contact
|
| 295 |
|
| 296 |
+
For questions, issues, or collaborations:
|
| 297 |
+
- 💬 Open an issue on the model repository
|
| 298 |
+
- 🗨️ Use HuggingFace discussions
|
| 299 |
+
- 📧 Contact via HuggingFace profile
|
| 300 |
+
|
| 301 |
+
## 📜 License
|
| 302 |
+
|
| 303 |
+
This model is released under the **Apache 2.0 License**.
|
| 304 |
+
|
| 305 |
+
## ⚠️ Ethical Considerations and Disclaimer
|
| 306 |
+
|
| 307 |
+
### Responsible Use
|
| 308 |
+
|
| 309 |
+
🔒 **Security Context:**
|
| 310 |
+
- This model is provided for assistance and should be used responsibly with appropriate human oversight
|
| 311 |
+
- Security recommendations should be validated by qualified cybersecurity professionals
|
| 312 |
+
- Do not rely solely on AI-generated recommendations for critical security decisions
|
| 313 |
+
- Consider organizational context, risk tolerance, and specific requirements
|
| 314 |
+
|
| 315 |
+
⚠️ **Potential Risks:**
|
| 316 |
+
- Model outputs may contain errors or incomplete information
|
| 317 |
+
- Recommendations might not account for specific organizational constraints
|
| 318 |
+
- Should not replace comprehensive security audits or penetration testing
|
| 319 |
+
- May not cover all aspects of complex vulnerabilities
|
| 320 |
+
|
| 321 |
+
### Bias and Fairness
|
| 322 |
|
| 323 |
+
- Model trained on historical CVE data may reflect biases in vulnerability reporting
|
| 324 |
+
- May prioritize certain vulnerability types over others based on training distribution
|
| 325 |
+
- Should not be the sole factor in security resource allocation decisions
|
| 326 |
|
| 327 |
+
### Best Practices
|
|
|
|
|
|
|
|
|
|
| 328 |
|
| 329 |
+
✅ **Do:**
|
| 330 |
+
- Use as a starting point for security analysis
|
| 331 |
+
- Validate all recommendations with security experts
|
| 332 |
+
- Test recommendations in non-production environments
|
| 333 |
+
- Document the role of AI in your security workflow
|
| 334 |
+
- Maintain human oversight for critical decisions
|
| 335 |
|
| 336 |
+
❌ **Don't:**
|
| 337 |
+
- Use for automated remediation without review
|
| 338 |
+
- Apply recommendations without understanding context
|
| 339 |
+
- Share sensitive organizational data with the model
|
| 340 |
+
- Rely exclusively on AI for security decisions
|
| 341 |
+
- Deploy in production without thorough testing
|
| 342 |
|
| 343 |
---
|
| 344 |
|
| 345 |
+
**Built with:** 🤖 Transformers • 🔥 PEFT • ⚡ LoRA/DoRA • 🛡️ Cybersecurity Focus
|
| 346 |
|
| 347 |
+
**For research and educational purposes. Always validate security findings with professional security tools and experts.**
|
model-00001-of-00004.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4902257696
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ce9d4045a7d5f95f94f998a413da0c4a066f0b1a80c3135b83e5cad278f5de8b
|
| 3 |
size 4902257696
|
model-00002-of-00004.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4915960368
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a923f50a8688aba8fd6d8b223053532d87dbccf877fe3e4a0ed57798b18992f4
|
| 3 |
size 4915960368
|
model-00003-of-00004.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4983068496
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:73189c19c3bcf4ed9930689c58d0b23b344a1eaf8627320c74c1003840ed4f86
|
| 3 |
size 4983068496
|
model-00004-of-00004.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 1580230264
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:941628afe7604157648d32de740b22143bf6c91b2715ee595a2805bc972d27ac
|
| 3 |
size 1580230264
|