K-文化的一切——从回归到 K-美妆,发送到您的邮箱订阅邮件

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

为让超大MoE模型在家用显卡上跑得更快,研究者尝试训练路由器学会缓存友好的选择模式,结果发现代价太大,是一份诚实的负面结果报告

作者用实测证明,在只有8GB显存的消费级显卡上运行2350亿参数的混合专家模型(Qwen3-235B)时,瓶颈不是算力而是内存带宽,这与理论公式(每个词元需读取的字节数除以带宽)几乎完全吻合。随后作者预先登记了一项实验,测试能否通过训练让路由器(决定每个词元用哪些专家模块的组件)更倾向于重复使用相同专家,从而提高缓存命中率,同时不损失模型质量。结果显示这种机制确实有效,最多能减少60%的缓存缺失,但在所有配置下,困惑度(衡量语言模型质量的指标)的上升都超过了预先设定的1%上限,因此判定为失败。

METAL MEDIA 解读图

为让超大MoE模型在家用显卡上跑得更快,研究者尝试训练路由器学会缓存友好的选择模式,结果发现代价太大,是一份诚实的负面结果报告

  1. 01在消费级SSD上流式运行Qwen3-235B(4比特量化,134GB)时,实测解码速度为每秒0.44个词元,与'每词元字节数除以带宽'的理论模型精确吻合;试图将32个请求批量处理以分摊磁盘读取开销的方案,反而因操作系统分页颠簸而崩溃
  2. 02作者开发了一个几乎不改动原有推理引擎(llama.cpp)的轻量级追踪工具llama-moe-trace,用它测量Qwen3-30B模型发现:相邻词元重复使用同一专家的概率是随机情况的2倍,95%的流量集中在52.5%的专家上,且代码类文本所用的专家几乎与其他领域不重叠
  3. 03作者按照预先登记的严格标准(缓存缺失至少减少30%,且困惑度上升不超过1%)训练了1.37亿到3.4亿参数规模的小型MoE模型,加入鼓励专家重复使用的额外损失函数,结果发现缺失减少幅度和质量损失紧密绑定,没有任何参数设置能同时满足两个条件
  4. 04作者还发现,把训练阶段的局部性优化与一种无需重新训练、仅在推理时将请求重定向到已缓存的相似专家的技巧结合起来,能在1.37亿和3.4亿两种规模下都以约3.4%的困惑度代价,减少约80%的缓存缺失,效果远超单独使用任一方法
这是 METAL MEDIA 制作的解读图,并非论文作者提供的原图。

他们做了什么

  1. 在消费级SSD上流式运行Qwen3-235B(4比特量化,134GB)时,实测解码速度为每秒0.44个词元,与'每词元字节数除以带宽'的理论模型精确吻合;试图将32个请求批量处理以分摊磁盘读取开销的方案,反而因操作系统分页颠簸而崩溃
  2. 作者开发了一个几乎不改动原有推理引擎(llama.cpp)的轻量级追踪工具llama-moe-trace,用它测量Qwen3-30B模型发现:相邻词元重复使用同一专家的概率是随机情况的2倍,95%的流量集中在52.5%的专家上,且代码类文本所用的专家几乎与其他领域不重叠
  3. 作者按照预先登记的严格标准(缓存缺失至少减少30%,且困惑度上升不超过1%)训练了1.37亿到3.4亿参数规模的小型MoE模型,加入鼓励专家重复使用的额外损失函数,结果发现缺失减少幅度和质量损失紧密绑定,没有任何参数设置能同时满足两个条件
  4. 作者还发现,把训练阶段的局部性优化与一种无需重新训练、仅在推理时将请求重定向到已缓存的相似专家的技巧结合起来,能在1.37亿和3.4亿两种规模下都以约3.4%的困惑度代价,减少约80%的缓存缺失,效果远超单独使用任一方法
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

为什么重要

这项研究以严格的预先登记标准,诚实地证明了'训练路由器让它天然对缓存友好'这个乐观设想,至少在小规模、多领域场景下并不能免费实现,这对任何想在消费级硬件上运行巨型MoE模型的人都有参考价值。同时,研究也指出训练时优化与推理时重路由相结合是更有前景的实用方向,并公开了测量工具、追踪数据和代码供后续研究复现和拓展。

本文术语

  • 混合专家模型(MoE) · 一种模型结构,拥有很多专家子网络,但每个词元只激活其中一小部分,从而在保持总参数量巨大的同时降低单次计算量
  • 路由器 · MoE模型中负责为每个词元挑选使用哪些专家子网络的部分
  • 内存带宽瓶颈 · 系统速度受限于从内存读取数据的速度,而不是处理器计算速度
  • 困惑度(perplexity) · 衡量语言模型预测文本准确程度的指标,数值越低说明模型效果越好
  • LRU缓存 · 一种缓存淘汰策略,优先淘汰最近最少被使用的内容

论文原文摘要(英文)

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.

作者 · Shriniwas Ramesh Suram

在 arXiv 阅读

最新论文

全部论文 →

METAL MEDIA 最新报道