Channel-Wise Mixed-Precision Quantization for Large Language Models

Zihan Chen, Bike Xie, Jundong Li, Cong Shen

TL;DR

This paper introduces Channel-Wise Mixed-Precision Quantization (CMPQ), a novel post-training quantization framework that allows Large Language Models (LLMs) to adapt to arbitrary fractional average bit-widths (e.g., 2.2 or 3.4 bits). By dynamically allocating precision to individual weight channels based on activation distributions and incorporating a dual-outlier protection strategy, CMPQ significantly outperforms existing integer-only and layer-wise mixed-precision methods without requiring expensive backpropagation.

What Problem Does This Paper Address?

Deploying LLMs on resource-constrained edge devices typically requires Post-Training Quantization (PTQ) to reduce memory footprints. However, traditional PTQ methods are rigid: they quantize weights uniformly to fixed integer bit-widths (like exactly 2, 3, or 4 bits). If a device has enough memory to support an intermediate precision—say, an average of 2.5 bits—standard methods cannot exploit this extra budget, resulting in wasted hardware capacity.

Existing mixed-precision methods attempt to solve this by varying bit-widths across different layers (layer-wise quantization). However, because converged LLMs have gradients close to zero, layer-wise sensitivity is incredibly difficult to estimate accurately. This paper addresses the need for a highly flexible, fine-grained, and computationally efficient quantization strategy that operates at the channel level to unlock fractional-bit storage budgets.

Figure 1: Illustration of different quantization approaches under a fixed bit-width constraint, such as 3 bits. (a) Standard quantization methods focus on algorithmic optimization to improve model performance, quantizing all layers uniformly to 3 bits. (b) LLM-MQ (Li et al., 2023) calculates layer-wise scores using first-order information and applies integer programming to assign lower bit-widths to less sensitive layers. (c) In contrast, our proposed CMPQ distributes the information loss evenly across layers by employing a channel-wise approach. This method assigns varying bit-widths within each layer based on activation distribution, ensuring that no single layer experiences significant information loss.

Methods

CMPQ shifts the granularity of mixed-precision from entire layers down to individual weight channels. The framework consists of three core components:

  1. Channel-Wise Precision Allocation: During a lightweight forward calibration pass, CMPQ computes the $L_2$-norm of the activations for each channel. Channels with large activation norms (salient channels) are allocated higher precision (e.g., 4-bit), while less critical channels receive lower precision (e.g., 2-bit). This allows the model to seamlessly hit any target fractional average bit-width.
  2. Channel-Wise Non-Uniform Quantization: Instead of standard uniform spacing (which performs poorly on the non-uniform weight distributions typical of LLMs), CMPQ applies a K-means clustering algorithm to each channel. The number of clusters ($K$) is directly determined by the allocated bit-width (e.g., $K=8$ for 3-bit).
  3. Dual Outlier Protection: To prevent extreme values from distorting the K-means clustering process, CMPQ isolates a tiny fraction (0.5%) of critical weights and keeps them in full FP16 precision. It uniquely categorizes these into two types:
  4. Activation-based outliers ($O_{act}$): The top 0.45% of channels with the largest activation $L_2$-norms.
  5. Quantization-aware outliers ($O_{q}$): The top 0.05% of individual weights that exhibit the largest reconstruction errors during a trial quantization step.

Crucially, CMPQ is highly efficient because it relies solely on forward propagation, avoiding the massive memory overhead of backpropagation or second-order Hessian matrix approximations.

Datasets

  • Calibration: 128 randomly selected 2048-token segments from the C4 (Colossal Clean Crawled Corpus) dataset.
  • Evaluation: Language modeling perplexity was evaluated on WikiText-2 and C4 across nine different LLMs (from the OPT and LLaMA families, up to 70B parameters).
  • Downstream Tasks: Zero-shot commonsense QA benchmarks (PIQA, HellaSwag) and five-shot in-context learning (MMLU).

Key Insights and Ideas

  • Channel Saliency Over Layer Saliency: Activation outliers in LLMs exhibit a distinct channel-wise pattern—if an outlier appears in a channel, it consistently occurs across all tokens. Quantizing at the channel level prevents any single layer from experiencing catastrophic information loss.
  • The Fractional-Bit Sweet Spot: The transition from 2-bit to just 2.2-bit quantization yields massive performance gains. Allocating a tiny 10% increase in storage overhead to the most salient channels dramatically stabilizes the model, a benefit that integer-only quantization completely misses.
  • Algorithmic Synergy: Non-uniform quantization (K-means) and outlier extraction complement each other perfectly. Removing the top 0.05% highest-error outliers prevents the K-means centroids from being skewed by extreme values, allowing the remaining centroids to much better represent the bulk of the weight distribution.

Key Results

  • Superior Integer Quantization: Even when restricted to standard integer targets, CMPQ outperforms prominent baselines. At 3-bit quantization on the LLaMA2-7B model (evaluated on C4), CMPQ achieves a perplexity of 7.66, outperforming GPTQ (7.97) and AWQ (7.84).
  • Massive Fractional-Bit Gains: As shown in the fractional bit-width curves, CMPQ consistently dominates layer-wise alternatives like LLM-MQ. For LLaMA2-7B, moving from 2-bit to 2.2-bit drops CMPQ's perplexity from 15.97 down to 11.11 (a ~30% improvement).
C4 perplexity comparison between CMPQ and LLM-MQ across fractional bit-widths.
  • Resource Efficiency: During the quantization process, CMPQ requires roughly half the peak memory of backpropagation-dependent methods like SqueezeLLM (e.g., 24.2 GB vs. 33 GB for LLaMA2-7B), making it highly practical for real-world engineering pipelines.

Limitations and Future Work

  • Weight-Only Quantization: The framework currently focuses exclusively on weight compression. It does not address activation quantization, which is also critical for maximizing inference speedups on edge hardware.
  • Discrete Precision Pool: The continuous average bit-widths are achieved by mixing a discrete set of precisions $\{2, 3, 4\}$ rather than optimizing over a truly continuous or unrestricted precision space.
  • Calibration Data Dependency: The channel allocation strategy assumes that the calibration dataset accurately reflects the target deployment distribution. Performance could degrade if the model encounters severe out-of-distribution data at runtime.

Summary updated

BibTeX
@misc{chen2024channel,
  author = {Zihan Chen and Bike Xie and Jundong Li and Cong Shen},
  title = {{Channel-Wise Mixed-Precision Quantization for Large Language Models}},
  year = {2024},
  eprint = {2410.13056},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.13056},
}
Figure