Quantization formats and what they cost
GPTQ, AWQ, GGUF's K-quants and the rest — what each one actually does to the weights, and where the quality goes when it goes.
Quantization is usually presented as a choice between file names. You are shown a list — Q4_K_M, GPTQ 4-bit, AWQ, NF4, 5.0bpw — with a size column and a vague ranking, and you pick the one that fits. That works until it does not: the model that fits produces subtly worse code, or the format your download is in has no kernel on your card, or the quantized weights are the same size as advertised and the process still runs out of memory. At that point the file name stops being enough and you need to know what the format actually did.
These pages take each format apart. What gets stored per weight, what gets stored per group, which tensors are treated differently from the rest, what the calibration data was for, and which step is the one that loses information. The arithmetic is done on the page from inputs you can check, because the interesting questions here — how much memory a group size costs, why 4-bit and not 3, why a vision tower is left alone — are answerable with division and a published constant, and answering them that way survives the next release of every tool involved.
GPTQ Explained: How Post-Training Calibration Works
The actual GPTQ loop — the layer-wise objective, the inverse-Hessian error update, and the three shortcuts that make it finish in hours instead of weeks.
10 min read
AWQ Explained: Protecting the Weights That Matter Most
How activation-aware quantization identifies salient channels from activation statistics and protects them with a scaling transform rather than higher precision.
9 min read
EXL2 and Fractional-Bit Quantization
How ExLlamaV2 mixes 2-, 3-, 4-, 5-, 6- and 8-bit quantization within one model to hit an arbitrary average bitrate, and what the measurement pass is measuring.
9 min read
bitsandbytes NF4 Quantization Explained
Why NormalFloat4 places its sixteen levels on the quantiles of a normal distribution instead of spacing them evenly, with the codebook values listed.
9 min read
Group Size in GPTQ and AWQ Quantization
What a group is, exactly how many bits per weight group sizes 32, 64 and 128 cost, and what changes in accuracy when you move between them.
8 min read
What a Calibration Dataset Actually Does During Quantization
Calibration data does not train anything — it decides which rounding errors are cheap, and the mechanism is different for GPTQ, AWQ and activation quantization.
9 min read
Quantization Granularity: Per-Tensor, Per-Channel and Per-Group Scales
One mechanism at three resolutions — how many weights share a scale — with the memory cost of each option worked out and the reason activations cannot use the fine ones.
9 min read
The Marlin Kernel and Why Quantized Weights Still Run Fast on GPU
Why a 4-bit matmul is a memory-bandwidth problem, why earlier W4A16 kernels lost their advantage as batch size grew, and what Marlin does about it.
9 min read
SmoothQuant Explained
How an offline per-channel rescaling moves quantization difficulty out of the activations and into the weights, making int8 activation quantization viable.
9 min read
Weight-Only Quantization Explained
Why W4A16 — quantized weights, full-precision activations — is the default for local inference, worked through the memory arithmetic and the batch-size limit.
9 min read
Dynamic Quantization for LLM Inference
What it means to compute a quantization scale at runtime instead of from calibration data, what that costs per token, and why weights never do it.
8 min read
What K, M and S Mean in a GGUF Quant Name
Decoding Q4_K_M and its relatives tensor by tensor — what the K structure is, and which specific tensors the S, M and L variants promote.
9 min read
Why 4-Bit Quantization Became the Local-Inference Default
An argument that 4 bits won on three independent constraints — the size curve, the published quality cliff below it, and byte alignment — none of which is about quality alone.
10 min read
Outlier Features and Why LLM Quantization Breaks Without Handling Them
The emergent outlier phenomenon in transformer activations, the measured evidence for it, and why it kills naive int8 but leaves weight-only 4-bit alone.
9 min read
How Long GPTQ Calibration Takes and What It Needs in Memory
The one published wall-clock anchor for GPTQ, a peak-VRAM model derived from layer shapes, and why quantizing a 70B does not need a 70B's worth of memory.
10 min read
INT4 Accuracy Loss by Model Size, Derived
The published per-size perplexity deltas for 4-bit quantization, a mechanism for why they shrink with scale, and an honest account of what the table does not show.
10 min read
Mixed-Precision Quantization: Keeping Some Layers at Higher Bits
How sensitivity ranking decides which layers get more bits, with the memory arithmetic for a non-uniform bake against a uniform one.
9 min read
Quantizing a Vision-Language Model: What's Different
Why the vision tower and projector are excluded from quantization, why the calibration set has to contain images, and what breaks when it does not.
9 min read
Other topics
- LLM fundamentals & architecture
- Tokens, tokenization & context windows
- Prompt engineering
- Reasoning models & test-time compute
- Multimodal AI: vision, audio, video
- RAG & retrieval
- Embeddings & vector search
- AI agents & tool use
- Structured output & function calling
- Fine-tuning & post-training
- Local inference errors, string by string
- Running local models day to day
- Testing code that calls an LLM
- Snapshot and property testing for model output
- Regression suites for prompts
- Eval gates in CI
- Flaky tests against a model
- Determinism and the cost of testing
- Contract and streaming tests
- Testing tool calls and retrieval
- Inference, serving & latency
- Rolling out a prompt change
- Testing AI systems in practice
- Forecasting a time series
- Machine learning on tabular data
- Geospatial data and models
- Understanding audio that is not speech
- Understanding video
- Core computer vision tasks
- Machine learning on graphs
- Point clouds and 3D
- Evaluation, benchmarks & LLM-as-judge
- Sensor and IoT data
- Logs and event streams
- Models over biological sequences
- Machine learning on molecules
- Embedding and searching code
- Extracting invoices and purchase orders
- Receipts, statements and tax forms
- Insurance policies and contracts
- Deeds, court filings and patents
- Extracting from medical records
- Observability & LLMOps
- CVs, certificates and identity documents
- Shipping, customs and technical documents
- Meetings, email, chat and filled-in forms
- Building an extraction pipeline
- Business, property and inspection documents
- Contract clauses and insurance claims
- Regulated and compliance documents
- Consumer, travel and closing documents
- Mapping one chat API onto another
- SDK and framework migrations
- Hallucination & failure modes
- Re-embedding and model deprecation
- Cutting over between providers
- Parity gaps, shims and legacy endpoints
- Moving between model versions
- Migrating vector stores and caches
- Mapping capabilities and parameters
- Migrating pipelines and agents
- Contracts, runbooks and rollback
- Auditing a codebase before a cutover
- Compliance and fine-tune migration
- LLM cost engineering
- Routing, cost tracking and multi-tenancy
- What a migration does to your prompts
- AI security & prompt injection
- Privacy, compliance & data residency
- AI governance, policy & society
- Building reliable AI applications
- AI hardware, GPUs & compute
- Open-weight models & local inference
- AI for developers & coding agents
- AI in industry: vertical playbooks
- AGI, superintelligence, alignment & the long future
- Machine learning foundations
- NLP fundamentals & classical tasks
- Data engineering for AI
- Synthetic data & dataset curation
- AI product design & UX
- Search, ranking & recommendation
- Enterprise adoption & change management
- AI careers, skills & teams
- Reading AI research
- AI in science & discovery
- Robotics & embodied AI
- AI economics, markets & business models
- AI myths, hype & media literacy
- Context engineering
- Shipping AI features: patterns & anti-patterns
- Build it: end-to-end AI tutorials
- Python for AI: hands-on recipes
- TypeScript, React and the web
- Frameworks and SDKs
- Errors and troubleshooting
- AI facts, numbers and statistics
- The history of AI
- The maths behind AI
- Architectures beyond the transformer
- Reinforcement learning
- Diffusion and generative media
- Speech, audio and voice engineering
- Benchmarks, one at a time
- AI search visibility
- Infrastructure and operations
- Databases and storage for AI
- Knowledge graphs and structured knowledge
- Classical ML in production
- Regulation, jurisdiction by jurisdiction
- Prompt recipes and pattern library
- AI for people who do not write code
- Writing, media and creative work
- Edge and on-device AI
- Interpretability and model internals
- Field notes
- OpenAI model behaviour
- Claude model behaviour
- Gemini model behaviour
- Llama model behaviour
- Mistral model behaviour
- Qwen model behaviour
- DeepSeek model behaviour
- Cohere model behaviour
- Grok model behaviour
- Small model behaviour
- Hybrid model architectures
- Token cost by language and script
- Transliteration, romanization and script handling
- Locale-correct output
- Multilingual generation quality
- Multilingual pipelines
- The EU AI Act, article by article
- AI under the GDPR and EU data law
- US AI regulation, state and sector
- International AI governance and standards
- AI litigation and enforcement
- Running AI workloads on AWS
- Running AI workloads on Google Cloud
- Running AI workloads on Azure
- AI at the edge: Workers, Vercel and Netlify
- Serving models on Kubernetes
- Operating AI infrastructure
- llama.cpp, flag by flag
- Ollama and the desktop local-model runtimes
- Local models on Apple Silicon
- Hardware for local inference
- Running speech and embedding models locally
- Model files, adapters and conversion
- VRAM arithmetic for local models