CoolFace
Modelpublic

DexopT/Qwen3-4B-Cybersecurity

sourceHugging Faceapache-2.0updated 6mo agoView on Hugging Face
2likes729downloads
Model Card

<div align="center">

<picture> <source media="(prefers-color-scheme: dark)" srcset="https://huggingface.co/datasets/Qwen/documentation-images/resolve/main/Qwen-logoWhite.png"> <source media="(prefers-color-scheme: light)" srcset="https://huggingface.co/datasets/Qwen/documentation-images/resolve/main/Qwen-logoBlack.png"> <img alt="Qwen Logo" src="https://huggingface.co/datasets/Qwen/documentation-images/resolve/main/Qwen-logo_Black.png" width="180"/> </picture>

Qwen3-4B-Cybersecurity

Qwen3-4B fine-tuned on 1.28M cybersecurity samples

![Base Model](https://huggingface.co/unsloth/Qwen3-4B-Instruct-2507) ![Heretic Version](https://huggingface.co/DexopT/Qwen3-4B-Cybersecurity-Heretic-16bit) ![GGUF](https://huggingface.co/DexopT/Qwen3-4B-Cybersecurity-GGUF) ![Dataset](https://huggingface.co/datasets/DexopT/cyberheretic) [![License](https://img.shields.io/badge/License-Apache2.0-yellow?style=flat-square)](https://apache.org/licenses/LICENSE-2.0)

</div>


๐Ÿ”ช Abliterated (refusal-removed) version: DexopT/Qwen3-4B-Cybersecurity-Heretic-16bit

Model Description

Qwen3-4B-Cybersecurity is a fine-tuned version of Qwen3-4B-Instruct-2507 specialized in cybersecurity topics including offensive security, penetration testing, vulnerability analysis, malware analysis, and threat intelligence.

Trained with Unsloth SFT on a curated dataset of 1,284,369 samples covering:

  • โ€”๐Ÿ”ด Offensive Security โ€” SQL injection, XSS, buffer overflows, reverse shells
  • โ€”๐Ÿ”ต Defensive Security โ€” CVE analysis, incident response, hardening
  • โ€”๐ŸŸก Network Security โ€” MITM, ARP spoofing, DNS poisoning, DDoS
  • โ€”๐ŸŸข Active Directory โ€” Kerberoasting, Pass-the-Hash, Golden Ticket attacks
  • โ€”โšซ Malware Analysis โ€” Ransomware, rootkits, persistence techniques
  • โ€”๐ŸŸฃ Web Security โ€” SSRF, XXE, CSRF, LFI/RFI, deserialization

Model Family

ModelDescriptionLink
Qwen3-4B-CybersecurityBase fine-tuned model (this repo)๐Ÿ“ You are here
Qwen3-4B-Cybersecurity-Heretic-16bitAbliterated โ€” refusal directions removedโ†’
Qwen3-4B-Cybersecurity-GGUFQ80 + Q4K_M quantized for llama.cppโ†’

Training Details

ParameterValue
Base modelQwen3-4B-Instruct-2507
Training frameworkUnsloth + TRL SFTTrainer
Training samples1,284,369
Training steps800
LoRA rank16
Context length2048
Batch size2 ร— 4 = 8 (effective)
Learning rate2e-4
LR schedulerCosine
OptimizerAdamW 8bit
Format16bit merged safetensors
PlatformGoogle Colab T4

Datasets

DatasetSamplesDescription
DexopT/cyber_heretic1,284,369Raw unified cybersecurity dataset (JSONL)
DexopT/cyber_heretic_tokenized1,284,369Pre-tokenized Arrow dataset (1024 ctx)

Dataset sources include .jsonl, .json, .csv, .parquet, and .arrow formats from multiple cybersecurity repositories, converted to unified OpenAI messages format.


Usage

Transformers

python
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

model = AutoModelForCausalLM.from_pretrained(
    "DexopT/Qwen3-4B-Cybersecurity",
    torch_dtype=torch.float16,
    device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained("DexopT/Qwen3-4B-Cybersecurity")

messages = [
    {"role": "system", "content": "You are an expert cybersecurity assistant."},
    {"role": "user", "content": "Explain how SQL injection works and how to prevent it."}
]

text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)

with torch.no_grad():
    outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.7, top_p=0.8)

print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))

MLX (Apple Silicon)

bash
pip install mlx-lm

mlx_lm.convert \
  --hf-path DexopT/Qwen3-4B-Cybersecurity \
  --mlx-path ~/models/qwen3-cyber-mlx \
  --quantize --q-bits 8

mlx_lm.chat --model ~/models/qwen3-cyber-mlx

LM Studio / llama.cpp / Ollama

Use the GGUF version: DexopT/Qwen3-4B-Cybersecurity-GGUF


Refusal Behavior

This model retains some of the original refusal behavior from the base Qwen3 model. For a version with refusal directions removed via Heretic abliteration, see:

๐Ÿ”ช DexopT/Qwen3-4B-Cybersecurity-Heretic-16bit

โš ๏ธ Disclaimer

This model is intended for educational and research purposes only. Use responsibly and only on systems you have explicit permission to test. The authors are not responsible for any misuse.


Links

๐Ÿ”ช Heretic VersionDexopT/Qwen3-4B-Cybersecurity-Heretic-16bit
๐Ÿ“ฆ GGUF (Q8 + Q4)DexopT/Qwen3-4B-Cybersecurity-GGUF
๐Ÿ“Š Training DatasetDexopT/cyber_heretic
๐Ÿ”ง Base Modelunsloth/Qwen3-4B-Instruct-2507
๐Ÿ  Qwen3 CollectionQwen3 on HuggingFace