Drop-in alternative to
sh0wie/Qwen3.8-Flash-Next-REAP-288-Q8E-MLX:
same 288 slots, same file layout, same runtime — but absorbed experts are
merged in, not dropped. Experts 8-bit gs64 affine on the 4-bit backbone. Loads on stock mlx-vlm (git main with
qwen4_exp); every non-expert tensor is byte-identical to the sh0wie build
(his RMSNorm/shards.N fixes included), only the 48x3 switch_mlp expert
tensors differ. No mtp.* tensors — use the author's standalone
MTP drafter
for speculative decoding (compatible with any expert count).
pip install git+https://github.com/Blaizzy/mlx-vlm.git
python -m mlx_vlm.generate --model WaveCut/Qwen3.8-Flash-Next-REAM-288-Q8E-MLX \
--prompt "Refactor this function to add input validation." --max-tokens 512
REAM (arXiv 2604.04356, Samsung SAIL Montréal: Merging Improves Pruning of Experts in LLMs), offline adaptation: instead of dropping the 224 non-kept experts per layer (REAP), each is merged into its most-similar kept expert with saliency-proportional coefficients.
saliency_full_505.npz (its argsort reproduces his pinned manifest bit-for-bit),
tempered and shrunk: w_i = (S_i/S_c)^2 * router_cos * count_confidence,
with the centroid keeping at least 90% of itself. Raw proportional weights
are catastrophic here (KL 1.397) because the real kept/dropped saliency gap
is only ~1.6x — the merge dissolves the expert REAP chose to keep.
Hungarian permutation alignment of intermediate channels before averaging
(fp32 accumulate, bf16 out).campaign/reports/truesal_ladder.md) locates the
optimum: KL is minimised when kept experts give away ~9% of their mass —
both heavier blending and near-pruning are worse.| model | KL vs stock (mean) | rare-name probe (10 names) | HumanEval subset (25 tasks) |
|---|---|---|---|
| stock 512e | 0 | 0.97 | 90.0% (full 50) |
| REAP-288 recon (prune) | 1.3066 | 0.91 | 92.0% (stock on same 25: 92.0%) |
| REAM-288 flat_tsg_tsD (this) | 1.2564 | 0.94 | not re-run for tsD; flat_sim (previous main, same pipeline) scored 88.0% vs stock 88.0% on its slice |
KL: teacher-forced top-256 KL vs the stock model over a fixed mixed corpus (en/ru/code/rare-entities/agentic, ~10K positions). Probe: rare entities x 10 seeded sampled generations, pass = name reproduced intact; aggregates recomputed on the name subset common to all rows (a monitoring bug killed the winner's third probe batch mid-run). HumanEval: 25-task slices of a frozen 50-task subset, no-thinking, greedy; the two 288e models landed on different slices (2-task overlap), so each is paired with the stock score on its own slice. Single-run evals; ±1-2 point differences are noise. RU slice of the probe (3 Cyrillic names, 30 gens): stock 27, prune 21, merge 24.
These rows are the 4-bit builds, not this one. This card carries them because they are the campaign's only like-for-like merge-vs-prune comparison — same script, same GPU, same problems. This build was not benchmarked generatively (107GB does not fit an 80GB card, so it was gated by dequantisation instead); judge it by the bf16 selection evidence above and by the 4-bit result as evidence about the merge itself, not about this file.
Both published 4-bit builds were run through the same script (eval_mlx.py /
probe_mlx.py on mlx-vlm), on the same GPU, over the same problems with the
same prompts, chat template, decoding and checkers — only the checkpoint
differs. HumanEval is the full 164; GSM8K is 200 problems drawn evenly over
the whole test split.
| 4-bit MLX build | HumanEval-164 | GSM8K-200 | rare-name probe |
|---|---|---|---|
| REAP-288 (author's prune) | 89.0% | 56.0% | 60.0% |
| REAM-288 (this merge) | 89.6% | 58.0% | 62.7% |
How to read this:
max_new=320 many
completions are cut off before the answer line; of six problems both builds
failed at that cap, five pass at 768. The cap applies equally to every row,
so it biases the absolutes, not the comparison.ple-store.json (layout: "safetensors_ranges") addresses the 320M-row
n-gram table by absolute byte offsets into named shard files, bypassing
the safetensors header. One file — model-00005-of-00131.safetensors — holds
both the first n-gram chunk and the layer-1 experts, so rewriting it with any
writer (ours or mx.save_safetensors) shifts the blob, the ple-store offsets
land mid-tensor, and mlx-vlm emits NaN logits — even when every tensor is
bit-identical to the author's.
Shards are therefore patched in place: the author's file is copied
verbatim and only the expert payloads are overwritten at their original
offsets. If you rebuild from these weights, keep the layout, or regenerate
ple-store.json to match your new offsets.
sh0wie / HamsterResearch (REAP-288 manifests, conversion, fixes), Samsung SAIL Montréal (REAM), Qwen team (base model, license inherited).
experts-q8-00012.safetensors 5.5 GBexperts-q8-00006.safetensors 5.5 GBexperts-q8-00007.safetensors 5.5 GBexperts-q8-00003.safetensors 5.5 GBexperts-q8-00004.safetensors 5.5 GBexperts-q8-00010.safetensors 5.5 GBexperts-q8-00008.safetensors 5.5 GBexperts-q8-00011.safetensors 5.5 GBexperts-q8-00009.safetensors 5.5 GBexperts-q8-00013.safetensors 5.5 GBexperts-q8-00005.safetensors 5.5 GBexperts-q8-00002.safetensors 4.5 GBexperts-q8-00014.safetensors 4.0 GBexperts-q8-00001.safetensors 3.0 GBbase-00031.safetensors 1.0 GBbase-00032.safetensors 1.0 GBbase-00034.safetensors 1.0 GBbase-00036.safetensors 1.0 GBbase-00033.safetensors 1.0 GBbase-00035.safetensors 1.0 GBbase-00009.safetensors 1.0 GBbase-00014.safetensors 1.0 GBbase-00028.safetensors 1.0 GBbase-00030.safetensors 1.0 GBbase-00008.safetensors 1.0 GBbase-00010.safetensors 1.0 GBbase-00012.safetensors 1.0 GBbase-00013.safetensors 1.0 GBbase-00017.safetensors 1.0 GBbase-00018.safetensors 1.0 GBbase-00025.safetensors 1.0 GBbase-00026.safetensors 1.0 GBbase-00015.safetensors 1.0 GBbase-00019.safetensors 1.0 GBbase-00021.safetensors 1.0 GBbase-00022.safetensors 1.0 GBbase-00011.safetensors 1.0 GBbase-00016.safetensors 1.0 GBbase-00020.safetensors 1.0 GBbase-00023.safetensors 1.0 GBbase-00024.safetensors 1.0 GBbase-00027.safetensors 1.0 GBbase-00029.safetensors 1.0 GBbase-00006.safetensors 1.0 GBbase-00007.safetensors 1.0 GBbase-00037.safetensors 540 MBbase-00005.safetensors 523 MBbase-00001.safetensors 488 MBbase-00130.safetensors 366 MBbase-00131.safetensors 358 MBbase-00068.safetensors 73 MBbase-00076.safetensors 73 MBbase-00086.safetensors 73 MBbase-00102.safetensors 73 MBbase-00041.safetensors 73 MBbase-00049.safetensors 73 MBbase-00094.safetensors 73 MBbase-00057.safetensors 73 MBbase-00112.safetensors 73 MBbase-00120.safetensors 73 MBbase-00082.safetensors 73 MBbase-00126.safetensors 73 MBbase-00078.safetensors 44 MBbase-00108.safetensors 44 MBbase-00064.safetensors 44 MBbase-00098.safetensors 44 MBbase-00051.safetensors 44 MBbase-00045.safetensors 44 MBbase-00106.safetensors 44 MBbase-00116.safetensors 44 MBbase-00053.safetensors 44 MBbase-00070.safetensors 44 MBbase-00062.safetensors 44 MBbase-00072.safetensors 44 MBbase-00088.safetensors 44 MBbase-00090.safetensors 44 MBbase-00043.safetensors 44 MBbase-00114.safetensors 44 MBbase-00122.safetensors 44 MBbase-00128.safetensors 44 MBbase-00096.safetensors 44 MBbase-00104.safetensors 44 MBbase-00003.safetensors 44 MBbase-00060.safetensors 33 MBbase-00059.safetensors 12 MBbase-00047.safetensors 12 MBbase-00066.safetensors 12 MBbase-00074.safetensors 12 MBbase-00039.safetensors 12 MBbase-00084.safetensors 12 MBbase-00092.safetensors 12 MBbase-00110.safetensors 12 MBbase-00080.safetensors 12 MBbase-00055.safetensors 12 MBbase-00118.safetensors 12 MBbase-00100.safetensors 12 MBbase-00124.safetensors 12 MB