Sub topic 1
What a Parameter Count Tells You
Prerequisites
This chapter assumes you know what a large language model does, can use a command line, and can distinguish disk storage from RAM. You should also be comfortable converting bits, bytes, and GiB.
Parameters and Model Size
A parameter is a learned number in a model. During training, the model adjusts these numbers to represent language patterns. A model described as “8B” has about 8 billion parameters.
Parameter count indicates capacity, but it does not directly equal file size. File size also depends on the numeric format used to store each parameter.
Number Formats: From FP32 to 4-bit
A numeric format determines how many bits store one parameter. More bits usually preserve more numerical detail but require more memory.
| Format | Bits per parameter | Approximate storage per billion parameters |
|---|---|---|
| FP32 | 32 | 3.73 GiB |
| FP16 or BF16 | 16 | 1.86 GiB |
| INT8 | 8 | 0.93 GiB |
| 4-bit | 4 | 0.47 GiB |
These values describe the weights only. Runtime metadata, temporary tensors, and the KV cache require additional memory.
What Quantisation Does
Quantisation converts high-precision weights into lower-precision representations. A quantised value stores fewer bits, while scale values help reconstruct an approximation of the original weight.
The conversion reduces memory use and often improves memory traffic. It also introduces approximation error. A well-designed quantisation keeps important values more accurately than less important ones, so quality usually declines gradually rather than suddenly.
Reading GGUF Names
GGUF is a file format commonly used by local model runners. A name such as model-Q4_K_M.gguf usually means:
Q4: roughly four bits per weight.K: a newer block-based quantisation scheme.M: a medium quality or mixed-detail variant within that scheme..gguf: the file format.
The exact file size can differ because scales, metadata, and some tensors may use higher precision.
Estimating Memory for Weights
Use this first estimate:
weight memory = parameter count × bits per weight ÷ 8
The following function returns GiB for a parameter count expressed in billions:
def weights_gib(params_billion, bits_per_weight):
return params_billion * 1e9 * bits_per_weight / 8 / 2**30
print(f"{weights_gib(8, 4.85):.1f} GiB")An 8B model stored at about 4.85 bits per weight needs roughly 4.5 GiB for weights. Reserve extra memory for the runtime and KV cache before deciding whether it fits.
Exercise
Why is an 8B model not automatically 8 GiB?
Show answer
The parameter count is a count of values, not their storage size. The number of bits used for each value determines the weight memory.