BARQ: Balanced Codebook Refinement for Low-Bit LLM Quantization
Organizations: National University of Singapore · Independent Researcher · Central South University
Abstract
As large language models (LLMs) grow in parameter count, model storage and parameter memory traffic have become major bottlenecks to efficient deployment. Codebook-based weight quantization reduces these costs, but imbalanced nearest-codeword assignments during fitting can leave some codewords insufficiently updated, limiting effective codebook utilization. To address this limitation, we propose Balanced Assignment Refinement for Quantization (BARQ), which improves quantization quality through balanced fitting of existing codebooks. Specifically, we first compute joint soft assignments between weight blocks and codewords through entropically regularized optimal transport with uniform marginals and curvature-weighted reconstruction costs, ensuring equal positive fitting mass for every codeword in the exact solution. We then refine the codewords through an assignment-weighted barycentric update, which we prove minimizes the fitting objective for fixed assignments. For finite Sinkhorn iterations, the implemented update retains this optimality provided all codeword masses exceed the denominator floor. Finally, we discard the soft assignments and use the refined codebook for standard hard nearest-codeword encoding, with our analysis establishing sufficient conditions for reducing hard-quantization distortion and evaluation loss. Across multiple LLMs, BARQ achieves lower perplexity and higher mean zero-shot accuracy than the evaluated baselines at comparable bit budgets. The code is available at https://github.com/chenhangcuisg-code/BARQ.
Figures & tables
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
| Symbol | Meaning | Symbol | Meaning |
|---|---|---|---|
| number of weight blocks in one group | soft assignment mass, | ||
| block dimension (weights per block) | fitting mass of codeword , | ||
| the -th weight block, | prescribed row and column marginals of | ||
| nominal codebook size, | couplings with marginals and | ||
| index bits per value | dimensionless entropic regularization | ||
| the -th codeword; | groupwise cost scale, fixed per update pair |
| Setting | PPL | Zero-shot accuracy (%) | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ARC-e | ARC-c | HellaSwag | PIQA | WinoGrande | Avg. | |||||||||||
| gs | bpv | GPT-VQ | Ours | GPT-VQ | Ours | GPT-VQ | Ours | GPT-VQ | Ours | GPT-VQ | Ours | GPT-VQ | Ours | GPT-VQ | Ours | |
| Qwen3-14B | ||||||||||||||||
| 1 | 32 | 2.500 | 10.80 | 10.73 –0.07 | 77.40 | 73.65 –3.75 | 54.61 | 48.04 –6.57 | 68.91 | 69.51 +0.60 | 75.14 | 75.30 +0.16 | 71.19 | 70.48 –0.71 | 69.45 | 67.40 –2.05 |
| 64 | 2.250 | 11.29 | 11.14 –0.15 | 75.51 | 70.79 –4.72 | 48.29 | 47.87 –0.42 | 65.90 | 66.74 +0.84 | 75.14 | 73.99 –1.15 | 69.06 | 70.09 +1.03 | 66.78 | 65.90 –0.88 | |
| 128 | 2.125 | 11.80 | 11.79 –0.01 | 70.20 | 65.99 –4.21 | 46.33 | 45.56 –0.77 | 63.98 | 64.26 +0.28 | 73.56 | 72.14 –1.42 | 68.67 | 68.19 –0.48 | 64.55 | 63.23 –1.32 | |
LLM Quantization
Large language model quantization reduces numerical precision to lower memory use and accelerate training or inference.
See all 386 papers