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

LoftQ: LoRA-Fine-Tuning-Aware Quantization for Large Language Models

About

Quantization is an indispensable technique for serving Large Language Models (LLMs) and has recently found its way into LoRA fine-tuning. In this work we focus on the scenario where quantization and LoRA fine-tuning are applied together on a pre-trained model. In such cases it is common to observe a consistent gap in the performance on downstream tasks between full fine-tuning and quantization plus LoRA fine-tuning approach. In response, we propose LoftQ (LoRA-Fine-Tuning-aware Quantization), a novel quantization framework that simultaneously quantizes an LLM and finds a proper low-rank initialization for LoRA fine-tuning. Such an initialization alleviates the discrepancy between the quantized and full-precision model and significantly improves generalization in downstream tasks. We evaluate our method on natural language understanding, question answering, summarization, and natural language generation tasks. Experiments show that our method is highly effective and outperforms existing quantization methods, especially in the challenging 2-bit and 2/4-bit mixed precision regimes. The code is available on https://github.com/yxli2123/LoftQ.

Yixiao Li, Yifan Yu, Chen Liang, Pengcheng He, Nikos Karampatziakis, Weizhu Chen, Tuo Zhao• 2023

Related benchmarks

TaskDatasetResultRank
Language ModelingWikiText2
Perplexity5.78
3785
Language ModelingWikiText-2 (test)
PPL12.8
2333
Language ModelingWikiText-2--
2320
Natural Language UnderstandingGLUE (dev)
SST-2 (Acc)95.6
529
Language ModelingC4 (test)
Perplexity14.14
464
Mathematical ReasoningMathQA
Accuracy53.96
354
Commonsense ReasoningARC-C
Accuracy54.52
215
Arithmetic ReasoningGSM8K (test)
Accuracy51.3
189
Language UnderstandingMMLU 5-shot
Accuracy37.1
153
Question AnsweringCommonsenseQA (CSQA)
Accuracy58.5
124
Showing 10 of 15 rows

Other info

Follow for update