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

ResQ: Mixed-Precision Quantization of Large Language Models with Low-Rank Residuals

About

Post-training quantization (PTQ) of large language models (LLMs) holds the promise in reducing the prohibitive computational cost at inference time. Quantization of all weight, activation and key-value (KV) cache tensors to 4-bit without significantly degrading generalizability is challenging, due to the high quantization error caused by extreme outliers in activations. To tackle this problem, we propose ResQ, a PTQ method that pushes further the state-of-the-art. By means of principal component analysis (PCA), it identifies a low-rank subspace (in practice 1/8 of the hidden dimension) in which activation variances are highest, and keep the coefficients within this subspace in high precision, e.g. 8-bit, while quantizing the rest to 4-bit. Within each subspace, invariant random rotation is applied to further suppress outliers. We show that this is a provably optimal mixed precision quantization scheme that minimizes error. With the Llama and Qwen2.5 families of models, we demonstrate that ResQ outperforms recent uniform and mixed precision PTQ methods on a variety of benchmarks, achieving up to 33\% lower perplexity on Wikitext than the next best method SpinQuant, and upto 3\times speedup over 16-bit baseline. Code is available at https://github.com/utkarsh-dmx/project-resq.

Utkarsh Saxena, Sayeh Sharify, Kaushik Roy, Xin Wang• 2024

Related benchmarks

TaskDatasetResultRank
Language ModelingWikiText2
Perplexity5.38
4085
Language ModelingWikiText-2
Perplexity (PPL)6.53
2862
Language ModelingWikiText
Word Perplexity4.1
331
Zero-shot Common Sense ReasoningCommon Sense Reasoning
Zero-shot Accuracy69.64
148
Zero-shot EvaluationArc-Challenge, Arc-Easy, HellaSwag, LAMBADA-openai, LAMBADA-standard, PIQA, and WinoGrande Zero-Shot
Accuracy (0-shot)57.81
123
Commonsense ReasoningSix commonsense reasoning tasks zero-shot
Average Accuracy (Zero-shot)72
99
Common Sense ReasoningARC-e, ARC-c, BoolQ, HellaSwag, OpenBookQA, PIQA, SIQA, WinoGrande
0-shot Accuracy71.98
92
Common Sense ReasoningSix common sense reasoning tasks
Accuracy58.43
74
Language Modeling and ReasoningARC-Challenge (AC), ARC-Easy (AE), HellaSwag (HS), LAMBADA-openai (LO), LAMBADA-standard (LS), PIQA (PQ), WinoGrande (WG) zero-shot
Accuracy (ARC-E)56.75
39
Zero-shot ReasoningZero-shot Reasoning Tasks (ARC-e, ARC-c, BoolQ, Hellaswag, WinoGrande, MMLU)
ARC-e Accuracy (Zero-shot)75
20
Showing 10 of 10 rows

Other info

Follow for update