What was done
- Saliency (REAP) on the full 512-expert model, loaded as the official FP8 checkpoint
with transformers 4.57.1 on 1× H200:
S_e = mean over routed tokens of (renormalized top-k router weight × ‖expert_output‖₂).
- Calibration data: 1,024 windows × 2,048 tokens = 2.1M tokens of teacher-written code
(prompt + Qwen3-Coder-Next answer) from the companion KD dataset
ch2oma/qwen3-coder-next-kd-top20
(Magicoder-OSS + evol-codealpaca prompts, decontaminated against HumanEval/MBPP).
- Pruning: keep the top-192 experts per layer by saliency, remap expert indices, slice the
router (
mlp.gate) rows. Attention, DeltaNet, shared experts, embeddings and lm_head are untouched.
The kept indices are in reap_keep.json.
- Weights stay in the original block-FP8 (128×128) format with
weight_scale_inv.
config.json only changes num_experts to 192.
Intended target: ~17 GB GGUF (IQ4_XS) for a 24 GB GPU such as the RTX A5000.
Usage
Loads like the official FP8 model (needs a GPU with FP8 support, e.g. Hopper/Ada, for transformers;
vLLM also works). To get bf16 for training / GGUF on other GPUs, dequantize block-wise:
W_bf16 = W_fp8.float() * repeat(weight_scale_inv, 128, 128),
or convert straight to GGUF with recent llama.cpp (--outtype bf16 dequantizes FP8 itself).
Evaluation
Table with columns: Model, HumanEval, HumanEval+, MBPP, MBPP+| Model | HumanEval | HumanEval+ | MBPP | MBPP+ |
|---|
| Qwen3-Coder-Next 80B FP8 (parent) | 92.7 | 87.2 | 91.8 | 76.7 |
| This model, IQ4_XS (imatrix), ~17 GB, before healing | 91.5 | 85.4 | 91.8 | 75.9 |
EvalPlus, greedy, max 1536 new tokens, prompt: "Please provide a self-contained Python script
that solves the following problem in a markdown code block".
GGUF files are in gguf/, quantized with an importance matrix computed on 300 × 512 tokens of
teacher-written code (gguf/imatrix192.dat). Scores were measured with llama.cpp on GPU.
Same GGUF vs Qwen3.8-27B on one RTX A5000 (Ollama)
Both models ~17 GB on disk, served by Ollama 0.40 on the same 24 GB GPU, greedy, same prompt,
thinking disabled for Qwen3.8. Scores via EvalPlus.
Table with columns: Model, HumanEval, HumanEval+, MBPP, MBPP+, Gen. speed, Output tokens (542 tasks)| Model | HumanEval | HumanEval+ | MBPP | MBPP+ | Gen. speed | Output tokens (542 tasks) |
|---|
| This model, IQ4_XS, before healing | 94.5 | 87.2 | 90.7 | 75.4 | ~85 tok/s | 275K |
| Qwen3.8-27B Q4_K_M, thinking off | 95.7 | 91.5 | 90.5 | 77.0 | ~76 tok/s | 117K |
Ollama's chat template gives slightly different numbers than the llama.cpp server run above.
The dense 27B is still ahead on the "+" test sets; closing that gap is the goal of the KD stage.
Roadmap
Credits
- Base model: Qwen/Qwen3-Coder-Next (Apache-2.0)
- Method: REAP, Cerebras Research ("REAP: One-Shot Pruning for Trillion-Parameter Mixture-of-Experts Models")