File size: 5,795 Bytes
ade7974
 
 
 
dc4b429
 
 
 
 
 
ade7974
dc4b429
ade7974
dc4b429
 
 
 
 
ade7974
 
dc4b429
 
 
 
 
 
 
 
 
 
 
 
 
4e6a6b3
dc4b429
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ade7974
a0858db
dc4b429
a0858db
 
 
ade7974
dc4b429
ade7974
dc4b429
ade7974
dc4b429
 
 
 
ade7974
dc4b429
 
ade7974
dc4b429
ade7974
dc4b429
ade7974
dc4b429
ade7974
dc4b429
 
 
 
 
 
 
 
ade7974
dc4b429
ade7974
dc4b429
 
 
 
 
 
 
 
 
 
 
 
ade7974
dc4b429
ade7974
dc4b429
ade7974
dc4b429
 
 
ade7974
dc4b429
ade7974
dc4b429
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ade7974
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
---
library_name: transformers
tags:
- generated_from_trainer
- cybersecurity
- continual-pretraining
- targeted-pretraining
- text-generation
- casual-lm
- risys-lab
model-index:
- name: RedSage-Qwen3-8B-Base
  results: []
language:
- en
base_model:
- RISys-Lab/RedSage-Qwen3-8B-CFW
pipeline_tag: text-generation
---

# RedSage-Qwen3-8B-Base

<div align="center">
  <img src="https://img.shields.io/badge/Task-Cybersecurity-red" alt="Cybersecurity"> 
  <img src="https://img.shields.io/badge/Stage-Targeted_Pretraining-blue" alt="Targeted Pretraining">
</div>

## Model Summary

**RedSage-Qwen3-8B-Base** is a cybersecurity-specialized Large Language Model (LLM) developed by **RISys-Lab**. It represents the **second stage** of the RedSage pre-training pipeline.

This model builds upon **RedSage-Qwen3-8B-CFW** by undergoing **Targeted Pre-Training** on high-quality, curated cybersecurity resources (`RedSage-Seed` and `RedSage-Dump`). While the previous stage focused on breadth using web data, this stage focuses on depth, technical standards, and verified skills.

- **Paper:** [RedSage: A Cybersecurity Generalist LLM](https://openreview.net/forum?id=W4FAenIrQ2) ([arXiv](https://arxiv.org/abs/2601.22159))
- **Repository:** [GitHub](https://github.com/RISys-Lab/RedSage)
- **Base Model:** [RISys-Lab/RedSage-Qwen3-8B-CFW](https://huggingface.co/RISys-Lab/RedSage-Qwen3-8B-CFW)
- **Variant:** Base (Final Pre-trained Checkpoint)

## Intended Use

This model is a **base model** intended for:
1.  **Fine-tuning:** Serving as a high-quality foundation for downstream cybersecurity tasks (e.g., incident response, malware analysis).
2.  **Research:** Investigating the impact of curated versus web-scale data in domain adaptation.
3.  **Completion:** Code completion and technical writing in cybersecurity contexts.

**Note:** As a base model, this checkpoint has **not** been instruction-tuned (SFT) or aligned (DPO). It behaves like a completion engine. For a chat-ready assistant, please see `RISys-Lab/RedSage-Qwen3-8B-DPO`.

## Training Lineage

RedSage employs a multi-stage training pipeline. This model represents the output of **Stage 2**.

1.  Stage 1: Continual Pre-Training (CPT) -> [RedSage-Qwen3-8B-CFW](https://huggingface.co/RISys-Lab/RedSage-Qwen3-8B-CFW) (CyberFineWeb data)
2.  **Stage 2: Targeted Pre-Training** -> **`RedSage-Qwen3-8B-Base`** (Current Model)
    * *Data:* RedSage-Seed (\~150M Tokens) + RedSage-Dump (\~700M Tokens)
4.  Stage 3: Supervised Fine-Tuning (SFT) -> [RedSage-Qwen3-8B-Ins](https://huggingface.co/RISys-Lab/RedSage-Qwen3-8B-Ins)
5.  Stage 4: Direct Preference Optimization (DPO) -> [RedSage-Qwen3-8B-DPO](https://huggingface.co/RISys-Lab/RedSage-Qwen3-8B-DPO)

## Training Data: RedSage-Seed & Dump

This model was trained on approximately **850 million tokens** of curated data, split into two collections:

1.  **RedSage-Seed (~150M Tokens):** A highly curated collection of 28,637 samples converted to structured Markdown.
    * **Knowledge:** General concepts and Frameworks (MITRE ATT&CK, CAPEC, CWE, OWASP).
    * **Skills:** Offensive security resources including write-ups, hacking techniques, and payload examples.
    * **Tools:** Manuals and cheat sheets for CLI tools and Kali Linux.

2.  **RedSage-Dump (~700M Tokens):** A larger aggregation of 459K technical documents.
    * **Sources:** Computer education portals, cybersecurity news, RFC entries, NIST publications, and the National Vulnerability Database (NVD).

## Performance

RedSage-8B-Base achieves state-of-the-art performance among 8B models, showing significant improvements over the general-purpose Qwen3-8B-Base. It achieves the highest mean score on external benchmarks among all 8B base models tested.

### RedSage-Bench (0-shot Accuracy)

| Category | Qwen3-8B-Base | **RedSage-8B-Base** |
| :--- | :---: | :---: |
| **Macro Average** | 84.24 | **85.05** |
| Knowledge (General) | 83.08 | 83.12 |
| Knowledge (Frameworks) | 81.94 | **84.94** |
| Skill (Offensive) | 88.23 | **88.72** |
| Tools (CLI) | 85.08 | **85.44** |
| Tools (Kali) | 78.86 | **79.36** |

### External Cybersecurity Benchmarks (5-shot)

| Benchmark | Qwen3-8B-Base | **RedSage-8B-Base** |
| :--- | :---: | :---: |
| **Mean** | 80.81 | **84.56** |
| CTI-Bench (MCQ) | 68.80 | **71.04** |
| CTI-Bench (RCM) | 63.50 | **78.40** |
| CyberMetric (500) | 92.00 | **92.60** |
| MMLU (Security) | 83.00 | **87.00** |
| SecBench (En) | **82.84** | 81.76 |
| SecEva (MCQ) | 75.60 | **75.83** |
| SECURE (CWET) | 92.70 | **93.22** |
| SECURE (KCV) | 75.05 | **87.20** |
| SECURE (MEAT) | 93.81 | **94.00** |

## Training Procedure

The model was trained using the [Axolotl](https://github.com/axolotl-ai-cloud/axolotl) framework.

- **Learning Rate:** 2.5e-6 (constant with linear warmup)
- **Optimizer:** AdamW
- **Epochs:** 1

## Usage

```python
from transformers import AutoTokenizer, AutoModelForCausalLM

model_id = "RISys-Lab/RedSage-Qwen3-8B-Base"

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")

text = "The primary difference between a firewall and an IDS is"
inputs = tokenizer(text, return_tensors="pt").to("cuda")

outputs = model.generate(**inputs, max_new_tokens=50)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```

## Citation

If you use this model or dataset, please cite our paper:

```
@inproceedings{suryanto2026redsage,
  title={RedSage: A Cybersecurity Generalist {LLM}},
  author={Naufal Suryanto and Muzammal Naseer and Pengfei Li and Syed Talal Wasim and Jinhui Yi and Juergen Gall and Paolo Ceravolo and Ernesto Damiani},
  booktitle={The Fourteenth International Conference on Learning Representations},
  year={2026},
  url={https://openreview.net/forum?id=W4FAenIrQ2}
}
```