Downloads · 30 days
57
27% of all-time downloads
sss22213/Qwen3.8-27B-Heretic-NoRefusal
Qwen3.8-27B-Heretic-NoRefusal is a image-text-to-text model from sss22213. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
An abliterated ("uncensored") version of Qwen/Qwen3.8-27B, produced with Heretic by directional ablation of the refusal direction. The weights are the original bf16 Qwen3.8-27B with the ablation merged in; the tokeniz…
Downloads · 30 days
57
27% of all-time downloads
All-time downloads
209
Public
Parameters
27.4B
54.7 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors54.7 GB · 100%
From the Hugging Face model README
An abliterated ("uncensored") version of Qwen/Qwen3.8-27B, produced with Heretic by directional ablation of the refusal direction. The weights are the original bf16 Qwen3.8-27B with the ablation merged in; the tokenizer, chat template, processor and vision encoder are unchanged, so it loads and runs exactly like the base model.
The model was not fine-tuned on any new data. Abliteration only removes the model's tendency to refuse; it does not add knowledge or capabilities.
| Base (Qwen3.8-27B) | This model | |
|---|---|---|
| Refusals on 100 held-out harmful prompts (keyword-based) | 99 / 100 | 4 / 100 |
| KL divergence from base on 100 harmless prompts (first token) | 0 | 0.0796 |
Everything below was run through Heretic WebUI, a web front end for Heretic, on a single RTX 5090 (32 GB).
Method. Classic directional ablation (Heretic master, commit bedb94e). A refusal direction is extracted from the residual stream at each layer by contrasting harmful and harmless prompts, orthogonalized against the harmless direction (orthogonalize_direction = true), and subtracted from the attention output (attn.o_proj) and MLP output (mlp.down_proj) projections with a per-layer weight profile. Row normalization was set to full, so the result is expressed as a rank-3 LoRA adapter (r = 3, lora_alpha = 3, targets o_proj / out_proj / down_proj) that preserves the original row magnitudes of each weight matrix.
Search. Optuna ran 350 trials (60 random start-up trials) over the layer index of the direction and the weight profiles of both projections, minimizing two objectives at once: the number of refusals and the KL divergence from the base model. To fit the 27B model on one GPU, the optimization ran against a bitsandbytes 4-bit copy of the base; the final adapter was then merged into the original bf16 weights on CPU with PEFT merge_and_unload, so nothing in this repository is quantized.
Data.
| Role | Dataset | Split |
|---|---|---|
| Refusal direction (harmful) | mlabonne/harmful_behaviors | train[:400] |
| Refusal direction (harmless) | mlabonne/harmless_alpaca | train[:400] |
| Refusal count (held out) | mlabonne/harmful_behaviors | test[:100] |
| KL divergence (held out) | mlabonne/harmless_alpaca | test[:100] |
Evaluation prompts come from the test split, so no prompt used for scoring was used to derive the direction. Refusals are counted by matching a list of refusal markers in the first 100 generated tokens; the list contains Heretic's English markers plus Traditional/Simplified Chinese ones (e.g. 抱歉, 我無法, 拒絕), so refusing in Chinese is counted too. All generation during direction extraction and scoring used the system prompt You are a helpful assistant. with thinking disabled (enable_thinking=False).
Selected trial. Of the 350 trials, 17 landed on the Pareto front. The exported model is trial 198, the front's lowest-refusal point:
| Trial | Refusals | KL divergence | |
|---|---|---|---|
| 198 | 4 / 100 | 0.0796 | this model |
| 202 | 9 / 100 | 0.0648 | |
| 206 | 18 / 100 | 0.0608 | |
| 173 | 41 / 100 | 0.0593 | |
| 163 | 58 / 100 | 0.0552 | |
| … | … | … | |
| 179 | 99 / 100 | 0.0002 | ≈ base |
Ablation parameters of trial 198: direction_index = 28.09; attn.o_proj: max_weight = 1.39, max_weight_position = 38.78, min_weight = 0.23, min_weight_distance = 36.11; mlp.down_proj: max_weight = 1.48, max_weight_position = 44.26, min_weight = 1.46, min_weight_distance = 31.33.
Use it exactly as you would use Qwen/Qwen3.8-27B — same chat template, same enable_thinking / reasoning_effort controls, same vision inputs. See the base model card for Transformers, vLLM and SGLang instructions; only the model name changes.
from transformers import AutoModelForImageTextToText, AutoProcessor
model_id = "sss22213/Qwen3.8-27B-Heretic-NoRefusal"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForImageTextToText.from_pretrained(model_id, dtype="auto", device_map="auto")
messages = [{"role": "user", "content": "Give me a short introduction to large language models."}]
inputs = processor.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
enable_thinking=False, # thinking is on by default, as in the base model
).to(model.device)
output = model.generate(**inputs, max_new_tokens=512)
print(processor.decode(output[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
The full bf16 checkpoint is about 55 GB in two safetensors shards. For local use on a single consumer GPU, quantize it (e.g. convert to GGUF and run with llama.cpp / Ollama).
o_proj / down_proj weights. Image and video understanding should be unaffected, but this was not tested.The run is fully described by the Heretic configuration above (Heretic master @ bedb94e, datasets and splits as listed, n_trials = 350, n_startup_trials = 60, max_response_length = 100, orthogonalize_direction = true, row_normalization = "full", full_normalization_lora_rank = 3, quantization = "bnb_4bit", disable_thinking = true). Heretic WebUI stores the study checkpoint, so any other point on the Pareto front (for example trial 202 at 9 / 100 and KL 0.0648) can be exported from the same run without re-running the search.