NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

QBB: Quantization with Binary Bases for LLMs

Adrian Bulat, Yassine Ouali, Georgios TzimiropoulosNeurIPS 2024

TL;DR

QBB (Quantization with Binary Bases) is a novel post-training quantization method that compresses Large Language Model (LLM) weights into a sum of multiple 1-bit binary matrices. By effectively replacing costly matrix multiplications with hardware-friendly summations, QBB achieves state-of-the-art low-bit quantization performance—matching or beating standard 4-bit methods—while paving the way for highly energy-efficient LLM inference.

What Problem Does This Paper Address?

Deploying massive LLMs on consumer hardware requires quantization, typically down to 4 bits. While current Post-Training Quantization (PTQ) methods handle 4-bit compression well for large models, they struggle with smaller models (sub-7B parameters) and hit a wall when trying to compress further.

More importantly, standard 4-bit quantization still relies on mixed-precision matrix multiplications (e.g., 16-bit activations multiplied by 4-bit weights). These operations lack native hardware support on many chips, requiring software workarounds that leave potential energy and speed efficiency on the table. The authors tackle this by pushing quantization to the extreme: binarization (1-bit). If weights are purely binary ($-1$ or $1$), multiplications can be entirely replaced by simple additions and subtractions, drastically reducing power consumption. The challenge? Naive binarization destroys model accuracy.

Methods

To make binarization accurate, QBB represents a single full-precision weight matrix as a linear combination of $N$ binary matrices (usually $N=4$), each paired with a scaling vector. The method involves three main phases:

1. Cascaded Initialization

Instead of randomly initializing the binary matrices, QBB uses an analytical solution. The first binary matrix approximates the original weights. The second matrix approximates the residual error left by the first, the third approximates the error of the second, and so on.

Cascaded Initialization Process

2. Iterative Optimization

Using gradient descent (via a straight-through estimator to handle the non-differentiable sign function), the authors optimize the binary matrices. To prevent chaotic training instability, they freeze all but one binary matrix at a time, updating them sequentially in a round-robin fashion while continuously updating the scaling vectors.

Iterative Optimization with Round-Robin Updates

3. Data-Free Holistic Calibration

Finally, QBB fine-tunes only the scaling vectors to recover global model performance. Instead of requiring a real training dataset, the full-precision "teacher" model generates synthetic text from random tokens. The quantized "student" model is then calibrated using Knowledge Distillation (KD) to match the teacher's output logits.

To make the approximation even easier, QBB uses progressive quantization: it starts with weights that have already been quantized to 4-bit by an off-the-shelf method (like GPTQ) rather than starting from raw 16-bit weights.

Datasets

  • Evaluation: The models were evaluated on the standard WikiText2 dataset to measure perplexity (a standard metric where lower is better).
  • Calibration: None. A major feature of QBB is that it is entirely data-free. It relies solely on synthetically generated tokens produced by the model itself, bypassing the need for curated calibration datasets.

Key Insights and Ideas

  • Residuals are the secret to binary bases: Directly trying to optimize multiple binary matrices at once fails. By forcing each subsequent binary matrix to target the residual error of the previous ones, the reconstruction error drops by 2x compared to standard initialization.
  • Simultaneous updates cause chaos: Because binary weights flip abruptly between $-1$ and $1$, updating all $N$ matrices simultaneously causes massive training oscillations. Updating them one-by-one (akin to block coordinate descent) is crucial for convergence.
  • Smart data filtering speeds up distillation: During the data-free calibration phase, the authors don't just use all the synthetically generated text. They score the generated sequences and only train on the ones where the teacher and student models disagree the most. This makes the calibration highly sample-efficient.
  • Summations over Multiplications: By using $N=4$ binary bases, the math reduces to conditional additions. On custom hardware, an adder circuit consumes roughly 4x to 8x less energy than a multiplier, meaning this mathematical restructuring translates directly to massive theoretical power savings.

Key Results

The authors evaluated QBB across the LLaMA, LLaMA-2 (7B to 70B), and Phi-2 (2.7B) model families.

  • State-of-the-Art Accuracy: Using 4 binary bases ($N=4$), QBB matches or outperforms existing state-of-the-art 4-bit and 3-bit PTQ methods (like GPTQ, AWQ, OmniQuant, and QuIP#).
  • Concrete Numbers: On LLaMA-2 7B, QBB achieves a WikiText2 perplexity of 5.21. For comparison, OmniQuant (4-bit) achieves 5.58, and QuIP# (4-bit) achieves 5.56.
  • Small Model Success: On the notoriously difficult-to-quantize Phi-2 (2.7B) model, QBB successfully maintains stability, achieving a perplexity of 10.40 without requiring any real training data.

Limitations and Future Work

  • Hardware Implementation: The massive efficiency gains (removing multiplications) are currently theoretical. The authors note that custom CUDA kernels or specialized hardware (like FPGAs or ASICs) need to be developed to actually realize these speed and energy benefits in practice.
  • Inherited Biases: Because the method is applied post-training to existing LLMs, the quantized models will inherit any biases present in the original closed-source training datasets.
  • Future Work: The authors suggest that future research could explore binarizing the activations as well as the weights. If both are 1-bit, inference could be performed using purely bit-wise operations (like XNOR), unlocking even more extreme hardware efficiency.

Summary updated

BibTeX
@inproceedings{bulat2024qbb,
  author = {Adrian Bulat and Yassine Ouali and Georgios Tzimiropoulos},
  title = {{QBB: Quantization with Binary Bases for LLMs}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=Kw6MRGFx0R},
}
Figure