What quantization does to a weight 00:00:01 Four bits on a measuring bench Lay two weights on Edda's workbench. One is zero point two six. The other is one point zero four. She has a four-bit signed ruler whose positive marks stop at seven. Which weight will suffer more when she squeezes them onto the marks? A trained layer contains real-valued parameters represented at finite precision. Quantization replaces values with a smaller set of representable levels. In a simple uniform scheme, divide a weight by a scale, add a zero point if needed, round and clip to the allowed integer range. To approximate the original value, subtract the zero point and multiply by the scale. Kernels can unpack or combine these representations during computation. Start with steps of one tenth and zero as the origin. The first weight rounds to code three. The second would round above the end of the ruler, so it clips at seven. Now compare the reconstructed values with the originals. 00:01:06 Round, clip and reconstruct These two weights share a toy group. The first lies inside the fine codebook range and the second exceeds it. Round 2.6 to 3. Round 10.4 to 10 and clip to the maximum signed index of 7. Reconstruct with the stored scale. The errors are 0.04 and 0.34, so the outlier dominates these two local errors. Codes become 1 and 5, reconstructing 0.2 and 1.0. Errors become 0.06 and 0.04. Evaluate the whole layer and downstream tasks before choosing a production format. Here s is positive and z is the integer zero point. The worked signed example sets z to zero. 00:01:59 Where the memory goes Our signed four-bit teaching scale runs from minus eight to seven. Each code step represents one tenth. The origin has code zero. A weight of zero point two six maps to code three and reconstructs as zero point three. An outlier can round to an index beyond the codebook, at which point clipping creates additional error. Production G G U F K-quants use more elaborate block layouts. For 1.04, the rounded index would be 10. Clip to 7 and reconstruct 0.7. The absolute error is 0.34. In post-training quantization a representative calibration set can reveal activation ranges or weights that particularly affect layer outputs. GPTQ approximates layer reconstruction error. AWQ uses activation information to protect salient weights. Quantization-aware training instead accounts for quantization effects while updating parameters. Calibrating only on short English chat can hide errors for long code or non-English documents. Evaluate those slices against the unquantized reference. A frozen quantized backbone can supply weights to a higher-precision computation while small trainable adapters learn the task update. NF4 uses a different set of representable levels from this uniform integer example. Track base weights, adapter gradients and optimizer state separately. Increasing adapter rank leaves the frozen four-bit weights intact but grows the trainable state. Lowering the base precision alone does not eliminate training activations. A coarse scale covers large magnitudes while losing distinctions between nearby small weights. A fine scale preserves small differences but clips outliers. Different layers or groups can use their own scales, at a metadata cost. Weight precision, activation precision, accumulator precision and key and value-cache precision are independent choices. A four-bit weight file does not imply four-bit arithmetic or memory for the entire system. 00:04:14 Change the ruler Increasing the toy scale reduces outlier clipping but what can it cost? The number of codes remains fixed. Changing the scale spreads them farther apart. The wider ruler helps the outlier and coarsens the near-zero measurements. Edda keeps a calibration set and measures downstream outputs. two carefully chosen weights expose the trade without predicting the best production setting.