Skip to content
TheAgent Ecosystem
Models & Cost

LLM Quantization Explained: GGUF vs GPTQ vs AWQ

What each format actually does to your weights, how much quality you lose at 4 bits, and which one your hardware can run.

Muhammad Qasim HammadAI-assisted10 min read1,999 words

AI-drafted, reviewed by Muhammad Qasim Hammad on October 18, 2026. See our AI disclosure.

LLM Quantization: Three Formats, One Decision
Table of contents
  1. What does quantization actually change inside the model?
  2. How much quality do you actually lose?
  3. What is the difference between GGUF, GPTQ, and AWQ?
  4. How much memory does a quantized model actually need?
  5. Which format fits your hardware?
  6. What should you run first?

Every guide to running a model locally eventually hands you a list like Q4_K_M, Q5_0, GPTQ-4bit, AWQ, and expects you to know which one to download. The names encode 2 different things at once: how many bits each weight gets, and which algorithm decided what to do with the rounding error. Those are separate choices, and the second one matters more than the first: a badly-designed 3-bit format loses far more accuracy than a well-designed one at the same nominal bit width.

What does quantization actually change inside the model?#

It changes how each weight is stored, not what the model knows. A 16-bit weight becomes a 4-bit or 5-bit integer plus a small shared scaling factor, so the file shrinks by roughly the ratio of the bit widths. The architecture, the parameter count, and the training are all untouched.

The mechanism is bucketing. Take a block of weights, find the range they span, and divide that range into however many steps your bit budget allows. At 4 bits you get 16 steps. Each original weight snaps to the nearest step, and you store the step index plus the block's scale. Reconstruction at inference time multiplies back out.

Four-step diagram showing weights grouped into a block, the range divided into steps, values snapped to indices, and reconstruction at inferenceThe model's knowledge is untouched. Only the storage precision of each weight changes.

That is why quantization is lossy in a specific way: it introduces rounding error, and the error is worst where weights inside a block are spread far apart. Everything clever in the modern formats is an attempt to manage that spread, either by using smaller blocks, by giving sensitive layers more bits than insensitive ones, or by choosing which weights to protect based on how much the model actually depends on them.

The naming conventions encode those choices, once you know how to read them. In llama.cpp's scheme, the digit is the nominal bit width and the letters after it describe the strategy: _K marks a k-quant that varies precision across tensors, and the trailing _S, _M, or _L picks how generous that variation is. So Q4_K_M is a 4-bit k-quant of medium generosity, and its real footprint lands above 4 bits per weight once the scales and the higher-precision layers are counted. Q4_0 is the older flat scheme with no per-layer variation, which is exactly why the 2 can score differently while both claiming 4 bits.

How much quality do you actually lose?#

Less than the folklore suggests down to about 4 bits, then sharply more below it. On Llama-3.1-8B-Instruct, 8-bit is indistinguishable from the 16-bit baseline, 5-bit and 4-bit sit within a point of it on downstream tasks, and 3-bit is where measurable damage begins.

The numbers below come from a single evaluation that ran all 13 configurations under the same conditions, which is what makes them comparable. The baseline is FP16 at 15,317 MiB, perplexity 7.32 on WikiText-2, and a 69.47% average across GSM8K, HellaSwag, IFEval, MMLU, and TruthfulQA. Source

FormatFile sizeSize cutPerplexity5-task average
FP16 baseline15,317 MiB0%7.3269.47%
Q8_08,138 MiB46.87%7.33near baseline
Q5_05,332 MiB65.19%7.4369.92%
Q4_K_S4,468 MiB70.83%near baseline69.17%
Q3_K_S3,487 MiB77.23%8.9665.49%
Bar chart comparing downstream benchmark accuracy across FP16, Q5_0, Q4_K_S and Q3_K_S on Llama-3.1-8B-InstructAverage of GSM8K, HellaSwag, IFEval, MMLU and TruthfulQA. Q5_0 above baseline is noise, not a gain.

Two honest readings of that table. First, Q5_0 scoring 69.92% against a 69.47% baseline is not quantization improving the model. It is measurement noise on a 5-task average, and reading it as a gain would be a mistake. Second, the damage at 3 bits is not evenly spread: mathematical reasoning took the worst of it, with GSM8K falling 9.3 points from 77.63% to 68.31%, while commonsense reasoning stayed essentially flat across every level. If your workload is arithmetic or multi-step logic, you have less headroom than a benchmark average implies.

What is the difference between GGUF, GPTQ, and AWQ?#

GGUF is a file format; GPTQ and AWQ are algorithms that decide how to round. GGUF packages llama.cpp's k-quant schemes, which vary bit depth by layer sensitivity. GPTQ uses approximate second-order information to compensate for error as it quantizes. AWQ protects the small fraction of weights the activations show to be salient.

That distinction confuses people because the 3 names appear side by side in download lists as though they were alternatives at the same level. In practice they cluster by runtime. GGUF is what you use with llama.cpp and everything built on it, which is why it is the format behind the local runners covered in Ollama, LM Studio and Jan. GPTQ and AWQ produce GPU-resident models you serve from Python.

Comparison of GGUF as a container format against GPTQ and AWQ as quantization algorithms across runtime, hardware and methodThey sit at different levels of the stack, which is why they appear side by side in download lists.

The algorithms are worth understanding because their assumptions differ. GPTQ quantizes weights one at a time using approximate second-order information, adjusting the remaining unquantized weights to compensate for the error just introduced. Its paper reports quantizing a 175B-parameter model in roughly 4 GPU hours at 3 to 4 bits with negligible accuracy degradation, and inference speedups near 3.25 times on an A100 and 4.5 times on an A6000 against FP16. Source

AWQ starts from a different observation: not all weights matter equally, and protecting roughly 1% of them substantially reduces quantization error. Its insight is that you should identify those salient channels from the activation distribution rather than from weight magnitude, since what matters is which weights the model actually leans on. The paper targets 4-bit weight-only quantization and reports its TinyChat runtime delivering more than 3 times the speed of a Hugging Face FP16 implementation. Source

How much memory does a quantized model actually need?#

Start with parameters times bits divided by 8 for the weights, then add the KV cache, which grows with context length and is usually stored at higher precision. An 8B model at 4 bits needs roughly 4.5 GB for weights, but a long-context session can add several more gigabytes on top of that.

The weight math is the easy half and the part every VRAM calculator shows you. The measured file sizes above track it closely: 8B parameters at roughly 4.5 effective bits per weight lands near 4.5 GB, and Q8_0 at 8 bits lands near 8.1 GB. Effective bits per weight is not exactly the nominal number, because k-quant formats spend extra bits on scales and on layers they judge sensitive.

The KV cache is the half that surprises people. It scales with context length, batch size, and layer count, and it is live memory rather than a fixed file, so a model that loads comfortably can still fail partway through a long conversation. If you are sizing hardware for concurrent users rather than a single chat, that cache is usually the binding constraint, and it is one reason the economics of running your own hardware turn on utilisation rather than on the model you picked, which is the arithmetic in local against API cost breakeven.

There is also a third claim on memory that no calculator shows: the runtime's own overhead, plus whatever the operating system and display stack already hold. On a 16 GB card the practical ceiling for weights plus cache is closer to 14 GB than 16, and on a shared machine it can be lower still. Planning to fill the card exactly is how you end up with a model that loads on a clean boot and fails after a browser has been open for an hour.

Quantizing the KV cache itself is the lever most people miss. Both llama.cpp and the GPU serving stacks can store cache entries at 8 bits instead of 16, which roughly halves the fastest-growing part of your memory budget and costs noticeably less quality than taking the weights down another level. If you are choosing between a smaller weight format and a smaller cache format to fit a long context, the cache is usually the better thing to compress.

Checklist of five memory consumers when running a quantized model locally including weights, KV cache, runtime overhead and headroomOnly the first line is what a VRAM calculator shows you.

Which format fits your hardware?#

Hardware decides more than preference does. GGUF runs on CPU, CUDA, Metal, and Intel GPUs, which makes it the only realistic option on Apple Silicon or a CPU-only box. AWQ targets CUDA, ROCm, and Intel GPUs with no Metal support. GPTQ covers a similarly GPU-centric range.

Decision flowchart for picking a quantization format based on accelerator, reasoning workload, and calibration needsHardware narrows the field first, then workload decides how many bits you can afford to give up.

Hugging Face publishes a support matrix for exactly this decision, listing each method against CPU, CUDA, ROCm, Metal, and Intel GPU alongside its available bit widths and whether it quantizes on the fly. Source The practical shortcuts fall out quickly. On a Mac, GGUF. On a single consumer NVIDIA card with a Python serving stack, AWQ or GPTQ at 4 bits. If you need to load an unquantized checkpoint and compress it on the fly without a calibration pass, bitsandbytes does that at 4 and 8 bits where the other 2 do not.

Calibration is the hidden cost worth naming. GPTQ and AWQ both need a representative data sample to decide how to round, so downloading a prequantized checkpoint means inheriting whatever calibration set its author used. That is usually fine for general use and occasionally wrong for a narrow domain, which is one more reason to measure on your own prompts rather than trusting a leaderboard, the same way you would evaluate a smaller model against a larger one.

What should you run first?#

Start at 4-bit in a format your hardware supports natively, measure on your own prompts, and only move up if you can show a specific failure. The measured evidence puts 4-bit and 5-bit within about a point of full precision on general tasks, so starting higher usually spends memory you could have given to context instead.

The one place to override that default is reasoning-heavy work. If your prompts involve arithmetic, code with tight logic, or multi-step planning, benchmark 5-bit against 4-bit before deciding, because that is where the measured gap between levels actually opens up. Everything else is a matter of fitting the model into the memory you have while leaving room for the cache.

It is also worth checking whether quantization is the right lever at all. Squeezing a large model onto small hardware competes directly with picking a smaller model that fits comfortably, and a well-chosen 8B at 5 bits often beats a heavily-compressed 30B on both speed and reliability. That tradeoff, plus the economics of running any of it locally instead of calling an API, is the local-versus-API breakeven calculation worth doing before you optimize the format at all.

Frequently asked questions

Is GGUF better than GPTQ or AWQ?
The question mixes categories. GGUF is a container format used by llama.cpp and the local runners built on it, while GPTQ and AWQ are quantization algorithms producing GPU-resident models you serve from Python. The real choice is usually decided by your hardware, not by quality.
How much quality does 4-bit quantization lose?
Very little on general tasks. In a controlled evaluation of Llama-3.1-8B-Instruct, Q4_K_S scored a 69.17% 5-task average against a 69.47% FP16 baseline while cutting file size by 70.83%. Math-heavy work degrades earlier than that average suggests.
What does the K in Q4_K_M mean?
It marks a k-quant, meaning the format varies precision across tensors instead of applying one flat bit width everywhere. The trailing S, M, or L sets how generous that variation is, so real bits per weight land above the nominal 4.
Should I quantize the KV cache too?
Often yes. The cache grows with context length and batch size and usually becomes the binding memory constraint before the weights do. Storing it at 8 bits instead of 16 roughly halves that growth and typically costs less quality than dropping another weight level.
Do GPTQ and AWQ need calibration data?
Yes. Both use a representative data sample to decide how to round, so a prequantized checkpoint inherits whatever calibration set its author used. That is usually fine for general use and occasionally wrong for narrow domains, which is why you should test on your own prompts.

Sources

Primary references and vendor documentation used while drafting and reviewing this article.

  1. Which Quantization Should I Use? A Unified Evaluation of llama.cpp Quantization on Llama-3.1-8B-Instruct (2026)
  2. Frantar et al.: GPTQ, Accurate Post-Training Quantization for Generative Pre-trained Transformers
  3. Lin et al.: AWQ, Activation-aware Weight Quantization for LLM Compression and Acceleration
  4. Hugging Face: Quantization method overview and hardware support matrix

Written by

Muhammad Qasim Hammad
Muhammad Qasim Hammad
AI agents & automationFounder · Cart Gaze LLCPMP-certified PM

Muhammad Qasim Hammad is an AI agent and automation expert and the founder of Cart Gaze LLC (cartgaze.com). He builds product for the love of it: when an idea lands, a working prototype is usually running within hours, built with the same AI agents and automations he sells. He puts his own output at roughly 20× what it was before agents, and the Agentic OS behind this site is the working proof, documented in public with the tools he actually ran and what they really cost.

AI & Automation Services

Want a pipeline like this running in your business?

I'm Qasim — I design and ship AI agents and n8n automations for solo operators and small teams. Tell me what's eating your team's week, and I'll scope a fix.

Related reading