✎ Edit content·DAY 063 · POST 2 OF 5 · Why It Matters

Quantization (4-bit, 8-bit)

NLP & LLMs · 12 slides
DAY 063 · POST 2 OF 5
(REMINDER)
DAY 063
Why Quantization Matters
@saurav_dnj_24github.com/SauravDnj · linkedin.com/in/sauravdnj
1 / 12

Theme

Palette

Download

4K — sharpest, slowest
🎬 Video options
Preparing preview…
Live preview · loops the “none” effect
All rendering runs in your browser. No server, no cost, no upload. MP4/WebM = full motion + effects · GIF = lightweight loop · PNG/PDF = static for the Instagram & LinkedIn carousel.

Caption (tap to copy)

📖 Deep dive (full written explanation)

The slides stay clean and scannable. Here's the in-depth explanation behind each one — great for the blog version, show notes, or studying the topic properly.
Slide 1 · Why Quantization Matters

Having defined quantization, this post argues why it's one of the most consequential inference techniques in practice. The short version: memory is the budget for running large models, and quantization is how you spend far less of it. That single fact reshapes who can run what, and at what cost.

The emotional hook is real — quantization is the reason an individual can run a 70B model at home at all. That's not a minor optimization; it's a shift in access.

Slide 2 · Memory is the real bottleneck

The most important and least intuitive point is that LLM inference is memory-bandwidth-bound, not compute-bound. Generating each token requires reading the full weight set from memory. The GPU's math units often sit idle waiting for data to arrive.

Because of this, cutting the bits per weight cuts the bytes that must be streamed per token, and latency drops close to proportionally. People assume quantization is purely about fitting in memory, but the speedup is just as important — and it comes from the same change.

Slide 3 · VRAM to load a 7B model

The bar chart drives home the headline numbers for a 7B model. FP32 needs about 28GB just for weights, FP16 about 14GB, INT8 about 7GB, and INT4 about 3.5GB. Each step down the precision ladder roughly halves the footprint.

Those thresholds map directly onto real hardware. 28GB rules out most consumer cards; 3.5GB fits comfortably on a modest laptop GPU. The chart is really a map of which hardware each precision unlocks.

Slide 4 · The back-of-envelope formula

This slide gives you the formula to compute any of those numbers yourself: weight memory is approximately parameters times bytes-per-parameter. FP32 is 4 bytes, FP16 is 2, INT8 is 1, and INT4 is half a byte.

The reason to internalize this is planning. Before you download a model or rent a GPU, you can estimate in seconds whether it will fit. Remember to add headroom — activations and especially the KV cache for long contexts consume additional memory beyond the weights.

Slide 5 · Compute the memory yourself

The code turns the formula into a tiny loop that prints the memory for each format. There's nothing fancy here, and that's the point: capacity planning for model serving is genuinely this simple at the first-order level.

Keep this snippet handy. When someone asks 'will this 13B model fit on my 8GB card in 4-bit?' you can answer with arithmetic rather than guessing. The answer, for the record, is yes for the weights — roughly 6.5GB — though you'll want to watch the KV cache.

Slide 6 · Bigger model on the same card

A subtle but powerful framing: quantization isn't only about shrinking a fixed model, it's about choosing a better model for a fixed memory budget. A 4-bit 13B model occupies similar VRAM to an FP16 7B but is usually noticeably more capable.

This reframes the decision. Instead of 'how small can I make my model,' the question becomes 'given my VRAM, what's the most capable model I can run?' Often the answer is a larger model at lower precision, because you're spending your bits on capability rather than on decimal places you don't need.

Slide 7 · The access story

The comparison spells out the access story that makes quantization matter beyond raw performance. Without it, large models live on multi-GPU servers, which means cloud rentals, per-hour costs, and your data leaving your machine. With 4-bit, the same models run on one or two local cards.

That changes who gets to participate. Privacy-sensitive use cases become viable because data never leaves the device, costs drop to electricity, and the barrier to experimentation collapses — anyone curious can just try things.

Slide 8 · Where the savings show up

These bullets summarize where the savings concretely land: cheaper hardware because you need less VRAM, faster tokens because less data moves, a small enough footprint for edge and mobile deployment, and local inference that sidesteps both privacy concerns and recurring API bills.

The value is multi-dimensional. Even teams that could afford big GPUs often quantize, because the latency and cost-per-token improvements compound across millions of requests.

Slide 9 · The cost flywheel

The cycle diagram captures why quantization tends to accelerate adoption. Quantizing lets a model fit cheaper hardware, which means you can run it locally without per-call costs, which lowers the friction to iterate, which leads to more usage and experimentation — and the loop reinforces itself.

This flywheel is a big part of why the local-LLM ecosystem exploded: once a capable model fits on hardware people already own, the rate of community tinkering jumps dramatically.

Slide 10 · It isn't free

Honesty matters, so this slide names the cost. Quantization trades accuracy for efficiency, and the loss is not uniform. INT8 is usually nearly invisible; aggressive INT4 can measurably degrade reasoning, math, and rare-token handling. Smaller models feel the hit more because they have less redundancy to spare.

The operational rule is simple and non-negotiable: measure quality on your own task, not just the size on disk. A model that loads is not the same as a model that still works, and only an eval tells you which you have.

Slide 11 · When it's clearly worth it

Closing with a checklist of when quantization is clearly the right call: you're VRAM-constrained, you serve high request volume where per-call savings compound, you need on-device or offline operation, or latency and hosting cost are your actual pain points.

If none of those apply — you have ample memory and low volume — the accuracy trade may not be worth it. But for the vast majority of real deployments, at least one of these is true, which is why quantization is now a default rather than an exotic optimization.

Slide 12 · Save this. Follow for Day 64.

That's the why. Quantization matters because memory is the binding constraint on running large models, and trading a little precision buys enormous gains in cost, speed, and access.

Next we open the hood: the actual equations, the scale-and-zero-point machinery, granularity choices, the outlier problem, and the difference between quantizing after training versus during it.

🎨 AI image prompt (matches this theme + palette)

Paste into Midjourney, DALL·E, Ideogram, etc. to generate an on-brand image, then upload it on the Edit content page. The prompt updates automatically with the selected theme + palette.