{ "question": "If you cut Qwen3.6-35B-A3B from 8 routed experts per token to 4 (or 6, 2) in MLX on an M3 Max, how much decode speed do you gain and how much GSM8K accuracy and perplexity do you lose?", "environment": { "machine": "None 0 GB", "os": "macOS 27.0.1 (Darwin 27.0.0)", "software": { "python": "3.13.5", "mlx": "0.31.2", "mlx_lm": "0.31.3", "numpy": "2.4.2", "pyarrow": "24.0.0", "transformers": "5.12.1" }, "model": "mlx-community/Qwen3.6-35B-A3B-4bit", "model_commit": "38740b847e4cb78f352aba30aa41c76e08e6eb46", "moe": { "num_experts": 256, "default_top_k": 8, "norm_topk_prob": true, "moe_layers": 40, "routing": "softmax over all 256 router logits (fp32-precise) -> top-k via argpartition -> divide the k probabilities by their sum (norm_topk_prob=True); shared expert always on, gated by sigmoid(shared_expert_gate)" }, "thermal": { "start": "Note: No thermal warning level has been recorded\nNote: No performance warning level has been recorded\nNote: No CPU power status has been recorded", "end": "Note: No thermal warning level has been recorded\nNote: No performance warning level has been recorded\nNote: No CPU power status has been recorded" }, "quick_mode": false, "total_runtime_s": 1456.6613669395447 }, "runs": 5, "metrics": { "decode_tps_k8": { "value": 81.88842055232055, "unit": "tokens/s", "samples": [ 4.764196807862756, 81.88842055232055, 85.3436504425253, 15.987520990409578, 87.62621818059971 ], "note": "median of 5; min 4.76, max 87.63; 512-token prompt, 256 greedy tokens" }, "prefill_tps_k8": { "value": 775.0011676444472, "unit": "tokens/s", "samples": [ 274.671775252849, 775.0011676444472, 888.4905984456532, 200.24410289789347, 900.598294478338 ], "note": "median; 512-token prompt" }, "speedup_k8": { "value": 1.0, "unit": "x", "samples": [], "note": "median decode tok/s divided by k=8 median" }, "peak_memory_k8": { "value": 20.175689022, "unit": "GB", "samples": [ 20.175689022, 20.175689022, 20.175689022, 20.175689022, 20.175689022 ], "note": "mx.get_peak_memory after each timed run (reset before), 1e9 bytes" }, "ppl_k8": { "value": 6.558687736182882, "unit": "PPL", "samples": [], "note": "wikitext-2-raw test, 16 x 2048-token windows, 32752 tokens scored" }, "gsm8k_acc_k8": { "value": 64.0, "unit": "%", "samples": [ 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0 ], "note": "exact match on final number, n=150, 0-shot, thinking off, greedy, max 384 tokens; samples are per-question 0/1 in idx order" }, "gsm8k_truncated_k8": { "value": 60, "unit": "count", "samples": [], "note": "hit max_tokens=384" }, "gsm8k_unparseable_k8": { "value": 0, "unit": "count", "samples": [], "note": "no number found in output" }, "gsm8k_mean_output_tokens_k8": { "value": 327.66, "unit": "tokens", "samples": [], "note": "" }, "wall_clock_k8": { "value": 408.92001032829285, "unit": "s", "samples": [], "note": "speed timed runs + PPL + GSM8K time for this k (excl. warm-up)" }, "decode_tps_k6": { "value": 87.25140891936327, "unit": "tokens/s", "samples": [ 12.716489778407222, 87.25140891936327, 85.91599294238283, 95.25722287468571, 95.90124270490364 ], "note": "median of 5; min 12.72, max 95.90; 512-token prompt, 256 greedy tokens" }, "prefill_tps_k6": { "value": 987.5338319223508, "unit": "tokens/s", "samples": [ 195.60037954138204, 998.0994021591688, 987.5338319223508, 969.9049259723197, 1070.2636646288552 ], "note": "median; 512-token prompt" }, "speedup_k6": { "value": 1.0654914129601043, "unit": "x", "samples": [], "note": "median decode tok/s divided by k=8 median" }, "peak_memory_k6": { "value": 20.220464626, "unit": "GB", "samples": [ 20.220431666, 20.220464626, 20.220431666, 20.220431666, 20.220431666 ], "note": "mx.get_peak_memory after each timed run (reset before), 1e9 bytes" }, "ppl_k6": { "value": 6.758699260226353, "unit": "PPL", "samples": [], "note": "wikitext-2-raw test, 16 x 2048-token windows, 32752 tokens scored" }, "gsm8k_acc_k6": { "value": 67.33333333333333, "unit": "%", "samples": [ 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1 ], "note": "exact match on final number, n=150, 0-shot, thinking off, greedy, max 384 tokens; samples are per-question 0/1 in idx order" }, "gsm8k_truncated_k6": { "value": 62, "unit": "count", "samples": [], "note": "hit max_tokens=384" }, "gsm8k_unparseable_k6": { "value": 0, "unit": "count", "samples": [], "note": "no number found in output" }, "gsm8k_mean_output_tokens_k6": { "value": 327.94666666666666, "unit": "tokens", "samples": [], "note": "" }, "gsm8k_delta_vs_k8_k6": { "value": 3.3333333333333335, "unit": "percentage points", "samples": [ -2.0, 8.666666666666666 ], "note": "paired bootstrap 95% CI in samples [lo, hi], 10k resamples, seed 0" }, "wall_clock_k6": { "value": 344.9432854652405, "unit": "s", "samples": [], "note": "speed timed runs + PPL + GSM8K time for this k (excl. warm-up)" }, "decode_tps_k4": { "value": 91.36371409196812, "unit": "tokens/s", "samples": [ 91.36371409196812, 90.98303749848866, 91.82758138730627, 8.516409382654878, 99.6998715659888 ], "note": "median of 5; min 8.52, max 99.70; 512-token prompt, 256 greedy tokens" }, "prefill_tps_k4": { "value": 1114.4974734201487, "unit": "tokens/s", "samples": [ 1114.4974734201487, 1035.5074219421465, 1092.1608479263186, 1282.3635561510512, 1192.4032015417342 ], "note": "median; 512-token prompt" }, "speedup_k4": { "value": 1.1157098094668167, "unit": "x", "samples": [], "note": "median decode tok/s divided by k=8 median" }, "peak_memory_k4": { "value": 20.17371373, "unit": "GB", "samples": [ 20.173713538, 20.173713626, 20.17371357, 20.17371373, 20.173713538 ], "note": "mx.get_peak_memory after each timed run (reset before), 1e9 bytes" }, "ppl_k4": { "value": 7.6852190547561765, "unit": "PPL", "samples": [], "note": "wikitext-2-raw test, 16 x 2048-token windows, 32752 tokens scored" }, "gsm8k_acc_k4": { "value": 56.0, "unit": "%", "samples": [ 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1 ], "note": "exact match on final number, n=150, 0-shot, thinking off, greedy, max 384 tokens; samples are per-question 0/1 in idx order" }, "gsm8k_truncated_k4": { "value": 74, "unit": "count", "samples": [], "note": "hit max_tokens=384" }, "gsm8k_unparseable_k4": { "value": 0, "unit": "count", "samples": [], "note": "no number found in output" }, "gsm8k_mean_output_tokens_k4": { "value": 336.8666666666667, "unit": "tokens", "samples": [], "note": "" }, "gsm8k_delta_vs_k8_k4": { "value": -8.0, "unit": "percentage points", "samples": [ -14.0, -2.0 ], "note": "paired bootstrap 95% CI in samples [lo, hi], 10k resamples, seed 0" }, "speedup_pct_per_acc_point_lost_k4": { "value": 1.4463726183352095, "unit": "% speed per pp", "samples": [], "note": "decision number: decode speedup (%) per GSM8K point lost" }, "wall_clock_k4": { "value": 275.1910705566406, "unit": "s", "samples": [], "note": "speed timed runs + PPL + GSM8K time for this k (excl. warm-up)" }, "decode_tps_k2": { "value": 93.9945870298861, "unit": "tokens/s", "samples": [ 93.9945870298861, 89.36632667548403, 102.95799824427412, 5.640231967614811, 103.58177528701572 ], "note": "median of 5; min 5.64, max 103.58; 512-token prompt, 256 greedy tokens" }, "prefill_tps_k2": { "value": 1185.2674953340882, "unit": "tokens/s", "samples": [ 1217.9370957772392, 1147.129752972383, 1254.2556199592686, 189.22280934141446, 1185.2674953340882 ], "note": "median; 512-token prompt" }, "speedup_k2": { "value": 1.1478373425193935, "unit": "x", "samples": [], "note": "median decode tok/s divided by k=8 median" }, "peak_memory_k2": { "value": 20.165544342, "unit": "GB", "samples": [ 20.165544294, 20.165544342, 20.165544294, 20.165544294, 20.165544294 ], "note": "mx.get_peak_memory after each timed run (reset before), 1e9 bytes" }, "ppl_k2": { "value": 17.175239233376594, "unit": "PPL", "samples": [], "note": "wikitext-2-raw test, 16 x 2048-token windows, 32752 tokens scored" }, "gsm8k_acc_k2": { "value": 14.666666666666666, "unit": "%", "samples": [ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0 ], "note": "exact match on final number, n=150, 0-shot, thinking off, greedy, max 384 tokens; samples are per-question 0/1 in idx order" }, "gsm8k_truncated_k2": { "value": 81, "unit": "count", "samples": [], "note": "hit max_tokens=384" }, "gsm8k_unparseable_k2": { "value": 9, "unit": "count", "samples": [], "note": "no number found in output" }, "gsm8k_mean_output_tokens_k2": { "value": 295.1066666666667, "unit": "tokens", "samples": [], "note": "" }, "gsm8k_delta_vs_k8_k2": { "value": -49.333333333333336, "unit": "percentage points", "samples": [ -57.333333333333336, -41.333333333333336 ], "note": "paired bootstrap 95% CI in samples [lo, hi], 10k resamples, seed 0" }, "speedup_pct_per_acc_point_lost_k2": { "value": 0.2996702888906625, "unit": "% speed per pp", "samples": [], "note": "decision number: decode speedup (%) per GSM8K point lost" }, "wall_clock_k2": { "value": 240.54908919334412, "unit": "s", "samples": [], "note": "speed timed runs + PPL + GSM8K time for this k (excl. warm-up)" } }, "observations": [ "k=6: decode 87.3 tok/s vs 81.9 at k=8 (1.07x).", "k=6: GSM8K 67.3% (+3.3 pp vs k=8, 95% CI [-2.0, +8.7], CI includes 0); truncated 62, unparseable 0.", "k=6: wikitext-2 PPL 6.759 vs 6.559 at k=8 (+3.0%).", "k=4: decode 91.4 tok/s vs 81.9 at k=8 (1.12x).", "k=4: GSM8K 56.0% (-8.0 pp vs k=8, 95% CI [-14.0, -2.0], CI excludes 0); truncated 74, unparseable 0.", "k=4: wikitext-2 PPL 7.685 vs 6.559 at k=8 (+17.2%).", "k=2: decode 94.0 tok/s vs 81.9 at k=8 (1.15x).", "k=2: GSM8K 14.7% (-49.3 pp vs k=8, 95% CI [-57.3, -41.3], CI excludes 0); truncated 81, unparseable 9.", "k=2: wikitext-2 PPL 17.175 vs 6.559 at k=8 (+161.9%).", "Router check: expert-index width equals k in all 40 MoE layers for k in 2,4,6,8: True. k=8 after toggling reproduces the unmodified model's 48 greedy tokens: True." ], "caveats": [ "One model (mlx-community/Qwen3.6-35B-A3B-4bit), 4-bit affine quantization, MLX only, one machine; results do not transfer automatically to other MoEs, quant formats or runtimes.", "Top-k probabilities are renormalised to sum to 1 over the k kept experts (the model code's norm_topk_prob=True path). Other choices (no renormalisation) were not tested.", "GSM8K uses 150 questions; differences whose paired-bootstrap CI includes 0 are within noise.", "Thinking is disabled and decoding is greedy with max 384 tokens, so absolute GSM8K accuracy is not comparable to model-card numbers; only the relative comparison across k is meaningful.", "GSM8K generation is batched (mlx_lm BatchGenerator, batch 32); speed numbers come only from the single-stream speed phase.", "Answer extraction: last number inside \\boxed{} if present, else last number in the output; the same regex is used for every k.", "Speed is single-stream batch-1 decode after a 512-token prompt; runs were interleaved in rotating k order to spread thermal drift; pmset -g therm logs are in out/meta.json.", "Perplexity covers only the first 32,768 wikitext-2 test tokens (16 non-overlapping 2048-token windows, no sliding context)." ] }