arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2408.04278cs.CL
收藏

LaDiMo:受逐层蒸馏启发的 MoE 化方法

LaDiMo: Layer-wise Distillation Inspired MoEfier

Samsung SDS(三星 SDS);Cloud Research Team(云研究团队)

Sungyoon Kim, Youngjun Kim, Kihyo Moon, Minsung Jang

AI总结:

本文提出 LaDiMo 算法,通过逐层专家构建与路由策略决策,以极少的训练数据和成本将预训练稠密模型高效转换为 MoE 模型,在保持准确率的同时显著降低激活参数量。

摘要:

大型语言模型的出现彻底变革了自然语言处理,但其日益增长的复杂性带来了巨大的训练成本、资源需求和环境影响。为此,稀疏混合专家(Mixture-of-Experts, MoE)模型已成为稠密模型的一种有前景的替代方案。由于从头训练 MoE 模型可能极其昂贵,近期研究开始探索利用预训练非 MoE 模型中的知识。然而,现有方法存在局限性,例如需要大量硬件资源和数据。我们提出了一种新算法 LaDiMo,它能以极少的额外训练成本,高效地将基于 Transformer 的非 MoE 模型转换为 MoE 模型。LaDiMo 包含两个阶段:逐层专家构建和路由策略决策。通过利用知识蒸馏(Knowledge Distillation)的概念,我们对模型进行压缩并快速恢复其性能。此外,我们开发了一种自适应路由器,通过分析路由权重的分布并确定一种在准确率与延迟之间取得平衡的逐层策略,来优化推理效率。我们通过仅使用 100K 个 token 将 LLaMA2-7B 模型转换为 MoE 模型,在保持准确率的同时将激活参数减少了 20% 以上,证明了该方法的有效性。我们的方法为构建和部署 MoE 模型提供了一种灵活高效的解决方案。

英文摘要:

The advent of large language models has revolutionized natural language processing, but their increasing complexity has led to substantial training costs, resource demands, and environmental impacts. In response, sparse Mixture-of-Experts (MoE) models have emerged as a promising alternative to dense models. Since training MoE models from scratch can be prohibitively expensive, recent studies have explored leveraging knowledge from pre-trained non-MoE models. However, existing approaches have limitations, such as requiring significant hardware resources and data. We propose a novel algorithm, LaDiMo, which efficiently converts a Transformer-based non-MoE model into a MoE model with minimal additional training cost. LaDiMo consists of two stages: layer-wise expert construction and routing policy decision. By harnessing the concept of Knowledge Distillation, we compress the model and rapidly recover its performance. Furthermore, we develop an adaptive router that optimizes inference efficiency by profiling the distribution of routing weights and determining a layer-wise policy that balances accuracy and latency. We demonstrate the effectiveness of our method by converting the LLaMA2-7B model to a MoE model using only 100K tokens, reducing activated parameters by over 20% while keeping accuracy. Our approach offers a flexible and efficient solution for building and deploying MoE models.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑