TL;DR
RaanA is a fast, flexible, and data-efficient post-training quantization (PTQ) framework that delivers strong LLM compression even down to extreme sub-3-bit regimes. By combining a Hadamard-accelerated randomized vector quantization scheme (RaBitQ-H) with an integer-programming bit allocator (AllocateBits), RaanA matches or outperforms state-of-the-art baselines while quantizing a 70B model in under an hour on commodity hardware—using as little as a single synthetic sentence for calibration.
What Problem Does This Paper Address?
Mainstream PTQ methods for LLMs (such as GPTQ, AWQ, and OmniQuant) predominantly build upon the Optimal Brain Quantizer (OBQ) framework. While popular, the OBQ paradigm suffers from three critical drawbacks:
- Uniform layer treatment: OBQ minimizes reconstruction error layer-by-layer without considering how errors propagate to the final model output; early layers impact every subsequent stage, while the final layer impacts only itself.
- Heavy calibration overhead: Solving OBQ relies on estimating layer-wise Hessian matrices ($\mathbf{X}^\top\mathbf{X}$), which requires hundreds to thousands of calibration tokens, takes hours of GPU time, and risks overfitting to the calibration data distribution.
- Rigid precision: Standard methods generally restrict layers to uniform integer precisions (e.g., all 4-bit) or crude binary mixed precision (4-bit vs. 8-bit).
Methods
RaanA tackles these challenges using two core components:
- RaBitQ-H (Randomized Vector Quantization with Hadamard Transforms): Rather than rounding individual scalar weights, RaanA adopts RaBitQ, a vector quantization technique originally developed for approximate nearest neighbor search (ANNS). To eliminate RaBitQ's costly $O(d^2)$ dense random rotation, the authors introduce RaBitQ-H, replacing dense rotation with a Randomized Hadamard Transformation (RHT). RHT requires only $d$ random sign flips and executes in $O(n \log d)$ time, introducing near-zero storage and compute overhead.
-
AllocateBits (Sensitivity-Aware Bit Allocation): The authors bound the model-level output error as a function of each layer's bit-width $b_k$, showing it scales with $\alpha_k 2^{-b_k}$, where $\alpha_k$ depends on the layer's input norm and the output Jacobian norm. Allocating layer-wise bit-widths under a total budget $R$ is formulated as an integer program: $$\min_{\{b_k\}} \sum_{k=1}^L \alpha_k 2^{-b_k} \quad \text{s.t.} \quad \sum_{k=1}^L b_k m_k \le R$$ Because LLM layer dimensions are powers of 2, the greatest common divisor (GCD) of parameter counts $g = \gcd(m_1, \dots, m_L, R)$ is large ($\approx 10^6$). Dividing the constraint by $g$ shrinks the search space so dramatically that global optimization via dynamic programming runs in seconds on a CPU.
-
Zero-Shot / Few-Shot Calibration: Because Jacobian norms converge much faster than Hessian matrices, $\alpha_k$ can be estimated using just 5 training samples (few-shot) or a single synthetic sentence repeated 100 times (zero-shot).
Datasets
The authors evaluate RaanA across standard language modeling benchmarks:
- WikiText-2 (token sequence length 2048)
- C4 (evaluated on 500 validation chunks of length 2048)
Evaluated models include the LLaMA family (LLaMA-1 7B/13B, LLaMA-2 7B/13B/70B) and Qwen3 (4B, 8B, 14B). No new evaluation benchmarks are introduced.
Key Insights and Ideas
- Vector quantization breaks the OBQ bottleneck: Transitioning from entry-wise float rounding to randomized grid vector quantization (RaBitQ) yields sub-exponential error bounds and robust inner product estimation without needing heavy outlier protection schemes.
- Hadamard transforms make vector quantization viable for GEMM: In database ANNS, dimension $d$ is small relative to database size $N$, so rotation cost is negligible. In LLMs ($d \approx c$), dense rotations would double the GEMM cost. Fast Hadamard transforms reduce this overhead to $O(\log d / c)$, making vector quantization practical.
- The "Divide-by-GCD" trick: Mixed-precision bit allocation is typically NP-complete. By recognizing that transformer dimensions share large common factors ($g \sim 10^6$), the dynamic programming state space is reduced from trillions to $\sim 10^5$, making exact bit optimization essentially free.
- Calibration data is mostly unnecessary: While Hessians demand thousands of diverse calibration samples, network Lipschitz / Jacobian norms can be estimated reliably from an arbitrary dummy text prompt.
Key Results
- State-of-the-Art in Ultra-Low Bit Regimes: At ~2.3 average bits on LLaMA-2 70B (WikiText-2), RaanA achieves a perplexity of 4.49, clearly surpassing OmniQuant (6.55) and Quip# without fine-tuning (4.87).
- Zero-Shot Calibration Viability: On LLaMA-2 7B at 3.1 bits, zero-shot RaanA (using a single repeated synthetic sentence) scores 6.45 perplexity on WikiText-2, trailing 5-shot calibration (6.33) by only 0.12 points and outperforming uniform 3-bit allocation (7.63).
- Quantization Speed: Quantizing LLaMA-2 70B takes ~55 minutes (3,293 s) using 4 A100 GPUs and dual AMD EPYC CPUs—roughly $10\times$ faster than Quip# (which can take up to 10 hours for 70B models).
Limitations and Future Work
- CPU Bottleneck: RaBitQ currently lacks an optimized native GPU kernel; running the quantization core on CPU remains the primary throughput bottleneck.
- Coarse Layer-Wise Allocation: AllocateBits currently assigns uniform bit-widths across all weights within a given layer; extending allocation to column-wise, block-wise, or entry-wise granularity could further enhance quality.
- Non-Power-of-2 Dimensions: Fast Hadamard transforms require matrix dimensions to be powers of two. For architectures with irregular hidden dimensions, RaanA must fall back to tiled or segmented transforms.
Summary updated