Skip to content
ginsberg.si

How AI Chatbots Actually Work · Part 4 of 5

What's Inside an AI Model, and Why People Shrink It

What's inside a model download, in plain English: billions of weights, and why people shrink them so the layer's output stays close. No math.

11 Nov 2026

A wall of filing drawers spilling numbered weights toward a smaller bookshelf of compressed volumes.

A tens-of-gigabytes download is not a book of English sentences. It is a labeled warehouse of matrices — the dial settings from Lesson 3 — written in a particular numeric handwriting.

Open a modern checkpoint and you find metadata plus large tensors with names like attention projections and feed-forward gates. From the technical course: Llama-3-8B has 8,030,261,248 parameters. In bfloat16 (two bytes each), the raw weights alone are on the order of sixteen gigabytes. An illustrative ~25-billion-parameter configuration occupied about 50.5 GB in bfloat16, mostly in the feed-forward layers.

Number formats trade precision and range against memory. Quantization stores weights in fewer bits — often around four — by careful rounding, scaling, and grouping. Naive four-bit storage fails when a few extreme values stretch the scale. Practical methods group weights, learn scales per group, and sometimes protect weights that matter more for the layer's output. The goal is not to keep every weight pristine. The goal is to keep the layer's output close.

A thick book labeled full precision beside a slim book labeled compressed, with a note that says keep the layer's output close.
Keep the layer's output close
1.90%
Held-out output errorPlain rounding (RTN)

Round each weight; ignore which ones matter more for the output.

Measured on real Llama-3-8B layer-0 q_proj weights at 4 bits with groups of 128 (technical Lesson 18). Held-out text.

Q4_K_M, popular in the GGUF family used with llama.cpp, mixes mostly 4-bit blocks with some higher-bit tensors. On a measured Llama-3-8B file, that was about 4.894 bits per weight overall. GPTQ and AWQ are competing recipes with the same moral. One published comparison cited in the technical course moved Llama-3-8B perplexity from about 6.23 to 6.41 under Q4_K_M, with KL divergence around 0.031 — a small shift, not a different book.