Qwen3-Coder-Next REAP-192 Uncensored
Qwen3-Coder-Next (80B-A3B, 512 experts/layer) → pruned with REAP to 192 experts/layer, refusal direction abliterated.
Not KD-healed. Unlike REAP-128, this model was not distilled after abliteration (QLoRA KD on a 31B model does not fit a 24 GB card). Scores below show abliteration alone cost ~1–3 points.
| Parent | This model | |
|---|---|---|
| Routed experts / layer | 512 | 192 (62.5% removed) |
| Total params | ~80B | ~31B |
| Active params / token | ~3B (top-10 + shared expert) | ~3B (unchanged) |
| Layers / hidden | 48 / 2048 (hybrid Gated DeltaNet + attention every 4th layer) | same |
| Context | 256K | 256K (tested up to 32K) |
| Refusals | yes | removed |
Files
| File | Size | For |
|---|---|---|
model-000*.safetensors (bf16) | ~63 GB | transformers / fine-tuning / your own quants |
gguf/qwen3-coder-next-reap192-uncensored-IQ4_XS.gguf | ~17 GB | 24 GB GPUs (e.g. RTX A5000 / 3090 / 4090) |
reap_keep.json | original expert indices kept in each layer |
GGUF quantized with an importance matrix computed on the 80B parent (300 × 512 tokens of teacher-written code). The MTP head is not included in the GGUF.
Usage
llama.cpp
huggingface-cli download ch2oma/qwen3-coder-next-reap192-uncensored gguf/qwen3-coder-next-reap192-uncensored-IQ4_XS.gguf --local-dir .
llama-server -m gguf/qwen3-coder-next-reap192-uncensored-IQ4_XS.gguf -ngl 99 -c 32768 --jinja
Ollama (Modelfile)
FROM ./qwen3-coder-next-reap192-uncensored-IQ4_XS.gguf
PARAMETER num_ctx 32768
PARAMETER temperature 0.7
PARAMETER top_p 0.8
PARAMETER top_k 20
PARAMETER repeat_penalty 1.05
ollama create qwen3-coder-next-reap192-uncensored:iq4_xs -f Modelfile
transformers (≥ 4.57, flash-linear-attention recommended)
from transformers import AutoModelForCausalLM, AutoTokenizer
m = "ch2oma/qwen3-coder-next-reap192-uncensored"
tok = AutoTokenizer.from_pretrained(m)
model = AutoModelForCausalLM.from_pretrained(m, torch_dtype="bfloat16", device_map="auto")
Non-thinking model (no <think> block). Tool-call parsers for vLLM / SGLang are included.
How it was made
1. REAP expert pruning
- Saliency per expert:
S_e = mean over routed tokens of (renormalized top-k router weight × ‖expert output‖₂), measured on the full 512-expert model (official FP8 checkpoint, 1× H200). - Calibration: 1,024 windows × 2,048 tokens = 2.1M tokens of teacher-written code (Magicoder-OSS + evol-codealpaca prompts answered by Qwen3-Coder-Next, decontaminated against HumanEval/MBPP).
- Kept the top-192 experts per layer, remapped indices and sliced the router rows. Attention, Gated DeltaNet, shared experts, embeddings and lm_head are untouched.
- Block-FP8 (128×128) weights dequantized to bf16:
W = W_fp8 × repeat(weight_scale_inv, 128, 128).
2. Abliteration (directional ablation)
- Refusal direction per layer:
r = normalize(mean_harmful − mean_harmless)of last-token residuals, 100 harmful (mlabonne/harmful_behaviors) vs 100 harmless (mlabonne/harmless_alpaca) prompts. - Projected
rout of every matrix that writes to the residual stream, weight 1.0:W ← W − r(rᵀW)onself_attn.o_proj,linear_attn.out_proj,shared_expert.down_projand all 192experts.*.down_projin each of the 48 layers — 9,312 matrices.
No KD healing step (see note above). A healed version may replace these files later under the same names.
Evaluation
EvalPlus, greedy, max 1,536 new tokens, prompt: "Please provide a self-contained Python script that solves the following problem in a markdown code block".
| Model | HumanEval | HumanEval+ | MBPP | MBPP+ |
|---|---|---|---|---|
| Qwen3-Coder-Next 80B FP8 (parent) | 92.7 | 87.2 | 91.8 | 76.7 |
| REAP-192 IQ4_XS, before abliteration (llama.cpp, H200) | 91.5 | 85.4 | 91.8 | 75.9 |
| REAP-192 IQ4_XS, before abliteration (Ollama, RTX A5000) | 94.5 | 87.2 | 90.7 | 75.4 |
| Qwen3.8-27B Q4_K_M, thinking off (Ollama, RTX A5000) | 95.7 | 91.5 | 90.5 | 77.0 |
| This model, IQ4_XS (Ollama, RTX A5000) | 91.5 | 86.6 | 88.6 | 73.0 |
All 542 tasks completed, none failed. Compare with the row above (same backend, same settings): abliteration cost −3.0 / −0.6 / −2.1 / −2.4 points. HumanEval+ stays within 0.6 of the 80B parent.
Refusals: 0 / 25 on held-out mlabonne/harmful_behaviors test prompts (IQ4_XS, greedy),
vs 21 / 25 for REAP-192 before abliteration. None of these prompts were used to compute the refusal direction.
LiveCodeBench v6 (182 problems dated 2025-01-01 or later, official prompt, greedy, max 4,096 tokens, IQ4_XS on Ollama):
| Model | pass@1 | Easy (45) | Medium (55) | Hard (82) |
|---|---|---|---|---|
| This model, IQ4_XS | 40.1 | 91.1 | 43.6 | 9.8 |
| REAP-128 uncensored, IQ2_XXS | 28.0 | 91.1 | 18.2 | 0.0 |
SWE-bench Verified, 50-task random subset (seed 42): 22 / 50 resolved (44%) (REAP-128 uncensored IQ4_XS: 10 / 50 on the same tasks). mini-swe-agent (bash only), 200-step limit, 40 min per task, 128K context, IQ4_XS on Ollama. This is a small, budget-constrained harness: do not compare with officially reported SWE-bench scores.
Speed: ~85 tok/s decode on an RTX A5000, fully on GPU.
Limitations
- Not KD-healed: small accuracy loss from abliteration remains (mostly MBPP).
- Pruning was calibrated on code; general chat, other languages and non-coding knowledge degrade more than coding.
Responsible use
Safety refusals are removed. The model will comply with harmful requests; you are responsible for how you use it and its outputs, and for complying with applicable laws.
Credits
- Base model: Qwen/Qwen3-Coder-Next (Apache-2.0)
- REAP: Cerebras Research, "REAP: One-Shot Pruning for Trillion-Parameter Mixture-of-Experts Models"
- Directional ablation: Arditi et al., "Refusal in Language Models Is Mediated by a Single Direction" (2024)