Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

PB-LLM: Partially Binarized Large Language Models

About

This paper explores network binarization, a radical form of quantization, compressing model weights to a single bit, specifically for Large Language Models (LLMs) compression. Due to previous binarization methods collapsing LLMs, we propose a novel approach, Partially-Binarized LLM (PB-LLM), which can achieve extreme low-bit quantization while maintaining the linguistic reasoning capacity of quantized LLMs. Specifically, our exploration first uncovers the ineffectiveness of naive applications of existing binarization algorithms and highlights the imperative role of salient weights in achieving low-bit quantization. Thus, PB-LLM filters a small ratio of salient weights during binarization, allocating them to higher-bit storage, i.e., partially-binarization. PB-LLM is extended to recover the capacities of quantized LMMs, by analyzing from the perspective of post-training quantization (PTQ) and quantization-aware training (QAT). Under PTQ, combining the concepts from GPTQ, we reconstruct the binarized weight matrix guided by the Hessian matrix and successfully recover the reasoning capacity of PB-LLM in low-bit. Under QAT, we freeze the salient weights during training, explore the derivation of optimal scaling factors crucial for minimizing the quantization error, and propose a scaling mechanism based on this derived scaling strategy for residual binarized weights. Those explorations and the developed methodologies significantly contribute to rejuvenating the performance of low-bit quantized LLMs and present substantial advancements in the field of network binarization for LLMs.The code is available at https://github.com/hahnyuan/BinaryLLM.

Yuzhang Shang, Zhihang Yuan, Qiang Wu, Zhen Dong• 2023

Related benchmarks

TaskDatasetResultRank
Language ModelingWikiText2
Perplexity20.37
2839
Language ModelingWikiText-2 (test)
PPL20.37
1949
Commonsense ReasoningHellaSwag
Accuracy65
1891
Language ModelingWikiText-2--
1624
Language ModelingC4
Perplexity11.13
1422
Language ModelingPTB
Perplexity41.87
1034
Question AnsweringARC Challenge
Accuracy23.12
906
Commonsense ReasoningPIQA
Accuracy74.16
751
Question AnsweringARC-E
Accuracy31.27
416
Commonsense ReasoningWinoGrande
Accuracy71.27
372
Showing 10 of 24 rows

Other info

Follow for update