PB-LLM: Partially Binarized Large Language Models

Zhihang Yuan, Yuzhang Shang, Zhen Dong

TL;DR

PB-LLM is the first successful framework to bring 1-bit binarization to Large Language Models (LLMs) without destroying their reasoning capabilities. By identifying and "protecting" a small percentage of critical (salient) weights in higher precision while binarizing the rest, the authors achieve extreme compression—reaching effective bit-widths as low as 1.7 bits—while maintaining performance that rivals much heavier 4-bit models.

The Challenge: The Memory Wall and Binarization Collapse

The "memory wall" is the primary bottleneck for deploying LLMs. A model like LLaMA-65B requires over 130GB of VRAM just for inference, far exceeding the capacity of most consumer GPUs. While 4-bit quantization has become a standard solution, pushing further into the "ultra-low-bit" territory (1 or 2 bits) typically leads to a catastrophic "collapse" in the model’s linguistic and reasoning abilities.

Existing binarization techniques (which compress weights to just $\pm1$) were designed for smaller computer vision models. When applied to LLMs, these methods fail because LLMs are highly sensitive to "salient weights"—outlier values that carry a disproportionate amount of the model's knowledge. PB-LLM addresses this by proposing a "partial" approach: binarize the bulk of the model, but keep the vital few weights intact.

The PB-LLM Methodology

The core innovation is the Partially-Binarized LLM (PB-LLM) strategy, which selectively compresses the network to preserve its reasoning capacity.

PB-LLM Architecture and Performance Recovery

The framework operates in three main stages:

  1. Salient Weight Identification: The authors compared magnitude-based filtering (keeping the largest absolute values) and Hessian-based filtering (using second-order derivatives to find weights that most affect the loss). Surprisingly, for training-based approaches, simple magnitude-based filtering was highly effective and much cheaper to compute.
  2. PB-GPTQ (Post-Training Quantization): For scenarios where retraining isn't possible, the authors adapted the popular GPTQ algorithm. It binarizes non-salient weights and uses the Hessian matrix to "compensate" for the resulting error by adjusting the remaining higher-precision weights.
  3. Quantization-Aware Training (QAT): To further recover performance, the authors developed a specialized QAT regime. They found that freezing the salient weights during training and using an analytically derived optimal scaling factor for the binarized weights allowed the model to converge significantly faster than traditional QAT methods.

Evaluation and Datasets

The authors evaluated PB-LLM across a variety of benchmarks to ensure robustness:

  • Language Modeling (Perplexity): WikiText2, C4, and PTB.
  • Zero-Shot Reasoning: A suite of seven tasks including BoolQ, PIQA, HellaSwag, WinoGrande, ARC (Easy and Challenge), and OpenBookQA (OBQA).
  • Training Data: For the QAT experiments, they used a 1-billion token subset of the RedPajama dataset to fine-tune the models.

Key Insights

  • The "Salient" Secret Sauce: The paper confirms that not all weights are created equal. Retaining just 10-30% of weights in 8-bit precision while binarizing the other 70-90% allows the model to retain almost all its "intelligence."
  • Binarization is Not Just Quantization: Naive binarization fails because it lacks the granularity to represent the complex distributions in LLMs. PB-LLM treats binarization as a structural search for which parts of the network can be simplified and which must remain precise.
Training Loss with Frozen Outliers
  • Efficiency in Training: Traditional LLM-QAT often requires 100k+ iterations. By freezing salient weights (outliers), PB-LLM achieves recovery in just 1k–10k iterations, making it a much more practical tool for researchers with limited compute.
  • Analytic Scaling: Instead of letting the model learn scaling factors for binarized weights (which can be unstable), the authors provide a mathematical derivation for the "ideal" scaling factor based on the L1-norm of the weights, significantly stabilizing the training process.

Performance Highlights

  • Superiority over 4-bit RTN: On LLaMA-7B, PB-LLM with 30% salient weights (effectively ~2.7 bits) achieved an average zero-shot accuracy of 66.9%, actually outperforming standard 4-bit Round-To-Nearest (RTN) quantization (65.2%) and nearly matching the full-precision (FP) baseline (68.7%).
  • Extreme Compression: Even with only 10% salient weights (effectively ~1.7 bits), the model maintained a reasoning score of 60.6%, whereas previous binarization methods dropped to near-random guess levels (~30-36%).
  • Fast Convergence: The QAT training curves show that PB-LLM begins recovering reasoning capabilities almost immediately, while standard binarized models remain flat-lined for the duration of training.

Limitations and Future Directions

  • Hardware Support: While PB-LLM reduces the theoretical memory footprint and allows for efficient bitwise operations (XNOR/Bitcount), current deep learning frameworks and hardware (like standard NVIDIA GPUs) are not yet fully optimized to run "mixed-precision" binarized kernels at peak efficiency.
  • Salient Ratio Tuning: The performance is highly sensitive to the percentage of salient weights chosen. Finding the "sweet spot" for different model architectures (e.g., Falcon vs. LLaMA) still requires manual experimentation.
  • Future Work: The authors suggest exploring more sophisticated ways to store the "index" of salient weights (like CSR or CSC sparse formats) to further reduce the overhead of the partial binarization map.

Summary updated

BibTeX
@inproceedings{yuan2024pb,
  author = {Zhihang Yuan and Yuzhang Shang and Zhen Dong},
  title = {{PB-LLM: Partially Binarized Large Language Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=BifeBRhikU},
}
Figure