Quantization

A technique that reduces the numerical precision of model weights to shrink memory footprint and accelerate inference. Converts 16-bit floating-point parameters into 4-bit or 8-bit representations so LLMs can run efficiently on consumer hardware.

General Meaning

LLM weight parameters are typically trained and stored as 16-bit floating-point numbers (FP16 or BF16). Quantization converts those weights into lower-bit representations such as 4-bit or 8-bit integers (INT4, INT8, Q4_K_M, MXFP4, etc.).

Because weight files become dramatically smaller, larger models can fit into limited GPU VRAM or unified memory, and alleviating memory-bandwidth bottlenecks boosts token generation speed. However, overly aggressive quantization introduces a trade-off by degrading inference accuracy and structural compliance.

Why It Matters

  • Fitting within constrained memory: Enables standard desktop machines (with 16GB to 64GB of memory) to load and run 7B-to-70B-class models locally.
  • Boosting inference throughput: Reducing the bytes transferred per weight improves token generation speed (tok/s), which is primarily memory-bandwidth bound on local hardware.
  • Faster model startup and switching: Smaller weight files shorten disk read (mmap) times when loading models into memory.

How the Site Factory Uses It

To run local LLMs across Mac mini (16GB) and Mac Studio machines, the Site Factory actively adopts quantized models—such as Q4_K_M (4-bit k-quant), MXFP4, and nvfp4 recorded in evidence.json—and empirically measures both their accuracy and speed. Under rule K100 (rules.md), model adoption is never decided by nominal specs; instead, the Site Factory selects models using empirical benchmark results from the exact host machine, target task, and identical model digest.

Whether quantization-induced degradation is acceptable for operational extraction or classification is evaluated directly by the task-specific benchmark suite (mac-llm-bench), which also openly publishes failure results from small quantized models (such as MiniCPM5-2B) on the dashboard. Every A2A and benchmark execution evidence log explicitly records the model's quantization_level alongside its digest.

Caveats & Operational Rules

  • Quantization does not erase parameter-scale differences: While a 70B model at Q4 often outperforms an 8B model at Q8, aggressive quantization on a very small model can cause severe JSON syntax collapse.
  • Different quantization digests of the same model name are different models: Even under the same model name, changing the revision or quantization format alters accuracy and speed, so the Site Factory pins identity down to the exact digest.
  • Runtime compatibility and speed vary by quantization format: Even among 4-bit formats, GGUF k-quants, AWQ, GPTQ, and Apple Silicon-optimized formats (MXFP4) have different runtime support and throughput characteristics.

Related Terms

References

  • Book: Chip Huyen, "AI Engineering", Chapter 7 (Model Compression and Quantization)

Verified: 2026-11-08