MoE模型其实只靠少数专家就能搞定,可大幅优化推理成本。
MoE Lens -- An Expert Is All You Need
- 通过路由分布和早期解码分析专家使用情况
- 仅少数专家处理超50%路由,单个专家性能损失仅5%
- 适合想优化MoE推理效率的研究者与工程师
Mixture of Experts(MoE)模型通过稀疏激活实现参数高效扩展,但其推理与内存开销仍难优化,源于对其专业化行为理解不足。本文通过两种互补方法系统分析了MoE中的专家专业化:特定领域路由模式与早期解码框架,追踪专家对输出表示的贡献。对DeepSeekMoE模型的分析显示,尽管每层有64个路由专家且6个活跃,但模型主要依赖少数专业专家;顶层加权专家的输出几乎逼近全集合预测。通过系统分析令牌路由分布,我们验证了极少专家处理超过50%的路由决策,覆盖多个专业领域。各层单专家与全集专家隐藏状态相似度极高,部分层余弦相似度达0.95,仅用单一专家时困惑度提升5%。结果表明MoE模型具备高度集中的专业知识,为通过针对性专家剪枝优化推理提供了可能,同时保持性能,并为研究知识在模型中的定位开辟新路径。
原文摘要 · Abstract (English)
Mixture of Experts (MoE) models enable parameter-efficient scaling through sparse expert activations, yet optimizing their inference and memory costs remains challenging due to limited understanding of their specialization behavior. We present a systematic analysis of expert specialization in MoEs through two complementary approaches: domain-specific routing patterns and an early decoding framework that tracks expert contributions to output representations. Our analysis of the DeepSeekMoE model reveals that despite having 64 routed experts with 6 active for each layer's computation, the model predominantly relies on a few specialized experts, with the top-weighted expert's output closely approximating the full ensemble prediction. We quantitatively validate these findings through a systematic analysis of the token routing distribution, demonstrating that very few experts handle over 50\% of routing decisions across different specialized domains. Hidden state similarity between single and ensemble experts for every layer is extremely high, with some layers having cosine similarity as high as 0.95 and perplexity increasing by only 5\% when using a single expert across all three domains. Our results indicate that Mixture of Experts models exhibit concentrated expertise highlighting potential opportunities for inference optimization through targeted expert pruning while maintaining model performance and opening avenues towards studying localization of learned knowledge in these models.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。