Saved in:
Bibliographic Details
Main Authors: Kim, Sungyoon, Kim, Youngjun, Moon, Kihyo, Jang, Minsung
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2408.04278
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866911982169358336
author Kim, Sungyoon
Kim, Youngjun
Moon, Kihyo
Jang, Minsung
author_facet Kim, Sungyoon
Kim, Youngjun
Moon, Kihyo
Jang, Minsung
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2408_04278
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle LaDiMo: Layer-wise Distillation Inspired MoEfier
Kim, Sungyoon
Kim, Youngjun
Moon, Kihyo
Jang, Minsung
Computation and Language
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.
title LaDiMo: Layer-wise Distillation Inspired MoEfier
topic Computation and Language
url https://arxiv.org/abs/2408.04278