Qwen4-35B-A3B-SM86-Fast-Uncensored
[!Warning] The refusals of this model have been removed by directional ablation. It answers requests the original declines, and what it writes can be wrong, unsafe or offensive. You are responsible for what you ask of it and for what you do with the output.
quant-mind/Qwen4-35B-A3B-SM86-Fast (Qwen4-35B-A3B with INT4 routed experts and LM head, for two RTX 3090s on vLLM 0.34.0) with the edit of OpenUncensored/Qwen4-35B-A3B-Uncensored applied without requantizing anything.
That edit removes a two-dimensional refusal subspace from every residual writer of layers 8
to 33 (W' = W - 1.5 B Bᵀ W, 78 tensors). Two thirds of them are plain BF16 matrices. The
rest are the routed experts, 256 down projections per layer, which are 4-bit here, and
OpenUncensored's card warns that quantizing them may weaken the edit. This build sidesteps
that:
- the 26 attention writers carry the edit in their BF16 weights;
- the MLP writers are left exactly as in the base build. In every layer the routed and the
shared experts share one basis and one strength, so editing all of them equals one
projection of the block's summed output,
y' = y - 1.5 (y B) Bᵀ. The runtime applies it fromresidual_edit.safetensors.
It needs a patched vLLM: the two patches of the base build plus
reproduce/qwen4_exp-residual-edit.patch.
Without the third one the checkpoint loads and serves only the attention part of the edit.
Unofficial community build, not affiliated with Qwen / Alibaba, OpenUncensored or vLLM.
Measured
Two RTX 3090s at 270 W, TP2, fp8 KV, text only, one stream, with the
DFlash2 W4A16 drafter
(7 draft tokens). Runtime: HyperQwen de39ebdf
(vLLM 0.34.0) plus the three patches.
Refusal phrases on the first 100 prompts of the test split of mlabonne/harmful_behaviors (a refusal phrase in the first 400 characters of the answer; thinking off at the card's non-thinking sampling and 256 tokens, thinking on at the defaults and 2,000 tokens):
| Build | Thinking off | Thinking on |
|---|---|---|
| Base build | 98 / 100 | 98 / 100 |
| This build without the runtime projection (attention part only) | 75 / 100 | not measured |
| This build | 0 / 100 | 0 / 100 |
A phrase count measures refusals, not answer quality. OpenUncensored's judged evaluation of the BF16 edit reports 2 and 1 refusals and 63 to 66 full answers of 72.
Against the base build on the same runtime:
| Base build | This build | |
|---|---|---|
| Perplexity, 36,465 tokens of Go source | 2.2545 | 2.2612 (+0.30%) |
| Top-1 agreement with the base build | 96.0% | |
| GSM8K, 200 questions, greedy | 195 | 196 |
| Forced tool call with a shell-hostile command | 4/4 | 4/4 |
| Optional tool call, 10 needed / 10 not needed | 10 / 10 | 10 / 10 |
| Decode on real code and prose prompts, geomean | 257 to 271 tok/s | 257 tok/s |
| Tokens per verify step (DFlash2) | 3.17 to 3.41 | 3.39 |
| Peak VRAM | 18.9 / 18.8 GiB | 18.9 / 18.8 GiB |
The drafter was trained on the unedited model and reads layers inside the edited range; its acceptance did not move. Harness presets on a fresh load, second pass: 235 tok/s after a 12.6k-token prompt and 242 after a 224k-token prompt, cold prefill 7,637 tok/s.
Serving
# once, in the environment that has vllm==0.34.0
VLLM_DIR="$(python -c 'import vllm, os; print(os.path.dirname(vllm.__file__))')"
for p in qwen4_exp-quant-head-draft-vocab qwen4_exp-aux-hidden-states qwen4_exp-residual-edit; do
patch -p1 -d "$VLLM_DIR" < reproduce/$p.patch
done
CUDA_DEVICE_ORDER=PCI_BUS_ID PYTORCH_CUDA_ALLOC_CONF=expandable_segments:False \
vllm serve /path/to/Qwen4-35B-A3B-SM86-Fast-Uncensored --served-model-name qwen4-35b-a3b-unc \
--tensor-parallel-size 2 --distributed-executor-backend mp --dtype bfloat16 \
--max-model-len 262144 --max-num-seqs 1 --max-num-batched-tokens 4096 \
--gpu-memory-utilization 0.82 --kv-cache-dtype fp8 --block-size 2304 --language-model-only \
--engram-config '{"disk_offload":true}' --prefix-cache-retention-interval None \
--chat-template /path/to/Qwen4-35B-A3B-SM86-Fast-Uncensored/chat_template.agents.jinja \
--speculative-config '{"method":"dflash","model":"/path/to/Qwen4-35B-A3B-DFlash2-W4A16","num_speculative_tokens":7,"draft_sample_method":"probabilistic","attention_backend":"FLASH_ATTN","kv_cache_dtype":"bfloat16"}' \
--enable-prefix-caching --enable-prompt-tokens-details \
--enable-auto-tool-choice --tool-call-parser qwen3_coder --reasoning-parser qwen3
- The boot log must show
Qwen4 residual edit on the MLP output of 26 layers (8 to 33).VLLM_QWEN4_RESIDUAL_EDIT=0turns the projection off. - Everything else (the MTP fallback,
block-size, the agent chat template, the n-gram table on disk) is as on the base build's card.
What differs from the base build
| File | Change |
|---|---|
model-00003-of-00008.safetensors | 26 BF16 attention writers edited (20 linear_attn.out_proj, 6 self_attn.o_proj): the component inside the refusal basis is 0.4999 to 0.5000 of the original, the change outside it at most 0.17% of the weight norm (BF16 rounding) |
residual_edit.safetensors | new: layers.N.mlp.B (orthonormal [2048, 2], fp32) and layers.N.mlp.s (1.5) for layers 8 to 33 |
| every other weight file | byte-identical |
PROVENANCE.md has the recipe, the gates and the hashes;
reproduce/build_uncensored.py rebuilds this from the base
build and OpenUncensored's edit.safetensors.
Limits
- Measured on one rig, one stream, text only. The vision encoder is in the checkpoint and was not exercised.
- No judged evaluation of the answers to harmful requests was run here, only the phrase count.
- At temperature 0 two runs of the base build were not token-identical; the same applies here.
Credits
- Qwen/Qwen4-35B-A3B, Apache 2.0.
- OpenUncensored/Qwen4-35B-A3B-Uncensored,
Apache 2.0, revision
0b86787a: the refusal directions and the edit. - palmfuture/Qwen4-35B-A3B-GPTQ-Int4: the INT4 routed experts.
- syv-ai/HyperQwen: the runtime patch series.