AI State of the Art
SOTA/Inference & Optimization/27 min
Section 121

SqueezeLLM, QuIP, AQLM: Compression to 2-3 Bits

Listen as a podcast →

The Outlier Problem: Why Naive Rounding Fails

SqueezeLLM is a post-training quantization method (PTQ): it applies to an already trained, frozen model and never retrains it, the same side of the dividing line as GPTQ and AWQ, opposite QAT.

SqueezeLLM: Dense-and-Sparse Quantization (Kim et al., 2023)

An LLM's weights hide an embarrassing flaw: a handful of them are far larger than all the rest. These extreme values, the outliers, are very rare, but they wreck uniform rounding.

To see why, take an analogy. Imagine arranging 1000 books on a shelf, 999 of which run between 200 and 300 pages. One single book is 15,000 pages long. If you create evenly spaced categories from the smallest to the largest, nearly all of your categories go to covering the empty stretch between 300 and 15,000 pages, and the other 999 books all end up in the first category, with no distinction between a 210-page book and a 290-page one.

That is exactly what happens with uniform quantization of an LLM's weights.

The measurement the method rests on

The authors plot the weight distribution layer by layer in LLaMA-7B and find that 99.9% of the weights sit within roughly 10% of the total range of values. Put the other way: 0.1% of the weights are spread over the remaining 90%. But the quantization grid has to span the whole range. At 4 bits you only have 16 levels: the overwhelming majority of weights gets squashed onto one or two of them, while the rest of the levels cover empty space.

SqueezeLLM: Two Simple but Powerful Ideas

SqueezeLLM attacks the outlier problem with a two-pronged strategy. The central idea: treat normal cases and extreme cases separately.

Idea 1: Non-Uniform Quantization

Instead of spacing quantization levels evenly (0, 1, 2, ..., 15 for INT4), SqueezeLLM places them where the weights are actually concentrated. If 80% of weights are between -0.1 and +0.1, then the majority of quantization levels are placed in that interval.

Real weights-0.1-0.050.00.050.10.55.0
Uniform quantization01234515 (wastes 8 levels)
Non-uniform quantization12345615 (uses every level)

Concretely, SqueezeLLM uses k-means clustering: it searches for 16 representative values (the centroids) such that every weight lands as close as possible to one of them. Each centroid becomes a quantization level, and each weight is replaced by the index of its nearest centroid. It costs more to compute than even spacing, but the gain is considerable at low precisions (2 to 3 bits).

A second refinement is what earns the name "sensitivity-based quantization": the centroids are not chosen to minimize the error on the weights, but to minimize the impact on the model's output. A weight the model leans on heavily pulls the centroids towards itself; a negligible weight does not. The importance measure used is Fisher information, a standard statistical quantity playing the same role here as the Hessian in GPTQ: it says how much the output moves when you jiggle a weight.

Two stacked charts. On top, the weight histogram of one LLaMA-7B channel, bell-shaped and centered on zero, with red triangles marking the twenty most sensitive values. Below, the chosen quantization levels: green ticks evenly spaced (uniform quantization) and purple ticks clustered around the peak of the distribution (sensitivity-aware non-uniform quantization).
On top, the real weight distribution of one channel: almost everything sits between -0.03 and +0.03. Below, the green ticks show where a uniform quantizer puts its levels, several are wasted in the empty regions on the left and right. SqueezeLLM's purple ticks instead cluster where the weights actually are, and near the sensitive values marked in red.Source : SqueezeLLM paper (Kim et al., 2023), figure 3, via arXiv

Idea 2: Store the Extreme Values Separately, in High Precision

The second idea is even more elegant: extract the extreme values and store them apart in full precision (FP16), in a sparse format, CSR, Compressed Sparse Row, which records only the non-empty cells of an array along with their coordinates. Every other weight is aggressively quantized to 3 or 4 bits.

Result=(dense quantized matrix)×activations+(sparse matrix)×activations\text{Result} = (\text{dense quantized matrix}) \times \text{activations} + (\text{sparse matrix}) \times \text{activations}

Reading the formula: the original weight matrix has been cut into two pieces whose sum rebuilds it. Since multiplying by a sum is the same as summing the products, you just do two multiplications and add them. The first runs on compressed weights, the second on a nearly empty matrix, so it is very fast.

It's like having two parallel channels: a compressed channel for the vast majority of weights, and a precision channel for the few critical values.

How many weights get spared? In the paper's main configuration, 0.45%: 0.4% outliers (the largest in absolute value) and 0.05% sensitive values (those with the highest Fisher information). And that overhead is quantifiable: keeping 0.45% of the weights at 16 bits instead of 3 pushes the average cost from 3 bits to 3.24 bits per weight. A little under 8% more, for a quality gain the next section puts a number on. Another illustration of the general rule: a format advertised as "3-bit" never actually costs exactly 3.

Three three-dimensional surfaces side by side, joined by an equals sign then a plus sign. On the left the original weight matrix W, spiked with a few very tall red peaks. In the middle the dense matrix D, uniformly low and easy to quantize. On the right the sparse matrix S, nearly empty except for the extracted peaks.
The dense-and-sparse decomposition made visual. The original weight matrix (left) is hard to quantize because a handful of spikes blow up the scale. It is split in two: a dense matrix with no spikes, whose narrow value range quantizes cleanly at 3 bits, and a sparse matrix holding only the rare extreme values, kept in FP16.Source : SqueezeLLM paper (Kim et al., 2023), figure 4, via arXiv

What it delivers, with the protocol

Here are the figures from table 4 of the paper. Protocol: LLaMA-7B, perplexity measured on C4 and on WikiText-2, methods compared at equal memory cost (3.24 average bits per weight for all of them). Perplexity is the effective number of words the model is torn between, lower is better; definition in quantization concepts.

Method (≈3.24 bits/weight)C4 perplexityWikiText-2 perplexity
FP16 (reference, 16 bits)7.085.68
GPTQ, groups of 1287.896.27
AWQ, groups of 1287.906.44
SqueezeLLM (0.45% sparse)7.566.13

At an identical memory budget, then, SqueezeLLM cuts the gap to full precision by about 40% relative to GPTQ: 0.48 of a point on C4 against GPTQ's 0.81. That is what the paper's abstract phrases as reducing the gap "by up to 2.1x", depending on the model.

What not to conclude from this

You sometimes read that "SqueezeLLM at 3 bits matches GPTQ at 4 bits". The paper's numbers don't quite bear that out: at 4.24 bits, GPTQ with groups of 128 reaches 5.78 on WikiText-2, against 6.13 for SqueezeLLM at 3.24 bits. The solid claim is the one in the table above, at equal memory.

Two charts. On the left, five decreasing perplexity bars for LLaMA-7B at 3 bits: 28.26 for the baseline RTN method, then 18.08 after adding non-uniform quantization, 7.75 after adding sensitivity, then 7.67 and 7.56 after extracting sensitive values and outlier values. On the right, perplexity versus model size in gigabytes, with the SqueezeLLM curve clearly below the FP16 baseline curve.
On the left, the cumulative effect of the two ideas measured on LLaMA-7B at 3 bits: perplexity falls from 28.26 to 7.56 as each piece is added (non-uniform, then sensitivity, then extraction of sensitive and outlier values). Lower perplexity is better. On the right, at equal file size a larger model quantized by SqueezeLLM beats a smaller one at full precision.Source : SqueezeLLM paper (Kim et al., 2023), figure 1, via arXiv

Other Advanced Quantization Techniques

SqueezeLLM isn't alone in the race for extreme compression. Several rival approaches tackle the same problem with very different philosophies.

QuIP: Making Outliers Disappear With a Rotation

QuIP (Quantization with Incoherence Processing) takes the problem in reverse: rather than handling outliers after the fact, it makes them disappear before quantizing. How? By putting the weight matrix through a rotation, a transformation that leaves the computation's result unchanged, since you apply the inverse rotation to the activations. And a rotation redistributes one large isolated value across all dimensions: afterwards there is no spike left, the distribution is homogeneous, and it rounds cleanly. This is the same principle described in FP8 training.

  • QuIP# improves on the idea with Hadamard matrices, far faster to apply, and adds structured codebooks
  • Notable results at 2 bits, a regime where most methods collapse
  • Slight compute overhead at inference, offset by dedicated GPU programs
QuIP: 2-Bit Quantization of Large Language Models With Guarantees (Chee et al., 2023) QuIP#: Even Better LLM Quantization with Hadamard Incoherence and Lattice Codebooks (Tseng et al., 2024)

AQLM: Codebook Quantization

AQLM (Additive Quantization for Language Models) changes the paradigm. Instead of representing each weight by a single quantized number, it represents a small group of weights as a sum of vectors drawn from learned codebooks:

group of weights≈Codebook1[i1]+Codebook2[i2]+Codebook3[i3]\text{group of weights} \approx \text{Codebook}_1[i_1] + \text{Codebook}_2[i_2] + \text{Codebook}_3[i_3]

Reading the formula: each codebook is a numbered list of vectors, and i1i_1, i2i_2, i3i_3 are entry numbers in those lists. So what gets stored is no longer weights but three indices, plus the codebooks, shared across the whole layer.

Think of a colour system: instead of noting each pixel's exact hue, you note "base blue + a touch of green + a hint of grey." With a few well-chosen codebooks you can cover an enormous variety of values with very few bits. AQLM is among the strongest methods at 2 bits.

Extreme Compression of Large Language Models via Additive Quantization (AQLM, Egiazarian et al., 2024)

HQQ: Speed Above All

HQQ (Half-Quadratic Quantization) sacrifices a bit of quality for a large gain in speed. Its main appeal: it needs no calibration set at all. The model is quantized from its weights alone, without ever being shown text.

HQQGPTQ
Quantization timeMinutesHours
Data neededNoYes (calibration)
HQQ: the prototyper's tool

If you need to try a quantized model quickly without waiting on a calibration, HQQ is the right reflex. Its authors report quantization times on the order of a minute where GPTQ takes hours; we have not verified those figures independently.

FP8 Quantization: The Immediate Future

On recent GPUs (H100, L40S, and beyond), the FP8 (8-bit floating point) format is supported directly by the hardware. That changes everything:

  • One byte per parameter instead of two: a 7 billion parameter model goes from 14 GB to 7 GB, exactly half
  • Twice the operations per second of FP16: this is an advertised hardware property, the H100's matrix units processing FP8 at double the FP16 rate
  • Little or no calibration for the weights: converting often suffices. Quantizing the activations to FP8 as well does require determining scale factors, so some calibration.
  • Supported by vLLM, TensorRT-LLM, and the major inference servers

FP8 is the least risky format of the lot: halving memory at 8 bits is far more comfortable than dropping to 4. It's the first reflex on a recent GPU, subject, as always, to measuring on your own task.

Practical Guide: Which Method to Choose?

MethodBitsQuantization speedQualityBest for
RTN (round-to-nearest)4-8InstantAverageQuick tests
GPTQ3-4HoursGoodStandard GPU production
AWQ4MinutesVery goodGPU production, good tradeoff
HQQ2-4MinutesGoodRapid prototyping
QuIP#2-4MinutesVery goodExtreme compression
AQLM2-3HoursAmong the best at 2 bitsExtreme compression, research
GGUF2-8MinutesGoodCPU and GPU inference (Ollama)
2-bit: exciting but not yet reliable

2-bit quantization produces fascinating results in research, but remains unstable in production. For demanding tasks (math, code, multi-step reasoning), 4 bits remains the reliable standard. Always test on your own use case before deploying 2 or 3 bits.

Mixed-Precision Quantization

The idea: apply different precisions depending on how important each part of the model is, the input and output layers more finely, the middle layers more coarsely. This is no longer an emerging trend: it is exactly what the _S, _M, _L suffixes of the GGUF formats do, and it is why a "4-bit" format actually costs nearly 4.9 bits per weight.

The Other Side of the Line: Training While Knowing You Will Quantize

Every method on this page is post-training. The alternative is quantization-aware training (QAT): you train the model with the low precision imposed from the start, and it learns to cope. That costs a full training run instead of a calibration, but it lets you go where PTQ collapses. The emblematic example is BitNet b1.58, whose weights only take the values -1, 0 or +1: three values, i.e. about 1.58 bits per weight, not 1, see extreme quantization.

On-Device Quantization

Core ML (Apple) and LiteRT (formerly TFLite, for TensorFlow Lite (Google)) let you quantize and run models directly on phones and connected devices, with no remote service involved. For LLMs specifically, that role is played today by GGUF and llama.cpp.

Check your understanding0 / 4

1. Why does uniform rounding fail on LLM weights, according to the measurement SqueezeLLM is built on?

2. What does SqueezeLLM do with the roughly 0.45 percent of weights that are extreme or particularly sensitive?

3. One sometimes reads that SqueezeLLM at 3 bits equals GPTQ at 4 bits. What do the paper's numbers actually say?

4. Faced with outliers, what is the approach specific to QuIP, a rival method to SqueezeLLM?