Topic 3 of 5 · 5 min read
Choosing parameter count and dense or MoE
Goal: Choose a model size and architecture for a task from its quality needs and the memory you have.
Pick the smallest model that passes your task, then check that its total memory, not just its active compute, fits your hardware.
Check yourself · 1 of 3
A mixture-of-experts model is listed as 100B total and 10B active. Which resource does the 100B figure mainly tell you about?
Why it matters
Parameter count drives three things: quality, memory and speed. Bigger models usually answer better and need more memory and time. Choosing too big wastes money. Choosing too small fails on the hard cases.
Size tiers
| Tier | Typical size | Typical use |
|---|---|---|
| Small | up to about 10B parameters | Laptops, phones, classification, extraction |
| Mid | about 10B to 40B | One workstation GPU, coding help, chat |
| Large | 70B and up | Multi-GPU servers, harder reasoning |
Dense versus mixture of experts
A dense model uses all its parameters for every token. A mixture-of-experts (MoE) model has many expert sub-networks and a router that sends each token to only a few. So an MoE has a total parameter count and a smaller active count. A model named with 100B total and 10B active runs about as fast as a 10B dense model, but you must still store all 100B.
The rule: active parameters set speed, total parameters set memory.
Quick memory arithmetic
At 16-bit precision each parameter takes 2 bytes. At 4-bit it takes about half a byte. Add room for the context cache.
def weights_gb(params_billion, bits=16):
return params_billion * bits / 8
print(weights_gb(30, 16)) # 60.0 GB
print(weights_gb(30, 4)) # 15.0 GB
Distilled versions
A distilled model is a smaller model trained to imitate a larger one, often a reasoning model. It keeps part of the quality at a fraction of the size. It is not the original model, so test it.
Before and after
Weak: "We have a 24 GB GPU, so a 100B-total MoE with 10B active will be fast and fit."
Better: "The 100B total needs about 50 GB even at 4-bit. It will not fit. We choose a 30B dense model at 4-bit, about 15 GB, and test it."
What goes wrong
- Reading active parameters as memory.
- Forgetting the context cache, which grows with long prompts.
- Assuming bigger always wins on narrow tasks that a small model passes.
Examples
The MoE that does not fit
A 120B-total, 12B-active model looks fast on paper. At 4-bit its weights alone are about 60 GB, so it will not load on a 24 GB GPU. A 30B dense model at 4-bit is about 15 GB and does.
Small first
You classify support tickets into 6 labels. A 3B model gets 94 of 100 test tickets right. A 70B model gets 97 but needs ten times the hardware. For this task the small model is the sound choice unless those 3 points matter.
Key points
- Choose the smallest model that passes your own test set, then scale up only if it fails.
- Active parameters set speed in an MoE model; total parameters set the memory you need.
- At 16-bit a parameter costs about 2 bytes, at 4-bit about half a byte, plus room for the context cache.
- Distilled models are smaller imitations of bigger ones and need their own testing.
- Small models often handle classification and extraction; hard reasoning tends to need larger ones.
Common mistakes
- Judging memory from a MoE model's active parameter count.
- Sizing for the weights only and ignoring the context cache.
- Starting with the largest model instead of the smallest one that works.
- Treating a distilled model as equal to the teacher model without testing.
Check yourself · 2 of 3
A 20B-parameter dense model stored at 16-bit needs roughly how much memory for the weights?
Check yourself · 3 of 3
Your task passes testing with a 3B model, and a 70B model scores only slightly higher. What is the sensible choice?
Practice items, not counted towards your mastery.
Start here
- Hugging Face model hub (opens in a new tab)ToolFree
Search and filter open models by size, task and licence, and open each model card.
- Artificial Analysis: open-weight models (opens in a new tab)ToolFree
Independent quality, speed and price comparisons of open-weight models for shortlisting.
- The Open Source AI Definition (opens in a new tab)StandardFree
The definition that separates open-source AI from models that only publish weights.
More for this topic
- Mixture of Experts Explained (Hugging Face) (opens in a new tab)ArticleFree
Explains total versus active parameters and why MoE models need memory for all experts.