Toward Inference-optimal Mixture-of-Expert Large Language Models
作者: Longfei Yun, Yonghao Zhuang, Yao Fu, Eric P Xing, Hao Zhang
分类: cs.LG
发布日期: 2024-04-03
备注: 15 pages, 8 figures
💡 一句话要点
提出混合专家模型以优化大语言模型的推理效率
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 混合专家模型 大语言模型 推理效率 模型扩展 训练预算
📋 核心要点
- 现有的混合专家模型在推理效率上存在问题,尤其是在专家数量增加时,训练成本与推理效率之间的矛盾突出。
- 本文提出通过引入推理效率作为评估指标,修正MoE的扩展规律,以优化模型的训练与推理平衡。
- 实验结果表明,使用少量专家的MoE在性能上表现良好,但训练成本显著增加,提供了新的训练预算下的优化方案。
📝 摘要(中文)
基于混合专家(MoE)的大语言模型(LLMs),如Mixtral和DeepSeek-MoE,展示了在不增加训练成本的情况下扩展模型规模的潜力。本文研究了MoE模型的扩展规律,探讨了模型性能、模型规模、数据集规模与专家数量之间的关系。研究发现,增加专家数量的边际效益递减,但在推理时可能导致效率问题。为此,本文提出在验证损失之外,引入推理效率作为另一评估指标,并发现使用少量专家(4/8)在性能相同的情况下更为高效,尽管训练成本增加2.5-3.5倍。另一方面,训练一个较小的(16/32)专家MoE,结合更大的训练数据集,在训练预算下是一种有前景的设置。
🔬 方法详解
问题定义:本文旨在解决混合专家模型在推理阶段的效率问题,尤其是当专家数量增加时,训练成本与推理效率之间的矛盾日益明显。
核心思路:通过引入推理效率作为新的评估指标,修正传统的MoE扩展规律,探索在相同性能下的最优专家配置。
技术框架:研究首先分析了模型性能与专家数量、数据集规模之间的关系,然后提出了在训练预算下优化专家数量的策略,最后通过实验验证了不同配置的效果。
关键创新:本文的创新在于将推理效率纳入模型评估体系,提出了在训练成本与推理效率之间的平衡策略,与传统方法相比,提供了更全面的优化视角。
关键设计:在实验中,选择了4/8个专家的配置作为高效方案,并对比了16/32个专家的训练效果,发现后者在训练数据集增大时仍能保持较好的性能。具体的损失函数和网络结构设计未在摘要中详细说明,需参考原文。
📊 实验亮点
实验结果显示,使用4/8个专家的MoE在性能上与更大专家数量的模型相当,但训练成本却高达2.5-3.5倍。相对而言,使用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.