SyedCode01 commited on
Commit
df7b32e
·
verified ·
1 Parent(s): 404a881

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +215 -0
README.md ADDED
@@ -0,0 +1,215 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ library_name: transformers
6
+ tags:
7
+ - cybersecurity
8
+ - soc
9
+ - siem
10
+ - mitre-attack
11
+ - incident-response
12
+ - threat-detection
13
+ - security-operations
14
+ - fine-tuned
15
+ - qlora
16
+ - unsloth
17
+ - gguf
18
+ - ollama
19
+ base_model: openai/gpt-oss-20b
20
+ model-index:
21
+ - name: rhythmai-cybersec-20b
22
+ results:
23
+ - task:
24
+ type: text-generation
25
+ name: Cybersecurity Q&A
26
+ metrics:
27
+ - type: eval_loss
28
+ value: 0.5773
29
+ name: Validation Loss
30
+ - type: train_loss
31
+ value: 0.4873
32
+ name: Training Loss
33
+ datasets:
34
+ - AlicanKiraz0/Cybersecurity-Dataset-Fenrir-v2.0
35
+ - Trendyol/Trendyol-Cybersecurity-Instruction-Tuning-Dataset
36
+ pipeline_tag: text-generation
37
+ ---
38
+
39
+ # RhythmAI Cybersec 20B
40
+
41
+ A cybersecurity-specialized language model fine-tuned from [OpenAI GPT-OSS-20B](https://huggingface.co/openai/gpt-oss-20b) for Security Operations Center (SOC) tasks including alarm investigation, threat analysis, MITRE ATT&CK mapping, incident response, and log analysis.
42
+
43
+ Built for [RhythmAI](https://github.com/SyedCode01) -- an AI-powered SOC platform that integrates with LogRhythm SIEM.
44
+
45
+ ## Model Details
46
+
47
+ | Property | Value |
48
+ |----------|-------|
49
+ | **Base Model** | [openai/gpt-oss-20b](https://huggingface.co/openai/gpt-oss-20b) (MoE, 21B total / 3.6B active params) |
50
+ | **Architecture** | Mixture of Experts (MoE) with MXFP4 native quantization |
51
+ | **Fine-tuning Method** | QLoRA (4-bit) via [Unsloth](https://github.com/unslothai/unsloth) |
52
+ | **LoRA Rank** | 32 |
53
+ | **LoRA Alpha** | 64 |
54
+ | **LoRA Dropout** | 0.05 |
55
+ | **Target Modules** | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
56
+ | **Training Precision** | 4-bit QLoRA with BF16 compute |
57
+ | **Context Length** | 4,096 tokens |
58
+ | **GGUF Format** | MXFP4 (13 GB) |
59
+ | **License** | Apache 2.0 (inherited from GPT-OSS) |
60
+
61
+ ## Training Data
62
+
63
+ Fine-tuned on **9,702 curated cybersecurity examples** from public datasets, filtered for SOC/SIEM relevance:
64
+
65
+ | Source | Original Size | After Filtering | Description |
66
+ |--------|--------------|-----------------|-------------|
67
+ | [Fenrir v2.0](https://huggingface.co/datasets/AlicanKiraz0/Cybersecurity-Dataset-Fenrir-v2.0) | 83,920 | ~5,000 | General cybersecurity Q&A |
68
+ | [Trendyol Cybersecurity](https://huggingface.co/datasets/Trendyol/Trendyol-Cybersecurity-Instruction-Tuning-Dataset) | 53,202 | ~5,000 | Instruction-tuned cybersecurity |
69
+
70
+ **Filtering criteria**: Keyword relevance scoring (minimum 2 matches from 60+ SOC-relevant terms including SIEM, MITRE ATT&CK, incident response, threat detection, log analysis, etc.), response length between 50-15,000 characters, MD5-based deduplication.
71
+
72
+ **Split**: 9,217 train (95%) / 485 validation (5%)
73
+
74
+ **Format**: OpenAI-compatible chat format:
75
+ ```json
76
+ {"messages": [{"role": "system", "content": "..."}, {"role": "user", "content": "..."}, {"role": "assistant", "content": "..."}]}
77
+ ```
78
+
79
+ ## Training Details
80
+
81
+ | Parameter | Value |
82
+ |-----------|-------|
83
+ | **GPU** | NVIDIA RTX PRO 6000 Blackwell (96 GB VRAM) |
84
+ | **Framework** | Unsloth 2026.3.3 + Transformers 5.2.0 |
85
+ | **Epochs** | 3 |
86
+ | **Effective Batch Size** | 8 (2 per device x 4 gradient accumulation) |
87
+ | **Learning Rate** | 2e-4 (cosine schedule, 5% warmup) |
88
+ | **Optimizer** | AdamW 8-bit |
89
+ | **Weight Decay** | 0.01 |
90
+ | **Max Sequence Length** | 4,096 |
91
+ | **Packing** | Enabled (short examples packed together) |
92
+ | **Gradient Checkpointing** | Unsloth optimized (30% VRAM savings) |
93
+ | **Total Steps** | 3,459 |
94
+ | **Training Time** | ~12.5 hours |
95
+ | **Trainable Parameters** | 67M / 21B (0.32%) |
96
+
97
+ ## Training Metrics
98
+
99
+ | Metric | Value |
100
+ |--------|-------|
101
+ | **Final Training Loss** | 0.4873 |
102
+ | **Final Validation Loss** | 0.5774 |
103
+ | **Best Validation Loss** | 0.5773 (step 3,000) |
104
+ | **Initial Validation Loss** | 0.7866 (step 100) |
105
+
106
+ The model shows consistent improvement across training with no signs of overfitting (validation loss closely tracks training loss).
107
+
108
+ ## Capabilities
109
+
110
+ This model is specialized for:
111
+
112
+ - **Alarm Investigation**: Analyzing security alarms from SIEM platforms with contextual threat assessment
113
+ - **MITRE ATT&CK Mapping**: Identifying tactics, techniques, and procedures (TTPs) from security events
114
+ - **Incident Response**: Generating structured incident response playbooks and triage recommendations
115
+ - **Threat Analysis**: Assessing threat severity, identifying indicators of compromise (IOCs)
116
+ - **Log Analysis**: Interpreting Windows Event Logs, firewall logs, IDS/IPS alerts, and authentication logs
117
+ - **Detection Engineering**: Suggesting detection rules and correlation logic
118
+ - **Compliance Guidance**: NIST, PCI-DSS, HIPAA, GDPR security control recommendations
119
+
120
+ ## Usage
121
+
122
+ ### With Ollama (Recommended)
123
+
124
+ ```bash
125
+ # Create the model from GGUF
126
+ ollama create rhythmai-cybersec-20b -f Modelfile
127
+
128
+ # Run interactively
129
+ ollama run rhythmai-cybersec-20b "Analyze this security event: Multiple failed RDP login attempts from IP 203.0.113.45 targeting the domain controller, followed by a successful login and immediate PowerShell execution."
130
+
131
+ # Use via API
132
+ curl http://localhost:11434/api/chat -d '{
133
+ "model": "rhythmai-cybersec-20b",
134
+ "messages": [
135
+ {"role": "system", "content": "You are a senior SOC analyst. Analyze security events and provide actionable recommendations."},
136
+ {"role": "user", "content": "What MITRE ATT&CK techniques are associated with credential dumping?"}
137
+ ]
138
+ }'
139
+ ```
140
+
141
+ ### With Transformers + PEFT (Adapter)
142
+
143
+ ```python
144
+ from peft import PeftModel
145
+ from transformers import AutoModelForCausalLM, AutoTokenizer
146
+
147
+ base_model = AutoModelForCausalLM.from_pretrained("openai/gpt-oss-20b", device_map="auto")
148
+ model = PeftModel.from_pretrained(base_model, "SyedCode01/rhythmai-cybersec-20b", subfolder="adapter")
149
+ tokenizer = AutoTokenizer.from_pretrained("SyedCode01/rhythmai-cybersec-20b", subfolder="adapter")
150
+
151
+ messages = [
152
+ {"role": "system", "content": "You are a cybersecurity expert specializing in SOC operations."},
153
+ {"role": "user", "content": "Explain lateral movement in the context of MITRE ATT&CK."}
154
+ ]
155
+ inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)
156
+ outputs = model.generate(inputs, max_new_tokens=512, temperature=0.7)
157
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
158
+ ```
159
+
160
+ ## Example Output
161
+
162
+ **Prompt**: "What is lateral movement in cybersecurity?"
163
+
164
+ **Response**: Lateral movement in cybersecurity refers to the techniques attackers use to navigate through a network or system after gaining initial access. Once an attacker compromises a single device or account -- often with relatively low privileges -- they employ lateral movement to expand their reach, elevate their access levels, and ultimately achieve broader objectives such as data exfiltration or system control. This process involves moving from one compromised asset to another, leveraging existing network paths, user credentials, and administrative tools. Attackers might use legitimate remote management protocols (e.g., RDP, SSH), stolen passwords, or exploit vulnerabilities in software to traverse the environment. It's a critical phase in advanced persistent threat (APT) campaigns, as it enables attackers to remain stealthy over extended periods by using normal administrative functions and legitimate credentials.
165
+
166
+ ## File Structure
167
+
168
+ ```
169
+ rhythmai-cybersec-20b/
170
+ adapter/ # LoRA adapter weights (PEFT)
171
+ adapter_config.json
172
+ adapter_model.safetensors
173
+ tokenizer.json
174
+ tokenizer_config.json
175
+ gguf-q4_k_m_gguf/ # GGUF for Ollama deployment
176
+ gpt-oss-20b.MXFP4.gguf # 13 GB quantized model
177
+ Modelfile # Ollama model definition
178
+ README.md # This model card
179
+ ```
180
+
181
+ ## Intended Use
182
+
183
+ This model is designed for cybersecurity professionals, SOC analysts, and security teams who need AI assistance with:
184
+ - Security alarm triage and investigation
185
+ - Threat intelligence analysis
186
+ - Incident response planning
187
+ - Security posture assessment
188
+ - MITRE ATT&CK framework mapping
189
+
190
+ ## Limitations
191
+
192
+ - **Domain-specific**: Optimized for cybersecurity tasks; general knowledge may be less reliable than the base model
193
+ - **Not a replacement for human analysts**: Outputs should be validated by qualified security professionals
194
+ - **Training data bias**: Performance may vary for threats or attack patterns not well-represented in the training data
195
+ - **Context window**: Limited to 4,096 tokens; very long log files or reports may need to be chunked
196
+ - **No real-time data**: The model does not have access to real-time threat intelligence feeds
197
+
198
+ ## Citation
199
+
200
+ ```bibtex
201
+ @misc{rhythmai-cybersec-20b,
202
+ title={RhythmAI Cybersec 20B: A Fine-Tuned Cybersecurity Language Model},
203
+ author={Syed Hasan Iqbal},
204
+ year={2026},
205
+ url={https://huggingface.co/SyedCode01/rhythmai-cybersec-20b},
206
+ note={Fine-tuned from OpenAI GPT-OSS-20B for SOC operations}
207
+ }
208
+ ```
209
+
210
+ ## Acknowledgments
211
+
212
+ - [OpenAI](https://openai.com) for the GPT-OSS-20B base model (Apache 2.0)
213
+ - [Unsloth](https://github.com/unslothai/unsloth) for efficient QLoRA fine-tuning
214
+ - [AlicanKiraz0](https://huggingface.co/AlicanKiraz0) for the Fenrir v2.0 cybersecurity dataset
215
+ - [Trendyol](https://huggingface.co/Trendyol) for the cybersecurity instruction tuning dataset