Definitions

How computers for agents work, from the hardware to the sandbox.

Definitionsq

Quantization

Quantization stores a model's numbers with fewer bits, such as 8 or 4 instead of 16, so the model uses less memory and runs faster, at some cost in accuracy.

Quantization reduces the precision of the numbers in a model. A model's weights are usually trained as 16-bit or 32-bit floating-point numbers. Quantization converts them to fewer bits, such as 8-bit or 4-bit numbers. A 4-bit model takes about a quarter of the memory of the same model at 16 bits.

Smaller numbers mean a model fits on fewer or smaller GPUs, and moves less data from memory for each token. This often makes inference faster and cheaper. The trade-off is a loss of accuracy, which is small for careful methods at 8 bits and larger at lower precision. Methods differ in what they quantize, such as the weights, the activations, or the KV cache, and in whether they need extra training.

Quantization lets large models run on modest hardware, such as a single GPU or a laptop. Teams use it to serve more requests per GPU and to lower costs. A sandbox with one GPU can run a quantized model that would otherwise need several GPUs. Quality should be checked with evals after quantizing, because the loss varies by task.