base_model: unsloth/Qwen3.5-9B
library_name: transformers
license: apache-2.0
language:
- en
pipeline_tag: image-text-to-text
tags: - cybersecurity
- abliterated
- qwen3.5
Qwen3.5-9B CyberSecurity (Abliterated)
unsloth/Qwen3.5-9B with the LoRA adapterjeonjw/Qwen3.5-9B-CyberSecurity-LoRA merged in, followed by
refusal-direction ablation ("abliteration").
Method
- Merged the cybersecurity LoRA into the base model at fp16.
- Ran a set of harmful and harmless prompts through the merged model and captured the
last-token residual state at every decoder layer. - Derived one refusal direction per layer from the mean activation difference
(mean(harmful) - mean(harmless)). - Projected that direction out of every weight matrix whose output feeds the
residual stream:
| module | layers |
|---|---|
self_attn.o_proj |
full-attention layers |
linear_attn.out_proj |
hybrid linear-attention layers (24 of 32) |
mlp.down_proj |
all layers |
Projection strength scale = 1.0 (1.0 removes the direction completely; values
above 1.0 over-correct at the cost of model quality).
The vision tower is untouched. The MTP head is not present in this checkpoint
(transformers ignores mtp.* keys on load), so pass --no-mtp when converting to
GGUF.
Refusal rate
Measured on 6 held-out offensive-security prompts, greedy decoding,enable_thinking=False: 17% (no baseline measured)
Refusal detection is a keyword heuristic, so treat this as indicative rather than
authoritative.
Usage
import torch
from transformers import AutoModelForImageTextToText, AutoProcessor
model_id = "jeonjw/Qwen3.5-9B-CyberSecurity-Abliterated"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForImageTextToText.from_pretrained(
model_id, dtype=torch.bfloat16, device_map="auto"
)
messages = [
{"role": "system", "content": "You are a cybersecurity expert focused on defensive security, vulnerability analysis and authorized testing."},
{"role": "user", "content": "Explain how a format string vulnerability works and how to remediate it."},
]
text = processor.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True, enable_thinking=False
)
inputs = processor(text=[text], return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=512, do_sample=False)
print(processor.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
A GGUF build is published separately atjeonjw/Qwen3.5-9B-CyberSecurity-Abliterated-GGUF.
Limitations
- Abliteration removes a direction from the weights; it does not remove the behaviour
the model was trained on. Some requests will still be declined. - A single direction per layer is projected out. Refusal is not one-dimensional, so
residual refusal behaviour can remain. - Safety alignment is intentionally weakened. Outputs may be unsafe or incorrect.
- Intended for lawful use: security research, vulnerability analysis and defensive
work in authorized environments. No warranty of any kind.