Understanding AI model quantisation

Quantisation is why a model that needs 16 GB can run in 5. Here's what the 4-bit, 8-bit and Q4_K_M labels mean, and what you give up for the smaller size.

An AI model is mostly a huge list of numbers called weights. Normally each weight is stored with 16 bits of precision. Quantisation (or quantization) stores them with fewer bits, typically 8 or 4. The model becomes much smaller and faster, at the cost of a little accuracy. It's the main reason capable models can run on an ordinary laptop.

How much memory it saves

As Hugging Face explains, at 16-bit precision each weight takes 2 bytes. At 8-bit it takes 1 byte, and at 4-bit half a byte. That gives a simple rule of thumb for the weights alone:

Model size16-bit8-bit4-bit
8 billion parameters~16 GB~8 GB~4 to 5 GB
27 billion~54 GB~27 GB~14 to 17 GB
70 billion~140 GB~70 GB~35 to 43 GB

Real formats add a little overhead, and the model also needs memory for its working context. Apple's own measurements show the effect: Qwen3-8B used about 17.5 GB at full 16-bit precision but about 5.6 GB at 4-bit.

How much quality you lose

llama.cpp publishes measurements on Llama 3 8B, comparing each version with the full 16-bit model:

VersionPrediction error (perplexity)Same top word as the full model
16-bit (original)6.233100%
Q8_0 (8-bit)6.234 (about +0.04%)97.7%
Q6_K6.25396.0%
Q4_K_M (about 4.9 bits)6.407 (about +3%)91.9%
Q2_K (about 3.2 bits)9.752 (about +56%)71.1%

The pattern is clear: 8-bit is nearly lossless, 4-bit costs a little, and below 4 bits quality falls off sharply. Larger studies agree: a 2024 study of the Llama 3.1 family (published at ACL 2025) found 4-bit weight-only quantisation rivalling 8-bit, and the MLX team notes that 8-bit models are usually as good as 16-bit ones.

Why smaller is faster

When a model writes its answer, each new token requires reading the model's weights from memory. Apple's machine learning researchers describe this step as bounded by memory bandwidth. Fewer bytes to read means faster writing. llama.cpp's figures on an 8B model, from one test machine, show it: about 29 tokens a second at 16-bit, 51 at 8-bit and 72 at Q4_K_M.

The formats you'll see

  • GGUF (llama.cpp, used by Ollama and LM Studio): names like Q4_K_M, Q5_K_M, Q6_K and Q8_0. The number is roughly the bits per weight; "K" is the K-quant method; S, M and L are mixes. "IQ" types use an importance matrix to keep more quality at very low bits.
  • MLX (Apple): mlx_lm.convert --model <model> -q makes a 4-bit version; options set the bits and group size, and newer modes include MXFP4 and NVFP4.
  • MXFP4 and NVFP4: newer 4-bit floating-point formats. OpenAI ships gpt-oss with its mixture-of-experts weights in MXFP4, which lets gpt-oss-20b run within 16 GB. Ollama says NVFP4 roughly halves the quality loss of 4-bit quantisation (compared with q4_K_M) on Gemma 4 12B.
  • GPTQ and AWQ: methods mainly used on NVIDIA and other GPUs.

Don't forget the context cache

Quantising the weights isn't the only option. The memory a model uses for its conversation (the KV cache) can be compressed too. In Ollama, OLLAMA_KV_CACHE_TYPE=q8_0 uses about half the memory of the default, which Ollama says usually has no noticeable impact (it requires Flash Attention, which Ollama turns on where supported); q4_0 saves more with some loss. This is separate from the model's own quantisation.

How to choose

  1. Start from your memory. Pick a model and quantisation that leaves room for context and your other apps. See what computer you need.
  2. Consider a bigger model at 4-bit rather than a smaller one at 16-bit. Since 4-bit costs only a little quality, the same memory can hold a much larger model; test both on your own work.
  3. Use 8-bit when it fits comfortably. It's practically identical to the original.
  4. Avoid going below 4-bit unless you have no choice.
  5. Test on your own work. Hugging Face advises benchmarking on your own task and hardware.

Quantised models in Nexus

Nexus, a native Mac app for building with AI, runs quantised local models through its built-in engine based on Apple's MLX or through Ollama: download a model inside the app, or use your Ollama models if you've installed Ollama, then pick it in the chat. Nexus will be a one-time purchase of $199 USD, with no Nexus subscription; it needs an Apple silicon Mac with macOS 12 or later (14 or later for local models and the Codex app, 13 or later for Claude Code). Connecting third-party AI services such as Claude Code or Codex is optional and at your own expense (see Nexus pricing). It's coming soon.

Frequently asked questions

Is a 4-bit model much worse than the full model?

Usually only a little. In llama.cpp's measurements on Llama 3 8B, the common Q4_K_M version raised perplexity (a measure of prediction error) by about 3% compared with the full 16-bit model, and picked the same top word about 92% of the time. Below 4 bits, quality drops much faster.

What does Q4_K_M mean?

It's a llama.cpp (GGUF) quantisation type: roughly 4 bits per weight using the K-quant method, in a medium mix. In llama.cpp's table it averages about 4.9 bits per weight.

Should I use 4-bit or 8-bit?

Use 8-bit if it fits comfortably in your memory, since it's almost indistinguishable from the full model. Use 4-bit to run a bigger, more capable model in the same memory. LM Studio's advice is to choose a 4-bit option or higher if your machine can handle it.