
Niwaki-Flash-Next-19GB-v4.0-mlx
Qwen3.8-Flash-Next for 32 GB Macs: 119B total / ~5.6B active parameters
in about 19 GB of memory (a 33.3 GB download), perplexity 17% below v2.4's
102B, a task average of 0.765, every program-state behaviour we test at or
above the 102B's, and twenty languages within 1.08–1.42× of the unpruned
model's perplexity. 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 it is
The v4.0 model sized for 32 GB Macs: its routed experts are stored as E8 lattice codes at about 2 bits per weight (v4.0 uses 1–3 bits), and recovery training follows. Its 14.4 GB n-gram embedding table stays on disk and is read as tokens need it, so the model holds about 19 GB in memory although the download is 33.3 GB.
Against v2.4's 102B, the smallest v2.4 release (37.5 GB on disk), it reads lower perplexity and KL divergence, a higher task average and an equal or higher score on every program-state behaviour. v4.0 remains the stronger model where 64 GB is available; two-step arithmetic shows the gap most.
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 |
| v4.0, 141B | 44.8 GB | 27.25 GB (0.36×) | 5.70 | 11.72 | 0.62 | 0.794 | 0.76 / 0.55 |
| v2.4, 102B | 37.5 GB | 20.0 GB (0.26×) | 7.84 | 14.80 | 0.96 | 0.738 | 0.70 / 0.50 |
| this model | 33.3 GB | 15.7 GB (0.21×) | 6.51 | 12.76 | 0.78 | 0.765 | 0.79 / 0.53 |
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 |
| v4.0, 141B | 0.798 | 0.716 | 0.844 | 0.716 | 0.896 |
| v2.4, 102B | 0.742 | 0.648 | 0.788 | 0.660 | 0.850 |
| this model | 0.768 | 0.708 | 0.822 | 0.700 | 0.826 |
The average sits above the reference's on the strength of boolq and winogrande; arc_easy is level (0.768 against 0.770), and 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 |
| v4.0, 141B | 0.96 / 0.97 | 0.96 | 0.93 | 1.00 |
| v2.4, 102B | 0.95 / 0.96 | 0.96 | 0.87 | 0.97 |
| this model | 0.95 / 0.97 | 0.96 | 0.88 | 1.00 |
On 2,000 further two-step arithmetic problems, generated fresh and scored the same way, this model answers 92.9% correctly (the reference and v4.0 98.0%).
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.79 / 0.53 on the seed shared by every row (v4.0 0.76 / 0.55, v2.4's 102B 0.70 / 0.50).
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.25 | 1.22 | 1.20 | 1.23 | 1.28 | 1.24 | 1.28 | 1.34 | 1.29 | 1.18 |
| v4.0, 141B | 1.14 | 1.11 | 1.08 | 1.10 | 1.13 | 1.11 | 1.13 | 1.15 | 1.12 | 1.12 |
Of ten further languages, Punjabi reads 1.08, Vietnamese 1.24, Turkish and Azerbaijani 1.25, Greek 1.27, Belarusian 1.29, Hebrew 1.34, Thai 1.36, Icelandic 1.41 and Malayalam 1.42.
Model dimensions
| total parameters | 119B (from ~177B) |
| active parameters per token | ~5.6B (from ~6.7B) |
| layers / routed experts / top-k | 48 / 512 / 10 |
| routed experts stored | 12,672 of 24,576: all 512 in layers 0–9 and 34–47, 16 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 at ~2.0 bits per weight |
| expert intermediate size | 640 (unchanged) |
| n-gram embedding table (PLE) | 2-bit (group 128), 14.4 GB, read from disk as tokens need it |
| backbone precision | 4-bit (router gates and shared experts 8-bit) |
| whole-model size on disk | 33.3 GB |
| memory | 17.6 GiB after load; with prefill_step_size=512, 19.1 GiB peak on a 2,048-token prompt and 20.6 GiB on a 32,768-token prompt |
| runs in | 32 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 and reads the n-gram table from disk, the second decodes
the lattice-coded experts with Metal kernels.
pip install -U mlx mlx-vlm transformers
hf download neopolita/Niwaki-Flash-Next-19GB-v4.0-mlx --local-dir ./niwaki-flash-19gb
import mlx_vlm
from niwaki_flash_load import load # niwaki_flash_load.py from this repo
model, processor = load("./niwaki-flash-19gb")
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, prefill_step_size=512,
verbose=False).text)
prefill_step_size=512 processes the prompt in 512-token chunks, which
keeps the peak at 19.1 GiB on a 2,048-token prompt. mlx-vlm's default
2,048-token chunks peak at 21.9 GiB, above a 32 GB Mac's default GPU
working-set limit of 21.3 GiB. Prompts up to 32K tokens stay under that
limit (20.6 GiB); 64K-token prompts peak at 22.4 GiB and need it raised,
for example with sudo sysctl iogpu.wired_limit_mb=24576, which leaves
8 GiB for everything else. On Macs with memory to spare, leave
prefill_step_size at its default: prompts process about 25% faster.
enable_thinking=False skips the reasoning preamble; leave it on for harder
prompts. On an M4 Max: ~30 tokens/s decode and ~450 tokens/s prompt
processing on a 2,048-token prompt, ~25 and ~330 tokens/s at 32K tokens.
For llama.cpp: Niwaki-Flash-Next-23GB-v4.0-gguf stores the same experts in llama.cpp's own quantization types (one 40.2 GB file, 21.8 GiB on the GPU at a 2,048-token context, for the neopolita-llama.cpp fork); llama.cpp does not read this repo's lattice-coded experts.
For 24 GB Macs: Niwaki-Flash-Next-15GB-v5.0-mlx stores this model's experts at about 1.5 bits per weight instead of 2 (15.6 GiB peak on a 2,048-token prompt), at 4–6% higher perplexity.
Notes and limitations
- Compression trades quality: perplexity is 1.29× the reference's on WikiText-2 and 1.16× on C4, and hellaswag and piqa stay below the reference. Two-step arithmetic is the weakest of the behaviours we test (92.9% of fresh problems, against the reference's 98.0%). Fluent and on-topic; numbers and niche technical facts are less reliable than the reference.
- Speed: decode matches v4.0's on the same machine. Prompt processing with
prefill_step_size=512is about a fifth slower than at the default, and 13–17% slower than v4.0 at its default. Speeds were measured on a 128 GB M4 Max with the model's files in the file cache. - The n-gram table is read from disk as tokens need it; keep the model on a fast internal SSD.
- 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: v5.0 15 GB for 24 GB Macs, v4.0 141B and its GGUF, 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.