license: apache-2.0
language:
- en
- zh
base_model: barozp/Qwen3.8-27B-Opus-Distill-v2
base_model_relation: finetune
library_name: transformers
pipeline_tag: image-text-to-text
tags: - qwen
- qwen3
- qwen3.8
- qwen3_5
- reasoning
- opus-distill
- abliterated
- abliteration
- uncensored
- vision
- multimodal
- mtp
- causal-lm
- conversational
- v2
Qwen3.8-27B-Opus-Distill-v2-Abliterated-L14
Architecture-aware refusal-direction ablation ofbarozp/Qwen3.8-27B-Opus-Distill-v2
at pinned revision 2c1dcd2dd468b67a893fffbe961cbbc1781465b4.
This checkpoint is the λ = 1.4 ("L14") row from a verified residual-writer
sweep. It keeps the Opus-distill reasoning transfer, the v2 loop-bug fix, native
vision, and the MTP sidecar — then orthogonalizes a single refusal direction out
of every language residual writer.
Refusal suppression is not a capability upgrade, a truthfulness upgrade, or a
license to skip evaluation. Re-test this checkpoint on the prompts and
inference settings you actually intend to use.
At a glance
| What this is | Weight-edited derivative of Opus-Distill-v2. Not a new SFT/DPO run. |
| Parent | barozp/Qwen3.8-27B-Opus-Distill-v2 @2c1dcd2 |
| Grandparent | Qwen/Qwen3.8-27B |
| Edit | Rank-1 residual-writer orthogonalization |
| Direction | Residual position 46, nothinking mode |
| Strength | λ = 1.4 (L14 in the repo name) |
| Edited tensors | 131 |
| Unchanged keys | 1,199 (vision tower + lm_head included) |
| Unexpected changes | 0 — structural verification PASS |
| Params / dtype | ~27B, BF16 safetensors |
| Context | Native 262,144 tokens (YaRN to ~1M on compatible stacks) |
| Modalities | Text, image, video |
| License | Apache-2.0 |
Diagnostic sweep row used for this upload
{
"lam": 1.4,
"refusals": "2/32",
"refusal_pct": 6.25,
"capability": "35/40",
"capability_pct": 87.5
}
Direction used for the edit
{
"position": 46,
"mode": "nothinking",
"d": 12.894421577453613,
"auc": 1.0,
"hidden": 5120,
"n_good": 32,
"n_bad": 32
}
Those 32/32 and 35/40 figures are small diagnostic sets, not AdvBench /
MMLU / GPQA. Treat them as the reason λ = 1.4 was chosen, not as a published
scorecard for this checkpoint.
Lineage
Qwen/Qwen3.8-27B
│ LoRA r=64, merged
│ 11,716 verified Claude Opus reasoning traces
▼
barozp/Qwen3.8-27B-Opus-Distill-v2 @ 2c1dcd2dd468b67a893fffbe961cbbc1781465b4
│ rank-1 refusal-direction orthogonalization
│ residual pos 46 · λ = 1.4 · 131 residual writers
▼
KarlKinda/Qwen3.8-27B-Opus-Distill-v2-Abliterated-L14
Three things stacked in this repo, in order:
- Qwen3.8-27B — 64-layer hybrid (48 Gated DeltaNet + 16 gated full-attention),
native vision encoder, native MTP head, thinking control, 262K context. - Opus-Distill-v2 — LoRA fine-tune on verified-genuine Opus traces.
Same-protocol GPQA-Diamond rose from 0.232 → 0.470 vs. base, and the v1
stacked-constraint reasoning loop was removed. - L14 abliteration — one refusal direction projected out of every language
residual writer, with vision +lm_headbit-identical to the parent.
What was edited
Built 2026-08-29T15:14:02Z withnanofatdog/LLM-abliterate@f01cec9.
The tool is architecture-aware on this hybrid checkpoint. Generic Qwen
abliteration scripts often miss linear_attn.out_proj, the embedding row
space, and the state-dict-only MTP writers. This edit does not.
| Residual writer | Count | Status |
|---|---|---|
mlp.down_proj (all 64 layers) |
64 | edited |
linear_attn.out_proj (Gated DeltaNet layers) |
48 | edited |
self_attn.o_proj (full-attention layers) |
16 | edited |
| MTP residual writers | 2 | edited |
embed_tokens |
1 | edited |
| Total edited | 131 | |
| Vision tower | — | unchanged |
lm_head |
— | unchanged |
| All other keys, including the vision/MTP sidecar | 1,199 | unchanged |
Per-tensor relative Frobenius change is recorded in ABLIT_META.json
(typically ~0.019–0.023 on the edited matrices).
Why position 46 and λ = 1.4
- Residual position 46 was forced. Automatic layer selection on this family
can lock onto a very deep residual and lobotomize the model. - Extraction mode was
nothinking. - The included sweep tested
0, 0.8, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.65.
The kit README calls 1.2 conservative and 1.4 more aggressive. - This upload is the aggressive-but-still-capable row: 2/32 residual refusals
on the diagnostic set, 35/40 capability items still passing.
The edit itself is the usual rank-1 residual-writer projection:
- output projectors: (W \leftarrow W - \lambda,\hat{r}(\hat{r}^\top W))
- embedding: (E \leftarrow E - \lambda,(E\hat{r}^\top)\hat{r})
Architecture (inherited, not retrained)
| Spec | Value |
|---|---|
| Class | Qwen3_5ForConditionalGeneration |
| Model type | qwen3_5 |
| Parameters | 27B |
| Hidden size | 5,120 |
| Layers | 64 — pattern 3 × linear_attention + 1 × full_attention, repeated |
| Full attention | 24 Q heads / 4 KV heads, head dim 256, output gate (swish) |
| Linear attention | Gated DeltaNet, 48 V / 16 QK heads, head dim 128 |
| FFN intermediate | 17,408 |
| Vocab | 248,320 (padded) |
| Context | 262,144 native; YaRN toward 1M on vLLM / SGLang |
| Vision | Native encoder (depth 27, hidden 1,152, patch 16) + video preprocessor |
| MTP | 1 extra MTP layer, sidecar in model-vision-mtp.safetensors |
| Thinking | <think>…</think> with enable_thinking and reasoning_effort ∈ {xhigh, medium, low} |
Vision and MTP were never trained in the Opus distill and were not
abliterated except for the two MTP residual writers, which were edited so
speculative decoding cannot reintroduce the same refusal direction.
Parent distill (what you actually inherited)
v2 exists because v1 had a deterministic reasoning loop: stacked format
constraints such as "no prose" + "no markdown" sent the model into
non-converging "wait, let me re-check…" passes that burned the whole token
budget with zero visible output. Credit tozxbc2023 for the exact temp=0 repro.
Root cause in v1's data: ~83% of rows came from Jackrong TraceInversion
reconstructions, not live Opus traces. That template both boosted measured
reasoning and caused the loop.
v2 rebuilt the same prompt mix with verified traces only
(lordx64 /Roman1111111/claude-opus-4.6-10000x),
then dropped 169 pathological + 2,429 unverified rows after 30 parallel
LLM-judge passes. 14,250 → 11,716 rows, 100% verified sources
(barozp/opus-reasoning-distill-v2).
v1 loop vs v2 (parent, not this edit)
Repro at temp=0, seed=1234, fib(n) + stacked constraints:
| Test | Distill v1 | Distill v2 |
|---|---|---|
"no prose" + "no markdown" |
3000/3000 tokens, 0 visible output | 87/4096 tokens, clean code |
"no prose" + "no comments" |
3000/3000 tokens, 0 visible output | 73/4096 tokens, clean code |
| Same constraints, different task | — | 43/4096 tokens, clean code |
Distill-v2 vs Qwen3.8-27B base
lm-evaluation-harness, 0-shot log-likelihood MCQ, chat template off,--limit 500. Same protocol as v1 — the Δ is the signal. These numbers
are for the parent distill, not a fresh harness run of L14.
| Task | Metric | Base | Distill v2 | Δ | v1 Δ |
|---|---|---|---|---|---|
| wikitext | word ppl ↓ | 8.4335 | 8.3788 | −0.055 | −0.09 |
| mmlu | acc | 0.8494 | 0.8476 | −0.002 | −0.001 |
| hellaswag | acc_norm | 0.7420 | 0.7500 | +0.008 | −0.002 |
| arc_challenge | acc_norm | 0.5880 | 0.6220 | +0.034 | +0.042 |
| gpqa_diamond | acc_norm | 0.2323 | 0.4697 | +0.237 | +0.263 |
Knowledge and language modeling stay flat. Reasoning moves. GPQA here is
not comparable to Qwen's published 89.2 (thinking on, different harness).
Distill training recipe (parent)
- LoRA
r=64,alpha=64,dropout=0.05, merged - Targets:
q/k/v/o_projon the 16 full-attention layers;gate/up/down_projon all 64 FFNs - 1 epoch / 696 steps,
lr=1e-4cosine, 3% warmup, effective batch 16 MAX_SEQ=4096, bf16, ~4h15m on A100 80GB- Final val loss 0.4334 (v1 0.4647; pure-genuine abortive run 0.805)
How to run
Load this repo, not the parent. Architecture class isQwen3_5ForConditionalGeneration.
Transformers — multimodal
from transformers import AutoModelForImageTextToText, AutoProcessor
import torch
model_id = "KarlKinda/Qwen3.8-27B-Opus-Distill-v2-Abliterated-L14"
model = AutoModelForImageTextToText.from_pretrained(
model_id,
dtype=torch.bfloat16,
device_map="auto",
)
processor = AutoProcessor.from_pretrained(model_id)
messages = [
{
"role": "user",
"content": [
{"type": "image", "image": "https://example.com/diagram.png"},
{"type": "text", "text": "Walk through the diagram, then answer."},
],
}
]
inputs = processor.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_dict=True,
return_tensors="pt",
enable_thinking=True,
reasoning_effort="xhigh",
).to(model.device)
out = model.generate(**inputs, max_new_tokens=4096)
print(processor.decode(out[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
Transformers — text only
AutoModelForCausalLM also works for text-only graphs. PreferAutoModelForImageTextToText if you want vision + the official chat template.
Disable thinking when you want a direct answer:
inputs = processor.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_dict=True,
return_tensors="pt",
enable_thinking=False,
).to(model.device)
Recommended sampling
Copied from the Qwen3.8-27B card and from this repo's generation_config.json.
Thinking on (enable_thinking=True, default reasoning_effort="xhigh"):
| Param | Value |
|---|---|
| temperature | 1.0 |
| top_p | 0.95 |
| top_k | 20 |
| min_p | 0.0 |
| presence_penalty | 0.0 |
| repetition_penalty | 1.0 |
Thinking off (enable_thinking=False):
| Param | Value |
|---|---|
| temperature | 0.7 |
| top_p | 0.80 |
| top_k | 20 |
| presence_penalty | 1.5 |
| repetition_penalty | 1.0 |
vLLM / SGLang should follow the official Qwen3.8-27B serving notes (MTP,
YaRN, multimodal processor). This checkpoint keeps the parent tensor layout,
so those stacks that already load Opus-Distill-v2 should load this one the
same way.
What's in this repository
| Path | Role |
|---|---|
model-00001-of-00002.safetensors |
Language weights shard 1 (~49.8 GB) |
model-00002-of-00002.safetensors |
Language weights shard 2 (~4.0 GB) |
model-vision-mtp.safetensors |
Vision encoder + MTP sidecar |
model.safetensors.index.json |
Weight index |
config.json / generation_config.json |
Model + default sampling |
tokenizer.json / tokenizer_config.json / chat_template.jinja |
Tokenizer + thinking/tool template |
preprocessor_config.json / video_preprocessor_config.json |
Image / video processor |
ABLIT_META.json |
Edit method, λ, per-tensor rel-Frobenius |
code/ |
Exact HF Jobs kit used to extract, sweep, apply, and verify |
Approximate on-disk size is ~55–56 GB BF16 plus the vision/MTP sidecar.
Reproducing the edit
The code/ tree is not decoration. It is the kit that produced this upload:
submit-analyze.sh— extract the position-46 direction, sweep λ, writesweep.jsonto a private HF bucket.submit-apply.sh— apply the chosen λ, require an exact structural
verify, then publish.
Verify fails closed unless:
- base and output have the same tensor key set
- exactly 131 expected tensors changed
- vision tensors and
lm_headare byte-identical - both MTP residual writers are present and edited
- the residual projection matches the requested λ
See code/README.md for Jobs flavor, the Transformers
5.16.1 device-placement patch, and the pinned tool revision.
Example apply invocation from that kit:
export HF_USER="your-hugging-face-username"
export ABLATION_LAMBDA="1.4"
export OUTPUT_REPO="${HF_USER}/Qwen3.8-27B-Opus-Distill-v2-Abliterated-L14"
./submit-apply.sh
Intended use
- Research on refusal geometry in hybrid-attention multimodal models
- Side-by-side comparison with Opus-Distill-v2 at matched sampling
- Red-teaming and robustness work in a controlled setting
- Local / self-hosted generation where you accept the residual refusal rate
and the capability cost of λ = 1.4
Limitations
- This card does not claim 0% refusal. The selected sweep row is 2/32
on a tiny diagnostic set. Real prompts will differ, especially in thinking
mode (direction was extracted with thinking off). - Capability numbers above are the parent's. L14's own MMLU / GPQA / code
scores have not been published on this card. The 35/40 diagnostic is not a
substitute. - Abliteration removes a direction. It does not add knowledge, fix
hallucinations, or make outputs safe, legal, or correct. - Vision quality should match the parent (tower untouched) but has not been
separately re-benchmarked here. - Training context for the distill was 4096 tokens. Long-context behavior is
inherited from Qwen3.8-27B, not from the LoRA run. - Do not compare the distill GPQA delta to Qwen's official thinking-mode
GPQA-Diamond 89.2.
Related checkpoints
| Repo | Role |
|---|---|
Qwen/Qwen3.8-27B |
Stock base |
barozp/Qwen3.8-27B-Opus-Distill |
Distill v1 (loop bug) |
barozp/Qwen3.8-27B-Opus-Distill-v2 |
Immediate parent |
barozp/opus-reasoning-distill-v2 |
Distill dataset + provenance |
barozp/Qwen3.8-27B-Opus-Distill-v2-FP8 |
Parent FP8 (not this edit) |
barozp/Qwen3.8-27B-Opus-Distill-v2-GGUF |
Parent GGUF (not this edit) |
barozp/Qwen3.8-27B-Opus-Distill-v2-MLX-4bit |
Parent MLX |
There is no official FP8 / GGUF / MLX conversion of this L14 checkpoint
in-tree at upload time. Quantize from these BF16 shards if you need one;
MTP often drops out of GGUF conversions.
Credits
- Qwen team — Qwen3.8-27B
barozp— Opus-Distill v1/v2 and the
verified-trace cleanupzxbc2023— v1 loop reportnanofatdog/LLM-abliterate—
architecture-aware rank-1 editor used here