Everything K-culture — comebacks to K-beauty, straight to your inboxGet it in your inbox

METAL MEDIA

Cacheable by Design? Training Mixture-of-Experts Routers for Locality Against the Edge Memory-Bandwidth Wall: A Pre-Registered Negative Result with a Systems Measurement Study

arXiv:2608.182612026-08-20

Training MoE routers to be cache-friendly cuts memory misses a lot, but not without hurting accuracy, according to a pre-registered negative-result study

The author shows that serving a 235-billion-parameter Mixture-of-Experts model (Qwen3-235B) on an 8GB consumer GPU is limited by memory bandwidth, not compute, confirmed by measurements matching a simple bytes-per-token-over-bandwidth model. They then pre-registered an experiment to see if a router can be trained to keep reusing the same experts (making it more 'cacheable') without hurting language-model quality. The mechanism worked at cutting cache misses by up to 60%, but every tested configuration broke the pre-registered rule that perplexity (a quality score) worsen by no more than 1%.

METAL MEDIA explanatory visual

Training MoE routers to be cache-friendly cuts memory misses a lot, but not without hurting accuracy, according to a pre-registered negative-result study

  1. 01Real measurements on Qwen3-235B (134GB, 4-bit quantized) running from an SSD showed decode speed of 0.44 tokens/second, matching a first-principles model of bandwidth divided by bytes needed per token; trying to batch 32 concurrent requests to amortize disk reads instead collapsed due to OS paging thrash
  2. 02A custom tracing tool (llama-moe-trace), built as a small non-invasive addition to llama.cpp, revealed that Qwen3-30B's router reuses the same experts between adjacent tokens twice as often as chance, that 95% of traffic concentrates on 52.5% of all experts, and that code-domain routing barely overlaps with prose/math domains
  3. 03Training small MoE models (137M to 340M parameters) with an extra loss term rewarding expert reuse was tested against pre-registered pass/fail thresholds (at least 30% fewer cache misses, no more than 1% perplexity increase), but miss reduction and quality cost turned out to be tightly linked, so no setting satisfied both conditions at once
  4. 04Combining trained locality with a separate, training-free trick that reroutes to a similar cached expert at inference time produced a strong synergy, reaching about 80% fewer cache misses at roughly 3.4% perplexity cost—far cheaper than either method alone—at both the 137M and 340M model sizes
An explanatory diagram made by METAL MEDIA, not a figure supplied by the paper's authors.

What they did

  1. Real measurements on Qwen3-235B (134GB, 4-bit quantized) running from an SSD showed decode speed of 0.44 tokens/second, matching a first-principles model of bandwidth divided by bytes needed per token; trying to batch 32 concurrent requests to amortize disk reads instead collapsed due to OS paging thrash
  2. A custom tracing tool (llama-moe-trace), built as a small non-invasive addition to llama.cpp, revealed that Qwen3-30B's router reuses the same experts between adjacent tokens twice as often as chance, that 95% of traffic concentrates on 52.5% of all experts, and that code-domain routing barely overlaps with prose/math domains
  3. Training small MoE models (137M to 340M parameters) with an extra loss term rewarding expert reuse was tested against pre-registered pass/fail thresholds (at least 30% fewer cache misses, no more than 1% perplexity increase), but miss reduction and quality cost turned out to be tightly linked, so no setting satisfied both conditions at once
  4. Combining trained locality with a separate, training-free trick that reroutes to a similar cached expert at inference time produced a strong synergy, reaching about 80% fewer cache misses at roughly 3.4% perplexity cost—far cheaper than either method alone—at both the 137M and 340M model sizes
Table 1: Memory hierarchy on the test machine (i9-12900, RTX 3070 8 GB, 32 GB DDR4, WD SN530 NVMe). The 4-bit 235B model is 134 GB; only ∼40 GB fits the fast tiers.
TierBandwidthCapacityShare of 134 GB model
VRAM (GDDR6)∼448 GB/s8 GB6%
System RAM (DDR4)∼50 GB/s32 GB24%
NVMe SSD (PCIe 3, DRAM-less)∼2.4 GB/s∼70%
Table 2: Serving measurements, Qwen3-235B-A22B Q4_K_M. Aggregate throughput at batch B across concurrent streams. The union-of-experts model predicts aggregate rate should rise with B; it does to B=8 then collapses.
ConditionMeasuredModel
Decode, single stream (warm)0.441 tok/s
Decode, single stream (cold)0.128 tok/s0.20 tok/s
Prefill0.25 tok/s
Aggregate, B=10.128 tok/s0.112
Aggregate, B=80.189 tok/s0.20
Aggregate, B=320.087 tok/s0.35
Table 3: Routing profile of Qwen3-30B-A3B (llama-moe-trace, 8k tokens × 4 domains). Cache hit rates at the 235B’s 13.4% fast-memory budget (layer 24, code domain).
MetricValue
P⁡(expert reused at next token)0.444 (chance 0.223, 2.0×)
Working set (95% of traffic)52.5% of experts
LRU hit rate @ 13.4% budget65.9%
LFU hit rate @ 13.4% budget60.1%
Static-pin hit rate @ 13.4% budget59.2%
Belady oracle @ 13.4% budget79.1%
Table 4: Cross-domain expert-usage similarity (Qwen3-30B-A3B). Code’s expert set is nearly disjoint from the others.
codegeneralmathmedical
code1.000.160.140.11
general0.161.000.330.42
math0.140.331.000.35
medical0.110.420.351.00
Table 5: Main results (200M tokens/arm). Metrics averaged over prose/code/math. “hit” is the fraction of expert-loads already resident.
runarmλPPLreuseLRU hit@25%static hit@50%
a-main (s1)A32.00.3360.4940.747
a-main (s2)A31.90.3120.4800.734
b-l02B0.0232.00.4070.5640.794
b-l03B0.0332.50.4510.6080.817
b-main (s1)B0.0532.60.6340.7880.930
b-main (s2)B0.0532.90.6350.7960.933
c-mainC32.90.4700.7330.991
Table 6: Scale rung. Locality tax (arm A baseline vs arm B λ=0.05 at τ=0) and the stacked training-free rerouting point (τ=0.5 on arm B), at 137M and 340M; same 200M-token budget, cap=25% experts, LRU, seed 1. The tax does not shrink with scale; the stacking advantage persists.
locality tax (τ=0)stacked (τ=0.5)
sizeΔPPLmiss red.ΔPPLmiss red.
137M+2.0%59%+2.4%80%
340M+2.5%57%+3.4%82%
Table 7: Per-domain metrics, baseline (A) vs. locality (λ=0.05), each averaged over 2 seeds. “hit@25%” is LRU; “static@50%” is static-pin.
armdomainPPLΔPPLreusehit@25%static@50%
A (λ=0)prose63.90.2850.4320.765
A (λ=0)code4.70.3840.5440.722
A (λ=0)math27.30.3030.4860.738
B (λ=0.05)prose65.8+3.0%0.6190.7770.930
B (λ=0.05)code4.7+0.0%0.6850.8290.954
B (λ=0.05)math27.8+1.8%0.5990.7710.912
Table 8: Complete run log. Metrics averaged over prose/code/math.
runarmλtokensPPLreuseLRU hit@25%static@50%
a-sanityA50M69.30.3070.4690.731
b-l05B0.0550M69.50.6440.8090.957
b-l01B0.0150M67.70.3540.5180.779
b-l20B0.2050M70.10.8610.8550.977
a-main s1A200M32.00.3360.4940.747
a-main s2A200M31.90.3120.4800.734
b-l02B0.02200M32.00.4070.5640.794
b-l03B0.03200M32.50.4510.6080.817
b-main s1B0.05200M32.60.6340.7880.930
b-main s2B0.05200M32.90.6350.7960.933
c-mainC200M32.90.4700.7330.991
Table 9: Hyperparameters (identical across arms; only the router-loss weights λ,μ differ).
ModelOptimization
dmodel384optimizerAdamW (β=0.9,0.95)
layers8weight decay0.1
attention heads6peak LR6×10−4
experts E16scheduleone-cycle, 2% warmup
top-k2grad clip1.0
expert dff768precisionbf16 autocast
vocab (GPT-2 BPE)50257batch × seq8×1024
total / active params137M / 38Mbalance weight α0.01
context length1024domain weight μ0.1

Why it matters

The finding is an honest, rigorously pre-registered demonstration that the appealing idea of 'just train the router to be cache-friendly for free' does not hold up under a strict multi-domain test at small model scale, which matters for anyone trying to run huge MoE models on consumer hardware. It also points to a more promising practical direction—combining training-time and inference-time tricks—and releases open tooling and traces that others can build on.

Terms in this paper

  • Mixture-of-Experts (MoE) · a model architecture that activates only a small subset of many expert sub-networks per token, keeping total parameters huge but per-token computation small
  • router · the part of an MoE model that decides which expert sub-networks handle each token
  • memory-bandwidth bound · a situation where speed is limited by how fast data can be read from memory, not by how fast the processor can compute
  • perplexity · a score measuring how well a language model predicts text; lower is better
  • LRU cache · a caching policy that discards the least recently used item first when space runs out

Original abstract (English)

Serving a 235B-parameter Mixture-of-Experts (MoE) model on a single 8 GB GPU is bottlenecked not by compute but by memory bandwidth: decode must stream each token's active experts from whichever tier holds them, and on consumer hardware most experts sit on an SSD far slower than RAM. We quantify this bandwidth wall on Qwen3-235B (Q4_K_M, 134 GB): measured decode is 0.44 tok/s warm, matching a bytes-per-token / bandwidth model, while a batching scheme that should amortize one disk sweep instead collapses at batch 32 from paging thrash. We build llama-moe-trace, a zero-surgery router-telemetry tool, and measure routing on Qwen3-30B: adjacent-token expert reuse is 2.0x chance, 95% of traffic uses 52.5% of experts, and an LRU cache of 13.4% of experts serves 66% of requests. We then ask whether cacheability is trainable: we pre-register training of 137M MoE language models with auxiliary locality and domain router losses, under joint criteria on cache-miss reduction and perplexity. The mechanism works (misses down up to 60%; a 99% static-pin hit rate) but every configuration fails the pre-registered <=1% perplexity gate -- miss reduction and quality are tightly coupled. Concurrent StickyMoE reports the same loss as near-free on single-domain sub-25M models; on multi-domain 137M we find the tax real. Our contribution is this pre-registered, stricter-criterion, multi-domain evaluation plus edge-serving measurements. A 340M rung shows the tax does not shrink with scale (it rises slightly). We further show training-free cache-aware rerouting stacks with trained locality -- together ~80% miss reduction at <=3.4% perplexity at both sizes, far cheaper than either alone -- while domain-primed prefetching does not help. All code, traces, and the pre-registration are released.

Authors · Shriniwas Ramesh Suram

Read on arXiv

Latest papers

All papers →

Latest from METAL MEDIA