Total Parameters vs. Activated Parameters: How to Read LLM Model Sizes
When a large language model is released, the parameter count is often the first number people cite—but a single figure can be misleading. This article explains the difference between total parameters, activated parameters per token, and context window length, introduces the Mixture of Experts (MoE) architecture that drives the gap between them, and shows how to estimate GPU memory and per-token compute from these numbers, with practical Python examples and notes on real-world deployment considerations like memory bandwidth and batch-level expert activation.
1. Breaking Down the Parameter Numbers
When a large model is released, the parameter count is the most frequently quoted figure. But a single number rarely tells the whole story—at minimum, you need to distinguish three pieces of information:
- Total parameters: The number of all trainable weights in the model. This determines the size of the weight files and the minimum GPU memory required to load the model.
- Activated parameters per step: The number of parameters actually involved in computation when generating each token. This determines the per-step compute. In dense models, total parameters and activated parameters are identical. In sparse architectures, the two can differ by several times.
- Context window length: The maximum number of tokens a single request can process. This determines how the KV cache grows and whether long-text tasks can run on existing hardware.
Conflating these three leads to wrong conclusions. Looking only at total parameters overestimates inference compute costs. Looking only at activated parameters ignores the memory pressure at deployment time.
2. How Sparse Mixture-of-Experts Works
Sparse Mixture of Experts (MoE) is one of the most common sparse architectures today. The core idea is to split the feed-forward network into multiple expert subnetworks, with a router selecting a small number of experts for each token.
A typical forward pass works like this:
- The input token passes through the attention layer, producing a hidden state;
- The router scores all experts, usually keeping only the top-k highest-scoring ones;
- The selected experts each perform their computation, and their outputs are combined with a weighted sum based on gating weights;
- Unselected experts do not participate in this step, but their parameters still need to stay in GPU memory.
The following pure Python code demonstrates the core logic of top-k routing, with no framework dependencies:
import mathdef softmax(xs):m = max(xs)exps = [math.exp(x - m) for x in xs]s = sum(exps)return [e / s for e in exps]def topk_route(logits, k=2):probs = softmax(logits)ranked = sorted(range(len(probs)), key=lambda i: probs[i], reverse=True)[:k]total = sum(probs[i] for i in ranked)# Re-normalize the selected experts so their weights sum to 1return [(i, probs[i] / total) for i in ranked]# Routing scores for four experts, selecting the top twoprint(topk_route([0.1, 2.0, -0.5, 1.2], k=2))
This code highlights a key point: routing only decides which experts participate in the computation. The total number of experts does not equal the per-step compute—the per-step compute depends on how many experts are selected.
In actual training, a load-balancing mechanism is also required. If the router consistently favors a few experts, those experts become overloaded while the others fail to learn useful capabilities. Common solutions include adding a balancing term to the training loss or capping the number of tokens each expert can receive.
3. Estimating Resource Requirements from Parameter Counts
3.1 GPU Memory Usage
Weight storage depends only on total parameters, not activated parameters. Using the common half-precision format as an estimate, each parameter takes 2 bytes.
- A 100-billion-parameter model requires roughly 200 GB of memory just for weights;
- This is weights only—at runtime you also need to account for the KV cache, activations, and framework overhead.
3.2 Compute per Token
A common rule of thumb is that each activated parameter corresponds to about 2 floating-point operations in a single forward pass. Therefore, compute per token is roughly proportional to the number of activated parameters.
The following function gives a quick order-of-magnitude estimate—for reference only:
def estimate_resources(total_b, active_b, bytes_per_param=2):"""total_b and active_b are in billions (B) of parameters. Returns weight memory (GB) and compute per token (GFLOPs)."""weight_gb = total_b * bytes_per_param # 1B params × 2 bytes ≈ 2 GBgflops_per_token = 2 * active_b # ~2 GFLOPs per 1B activated parametersreturn weight_gb, gflops_per_tokenweight_gb, gflops = estimate_resources(total_b=100, active_b=10)print(f"Weight memory: ~{weight_gb:.0f} GB, compute per token: ~{gflops:.0f} GFLOPs")
One easily overlooked caveat: during the decoding phase, the system is primarily bottlenecked by memory bandwidth rather than raw compute. In MoE models, different requests in the same batch activate different experts, so the weights actually read for a batch can far exceed the activated parameters of a single request. For throughput planning, you need to benchmark with realistic batch sizes—single-request estimates are not enough.
4. The Engineering Cost of Long Contexts
The main cost of long-context capability comes from the KV cache…
