Why a Mixture-of-Experts Model Needs So Much Memory
Why the Hugging Face post says mixture-of-experts models have a costly memory caveat, how few experts run per token and what pruning does.
For: Learners curious about large models.
The cost of having many experts
Mixture-of-Experts (MoE) models have enabled state-of-the-art LLMs to be scaled to hundreds of billions of parameters, but they come with a fundamental and costly caveat: every expert MLP must occupy memory at inference time, even though the vast majority are idle for any given token.[1]
How few experts run per token
However, for any given token, only 8 experts in each layer are actually used.[1]
What pruning does
Expert pruning is one of the most direct fixes to this memory bottleneck.[1]
That is, permanently delete the least useful experts.[1]
Sources
- Higher-Order Pruning of Experts (huggingface.co · checked )
Related concepts
More articles
- LearningWhy Memory Size Is the Wrong Question for an AI GPUWhat NVIDIA's post says about high bandwidth memory, why useful work per byte is the better question and what it means for bytes to be resident but not working.
- LearningWhat an Expert Is in a Mixture-of-Experts ModelWhat a Hugging Face post says a Mixture of Experts model replaces, what an expert is not and what the router does for each token.
- LearningDense vs MoE: How Two Model Types Use Their ParametersWhat an NVIDIA post says a dense model and a Mixture-of-Experts model each do with a token.