Model Quantization Without Accuracy Loss

The promise of quantization has always been too good to be true: compress your model 4x, run it 2–3x faster, and lose virtually no accuracy. In practice, most teams see 2–5% accuracy drops on their benchmarks — enough to kill a production deployment. At Inferex, we've figured out why, and how to avoid it.

Why Naive Quantization Destroys Accuracy

Most quantization approaches apply uniform precision reduction across all layers. This is the mistake. Attention layers and the first/last transformer blocks are far more sensitive to quantization than FFN layers. Treating them the same causes disproportionate accuracy loss.

Three specific failure modes:

The Inferex Quantization Pipeline

Step 1: Sensitivity Profiling

Before quantizing, we run a 512-sample calibration pass and measure per-layer sensitivity using Hessian-based metrics. Layers above the sensitivity threshold are kept at FP16. Typically 15–20% of layers are preserved at full precision — but they account for most of the accuracy-critical computation.

Step 2: SmoothQuant for Outlier Handling

We apply the SmoothQuant transformation to migrate quantization difficulty from activations to weights (which are static and easier to scale). This alone reduces accuracy degradation from ~3% to ~0.5% on LLM benchmarks.

Step 3: GPTQ Weight Quantization

Weights are quantized using GPTQ — a second-order optimization method that minimizes per-layer reconstruction error. At INT4, GPTQ achieves better accuracy than naive INT8 on most benchmarks.

Step 4: KV-Cache Quantization

We separately quantize the KV cache at INT8 with per-token dynamic scaling. This reduces memory bandwidth by 2x with no measurable accuracy impact on MMLU, HellaSwag, or ARC benchmarks.

Benchmark Results

Llama 3 70B on standard benchmarks (FP16 baseline vs. Inferex INT4/FP8 mixed):

Less than 0.3% accuracy degradation across all benchmarks, with 4x compression and 2.8x throughput improvement. That's the number that actually holds in production.

← LLM Throughput Scaling Hardware Comparison →