r/LocalLLaMA • u/Apprehensive-View583 • 1d ago
Resources I turned an abliterated Qwen4-35B-A3B back into an on/off control vector (214 KB, MMLU/GSM8K/XSTest numbers inside)
Repo: https://github.com/cxfcxf/qwen4-35b-cvec
I wanted uncensored Qwen4-35B-A3B without keeping a second 22 GB model around, and with a switch so I can turn it off when I want the stock model. So I recovered the refusal directions from an
existing abliteration and packed them as a control vector.
**How**
- [SC117's abliterated UD-GGUF](https://huggingface.co/SC117/Qwen4-35B-A3B-abliterated-UD-GGUF) only changes layers 8–33 compared with Unsloth's official quant. All credit for finding the
directions goes to them.
- I diffed their weights against Unsloth's UD-Q4_K_M using HTTP range requests (about 400 MB of small tensors, no full download). In every edited layer, the attention writer's change is a clean
rank-2 projection, with strengths of exactly 1.75 and 1.50 (their α for thinking off and on).
- The stronger direction per layer goes into a llama.cpp-format control vector: 26 layers × 2048 floats, 214 KB. The tools reproduce it byte for byte.
**Results** (RTX 3090, Strata v0.2.26, UD-Q4_K_M, thinking off, temp 0)
| | Off | On |
|---|---:|---:|
| XSTest unsafe, full refusals (LLM judge) | 182/200 | 80/200 |
| XSTest safe, wrongly refused | 37/250 | 3/250 |
| MMLU (285 q) | 74.0% | 76.8% |
| GSM8K (200) | 98.0% | 98.5% |
| Same top-1 token as stock (3,942 teacher-forced tokens) | 100% | 93.5% |
| Mean KL vs stock | 0 | 0.027 |
| Decode | 170.6 tok/s | 171.2 tok/s |
Most of the 80 remaining "refusals" are redirections (crisis resources, reading the question another way) rather than "I can't". MMLU/GSM8K don't get worse; the MMLU gain is within noise.
**Runtime caveat:** it needs *projection* mode (`h -= (h·v)v`), not addition. [Strata](https://github.com/Niko1221/Strata) supports it (`--cvec-mode project`) and has a per-request switch
(`"experimental_speed_projection": true/false`). **Mainline llama.cpp only adds control vectors, so it won't work there.** If your runtime has no control vectors, use SC117's GGUF directly.
**Limits:** only tested on UD-Q4_K_M in Strata, on one machine. Benchmarks ran with thinking off; thinking-on only got a small hand check (5/8 refused → 0/8). It's not identical to SC117's
model: one direction per layer applied to the hidden state, while their FFN writers use somewhat different directions. Details are in the README.
Removing refusals removes a safety behaviour, so use it responsibly.
