Skip to main content
QUICK REVIEW

[论文解读] Lory: Fully Differentiable Mixture-of-Experts for Autoregressive Language Model Pre-training

Zexuan Zhong, Mengzhou Xia|arXiv (Cornell University)|May 6, 2024
Topic ModelingComputer Science被引用 6
一句话总结

Lory 引入一个完全可微的专家混合框架用于自回归语言模型预训练,使用因果分段路由和基于相似性的批量数据,达到强的困惑度和下游收益,且具有分段级专家合并。

ABSTRACT

Mixture-of-experts (MoE) models facilitate efficient scaling; however, training the router network introduces the challenge of optimizing a non-differentiable, discrete objective. Recently, a fully-differentiable MoE architecture, SMEAR, was proposed (Muqeeth et al., 2023), which softly merges experts in the parameter space; nevertheless, its effectiveness was only demonstrated in downstream fine-tuning on classification tasks. In this paper, we present Lory, the first approach that scales such architectures to autoregressive language model pre-training. Lory introduces two key techniques: (1) a causal segment routing strategy that achieves high efficiency for expert merging operations while preserving the autoregressive nature of language models; (2) a similarity-based data batching method that encourages expert specialization by grouping similar documents in training instances. We pre-train a series of Lory models on 150B tokens from scratch, with up to 32 experts and 30B (1.5B active) parameters. Experimental results show significant performance gains over parameter-matched dense models on both perplexity (+13.9%) and a variety of downstream tasks (+1.5%-11.1%). Despite segment-level routing, Lory models achieve competitive performance compared to state-of-the-art MoE models with token-level routing. We further demonstrate that the trained experts in Lory capture domain-level specialization without supervision. Our work highlights the potential of fully-differentiable MoE architectures for language model pre-training and advocates future research in this area.

研究动机与目标

  • 激励并使完全可微分的 MoE 架构在自回归语言模型中可用,而不仅限于编码器/分类任务。
  • 提出通过因果分段路由实现高效的专家合并,以在降低计算量的同时保持自回归生成。
  • 引入基于相似性的批量数据处理,以在预训练期间促成领域特定的专家专门化。
  • 通过对 Lory 模型进行预训练,规模达到 30B 全参数,最多 32 个专家,覆盖 150B token,以展示可扩展性。

提出的方法

  • 采用专家合并,其中 o_x = FFN(h_x; sum_i e_i * theta_i),其中 e_i 来自 Softmax 路由器。
  • 使用因果分段路由:将输入分成长度为 T 的分段,从前一个分段计算合并后的 theta,并应用到当前分段以保持自回归因果性。
  • 在训练期间,基于前一分段的平均隐藏表示计算路由权重;停止梯度传播以防止信息泄漏。
  • 使用基于相似性的批数据,将语义上相似的文档拼接在一起,促进专家专门化。
  • 在推理阶段,使用仅提示的路由来为整段生成确定每层的单一合并后的 FFN。
  • 使用 150B token、0.3B 和 1.5B 活性参数、每层 8/16/32 个专家进行训练,遵循密集模型初始化和预热计划。

实验结果

研究问题

  • RQ1完全可微分的 MoE 架构是否可以有效扩展到自回归语言模型的预训练?
  • RQ2因果分段路由在实现分段级专家合并的同时,是否能保持自回归生成?
  • RQ3基于相似性的批处理是否能促成领域层面的专家专门化并提升下游任务表现?
  • RQ4与传统的逐字标记级 MoE 和密集基线相比,完全可微分的 Lory 模型在困惑度和下游任务中的表现如何?

主要发现

  • Lory 在所评估的领域中相对于参数匹配的密集基线取得显著的困惑度提升,在 0.3B/32E 模型的 Books 上实现相对提升 +13.9%,并在 arXiv、Books、Wikipedia、C4、Python 等领域实现更广泛的困惑度下降。
  • 下游任务显示 MoE 的一致改进:在所选配置中,常识推理 +3.7%、阅读理解 +3.3%、闭卷问答 +1.5%、文本分类 +11.1%。
  • 带因果合并的分段级路由在性能上与最先进的 token-level MoE 模型相竞争,同时实现完全可微分训练。
  • 专家呈现出域级别的专门化且无需监督,中间层/较高层显示出更强的域信号(例如 arXiv、Python),表明超越局部标记模式的有效专门化。
  • 基于相似性的批处理显著提升 MoE 的性能,相较于随机批处理,并且对有效的专家训练与利用至关重要。

阅读本论文

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

在 Nubint 中阅读本论文

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