license: apache-2.0
license_link: https://huggingface.co/Qwen/Qwen3.8-27B/blob/main/LICENSE
base_model:
- Qwen/Qwen3.8-27B
pipeline_tag: text-generation
tags: - qwen
- qwen3
- abliterated
- uncensored
- safetensors
language: - en
- zh
Qwen3.8-27B-abliterated
Abliterated (uncensored) version of Qwen/Qwen3.8-27B with the refusal direction removed from the model weights, allowing unrestricted conversations.
What is Abliteration?
Abliteration is a technique that identifies and removes the "refusal direction" in a model's weight space. By projecting out this direction from the output projection (o_proj) and down projection (down_proj) weights across all layers, the model loses its tendency to refuse certain queries while retaining its general capabilities.
This technique is based on the research described in:
Model Details
| Property | Value |
|---|---|
| Base Model | Qwen/Qwen3.8-27B |
| Format | Safetensors (BF16) |
| Modification | Refusal direction removed |
| Layers Modified | All layers (self_attn.o_proj, mlp.down_proj) |
| Parameters | 27.78B |
Method
- Extract activations from the middle layer for 16 harmful and 16 harmless prompts
- Compute the refusal direction as the normalized mean difference between harmful and harmless activations
- Project out the refusal direction from
self_attn.o_projandmlp.down_projweights in all layers - Save the modified model in safetensors format
Usage
Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model = AutoModelForCausalLM.from_pretrained(
"douyamv/Qwen3.8-27B-abliterated",
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained("douyamv/Qwen3.8-27B-abliterated")
messages = [{"role": "user", "content": "Hello, tell me about yourself"}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer([text], return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
vLLM
vllm serve douyamv/Qwen3.8-27B-abliterated \
--tensor-parallel-size 2 \
--max-model-len 32768 \
--trust-remote-code
Disclaimer
This model is provided for research and educational purposes. The removal of safety guardrails means the model may generate content that the original model would refuse. Users are responsible for ensuring appropriate and ethical use.
Base Model Information
- Model: Qwen3.8-27B
- Parameters: 27.78B
- Architecture: Hybrid (Gated DeltaNet + Gated Attention)
- Context Length: 262,144 tokens (extensible to 1M+)
- License: Apache 2.0
Credits
Related Models
- douyamv/Qwen3.8-27B-GGUF — GGUF quantizations (Q2_K to Q8_0)
- douyamv/Qwen3.8-27B-FP8 — FP8 quantized safetensors
- douyamv/Qwen3.8-27B-abliterated-GGUF — Abliterated GGUF quantizations