DeepSeekMoE:迈向混合专家语言模型中专家专业化的极致

DeepSeekMoE: Towards Ultimate Expert Specialization in Mixture-of-Experts Language Models

代达劢 Damai Dai · DeepSeek · 2024-01-11 · arXiv:2401.06066 ↗ · 被引 933

打开互动全文版(逐段中英对照 + 图/公式 + 论文问答)→

摘要 · Abstract

在大语言模型时代,混合专家(MoE)是一种有前景的架构,用于在扩大模型参数时管理计算成本。然而,传统的 MoE 架构(如 GShard)激活 N 个专家中的前 K 个,难以确保专家专业化,即每个专家获取不重叠且集中的知识。为此,我们提出了 DeepSeekMoE 架构,旨在实现极致的专家专业化。它包含两个主要策略:(1)将专家细分为 mN 个,并激活其中的 mK 个,从而允许更灵活地组合激活的专家;(2)隔离 K_s 个专家作为共享专家,旨在捕获通用知识并减少路由专家中的冗余。从 2B 参数的适度规模开始,我们证明 DeepSeekMoE 2B 达到了与 GShard 2.9B 相当的性能,而后者拥有 1.5 倍的专家参数和计算量。此外,DeepSeekMoE 2B 几乎接近其具有相同总参数数量的密集对应模型的性能,这设定了 MoE 模型的上限。随后,我们将 DeepSeekMoE 扩展到 16B 参数,并表明它仅需约 40%的计算量即可达到与 LLaMA2 7B 相当的性能。进一步地,我们初步尝试将 DeepSeekMoE 扩展到 145B 参数,一致验证了其相对于 GShard 架构的显著优势,并显示其性能与 DeepSeek 67B 相当,而仅使用 28.5%(甚至可能 18.2%)的计算量。

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 the 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.

核心贡献 · Key contributions

局限 · Limitations

论文章节 · Sections(共 23)

阅读逐段中英对照全文 →