发现专家模型路由一致性差异,指导高效内存部署
Not All Models Suit Expert Offloading: On Local Routing Consistency of Mixture-of-Expert Models
- 提出两项指标量化专家激活的局部一致性
- 20个模型实测显示缓存大小约两倍活跃专家最平衡
- 领域专用专家更提升路由一致性,适合边缘部署
混合专家(MoE)通过稀疏激活实现大语言模型高效扩展。为在内存受限设备上部署大型MoE模型,许多系统采用专家卸载策略,将部分专家缓存在快速内存中,其余专家留在慢速内存或按需加载。尽管已有研究利用专家激活的局部性,但其局部路由一致性在不同模型间差异显著且未被充分研究。本文提出两个度量指标:(1)段落路由最佳性能(SRP),评估固定专家组对一段文本的覆盖能力;(2)段落缓存最佳命中率(SCH),衡量在缓存限制下利用未来信息的命中率。分析20个不同规模和架构的MoE模型,并用小模型验证关键影响因素。发现局部路由一致性与局部负载均衡存在强权衡,而全局负载均衡可与之共存。共享专家等设置会降低局部路由一致性。此外,领域专用专家比词汇专用专家更促进路由一致性。多数模型在缓存效率与效果间取得平衡,缓存大小约为活跃专家数的两倍。这些发现为不牺牲推理速度的内存高效设计提供支持。代码已公开于 https://github.com/ljcleo/moe-lrc。
原文摘要 · Abstract (English)
Mixture-of-Experts (MoE) enables efficient scaling of large language models (LLMs) with sparsely activated experts during inference. To effectively deploy large MoE models on memory-constrained devices, many systems introduce *expert offloading* that caches a subset of experts in fast memory, leaving others on slow memory to run on CPU or load on demand. While some research has exploited the locality of expert activations, where consecutive tokens activate similar experts, the degree of this **local routing consistency** varies across models and remains understudied. In this paper, we propose two metrics to measure local routing consistency of MoE models: (1) **Segment Routing Best Performance (SRP)**, which evaluates how well a fixed group of experts can cover the needs of a segment of tokens, and (2) **Segment Cache Best Hit Rate (SCH)**, which measures the hit rate of an expert cache utilizing a length of future information under a cache limit. We analyze 20 MoE LLMs with diverse sizes and architectures and use toy models to verify key factors related to local routing consistency. We find a strong trade-off between local routing consistency and *local* load balance, while showing that *global* load balance can coexist with local routing consistency. Meanwhile, settings like shared experts that decrease expert combination space can lead to low local routing consistency. We further reveal that domain-specialized experts contribute more to routing consistency than vocabulary-specialized ones, and that most models balance between cache effectiveness and efficiency with cache sizes approximately twice the active experts. These findings pave the way for memory-efficient MoE design and deployment without compromising inference speed. We publish the code for replicating experiments at https://github.com/ljcleo/moe-lrc .
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。