Downloads · 30 days
18
3% of all-time downloads
emulsazib/Qwen3-4B-Instruct-2507-GRPO-CTI
Qwen3-4B-Instruct-2507-GRPO-CTI is a text generation model from emulsazib. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
CyberSentinel CTI is a 4-billion-parameter language model for cyber threat intelligence (CTI) tasks. It is a fine-tune of Qwen/Qwen3-4B-Instruct-2507 trained with GRPO (Group Relative Policy Optimization) using Unslot…
Downloads · 30 days
18
3% of all-time downloads
All-time downloads
541
Public
Parameters
4B
10.6 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors8 GB · 76%
From the Hugging Face model README
CyberSentinel CTI is a 4-billion-parameter language model for cyber threat
intelligence (CTI) tasks. It is a fine-tune of
Qwen/Qwen3-4B-Instruct-2507
trained with GRPO (Group Relative Policy Optimization) using
Unsloth and
TRL, with reward functions that shape both
the format of the output and the correctness of the answer.
This repository ships the model in two forms:
| Format | File | Size | Use with |
|---|---|---|---|
| Full precision (bf16) | model-0000*-of-00002.safetensors | ~8.0 GB | 🤗 Transformers, vLLM |
| Quantized (Q4_K_M) | cybersentinel-cti-q4_k_m.gguf | ~2.5 GB | llama.cpp, Ollama, LM Studio |
ℹ️ Before publishing, replace
your-username/cybersentinel-ctiin the examples below with the actual Hugging Face repository id.
Qwen/Qwen3-4B-Instruct-2507
(via the unsloth/Qwen3-4B-Instruct-2507 4-bit build)<|im_start|>role … <|im_end|>)config.json)| Field | Value |
|---|---|
| Architecture | Qwen3ForCausalLM |
| Hidden size | 2560 |
| Layers | 36 |
| Attention heads | 32 (8 KV heads, GQA) |
| Intermediate size | 9728 |
| Vocab size | 151,936 |
| RoPE theta | 5,000,000 |
| Dtype | bfloat16 |
CyberSentinel CTI is intended to assist defensive security and threat-intelligence workflows, for example:
This model is released for defensive and educational purposes. It must not be used to develop malware, plan or carry out attacks, target individuals or organizations, evade detection, or otherwise cause harm. As with any LLM, outputs can be incorrect, incomplete, or fabricated — treat everything it produces as a draft to be verified by a qualified human analyst before it informs any security decision.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "your-username/cybersentinel-cti"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="bfloat16", device_map="auto")
messages = [
{"role": "system", "content": "You are CyberSentinel, a cyber threat intelligence analyst."},
{"role": "user", "content": "Summarize the TTPs described in this report and map them to MITRE ATT&CK: ..."},
]
inputs = tokenizer.apply_chat_template(
messages, add_generation_prompt=True, return_tensors="pt"
).to(model.device)
outputs = model.generate(inputs, max_new_tokens=512, temperature=0.7, top_p=0.8)
print(tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True))
./llama-cli -m cybersentinel-cti-q4_k_m.gguf \
-p "You are CyberSentinel, a cyber threat intelligence analyst." -cnv
# Modelfile
FROM ./cybersentinel-cti-q4_k_m.gguf
ollama create cybersentinel-cti -f Modelfile
ollama run cybersentinel-cti
The model was trained with GRPO (introduced in
DeepSeekMath) on top of the base
Qwen3-4B-Instruct-2507. LoRA adapters were attached to the attention and MLP
projections (q/k/v/o_proj, gate/up/down_proj), trained, then merged into the
16-bit base weights and additionally exported to GGUF Q4_K_M via llama.cpp.
Three reward functions shaped the policy:
format_reward_func — binary (0/1) reward for producing the required output structure.correctness_reward_func — task reward in the range −1 … +2 for a correct answer.soft_format_reward_func — partial-credit reward in 0 … 0.5 for near-correct formatting.| Setting | Value |
|---|---|
| Method | GRPO (RL) with LoRA (r=16, α=16, dropout=0.0) |
| Total steps | 2,000 |
| Generations per prompt (G) | 4 |
| Prompts per step | 4 |
| Effective batch size | 16 (4 × grad-accum 4) |
| Epochs | ~0.54 (≈8,000 prompts of 14,923 rows) |
| Precision | bf16 |
| Sampling temperature | 0.9 |
| KL coefficient (β) | 0.04 |
| Max prompt/seq length | 1,024 tokens |
| Trainable params | 33.0M / 4.06B (0.81%) |
The training set contained 14,923 CTI prompts after filtering (13 over-long prompts dropped from 14,936), with additional validation (2,630) and test (3,170) splits. Each example pairs a CTI prompt with a reference answer used by the correctness reward.
Over training the format reward climbed toward ~0.9 and the correctness reward lifted off its −1.0 floor, indicating the policy learned both the required output structure and improved task correctness. These are training rewards, not a held-out benchmark score — see Limitations.
Recommendation: Keep a qualified human in the loop. Do not use model output as the sole basis for any security or operational decision.
Released under the Apache License 2.0 (see LICENSE), consistent
with the Apache-2.0 license of the base Qwen3-4B-Instruct-2507 model. You are free
to use, modify, and redistribute the model, including commercially, provided you
retain the license and attribution.
If you use this model, please cite it along with the base model and methods:
@misc{cybersentinel_cti_2026,
title = {CyberSentinel CTI: A Qwen3-4B Model for Cyber Threat Intelligence},
author = {Sazib, Emul},
year = {2026},
howpublished = {\url{https://huggingface.co/your-username/cybersentinel-cti}},
note = {Fine-tuned from Qwen3-4B-Instruct-2507 with GRPO}
}
Base model — Qwen3:
@misc{qwen3,
title = {Qwen3 Technical Report},
author = {Qwen Team},
year = {2025}
}
Method — GRPO:
@article{shao2024deepseekmath,
title = {DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models},
author = {Zhihong Shao and Peiyi Wang and Qihao Zhu and Runxin Xu and Junxiao Song and Mingchuan Zhang and Y. K. Li and Y. Wu and Daya Guo},
year = {2024},
eprint = {arXiv:2402.03300}
}
Tooling — TRL & Unsloth:
@misc{vonwerra2022trl,
title = {TRL: Transformer Reinforcement Learning},
author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallou{\'e}dec},
year = {2020},
howpublished = {\url{https://github.com/huggingface/trl}}
}
Trained with Unsloth for 2× faster fine-tuning.