arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2309.14717cs.LGcs.CL
收藏

QA-LoRA: 大语言模型的量化感知低秩适配

QA-LoRA: Quantization-Aware Low-Rank Adaptation of Large Language Models

Huawei Inc.(华为公司)

Yuhui Xu, Lingxi Xie, Xiaotao Gu, Xin Chen, Heng Chang, Hengheng Zhang, Zhengsu Chen, Xiaopeng Zhang, Qi Tian

AI总结:

针对大语言模型计算负担重、难部署到边缘设备的问题,提出量化感知低秩适配算法QA-LoRA,通过分组算子平衡量化与适配自由度,实现微调时降本、微调后无损整合为量化模型,在LLaMA系列模型上验证有效。

摘要:

近年来,大语言模型(LLMs)发展迅猛。尽管这类模型在诸多语言理解任务中表现出色,但其沉重的计算负担极大地限制了应用场景,尤其是需要将其部署到边缘设备时的应用。本文提出了一种量化感知低秩适配(quantization-aware low-rank adaptation,QA-LoRA)算法。该算法的出发点是量化与适配的自由度存在不平衡,解决方案是采用分组算子,在提升量化自由度的同时降低适配的自由度。QA-LoRA仅需几行代码即可轻松实现,它为原始LoRA赋予了两方面能力:(1)微调期间,LLM的权重被量化(例如量化为INT4),以降低时间和内存开销;(2)微调完成后,LLM与辅助权重可自然整合为一个量化模型,且无精度损失。我们将QA-LoRA应用于LLaMA和LLaMA2模型家族,并在不同的微调数据集和下游场景中验证了其有效性。代码将发布于https://github.com/yuhuixu1993/qa-lora。

英文摘要:

Recently years have witnessed a rapid development of large language models (LLMs). Despite the strong ability in many language-understanding tasks, the heavy computational burden largely restricts the application of LLMs especially when one needs to deploy them onto edge devices. In this paper, we propose a quantization-aware low-rank adaptation (QA-LoRA) algorithm. The motivation lies in the imbalanced degrees of freedom of quantization and adaptation, and the solution is to use group-wise operators which increase the degree of freedom of quantization meanwhile decreasing that of adaptation. QA-LoRA is easily implemented with a few lines of code, and it equips the original LoRA with two-fold abilities: (i) during fine-tuning, the LLM's weights are quantized (e.g., into INT4) to reduce time and memory usage; (ii) after fine-tuning, the LLM and auxiliary weights are naturally integrated into a quantized model without loss of accuracy. We apply QA-LoRA to the LLaMA and LLaMA2 model families and validate its effectiveness in different fine-tuning datasets and downstream scenarios. Code will be made available at https://github.com/yuhuixu1993/qa-lora.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑