Sub topic 5
What model size means for quality and cost
This chapter covers what "model size" means, how it relates to quality, speed, and cost, and how to reason about it when choosing a model. It assumes you have called a model through an HTTP API or SDK, can read basic Python, and know the terms prompt, token, and context. Memory estimates, quantization, and cost formulas get their own chapters. Here we build the working model that those chapters rely on.
What a parameter count is
A language model is a large set of numbers called parameters, also called weights. Training adjusts these numbers so the model predicts text well. When a model is described as "7B" or "70B", the B stands for billions of parameters.
Parameter count is a rough measure of the model's capacity. It is the number of values the model can adjust to store patterns from its training data. It is not a direct measure of intelligence. Two models with the same count can differ a lot in quality, because quality also depends on the training data, the training method, and the amount of training.
Many hosted providers do not publish parameter counts. For those models you compare tiers (for example "small", "medium", "large") by name and price instead of by number.
Size, quality, and cost move together, roughly
Larger models tend to handle harder tasks better. They follow longer and more subtle instructions, keep more facts, and make fewer reasoning slips. Larger models are also more expensive to run, because every generated token requires using all (or most) of the weights.
The relationship is a trend, not a rule. Treat it as a starting guess to be checked by measurement.
Diminishing returns
Quality gains shrink as size grows. Going from 1B to 7B usually changes results a great deal. Going from 70B to 400B usually changes them less, while the cost grows in proportion to the size. For many production tasks, such as classification, extraction, and short summaries, a small model reaches acceptable quality, and extra size only adds cost.
Newer small models can beat older large ones
Training methods improve over time. A recent 8B model may outperform a model from a few years ago with ten times as many parameters. Compare models of similar release dates when you use size as a guide, and always confirm with your own tests.
Size and the cost of running a model
Size affects three things you pay for.
- Memory. The weights must fit in memory. At 16 bits per weight, each billion parameters needs about 2 GB.
- Compute per token. Each generated token needs work proportional to the parameter count, so large models generate more slowly on the same hardware.
- Price per token on hosted APIs. Providers charge more for their larger tiers, because those tiers use more hardware time.
The function below shows the first point. It is the same calculation the memory chapter uses in more detail.
def weight_memory_gb(params_billion: float, bits_per_weight: int) -> float:
"""Memory for the weights alone, in GB (1 GB = 1e9 bytes)."""
return params_billion * bits_per_weight / 8
for size in (1, 7, 70):
print(f"{size}B model at 16-bit: {weight_memory_gb(size, 16):.1f} GB")
# 1B model at 16-bit: 2.0 GB
# 7B model at 16-bit: 14.0 GB
# 70B model at 16-bit: 140.0 GBA 7B model fits on a single consumer or mid-range server GPU. A 70B model at 16-bit does not fit on any single common GPU, so it needs several GPUs or a lower precision. The jump between these sizes is therefore a change in the kind of hardware you need, not only a change in price.
Rough size classes
Class boundaries are informal and shift over time. The table gives a practical way to think about them.
| Class | Typical parameter count | Typical fit | Common uses |
|---|---|---|---|
| Small | 1B to 4B | Laptop, phone, or small GPU | Classification, simple extraction, autocomplete |
| Medium | 7B to 14B | One mid-range GPU | Summaries, Q&A over provided text, structured output |
| Large | 30B to 80B | Several GPUs, or one large GPU with lower precision | Complex instructions, multi-step reasoning, coding help |
| Very large | 100B and above | A multi-GPU server or a hosted API | Hardest reasoning, broad knowledge, long and tricky tasks |
Dense models and mixture-of-experts models
Most models described so far are dense: every parameter is used for every token. A mixture-of-experts (MoE) model splits much of its weights into groups called experts. For each token, a small router picks only a few experts to run.
An MoE model has two numbers that matter.
- Total parameters set the memory needed. All experts must be loaded, even though only some run for each token.
- Active parameters set the compute per token, and therefore much of the speed.
For example, a model might have 47B total parameters but use about 13B per token. It needs memory like a 47B model and generates at a speed closer to a 13B model. When a model card lists two sizes, check which one it describes before you estimate hardware.
What size does not tell you
Size is only one input. Keep these gaps in mind.
- Specialization. A small model fine-tuned for one task can beat a larger general model on that task. A general large model may still do better on tasks outside that one.
- Context window. Size and context length are separate properties. A small model can have a long context window, and a large model can have a short one.
- Instruction tuning. A base model trained only to continue text may follow instructions worse than a smaller model tuned to follow them.
- Languages and domains. Small models often lose quality faster in less common languages and in specialized fields such as law or medicine.
- Reasoning modes. Some models can spend extra output tokens "thinking" before they answer. This can raise quality without raising parameter count, but it raises output tokens, latency, and cost.
Common errors when using size to choose
- Picking the biggest model by default. This raises cost and latency without checking whether a smaller model passes your requirements.
- Treating the parameter count as a quality score. Compare on your own examples instead (a later chapter shows how).
- Ignoring tail behavior. A small model may pass 95 percent of cases and fail badly on the rest. Look at which cases fail, and whether a bigger model fixes them.
- Forgetting that memory has overhead. The weights are only part of the memory. The cache and runtime need extra room, which later chapters cover.
- Comparing across precisions without noting it. A 70B model at 4-bit and a 70B model at 16-bit are not the same cost or quality.
A working method for size
- Write down the minimum quality your task needs, as a pass rate on example cases.
- Start with a small or medium candidate, not the largest.
- Run it on your cases. If it passes, stop and check its cost and speed.
- If it fails, look at the failing cases. Try a better prompt first, then the next size up.
- Keep the smallest model that meets the requirement, and record the results so you can repeat the test when new models appear.
This method leads directly to the decision process at the end of the tutorial: pick the smallest model that meets your requirements.
Exercise
A model card says "Mixtral-style MoE, 47B total parameters, 13B active per token". You plan to self-host it at 16-bit precision. Roughly how much memory do the weights need, and which parameter count explains why generation speed may be closer to a 13B model?
Show answer
The weights need about 47 × 16 / 8 = 94 GB, because memory depends on total parameters, since all experts must be loaded. Generation speed is closer to a 13B model because only the 13B active parameters run for each token.
Exercise
A teammate says, "We should use the 70B model, because bigger always means better answers." Give two reasons this reasoning is incomplete, and say what you would do instead.
Show answer
First, quality depends on training data, tuning, and specialization as well as size, so a smaller tuned model can match or beat a larger one on a given task. Second, a bigger model costs more in memory, latency, and price per token, with diminishing quality gains. Instead, build a small set of task-specific cases, test a small or medium model first, and move up a size only if it fails the required pass rate.