arXiv:2401.06066 · 中英对照阅读
DeepSeekMoE:迈向混合专家语言模型中的极致专家专门化
DeepSeekMoE: Towards Ultimate Expert Specialization in Mixture-of-Experts Language Models
中文速览
传统混合专家模型常让少数几个专家同时处理差异很大的知识,还可能让多个专家重复学习相同内容,因此算力省下来了,专家却未必真正分工。DeepSeekMoE把专家切得更细,让每个词可以灵活组合更多小专家,同时设置始终参与的共享专家来负责共通知识,从而减少其他专家的重复负担。实验显示,2B版本的表现接近同规模稠密模型,也胜过参数和计算量更大的传统 MoE;扩展到16B和145B后,也以明显更少的计算达到强稠密模型的相近水平。它的重要性在于,模型可以在不大幅增加计算成本的情况下扩展参数规模,并让不同专家更专注地各司其职。
摘要
在大型语言模型时代,混合专家(Mixture-of-Experts,MoE)是一种很有前景的架构,可在扩展模型参数规模时管理计算成本。然而,诸如 GShard 这类传统 MoE 架构会激活 $N$ 个专家中的 Top-$K$ 个,因此在确保专家专门化方面面临挑战,即每个专家都获取互不重叠且聚焦的知识。为此,我们提出了旨在实现极致专家专门化的 DeepSeekMoE 架构。该架构包含两项主要策略:(1)将专家细分为 $mN$ 个,并从中激活 $mK$ 个,从而使激活专家的组合更加灵活;(2)将 $K_{s}$ 个专家隔离为共享专家,以捕获通用知识并减少路由专家中的冗余。从 2B 参数这一适中规模起步,我们证明,DeepSeekMoE 2B 的性能可与 GShard 2.9B 相当,而后者拥有其 1.5 $\times$ 的专家参数量和计算量。此外,DeepSeekMoE 2B 的性能几乎达到总参数量相同的稠密模型,而该稠密模型为 MoE 模型设定了性能上限。随后,我们将 DeepSeekMoE 扩展至 16B 参数,并表明其仅使用约 40% 的计算量,便能实现与 LLaMA2 7B 相当的性能。进一步地,我们将 DeepSeekMoE 扩展至 145B 参数的初步尝试持续验证了其相较于 GShard 架构的显著优势,并表明其仅使用 28.5%(甚至可能仅使用 18.2%)的计算量,便能实现与 DeepSeek 67B 相当的性能。
In the era of large language models, Mixture-of-Experts (MoE) is a promising architecture for managing computational costs when scaling up model parameters. However, conventional MoE architectures like GShard, which activate the top- $K$ out of $N$ experts, face challenges in ensuring expert specialization, i.e. each expert acquires non-overlapping and focused knowledge. In response, we propose the DeepSeekMoE architecture towards ultimate expert specialization. It involves two principal strategies: (1) finely segmenting the experts into $mN$ ones and activating $mK$ from them, allowing for a more flexible combination of activated experts; (2) isolating $K_{s}$ experts as shared ones, aiming at capturing common knowledge and mitigating redundancy in routed experts. Starting from a modest scale with 2B parameters, we demonstrate that DeepSeekMoE 2B achieves comparable performance with GShard 2.9B, which has 1.5 $\times$ expert parameters and computation. In addition, DeepSeekMoE 2B nearly approaches the performance of its dense counterpart with the same number of total parameters, which set the upper bound of MoE models. Subsequently, we scale up DeepSeekMoE to 16B parameters and show that it achieves comparable performance with LLaMA2 7B, with only about 40% of computations. Further, our preliminary efforts to scale up DeepSeekMoE to 145B parameters consistently validate its substantial advantages over the GShard architecture, and show its performance comparable with DeepSeek 67B, using only 28.5% (maybe even 18.2%) of computations.
术语表
- Mixture-of-Experts (MoE)
- 混合专家
- DeepSeekMoE
- DeepSeekMoE
- GShard
- GShard
- LLaMA2
- LLaMA2
- Transformer
- Transformer
- Feed-Forward Network (FFN)
- 前馈网络
- expert specialization
- 专家专门化
- knowledge hybridity
- 知识混杂
- knowledge redundancy
- 知识冗余
- fine-grained expert segmentation
- 细粒度专家划分
- shared expert isolation
- 共享专家隔离
- shared expert
- 共享专家
- routed expert
- 路由专家
- expert
- 专家
- top-K routing
- Top-K 路由
- activated expert
- 激活专家
- dense model
- 稠密模型
- parameter efficiency
- 参数效率
- zero-shot learning
- 零样本学习
- few-shot learning
- 少样本学习
- ablation study
- 消融研究
- Open LLM Leaderboard
- Open LLM Leaderboard
- supervised fine-tuning (SFT)
- 监督微调
- alignment
- 对齐
- activated parameters
- 激活参数
- computational cost
- 计算成本