The Incredible Shrinking AI: A Guide to Quantization

How to fit a 175-billion parameter model on your MacBook.

Team · · 9 min read

The biggest problem with modern AI is Memory. A model like Llama-3-70B requires over 140GB of VRAM just to load—far more than any consumer computer has.

Quantization is the engineering trick that makes AI "small" enough to run locally.

The Math: From Float32 to 4-bit

Normally, each "weight" in a neural network is stored as a 32-bit floating-point number (Float32). This is incredibly precise, but it’s overkill.

  1. FP16/BF16 (16-bit): The current standard for training. It halves the memory with almost zero loss in quality.
  2. INT8 (8-bit): This maps the range of weights to 256 possible integers.
  3. 4-bit (and even 2-bit!): This is where it gets extreme. We map the weights to just 16 possible values.

The "Squeezing" Effect

Imagine a high-resolution photo. If you convert it to an 8-bit GIF, you lose some detail, but the "meaning" of the photo is still there.

Quantization does this to the AI's "brain." We find the most important patterns and "round" the numbers to the nearest available integer. If done correctly (using techniques like GPTQ or GGUF), a 4-bit model can perform at 95% of the accuracy of the original 32-bit model, while using 8x less memory.

Why It’s the Future

Quantization is the reason we have AI on our phones and laptops. It’s what allowed the "Open Source" movement to explode—by making "SOTA" (State of the Art) models accessible to everyone, not just those with a $10,000 GPU. The "Small Model" revolution is built on the back of 4-bit precision.