Skip to main content
Back

Qualcomm's LLVQ Beats Every 2-Bit LLM Compressor Using 24-Dimensional Math

Qualcomm researchers use a 24-dimensional lattice tied to a Fields Medal result to squeeze large language models down to 2 bits per weight.

Pro

Paper, Full Access
  • Qualcomm AI Research introduces LLVQ, a 24-dimensional vector quantizer built on the Leech lattice.
  • Uses the extended Golay code to compute lattice points on the fly, eliminating explicit codebook storage.
  • Achieves 92% retention of the Shannon rate-distortion limit at 2 bits per dimension on Gaussian sources.
  • Outperforms QuIP#, QTIP, AQLM, and PVQ across Llama-2, Llama-3, Ministral-3, and Qwen-v3 at 2 bits per weight.
  • Introduces Spherical GPTQ, a norm-preserving GPTQ variant that enables strong Hadamard-free post-training quantization.
  • Fused CUDA kernel delivers a 1.36x speedup over FP16 matrix-vector baseline at 4096x4096.

Compressing large language models to 2 bits per weight without wrecking accuracy has been one of the hardest problems in efficient inference. A new paper from Qualcomm AI Research, Leech Lattice Vector Quantization for Efficient LLM Compression, tackles this using a piece of mathematics so exotic that it earned Maryna Viazovska a Fields Medal in 2022: the Leech lattice, the densest known sphere packing in 24 dimensions. The result, LLVQ, beats QuIP#, QTIP, AQLM, and PVQ across Llama-2, Llama-3, Ministral-3, and Qwen-v3 at 2 bits per weight.

Why scalar quantization hits a wall

Classical rate-distortion theory says that mapping weights one at a time is fundamentally suboptimal, even for independent Gaussian sources. To beat this bound, you have to code blocks of weights jointly, which is what vector quantization (VQ) does: a d-dimensional block of weights becomes a single b-bit index into a codebook of size 2^b.

The catch is that a naive codebook doesn't scale. With enough dimensions to matter, both the storage of the codebook and the cost of nearest-neighbor lookup explode. Recent LLM quantizers have tried to fix this with structure: QuIP# uses the E8 lattice in 8 dimensions, QTIP uses trellis-based constructions, and PVQ uses high-dimensional pyramids. LLVQ pushes the same idea further, to the highest dimension where an optimal lattice packing is actually known.

The Leech lattice in one paragraph

A lattice is just a regularly spaced grid of points in space. The Leech lattice has a kissing number of 196,560 in 24 dimensions, and this is proven optimal, meaning no arrangement of unit spheres in 24D can touch a central sphere more times. For quantization, dense packing translates directly into low distortion: each point in the grid represents a small, near-spherical region of space, so any weight vector you land in gets rounded to a codeword that is provably close.

The problem is that a Leech-based codebook has astronomical cardinality. You can't materialize it. LLVQ's key move is to never store it in the first place.

Codebook-free encoding via the Golay code

LLVQ builds on a 1988 algorithm by Adoul and Barth that exploits the construction of the Leech lattice from the extended binary Golay code, a classic 24-bit error-correcting code. The Leech lattice is built from this code, and each lattice point corresponds to a codeword or a shifted version of one. Instead of storing lattice points, you store the much smaller Golay code rules. When you need a lattice point, you compute it from the code.

The paper extends this into a full quantization pipeline with three concrete contributions:

  1. Bijective indexing. The original algorithm could find nearest neighbors but couldn't map lattice points to unique integer bitstrings, which is exactly what a compressed representation requires. LLVQ organizes the lattice hierarchically by shells (points at the same squared norm), then classes (coordinate multisets), then local symmetries (Golay refinements, sign patterns, permutations), and encodes each level with modulo/integer-division arithmetic.
  2. Multi-shell angular search. Single-shell search only works when all candidates share a norm. LLVQ generalizes to a union of shells and adds cosine-similarity scoring, which is what shape-gain quantization needs.
  3. Parallel dequantization kernel. The reconstruction path is just small table lookups, integer division, and local combinatorial ops, with no dependencies between blocks, so it maps cleanly onto a CUDA kernel.

Spherical GPTQ: the geometric twist

Shape-gain quantization splits a weight vector into a direction (on the unit sphere) and a magnitude, quantizing each separately. LLVQ combines this with GPTQ-style Hessian error feedback, and the authors notice something clean: the standard scale-correction step of shape-gain acts as a retraction onto a product of spheres, yielding a Spherical GPTQ primarily acting on directions.

In practice this means after quantizing a block, you rescale it to match the original block norm, then compute the GPTQ residual using that norm-preserved reconstruction. The greedy error-feedback loop then operates on a hypersphere instead of unconstrained Euclidean space. Low-angular-distortion LLVQ reduces sensitivity to Hadamard/rotation preprocessing, and enables a strong Hadamard-free PTQ in practice. That matters because online Hadamard transforms are a real latency cost at inference time when they can't be fused into weights.

How close to the Shannon limit

On i.i.d. Gaussian sources at 2 bits per dimension, LLVQ gets closer to the theoretical rate-distortion floor than any competing quantizer. On Gaussian sources, LLVQ realizes the highest SQNR among competing quantizers, achieving over 92% retention of the Shannon limit at 2 bits/dim. For comparison, uniform scalar quantization retains 69%, Lloyd-Max 77%, and E8 (as used in QuIP#) 82%.

LLM benchmarks

The Gaussian gains translate directly into real models. At 2 bits per weight on Llama-2 7B, LLVQ with shape-gain achieves a Wikitext-2 perplexity of 5.48 with lightweight fine-tuning of only per-column scale factors, versus 5.86 for QTIP and 6.19 for QuIP# under similar conditions. On the harder 2-bit configurations without any fine-tuning, LLVQ still beats QuIP# by wide margins across MMLU and common-sense reasoning tasks.

Across five model families evaluated in a unified pipeline (Llama-2 7B, Llama-3 8B, Ministral-3 8B, Qwen-3 4B and 8B), the pattern holds. The shape-gain variant with zero gain bits is often the strongest configuration, which matches the paper's theoretical observation that when angular distortion is low enough, spending bits on direction is more valuable than spending them on magnitude.

Kernel performance

LLVQ ships with a fused CUDA kernel that combines dequantization and the matrix-vector product without materializing the weight matrix. On a 4096x4096 shape, the fused LLVQ kernel runs in 11.94 microseconds versus 16.3 microseconds for the FP16 baseline, a roughly 1.36x speedup. The authors note the kernel is slightly slower than QTIP's, but LLVQ compensates with better representation quality.

Caveats and what it's good for

A few practical constraints worth flagging:

  • The 24-dimensional block size is a hard architectural constraint. Weight tensors need to be padded or reshaped to multiples of 24, which is awkward for many transformer dimensions that are powers of two.
  • The paper focuses on representation quality and includes only preliminary kernel benchmarks. Beating QTIP on end-to-end inference latency will require more low-level engineering.
  • LLVQ is a post-training quantization method. Fine-tuning is limited to per-column scales, so the recovery techniques available in QAT pipelines aren't fully explored here.

For teams shipping models at aggressive compression ratios, especially the 2 bits per weight regime where scalar methods collapse, this is a meaningful upgrade over E8-based approaches. The Hadamard-free variant is particularly interesting for latency-sensitive deployments where the cost of online rotations is prohibitive. The paper doesn't mention public code, but the algorithm descriptions in the appendices and the pseudocode for Spherical GPTQ are detailed enough to reproduce.