← Blog · · 7 min read
Batching 16 requests shrinks MoE's lead over a dense 27B from 7.2x to about 4.4x on a Mac
On this page (7 sections)
- We expected batching to close the gap
- The lead shrank from 7.2x to about 4.4x, and the lines never crossed
- Sixteen agents on the MoE each get more than one agent on the dense model
- Batched greedy output is not the same as batch-1 greedy output
- Why the dense model scales better but still loses
- How we tested
- What this means for you
If you run several coding agents against one Mac, batching should wear down the MoE lead, since it helps dense models more. On our Mac it did only partly: Qwen3.6-35B-A3B's lead over the dense Qwen3.8-27B fell from 7.2x at one request to about 4.4x at 16.
TL;DR In mlx_lm, the MoE Qwen3.6-35B-A3B decoded 235.8 tok/s at 16 concurrent requests and the dense Qwen3.8-27B 53.1, a lead of about 4.4x (dense batch 16: one run). The dense model gained more from batching (4.43x vs 2.73x), but it started too far behind to catch up.

Look at the speedup panel: the dense line rises fastest, but in total throughput it never reaches the MoE lines.
We expected batching to close the gap
When several agents share one machine, two numbers matter most: total throughput, and how much speed each agent still gets.
There is a good argument that the MoE advantage should fade under load. Decoding a token is memory-bound, which means most of the cost is reading weights. A dense model reads all of its weights at every step, whether it serves one request or sixteen, so in theory extra requests cost very little.
An MoE model (mixture of experts: each token uses only a few of many expert sub-networks) reads few weights for one request. But different requests pick different experts, so each step reads more weights as the batch grows. If that effect were strong, the MoE lead could collapse by batch 8 or 16.
We tested three 4-bit models in mlx_lm at 1, 2, 4, 8, 12 and 16 concurrent requests: the dense Qwen3.8-27B and two MoE models, Qwen3.6-35B-A3B and LFM2.5-24B-A2B.
The lead shrank from 7.2x to about 4.4x, and the lines never crossed
The theory got the direction right: batching gave the dense model a bigger multiplier than either MoE model. But the dense model started so far behind that it never caught up.
| Model | Batch 1 (tok/s) | Batch 16 total (per request) | Speedup |
|---|---|---|---|
| Qwen3.8-27B (dense) | 12.0 | 53.1 (3.3) | 4.43x |
| Qwen3.6-35B-A3B (MoE) | 86.3 | 235.8 (14.7) | 2.73x |
| LFM2.5-24B-A2B (MoE) | 119.7 | 282.9 (17.7) | 2.36x |
At 16 requests, Qwen3.6-35B-A3B still had about 4.4x the dense model's total throughput, and LFM2.5-24B-A2B had about 5.3x. At batch 1 those ratios were 7.2x and about 10x.
The dense curve is not smooth. It went from 25.8 tok/s at batch 8 to 46.6 at batch 12, a bigger jump than any other step on its own curve, and we have no explanation for it. That point rests on two runs ranging from 42.1 to 51.1, and the dense batch 16 is a single run, so treat its top end as rough.
The extra throughput from each added request also drops off for the MoE models. Qwen3.6-35B-A3B gained only 8.8% from 12 to 16 requests, below the 10% cutoff we used to mark the knee: the first batch size where adding requests raised total throughput by less than 10%. LFM2.5-24B-A2B and the dense model were still gaining more than that at 16.
Sixteen agents on the MoE each get more than one agent on the dense model
What an agent actually experiences is its own per-request speed. At 16 concurrent requests, each Qwen3.6-35B-A3B stream decoded at 14.7 tok/s and each LFM2.5-24B-A2B stream at 17.7. The dense model managed 12.0 when serving one request with the whole machine to itself.
Each of the 16 MoE streams was faster than the dense model's single stream.
The bigger gap is the wait for the first token. In a static batch, no request gets a token until every prompt has been prefilled (read in). For 16 prompts of 259–329 tokens, that took 39.3 s on the dense model and 4.56 s on Qwen3.6-35B-A3B, 8.6x longer.
Batching did almost nothing for dense prefill: its prefill time grew 16.8x from batch 1 to 16. For Qwen3.6-35B-A3B it grew 10.3x. Prefill also lowers end-to-end throughput. At batch 16 the dense model delivered 35.3 tok/s with prefill counted, 34% below its decode-only 53.1.
But real agents do not arrive in neat static batches, and we did not test staggered arrivals. We only ran a small check of mlx_lm.server with requests sent all at once: LFM2.5-24B-A2B gave 88.5–88.7 tok/s end-to-end for one request and 136.2–141.4 for four concurrent ones.
Batched greedy output is not the same as batch-1 greedy output
We compared every batched output with the output for the same prompt run alone. Both used greedy decoding (temperature 0), so we expected identical tokens. We did not get them.
At batch 4 and above, 0% of outputs from either Qwen model matched their batch-1 version. At batch 2, the dense model matched 50% of the time and Qwen3.6-35B-A3B 0%. Some dense outputs differed from token 0. At batch 16, the median first difference was at token 32.5 for the dense model and token 15 for Qwen3.6-35B-A3B.
At the batch sizes with repeats, every repeat diverged at the same positions. Our hypothesis is that batched kernels sum numbers in a different order from batch-1 kernels. The tiny rounding differences that result could flip near-tied greedy choices. We did not check this at the kernel level. This is a numerics check, not a quality ranking.
Why the dense model scales better but still loses
The ordering of the speedups is consistent with the weight-reading argument: 4.43x for dense, 2.73x and 2.36x for the two MoE models. Our hypothesis is that the dense model reads all of its weights once per step and later requests in the batch reuse them. The MoE models read only a small share of their weights per token at batch 1, so they have less waste for batching to remove. We did not measure which experts each request used.
But the shape of the dense curve is not consistent with it. A purely memory-bound dense decode should scale almost linearly, yet the dense model reached only 25.8 tok/s at batch 8, barely twice its 12.0 at batch 1, before the unexplained jump at batch 12.
The dense model's slow start is real, not a fluke. Across 15 single-prompt reference runs, its median was 11.7 tok/s, with a range of 10.6 to 12.5.
Memory was never the limit. Peak memory rose from 16.1 to 24.3 GB for the dense model, from 20.0 to 24.4 GB for Qwen3.6-35B-A3B, and from 13.9 to 15.2 GB for LFM2.5-24B-A2B. We logged no swapouts and no pmset thermal warnings.
How we tested
- An Apple silicon Mac (the logs did not capture the chip or memory size). macOS 27.0.1 (26A434), Python 3.13.5, mlx 0.31.2, mlx_lm 0.31.3.
- Models:
mlx-community/Qwen3.8-27B-4bit,mlx-community/Qwen3.6-35B-A3B-4bitandLiquidAI/LFM2.5-24B-A2B-MLX-4bit. The 4-bit quantisations are not identical, so compare speedups as well as absolute speed. - Method: mlx_lm's
BatchGenerator(the engine behindbatch_generate), driven directly. We used 16 of our own prompts (259–329 tokens), greedy decoding, and EOS disabled so every request generated 256 tokens. All prompts were prefilled together, then decoded together. Decode throughput excludes prefill. - Repeats: 3 per batch size in random order, a fresh process per model, a random model order and a 60 s pause between models. The dense model ran out of time budget, so it got 2 runs at batch 4, 8 and 12 and one run at batch 16.
./run.sh
What this means for you
- If you serve several agents from one Mac, use an MoE model, provided its output quality is good enough for your agents; we measured speed, not quality. At every batch size we tested, both MoE models had higher total and per-request throughput, and at 16 requests Qwen3.6-35B-A3B had a far shorter wait for the first token.
- Don't expect total throughput to scale with the number of agents. Qwen3.6-35B-A3B gained 2.73x from 16x the requests, and less than 10% from 12 to 16, so past about 12 agents each of its agents gets slower with little gain in total. LFM2.5-24B-A2B was still gaining more than 10% at 16.
- This does not apply if you need bit-identical output regardless of load, for example in eval harnesses or caches keyed on output. Batching changed greedy outputs. It also may not hold for long contexts or agents that arrive at different times, which we did not test.
Code, raw numbers and charts: https://hackbig.com/blog-data/mlx-batch-throughput-moe-vs-dense/
If you run several agents against one Mac, what total tokens per second do you see at 4, 8 or 16 concurrent requests, and on which chip?
Code and raw data for this post
How this was made: an AI agent (Claude) designed and ran this experiment on our own MacBook in a sandbox; every number comes from the run's results file (linked below), checked by script before publishing.