INT4 vs INT8 Quantization: Memory, Speed

INT4 vs INT8 Quantization: Memory, Speed

What if you could shrink a large AI model to a quarter of its size and still keep most of its quality? That is the basic promise of quantization, a compression trick that has quietly become one of the most important tools in modern machine learning. The two most talked-about flavors are INT8 and INT4, and the choice between them shapes how much memory a model needs, how fast it runs, and how much accuracy it loses along the way.

The short version: INT8 is the safe, well-understood option. INT4 is the aggressive one that saves far more memory but asks harder questions about quality. This article breaks down how each works, where they differ in practice, and how to decide which one fits a given job. For readers tracking how these techniques move through the wider tech world, the latest news coverage is a good place to watch the trend unfold.

What Quantization Actually Does

Neural networks normally store their weights and activations as floating-point numbers, usually 16-bit (FP16) or 32-bit (FP32). Those formats are precise, but they are also heavy. Quantization maps those high-precision values onto a much smaller set of integers, which cuts memory use and lets hardware run faster integer math instead of slower floating-point operations.

The difference between the two formats comes down to how many distinct values each can represent:

Format Bit width Distinct values Relative size vs FP16
FP16 16 bits ~65,536 (with sign, exponent, mantissa) 1x (baseline)
INT8 8 bits 256 ~1/2
INT4 4 bits 16 ~1/4

Sixteen levels is not a lot of room. That single fact explains almost every trade-off that follows. The PyTorch quantization documentation is a solid primer if you want to see how these concepts are implemented in a major framework.

How INT8 Quantization Works

How INT8 Quantization Works

INT8 became the default because it hits a sweet spot. With 256 levels, an affine mapping (scale plus a zero-point) can represent a wide range of values with very little error. The foundational paper here is Jacob et al., 2018, which laid out the now-standard scheme of per-tensor affine quantization with integer-only arithmetic and showed that INT8 inference on MobileNet-class models stays close to float accuracy. You can read the original work on integer-arithmetic-only inference from Jacob et al. for the full method.

For years, people assumed INT8 would just work on large language models too. It did not. Dettmers et al., 2022, found that a small number of outlier features with huge magnitudes wreck naive 8-bit quantization of LLMs. Their fix, LLM.int8(), kept those outliers in FP16 and quantized everything else to INT8, enabling 8-bit inference of models up to roughly 175 billion parameters without accuracy loss. The LLM.int8() paper on outlier features explains the mixed-precision decomposition in detail.

That history matters because it shows INT8 is not automatically “safe” either. It is safe when the method accounts for outliers. Skip that step and even 8 bits can hurt.

How INT4 Quantization Works

INT4 pushes much harder. With only 16 levels, rounding error grows fast, so naive 4-bit quantization usually falls apart. The field solved this with smarter algorithms rather than brute force.

The breakthrough was GPTQ (Frantar et al., 2023), a post-training method that quantizes weights to 3–4 bits using layer-wise second-order error compensation. It reported 4-bit results close to FP16 on the OPT and BLOOM model families. The GPTQ paper on 3–4-bit weight quantization walks through the Hessian-based approach.

A second major advance was AWQ (Lin et al., 2024), or activation-aware weight quantization. The insight: only about 1% of weight channels matter disproportionately, and you can identify them by watching activation magnitudes. Protect those channels and 4-bit weight-only quantization holds up with low perplexity degradation. The AWQ paper on protecting salient weight channels covers the method. (Quantization (signal processing)))

The Weight-Only vs Full-Quantization Trap

Here is the detail that trips up a lot of people. In LLM research, “INT4” almost always means weight-only quantization: the weights get squeezed to 4 bits while activations stay in FP16. “INT8,” by contrast, often means quantizing both weights and activations, as in LLM.int8() and SmoothQuant.

That means INT4 and INT8 are not simply two rungs on the same ladder. They are frequently measuring different things. Comparing a weight-only INT4 model against a weight-plus-activation INT8 model is apples to oranges unless you check the fine print.

The Memory Math, Plain and Simple

Weight-only quantization roughly divides weight memory by 2 for INT8 and by 4 for INT4 compared with FP16. For a 7-billion-parameter model, the rough calculation looks like this:

Precision Approx. weight memory (7B model)
FP16 ~14 GB
INT8 ~7 GB
INT4 ~3.5 GB

These are arithmetic estimates that ignore overheads like embeddings, KV cache, and framework bookkeeping, so real numbers run higher. Still, the pattern holds: INT4 can turn a model that will not fit on a single consumer GPU into one that does. That is often the entire reason people reach for it. If you are weighing hardware and deployment options, the cloud category covers infrastructure choices that pair with these trade-offs.

Accuracy: Where the Real Difference Shows Up

Published results generally show INT8 near-lossless for many models, while INT4 quality swings widely depending on the algorithm and model size. A few practical patterns stand out:

  • Bigger models tolerate 4 bits better. A 70B model at INT4 often holds up well because it has more redundancy to spare.

  • Smaller models degrade more at 4 bits. A 7B model squeezed to INT4 can show noticeable quality loss on reasoning-heavy tasks.

  • The algorithm matters as much as the bit width. GPTQ and AWQ at 4 bits routinely beat naive 4-bit rounding by a wide margin.

  • Task sensitivity varies. Creative writing may survive INT4 fine while code generation or math suffers.

One caution: reported degradation figures are not comparable across papers because they use different models, benchmarks, and baselines. Be skeptical of any single “INT4 loses X%” claim presented without context.

Hardware Support Is Not Symmetric

INT8 tensor-core and accelerator support is broadly available across modern GPUs, mobile NPUs, and edge chips. Native INT4 support is more limited and often handled as weight-only or emulated in software. Hardware roadmaps move quickly, so verify against current vendor documentation before committing to a deployment plan. A format that a chip advertises in a spec sheet may not deliver the speedup you expect if the software stack has not caught up.

A Practical Decision Framework

So which should you pick? It depends on what you are optimizing for. Here is a workable way to think about it:

  • Start with INT8 if accuracy is non-negotiable. It is the mature, well-tested default for production systems where a quality regression is unacceptable.

  • Reach for INT4 when memory is the binding constraint. If the model will not fit otherwise, a well-implemented 4-bit version beats not running it at all.

  • Always benchmark on your own task. Public perplexity numbers are a guide, not a verdict. Run your actual prompts through both versions.

  • Check whether the scheme is weight-only or full. This determines what you are really comparing.

  • Match the method to the model size. Use proven algorithms like GPTQ or AWQ rather than naive rounding, especially on smaller models.

Common Mistakes to Avoid

People new to quantization stumble in predictable ways. They assume INT4 is always “better” because it is smaller, forgetting that quality is the whole point. They compare a weight-only INT4 model against a full INT8 model and draw the wrong conclusion. They test on a single benchmark and call it done. And they forget that activations, KV cache, and framework overhead can eat into the memory savings they expected. A little skepticism up front saves a lot of debugging later.

What Actually Works in Practice

The pattern that holds up across deployments: use INT8 as your baseline and treat INT4 as a targeted optimization for memory-constrained situations. When you do go to 4 bits, use a modern algorithm, test on real tasks, and keep an FP16 version around for comparison. If you want more background reading on how these tools fit into broader systems, the blog archive has related explainers.

Conclusion

INT4 and INT8 are not rivals so much as tools for different jobs. INT8 is the dependable workhorse: mature, broadly supported, and close to lossless when implemented well. INT4 is the aggressive compressor that can make the impossible fit, provided you use a smart algorithm and accept that quality depends heavily on your model and task. The right choice comes down to one question: is memory your bottleneck, or is accuracy? Answer that honestly, benchmark on your own workload, and the decision usually makes itself.

Frequently Asked Questions

What is the main difference between INT4 and INT8 quantization?

INT8 stores values in 8 bits (256 levels) and INT4 in 4 bits (16 levels). INT4 cuts weight memory roughly in half compared with INT8, but the smaller value range makes accuracy loss much more likely without a smart quantization algorithm.

Is INT4 always faster than INT8?

Not necessarily. INT4 reduces memory and can speed up memory-bound workloads, but native hardware support for INT4 is less common than for INT8. If the chip or software stack handles 4-bit math poorly, INT8 can actually run faster in practice.

Does INT4 quantization hurt model accuracy?

It can, and the amount depends heavily on the model size and method used. Larger models tend to tolerate 4 bits better, and algorithms like GPTQ and AWQ preserve quality far better than naive rounding. Smaller models often show noticeable degradation at 4 bits.

Why do some INT8 models still lose accuracy?

Large language models contain outlier features with very large magnitudes, and naive 8-bit quantization of those values causes errors. Methods like LLM.int8() handle this by keeping outliers in higher precision while quantizing the rest, which restores accuracy.

Can I run a 7B model on a single consumer GPU with INT4?

Often yes. A 7-billion-parameter model takes roughly 14 GB in FP16, about 7 GB in INT8, and around 3.5 GB for weights alone in INT4. Real memory use runs higher once you add overheads, but INT4 frequently makes single-GPU deployment feasible.

Which should I choose for production: INT4 or INT8?

Start with INT8 if accuracy is critical, since it is mature and broadly supported. Choose INT4 when memory is the hard constraint and you can validate quality on your own tasks. Benchmark both on real workloads before committing.

The deeper lesson is that bit width is a means, not an end. The goal is the smallest representation that preserves the behavior you depend on, and that threshold is empirical, not theoretical. A team that measures its own accuracy budget and picks the format accordingly will outperform one that chases the lowest bit count. Treat quantization as an engineering trade-off with a measurable cost, document which scheme and algorithm you used, and revisit the choice as models and kernels improve. For the underlying arithmetic and calibration details, the integer-arithmetic-only inference from Jacob et al. remains the clearest starting point, and pairing it with the outlier and GPTQ/AWQ papers above gives a complete picture of both formats.

One final consideration: quantization interacts with the rest of your stack. KV cache size, batch size, and context length all compete for the same memory you freed, so an INT4 model with a long context may still exceed your budget. Measure end-to-end memory rather than weights alone, and confirm that the inference framework uses the quantized kernels you expect instead of silently dequantizing. With those checks in place, the choice becomes a documented engineering decision you can revisit as models, kernels, and hardware evolve.

Latest articles

Scroll to Top