CDQuant: Accurate Post-training Weight Quantization of Large Pre-trained Models using Greedy Coordinate Descent

Pranav Ajit Nair, Arun Sai Suggala · OpenReview

Abstract

Large language models (LLMs) have recently demonstrated remarkable performance across diverse language tasks. But their deployment is often constrained by their substantial computational and storage requirements. Quantization has emerged as a key technique for addressing this challenge, enabling the compression of large models with minimal impact on performance. The recent GPTQ algorithm, a post-training quantization (PTQ) method, has proven highly effective for compressing LLMs, sparking a wave of research that leverages GPTQ as a core component. Recognizing the pivotal role of GPTQ in the PTQ landscape, we introduce CDQuant, a simple and scalable alternative to GPTQ with improved performance. CDQuant uses coordinate descent to minimize the layer-wise reconstruction loss to achieve high-quality quantized weights. Our algorithm is easy to implement and scales efficiently to models with hundreds of billions of parameters. Through extensive evaluation on the PaLM2 model family, we demonstrate that CDQuant consistently outperforms GPTQ across diverse model sizes and quantization levels. In particular, for INT2 quantization of PaLM2-Otter, CDQuant achieves a 10% reduction in perplexity compared to GPTQ.

Introduction

Large Language Models (LLMs) are notoriously resource-hungry, making deployment on consumer hardware difficult. Quantization—reducing the precision of model weights (e.g., from 16-bit to 4-bit)—is the primary solution to this challenge.

The current "gold standard" for this is GPTQ. However, GPTQ uses a "one-shot" cyclic approach: it processes each weight exactly once in a predetermined order. While fast, this is mathematically suboptimal. Earlier, more accurate methods like Optimal Brain Quantization (OBQ) were "greedy" (picking the best weight to update at each step) but were computationally ruinous and couldn't scale to modern LLMs.

CDQuant aims to bridge this gap. It is a new post-training quantization (PTQ) framework that replaces the popular GPTQ algorithm with a greedy coordinate descent approach. By iteratively selecting the weight updates that most significantly reduce reconstruction error, it achieves substantially higher accuracy while remaining scalable to models with hundreds of billions of parameters.

Methodology

CDQuant treats quantization as an optimization problem to minimize the layer-wise reconstruction loss. The framework incorporates several key techniques:

  • Greedy Coordinate Descent (CD): Unlike GPTQ’s fixed cycle, CDQuant identifies the specific coordinate (weight) and quantized value that yields the largest immediate reduction in the loss function. It uses the Hessian matrix to make these updates extremely efficient.
  • Block Coordinate Descent (BCD): To further improve quality, the authors propose updating small "blocks" of weights (e.g., $k=2$) simultaneously. This helps account for correlations between weights that a single-coordinate update might miss.
  • Optimal Weight Clipping (OWC): Before starting the descent, the algorithm uses a grid search to find the best "clipping" range for weights. This minimizes the impact of outlier weights, which often sabotage quantization at low bit-widths.
  • Versatility: CDQuant is designed as a "drop-in" replacement. It can be layered on top of other advanced techniques like QuIP, FrameQuant, or AWQ to further boost their performance.

Experimental Setup

The researchers evaluated CDQuant across two major model families:

  • Gemma: Gemma-1 7B, Gemma-2 9B, and Gemma-2 27B.
  • PaLM2: The Gecko, Otter, and Bison variants.

Performance was measured using Perplexity (on the C4 dataset and a PaLM2 internal subset) and a battery of zero-shot downstream tasks, including TriviaQA, SQuAD, NaturalQuestions, ARC, HellaSwag, BoolQ, PIQA, and WinoGrande.

Key Results and Insights

Superior Accuracy Across Bit-Widths

CDQuant consistently outperformed GPTQ across all tested models and bit-widths (2-4 bits). The greedy optimization approach, while maintaining a computational profile similar to GPTQ, reaches better local minima.

Perplexity results for 3-bit and 4-bit quantization configurations across various model families.

Breakthroughs in 2-Bit Quantization

The gains are most pronounced at lower bit-widths. On the PaLM2-Otter model at 2-bit quantization, CDQuant achieved a 10% reduction in perplexity compared to GPTQ.

Perplexity results for 2-bit quantization (w2a16g128) across Gemma and PaLM2 models.

Synergy and Initialization

  • The Power of Initialization: OWC initialization consistently outperformed the standard MinMax approach, especially for 2-bit and 3-bit quantization.
  • Boosting State-of-the-Art: When used as a replacement for the GPTQ component in QuIP and FrameQuant, CDQuant provided an additional ~5% performance boost for 2-bit Gemma-2 27B models.
  • Basis Transformations: CDQuant excels when the weight space is transformed (e.g., using the Hadamard transform in QuIP), suggesting coordinate descent is particularly effective when weight importance is distributed.

Discussion and Limitations

While CD is fast, the more accurate BCD variant is significantly slower (up to an order of magnitude) on large feed-forward layers. The authors suggest hybrid strategies—using CD for large layers and BCD for others—to mitigate this.

Furthermore, despite the gains, a performance gap still exists between this post-training approach and Quantization-Aware Training (QAT). Future work involves developing loss functions that more closely align with the final end-to-end performance of the model, moving beyond simple squared error proxies.

Summary updated

BibTeX
@inproceedings{nair2024cdquant,
  author = {Pranav Ajit Nair and Arun Sai Suggala},
  title = {{CDQuant: Accurate Post-training Weight Quantization of Large Pre-trained Models using Greedy Coordinate Descent}},
  booktitle = {Compression @ NeurIPS},
  year = {2024},
  url = {https://openreview.net/forum?id=Ej0qyjvn6V},
}
Figure