Skip to main content
QUICK REVIEW

[论文解读] OpenMoE: An Early Effort on Open Mixture-of-Experts Language Models

Fuzhao Xue, Zian Zheng|arXiv (Cornell University)|Jan 29, 2024
Topic ModelingComputer Science被引用 7
一句话总结

OpenMoE 发布解码器独立的 MoE LLM(650M–34B),伴随以代码和数据为主的预训练;对 MoE 路由进行分析,并为开源 MoE 发展提供经验教训。它研究路由行为、UL2 与 CasualLM 目标,以及代码-数据的好处。

ABSTRACT

To help the open-source community have a better understanding of Mixture-of-Experts (MoE) based large language models (LLMs), we train and release OpenMoE, a series of fully open-sourced and reproducible decoder-only MoE LLMs, ranging from 650M to 34B parameters and trained on up to over 1T tokens. Our investigation confirms that MoE-based LLMs can offer a more favorable cost-effectiveness trade-off than dense LLMs, highlighting the potential effectiveness for future LLM development. One more important contribution of this study is an in-depth analysis of the routing mechanisms within our OpenMoE models, leading to three significant findings: Context-Independent Specialization, Early Routing Learning, and Drop-towards-the-End. We discovered that routing decisions in MoE models are predominantly based on token IDs, with minimal context relevance. The token-to-expert assignments are determined early in the pre-training phase and remain largely unchanged. This imperfect routing can result in performance degradation, particularly in sequential tasks like multi-turn conversations, where tokens appearing later in a sequence are more likely to be dropped. Finally, we rethink our design based on the above-mentioned observations and analysis. To facilitate future MoE LLM development, we propose potential strategies for mitigating the issues we found and further improving off-the-shelf MoE LLM designs.

研究动机与目标

  • 提供一个首个开放、可复现的跨多尺度的解码器独立 MoE LLM 训练解决方案。
  • 分析 MoE 路由机制,理解标记如何分配给专家。
  • 评估 MoE LLM 相对于密集基线的性价比与性能。
  • 分享经验教训并提出缓解未来 MoE 模型中路由与数据混合问题的策略。

提出的方法

  • 采用解码器为主的 ST-MoE 架构,Top-2 门控(K=2)与残差 MoE 设计。
  • 使用负载平衡损失和路由器 z-损失来稳定端到端的 MoE 训练。
  • 以 UL2 目标(PrefixLM、SpanCorrupt)和大量代码数据进行预训练,然后使用带有对齐的监督 WildChat 数据进行微调。
  • 交错放置 MoE 层(每 4 层或 6 层一次)以平衡路由开销与模型容量。
  • 在多达 1T+ 标记的规模上训练并发布多种 OpenMoE 变体(Base/16E、8B/32E、34B/32E,含 Chat 变体)。
  • 在混合基准测试上进行评估(TriviaQA、HumanEval、WMT16 En-Ro、BigBench-Lite、lm-evaluation-harness 子集)以及用于对话的 MT-Bench,与像 TinyLLaMA、OpenLLaMA 这样的开源密集基线进行比较。
(a) Comparison of the validation loss on different pre-training datasets.
(a) Comparison of the validation loss on different pre-training datasets.

实验结果

研究问题

  • RQ1OpenMoE 模型在跨领域、跨语言和跨任务中的 MoE 路由决策如何表现?
  • RQ2路由决策在训练早期是否就固定且在很大程度上与上下文无关,对序列任务有哪些影响?
  • RQ3数据混合(尤其是代码密集数据)以及训练目标(UL2 与 CasualLM)对 MoE 模型性能和训练稳定性的影响如何?
  • RQ4有监督微调能否缓解路由相关问题,如长序列中的标记丢失或指令微调不匹配?
  • RQ5在激活参数与总训练数据方面,OpenMoE 与密集 LLMs 的性价比如何?

主要发现

  • 路由分析显示与上下文无关的专业化;标记往往被路由到相同的专家,无论上下文如何。
  • 路由决策在早期就被学习,并在整个预训练过程中基本保持固定,可能在领域外数据中导致路由错误。
  • 末端丢弃:由于每个专家容量固定,后续标记可能被丢弃,尤其是在含指令微调数据时。
  • 代码数据与 UL2 目标提升了预训练表现,代码主导的数据在某些基准上使标记预测更容易。
  • OpenMoE-8B/32E 在与更密集的开放模型相比时,在 TriviaQA 和 WMT16 En-Ro 上取得具有竞争力的结果,成本更低;Chat 变体在单轮性能上表现出色,但由于标记丢失,多轮性能较低。
  • 在 MT-Bench 上,OpenMoE 在单轮编码任务上优于基线,但多轮结果下降更明显,可能是由于序列长度的标记丢失。
(b) Comparison of validation accuracy on different pre-training datasets.
(b) Comparison of validation accuracy on different pre-training datasets.

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。