
Niwaki-Qwen3.8-Flash-Next-141B-A6B-v4.0-mlx
Qwen3.8-Flash-Next at 141B total / ~5.9B active parameters, with its
routed experts stored as lattice codes: 44.8 GB on disk, the same as v2.4,
perplexity 10% below v2.4's, a task average of 0.794, the program-state
behaviours we test at the unpruned model's level, and twenty languages
within 0.96–1.17× of the unpruned model's perplexity. For 64 GB Macs; stock
mlx-vlm plus the two loader files shipped in this repo.
Niwaki (庭木) are Japan's garden trees, sculpted by meticulous pruning so that every branch serves the form of the whole. This model applies that spirit to a Mixture-of-Experts.
A paper with the full method and measurements is coming soon.
Project page, with the releases and their measurements side by side: niwakiai.com
What changed from v2.4
v2.4 kept all 512 routed experts in 24 of the 48 layers and 16 per layer in the other 24, every expert at 3-bit. v4.0 stores every routed expert as E8 lattice codes, at about 3, 1.4 or 1 bit per weight, and keeps more experts in the same 44.8 GB: layers 10–33 keep 132–384 experts each (4,971 in all, against v2.4's 384), and the other 24 layers keep all 512. Recovery training follows.
Against v2.4, perplexity, KL divergence, the task average, generation diversity and 18 of the 20 languages we measure improve, and the program-state suite holds. v2.4 stays lower on Hindi and Malayalam, and its prompt processing is faster (see Notes).
Benchmarks
Evaluation protocol: WikiText-2 and C4 perplexity over 64 × 2048-token windows (fp32 loss, no chat template); task average over arc_easy, hellaswag, piqa, winogrande and boolq (zero-shot, 500 examples each, the same examples for every row); KL divergence of the next-token distribution to the reference over 16 × 2048 windows; generation d2 from an 8-prompt battery (see Generation).
| model | size | expert storage | wt2 ppl ↓ | C4 ppl ↓ | KLD ↓ | task avg ↑ | generation d2 (avg/min) |
|---|---|---|---|---|---|---|---|
reference Qwen3.8-Flash-Next (4-bit) | 111.5 GB | 75.5 GB | 5.06 | 10.97 | — | 0.759 | 0.78 / 0.62 |
| v2.4, 119B | 44.8 GB | 27.25 GB (0.36×) | 6.36 | 12.99 | 0.75 | 0.762 | 0.68 / 0.48 |
| this model | 44.8 GB | 27.25 GB (0.36×) | 5.70 | 11.72 | 0.62 | 0.794 | 0.76 / 0.55 |
Expert storage ratios are against the reference's 75.5 GB. Per task:
| model | arc_easy | hellaswag | piqa | winogrande | boolq |
|---|---|---|---|---|---|
| reference (4-bit) | 0.770 | 0.756 | 0.854 | 0.682 | 0.732 |
| v2.4, 119B | 0.764 | 0.684 | 0.818 | 0.678 | 0.868 |
| this model | 0.798 | 0.716 | 0.844 | 0.716 | 0.896 |
The average sits above the reference's on the strength of boolq, winogrande and arc_easy; on hellaswag and piqa this model stays below the reference.
Program-state behaviours
A 964-item suite of synthetic program-state tasks (variable tracking through reassignments, tracking with distractor statements, two-step arithmetic, multi-hop lookups), scored by forced choice between candidate answers on two held-out seeds; means over the two seeds.
| model | variable tracking | tracking with distractors | two-step arithmetic | multi-hop |
|---|---|---|---|---|
| reference (4-bit) | 0.95 / 0.96 | 0.96 | 0.91 | 1.00 |
| v2.4, 119B | 0.96 / 0.97 | 0.96 | 0.93 | 0.97 |
| this model | 0.96 / 0.97 | 0.96 | 0.93 | 1.00 |
On 2,000 further two-step arithmetic problems, generated fresh and scored the same way, this model answers 98.0% correctly (the reference 98.0%, v2.4 97.8%).
Generation
An 8-prompt battery (code, reasoning, chat, creative; 600-token sampled generations) scored by bigram diversity (distinct bigrams / total bigrams; a diversity statistic, not a quality score — the reading is closeness to the reference's 0.78 / 0.62). This model reads 0.76 / 0.55 on the seed shared by every row (v2.4 0.68 / 0.48) and 0.73–0.75 on three further sampling seeds.
Languages
FLORES-200 (devtest; each language's 1,012 sentences in 1,024-token windows, identical tokens for every row), perplexity relative to the reference — 1.00 means no loss:
| model | English | Spanish | French | German | Russian | Chinese | Japanese | Korean | Arabic | Hindi |
|---|---|---|---|---|---|---|---|---|---|---|
| this model | 1.14 | 1.11 | 1.08 | 1.10 | 1.13 | 1.11 | 1.13 | 1.15 | 1.12 | 1.12 |
| v2.4, 119B | 1.27 | 1.18 | 1.16 | 1.18 | 1.19 | 1.19 | 1.20 | 1.19 | 1.19 | 0.97 |
Of ten further languages, Thai, Greek, Vietnamese, Azerbaijani and Belarusian read 1.10, Turkish and Icelandic 1.12, Hebrew 1.14, Malayalam 1.17 and Punjabi 0.96. v2.4 reads lower on Hindi (0.97) and Malayalam (0.88); on the other eighteen languages this model reads lower.
Model dimensions
| total parameters | 141B (from ~177B) |
| active parameters per token | ~5.9B (from ~6.7B) |
| layers / routed experts / top-k | 48 / 512 / 10 |
| routed experts stored | 17,259 of 24,576: all 512 in layers 0–9 and 34–47, 132–384 per layer in layers 10–33 (there the routed path contributes only when the router picks a stored expert) |
| expert storage format | E8 lattice codes: 12,672 experts at ~3.0 bits per weight, 3,503 at ~1.4, 1,084 at ~1.0 |
| expert intermediate size | 640 (unchanged) |
| n-gram embedding table (PLE) precision | 2-bit (group 128) |
| backbone precision | 4-bit (router gates 8-bit) |
| whole-model size on disk | 44.8 GB |
| memory | 41.7 GiB after load; 46.0 GiB peak on a 2,048-token prompt and 49.5 GiB on a 32,768-token prompt, 44.7 GiB there with prefill_step_size=512 |
| runs in | 64 GB unified memory |
| modality | text only (vision tower not included) |
Usage (MLX, Apple Silicon)
Requires mlx-vlm >= 0.7.0rc0 and mlx >= 0.32, plus niwaki_flash_load.py
and niwaki_e8.py from this repo: the first tells stock mlx-vlm about the
artifact's layout, the second decodes the lattice-coded experts with Metal
kernels.
pip install -U mlx mlx-vlm transformers
hf download neopolita/Niwaki-Qwen3.8-Flash-Next-141B-A6B-v4.0-mlx --local-dir ./niwaki-flash-141b
import mlx_vlm
from niwaki_flash_load import load # niwaki_flash_load.py from this repo
model, processor = load("./niwaki-flash-141b")
messages = [{"role": "user", "content": "Explain hyper-connections in two sentences."}]
text = processor.tokenizer.apply_chat_template(messages, add_generation_prompt=True,
tokenize=False, enable_thinking=False)
print(mlx_vlm.generate(model, processor, text, max_tokens=300, verbose=False).text)
mlx-vlm processes the prompt in 2,048-token chunks by default, which peaks
at 46.0 GiB on a 2,048-token prompt and 46.5 GiB on an 8,192-token one,
under a 64 GB Mac's default GPU working-set limit of about 48 GiB. A
32,768-token prompt peaks at 49.5 GiB, above that limit. For prompts beyond
8K tokens on a 64 GB Mac, pass prefill_step_size=512 to
mlx_vlm.generate: 512-token chunks keep a 32,768-token prompt at 44.7 GiB.
enable_thinking=False skips the reasoning preamble; leave it on for harder
prompts. On an M4 Max: ~27 tokens/s decode and ~540 tokens/s prompt
processing on a 2,048-token prompt.
For llama.cpp: Niwaki-Qwen3.8-Flash-Next-141B-A6B-v4.0-gguf stores the same experts in llama.cpp's own quantization types (one 61.7 GB file, for the neopolita-llama.cpp fork); llama.cpp does not read this repo's lattice-coded experts.
For 32 GB Macs: Niwaki-Flash-Next-19GB-v4.0-mlx is the v4.0 model sized down (19.1 GiB peak on a 2,048-token prompt), with a GGUF build.
For 24 GB Macs: Niwaki-Flash-Next-15GB-v5.0-mlx stores the 19 GB model's experts at about 1.5 bits per weight (15.6 GiB peak on a 2,048-token prompt; prompts up to about 8K tokens fit a 24 GB Mac's default GPU limit).
Notes and limitations
- Compression trades quality: perplexity is 1.13× the reference's on WikiText-2 and 1.07× on C4, and hellaswag and piqa stay below the reference. Fluent and on-topic; numbers and niche technical facts are less reliable than the reference.
- Speed: decode runs 2–3% below v2.4's. Prompt processing is slower than v2.4's: 1.04–1.37× its time on prompts of 2–512 tokens, and 9–13% lower throughput at 2,048 tokens. Peak memory on a 2,048-token prompt is 1.6 GiB above v2.4's.
- The benchmarks above are English; see Languages for the others. The base model's biases are inherited, and rare-domain behaviour of the removed experts is less tested.
- Part of the Niwaki family: v2.4 119B / 102B, the first-generation 113B / 99B, the unpruned Qwen3.8-Flash-Next-Saikei-v1.0-4bit-mlx, and on Qwen3.6-35B-A3B the v3.0 models 30B / 27B / 24B.
Base model by the Qwen team (see license); 4-bit MLX conversion by mlx-community; compression and recovery training by the Niwaki project, 2026-10. Method details: paper coming soon.