arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2404.02852cs.LG
收藏

迈向推理最优的混合专家大语言模型

Toward Inference-optimal Mixture-of-Expert Large Language Models

UC San Diego(加州大学圣迭戈分校);Carnegie Mellon University(卡内基梅隆大学);The University of Edinburgh(爱丁堡大学)

Longfei Yun, Yonghao Zhuang, Yao Fu, Eric P Xing, Hao Zhang

AI总结:

本文研究 MoE 大语言模型在训练预算下的规模与 token 分配,通过将推理效率纳入缩放律,发现 4/8 专家服务最优,而较小的 16/32 专家配合更多数据更具训练性价比。

摘要:

基于混合专家(Mixture-of-Expert,MoE)的大语言模型(LLM),例如近期的 Mixtral 和 DeepSeek-MoE,已在扩展模型规模方面展现出巨大潜力,而不会承受密集 transformer 训练成本的二次增长。与密集模型一样,训练 MoE 也需要回答同一个问题:在给定训练预算下,如何在模型规模和 token 数量之间实现最优分配?我们研究了基于 MoE 的 LLM 的缩放律,考察模型性能、模型规模、数据集规模与专家度之间的关系。与此前在不同情境下研究 MoE 的工作相呼应,我们观察到增加专家数量会出现收益递减;但由于训练成本保持不变,这似乎表明应持续扩展专家数量直至饱和,而这在推理阶段是有问题的。我们提出修正 MoE 的缩放律,在验证损失之外引入推理效率作为另一项指标。我们发现,在相同性能下,具有少量(4/8 个)专家的 MoE 是服务效率最高的方案,但训练成本要高出 2.5–3.5 倍。另一方面,训练一个比损失最优解小得多(70–85%)的(16/32)专家 MoE,同时使用更大的训练数据集,是训练预算约束下一种有前景的配置。

英文摘要:

Mixture-of-Expert (MoE) based large language models (LLMs), such as the recent Mixtral and DeepSeek-MoE, have shown great promise in scaling model size without suffering from the quadratic growth of training cost of dense transformers. Like dense models, training MoEs requires answering the same question: given a training budget, what is the optimal allocation on the model size and number of tokens? We study the scaling law of MoE-based LLMs regarding the relations between the model performance, model size, dataset size, and the expert degree. Echoing previous research studying MoE in different contexts, we observe the diminishing return of increasing the number of experts, but this seems to suggest we should scale the number of experts until saturation, as the training cost would remain constant, which is problematic during inference time. We propose to amend the scaling law of MoE by introducing inference efficiency as another metric besides the validation loss. We find that MoEs with a few (4/8) experts are the most serving efficient solution under the same performance, but costs 2.5-3.5x more in training. On the other hand, training a (16/32) expert MoE much smaller (70-85%) than the loss-optimal solution, but with a larger training dataset is a promising setup under a training budget.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑