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:
1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4model = AutoModelForCausalLM.from_pretrained(
5 "DexopT/Qwen3-4B-Cybersecurity",
6 torch_dtype=torch.float16,
7 device_map="auto",
8)
9tokenizer = AutoTokenizer.from_pretrained("DexopT/Qwen3-4B-Cybersecurity")
10
11messages = [
12 {"role": "system", "content": "You are an expert cybersecurity assistant."},
13 {"role": "user", "content": "Explain how SQL injection works and how to prevent it."}
14]
15
16text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
17inputs = tokenizer(text, return_tensors="pt").to(model.device)
18
19with torch.no_grad():
20 outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.7, top_p=0.8)
21
22print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
1pip install mlx-lm
2
3mlx_lm.convert \
4 --hf-path DexopT/Qwen3-4B-Cybersecurity \
5 --mlx-path ~/models/qwen3-cyber-mlx \
6 --quantize --q-bits 8
7
8mlx_lm.chat --model ~/models/qwen3-cyber-mlx
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: