Mixture of Experts Calculator

Calculate MoE model parameters and efficiency.

MoE Configuration

Total Parameters

47.5B

13.7B active per forward

💾Total Memory
88.5 GB
🎯Expert Utilization
25%

Parameter Breakdown

Params per Expert176.2M
Params per Layer1.48B
Attention Params/Layer67.1M
Router Params/Layer32.8K

Efficiency Metrics

Parameter Efficiency28.8%
Memory Overhead247.1%
Equivalent Dense Model13.7B
Equiv. Dense Memory25.5 GB

Expert Configuration

Routed Experts8
Shared Experts0
Tokens per Expert16%

Tip: MoE models like Mixtral 8x7B have 47B total params but only ~13B active, giving dense-model quality at much lower compute cost.

What the Mixture of Experts Calculator Does

The Mixture of Experts calculator estimates how big a sparse MoE transformer is, how much GPU memory it needs, and how efficiently it spends compute compared to a dense model of the same quality. Mixture of Experts is the architecture behind sparse large language models such as Mixtral, DeepSeek-V3, and Qwen MoE, and its defining trick is simple: a layer holds many parallel feed-forward "experts," but a lightweight router sends each token to only a small subset of them. That means the model can carry an enormous total parameter count for capacity while keeping the active parameter count per token low for speed.

This MoE calculator turns that idea into concrete numbers. You enter the hidden size, number of transformer layers, total experts, active experts (the top-K routed per token), the expert intermediate (FFN) size, the vocabulary size, an optional shared-expert ratio, and the weight precision. From those inputs it reports total parameters, active parameters per forward pass, full-model memory, active memory, the per-expert and per-layer parameter breakdown, and efficiency metrics such as parameter efficiency, expert utilization, and memory overhead. The tool assumes a SwiGLU-style expert with three projection matrices (gate, up, and down), which is the standard in modern sparse models.

Why does this matter for anyone building or serving language models? Because MoE decouples capacity from compute. A model can advertise 47 billion total parameters yet only fire roughly 13 billion of them for any given token, delivering the modeling quality of a much larger dense network at a fraction of the FLOPs. The catch is memory: every expert weight still has to live in VRAM even when it is not selected, so storage scales with total parameters while compute scales with active parameters. Understanding that split is the whole point of using a mixture of experts calculator before you commit to a hardware budget or a training run.

Total MoE Parameter Count

totalParams = 2 * V * d + L * (4 * d^2 + E * 3 * d * ff + d * routedExperts + 4 * d)

Where:

  • V= Vocabulary size (number of tokens)
  • d= Hidden size (model dimension)
  • L= Number of transformer layers
  • E= Total experts per layer
  • ff= Expert intermediate (FFN) size
  • routedExperts= Experts that participate in routing (E minus shared experts)

How MoE Parameters Are Counted

The calculator builds the parameter total from four ingredients per layer plus a shared embedding table. Getting the breakdown right is what separates a useful mixture of experts calculator from a back-of-the-envelope guess.

Attention. Each layer carries the same self-attention block as a dense transformer: query, key, value, and output projections. Together these are 4 × d² parameters, independent of how many experts you add.

Experts. Every expert is a SwiGLU feed-forward network with a gate matrix, an up matrix, and a down matrix. Each matrix is roughly d × ff, so one expert holds 3 × d × ff parameters. With E experts per layer, the expert block is E × 3 × d × ff parameters — the part that dominates the total in any large sparse model.

Router. A tiny linear gate maps the hidden state to a score for each routed expert, costing d × routedExperts parameters. This is a rounding error compared with the experts themselves, which is exactly why MoE can scale capacity so cheaply per token.

Layer norm and embeddings. Normalization adds 4 × d parameters per layer, and the model includes input and output embeddings of 2 × V × d parameters shared across the network.

Component Formula Scales with
Attention 4 × d² Layers
All experts E × 3 × d × ff Total params
Router d × routedExperts Negligible
Embeddings 2 × V × d Vocab size

Active vs Total Parameters and Why It Matters

The single most important number a mixture of experts calculator reports is the gap between total parameters and active parameters. Total parameters count every weight stored on disk and in memory. Active parameters count only the weights a single token actually touches during a forward pass: the full attention block, the router, layer norms, embeddings, plus the K experts the router selected (and any shared experts that always fire).

Because only K of E experts run per token, the expert compute drops by a factor of K/E. The calculator computes active expert parameters as K × 3 × d × ff (plus shared experts), then adds the always-on components to get active parameters per layer. Multiply by the number of layers and add embeddings, and you have the active total. The parameter efficiency metric is simply active parameters divided by total parameters, expressed as a percentage — a low value means the model is highly sparse and stores far more capacity than it uses per token.

This split drives every practical decision about a sparse model. Inference latency and training FLOPs track active parameters, so an MoE behaves like a small model on the math. But VRAM must hold all experts at once, so memory tracks total parameters. The memory overhead metric captures that tension: it is the extra memory the full model needs relative to the active footprint. A model that is wonderfully cheap to compute can still be expensive to host, which is why teams reach for quantization (INT8 or INT4) to shrink the resident weights. Use the precision selector in the calculator to see how dropping from FP16 to INT4 roughly quarters total memory while leaving the parameter counts unchanged.

Interpreting the Efficiency Metrics

Beyond raw parameter counts, the MoE calculator surfaces three efficiency signals that help you reason about a design before you build it.

Expert utilization is K divided by E. With a top-2 router over 8 experts you get 25%, meaning each token engages a quarter of the available expert capacity. Lower utilization gives more sparsity and a larger capacity-to-compute ratio, but routing very few experts can hurt quality and load balancing if the router collapses onto a handful of favorites.

Parameter efficiency tells you what fraction of the stored network does useful work per token. A figure near 30% is typical for an 8-expert top-2 design; it signals that roughly 70% of the weights are dormant on any given step, waiting in memory for tokens routed elsewhere.

Memory overhead expresses how much extra memory the full model demands over the active footprint. The calculator also reports an equivalent dense model: a hypothetical dense network with the same active parameter count, which is a fair proxy for the quality-per-compute you are buying. If the equivalent dense model is, say, 13B while the total is 47B, you are getting 13B-class speed with the headroom of a far larger network.

Finally, the tool estimates tokens per expert using a capacity factor of 1.25, a common default that gives each expert a little slack to absorb uneven routing without dropping tokens. In production, a capacity factor that is too tight drops tokens during bursts, while one that is too loose wastes compute on padding. Reading these numbers together — utilization, efficiency, overhead, and capacity — gives a rounded picture of whether a mixture of experts configuration is balanced or lopsided before you spend a single GPU-hour.

Memory and Hardware Planning for MoE Models

Planning hardware for a sparse model is where the mixture of experts calculator earns its keep. The full-model memory equals total parameters multiplied by bytes per parameter, divided by 1024³ to get gigabytes. The calculator uses 4 bytes for FP32, 2 bytes for FP16 and BF16, 1 byte for INT8, and 0.5 bytes for INT4. Because experts dominate the count, total memory grows almost linearly with the number of experts even though compute does not.

That asymmetry has real consequences. A top-2-of-8 model is cheap to run but still has to fit all eight experts per layer in VRAM, so you may need multiple high-memory GPUs purely for storage. Quantization is the usual lever: moving weights from FP16 to INT4 cuts the resident size by roughly 4× with modern schemes, often turning a multi-GPU deployment into a single-card one. The calculator's active-memory figure also matters for expert-parallel serving, where experts are sharded across devices and only the selected ones are gathered per token — though every device must still hold its slice of every expert.

When you compare an MoE against a dense alternative, weigh three costs separately: storage (scales with total params), compute (scales with active params), and communication (the all-to-all routing traffic that grows with the number of devices). The calculator addresses the first two directly and lets you reason about the third by showing how aggressive your sparsity is. Treat its memory output as the floor for weights alone; real deployments add the KV cache, activations, and optimizer states during training, so budget extra headroom on top of the number shown here.

Worked Examples

Mixtral-style 8x7B configuration

Problem:

Estimate total and active parameters for a top-2-of-8 MoE with d=4096, L=32, ff=14336, V=32000, no shared experts, in FP16.

Solution Steps:

  1. 1Per expert = 3 * 4096 * 14336 = 176,160,768 params; attention = 4 * 4096^2 = 67,108,864.
  2. 2All experts per layer = 8 * 176,160,768 = 1,409,286,144; router = 4096 * 8 = 32,768; layer norm = 4 * 4096 = 16,384.
  3. 3Per layer = 67,108,864 + 1,409,286,144 + 32,768 + 16,384 = 1,476,444,160; embeddings = 2 * 32000 * 4096 = 262,144,000.
  4. 4Total = 262,144,000 + 32 * 1,476,444,160 = 47,508,357,120 (47.5B). Active uses only K=2 experts: 262,144,000 + 32 * (67,108,864 + 2*176,160,768 + 32,768 + 16,384) = 13,685,489,664 (13.7B).

Result:

About 47.5B total parameters but only 13.7B active per token, with roughly 28.8% parameter efficiency.

Full-model memory in FP16 vs INT4

Problem:

Find the full-model VRAM for the 47.5B-parameter MoE above in FP16, then in INT4.

Solution Steps:

  1. 1FP16 uses 2 bytes per parameter: 47,508,357,120 * 2 = 95,016,714,240 bytes.
  2. 2Convert to GB: 95,016,714,240 / 1024^3 = 95,016,714,240 / 1,073,741,824 = about 88.5 GB.
  3. 3INT4 uses 0.5 bytes: 47,508,357,120 * 0.5 = 23,754,178,560 bytes / 1,073,741,824 = about 22.1 GB.

Result:

The full model needs about 88.5 GB in FP16 and about 22.1 GB in INT4 for weights alone.

Expert utilization and efficiency

Problem:

Compute expert utilization and parameter efficiency for the top-2-of-8 model.

Solution Steps:

  1. 1Expert utilization = K / E * 100 = 2 / 8 * 100 = 25%.
  2. 2Parameter efficiency = active / total * 100 = 13,685,489,664 / 47,508,357,120 * 100.
  3. 3That ratio is about 0.288, so parameter efficiency is about 28.8%.

Result:

Each token uses 25% of available experts and only about 28.8% of all stored parameters.

Effect of adding more experts

Problem:

Keep d=4096, L=32, ff=14336, V=32000, K=2 but raise total experts from 8 to 16. How do total and active params change?

Solution Steps:

  1. 1All experts per layer doubles: 16 * 176,160,768 = 2,818,573,824; router = 4096 * 16 = 65,536.
  2. 2Per layer = 67,108,864 + 2,818,573,824 + 65,536 + 16,384 = 2,885,764,608; total = 262,144,000 + 32 * 2,885,764,608 = 92,606,611,456 (92.6B).
  3. 3Active stays K=2: per layer = 67,108,864 + 2*176,160,768 + 65,536 + 16,384 = 419,512,320; total = 262,144,000 + 32 * 419,512,320 = 13,686,538,240 (13.7B).

Result:

Total parameters nearly double to about 92.6B while active stays near 13.7B, so utilization halves to about 12.5%.

Tips & Best Practices

  • Use a top-2 router (K=2) as a sensible default before experimenting with higher or lower sparsity.
  • Remember that adding experts grows total memory almost linearly but barely changes inference compute.
  • Quantize to INT8 or INT4 to fit a large MoE on fewer GPUs since weights dominate the memory budget.
  • Watch expert utilization: very low values increase capacity but can cause routing collapse and load imbalance.
  • Budget extra VRAM beyond the calculator's weight figure for the KV cache, activations, and optimizer states.
  • Compare the equivalent dense model to judge whether the extra total parameters are worth the storage cost.
  • Keep the expert intermediate size in mind, as it multiplies directly into every expert's parameter count.
  • Add a shared expert when you want a common knowledge base while keeping routed experts specialized.

Frequently Asked Questions

Total parameters count every weight stored in the model, including all experts that are not used on a given token. Active parameters count only the weights a single token passes through: attention, the router, layer norms, embeddings, and the top-K experts the router selects. Memory scales with total parameters while compute and latency scale with active parameters, which is the central trade-off of mixture of experts.
Every expert weight must reside in GPU memory because the router can send any token to any expert at any step. Even though only K of E experts fire for a particular token, the model cannot know in advance which ones, so all experts stay resident. That is why full-model memory tracks total parameters and why teams use INT8 or INT4 quantization to shrink the footprint.
It assumes a SwiGLU feed-forward network with three projection matrices: gate, up, and down. Each is roughly d by ff, so one expert holds 3 times d times ff parameters. This matches modern sparse models like Mixtral and is why the expert intermediate size has such a large impact on the total.
Most production MoE models use a top-2 router, meaning K equals 2, which balances quality against compute. Some designs use top-1 for maximum sparsity or higher K for more capacity per token. Increasing K raises active parameters and inference cost proportionally while leaving total parameters unchanged.
A shared expert always activates for every token in addition to the routed experts, providing a common knowledge base that frees the routed experts to specialize. Setting the shared expert ratio above zero converts some experts into always-on shared ones, which increases active parameters because those experts fire on every token. Models like DeepSeek-V3 popularized this hybrid shared-plus-routed design.
The equivalent dense model is the active parameter count treated as a standalone dense network, which is a fair proxy for the quality-per-compute an MoE delivers. It is an approximation because routing, load balancing, and specialization mean an MoE can outperform a dense model of equal active size. Use it as a rough comparison rather than an exact equivalence.

Sources & References

Last updated: 2026-06-05

💡

Help us improve!

How would you rate the Mixture of Experts Calculator?

<>

Editorial Note

MyCalcBuddy Editorial Team

This page is maintained as an educational calculator reference.

Source

Formula Source: Standard Mathematical References

by Various

UpdatedLast reviewed: May 2026
CheckedFormula checks are based on standard references and internal QA review.