arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2407.17029cs.LG
收藏

通过最优平衡实现量化大语言模型的准确高效微调

Accurate and Efficient Fine-Tuning of Quantized Large Language Models Through Optimal Balance

National Key Laboratory of Parallel and Distributed Computing(平行与分布式计算国家重点实验室);College of Computer Science and Technology(计算机科学与技术学院);National University of Defense Technology(国防科技大学)

Ao Shen, Qiang Wang, Zhiquan Lai, Xionglve Li, Dongsheng Li

AI总结:

本文针对量化大语言模型微调中的欠拟合问题,提出 Q-BLoRA 和 QA-BLoRA 两种平衡低秩适配方法,通过简化适配器输入输出并提高秩,实现高精度微调与低精度部署。

摘要:

大语言模型(LLMs)已在多个领域展现出卓越的性能。然而,庞大的模型参数量使得微调变得困难,显著限制了其应用与部署。现有解决方案将参数量化与低秩适配(LoRA)相结合,虽然降低了内存占用,但会导致性能下降。此外,将微调后的模型转换为低精度表示会进一步降低性能。在本文中,我们识别出使用 LoRA 微调量化 LLMs 时存在的不平衡问题:适配器的输入和输出过于复杂,而适配器的有效可训练性较低,导致微调过程中出现欠拟合。为此,我们提出量化 LLMs 的平衡低秩适配微调方法(Q-BLoRA),该方法简化了适配器的输入和输出,同时提高适配器的秩,以缓解微调过程中的欠拟合。针对低精度部署,我们提出基于平衡低秩适配的量化感知微调方法(QA-BLoRA),该方法与分块量化对齐,并基于 Q-BLoRA 的参数合并促进低秩适配的量化感知微调。Q-BLoRA 和 QA-BLoRA 均易于实现,并提供以下优化:(i) Q-BLoRA 与基线方法及其他变体相比,始终达到最先进的准确率;(ii) QA-BLoRA 能够直接生成低精度推理模型,与其他低精度模型相比,这些模型表现出显著的性能提升。我们在多种模型和场景下验证了 Q-BLoRA 和 QA-BLoRA 的有效性。代码将在 https://github.com/xiaocaigou/qbaraqahira 上公开。

英文摘要:

Large Language Models (LLMs) have demonstrated impressive performance across various domains. However, the enormous number of model parameters makes fine-tuning challenging, significantly limiting their application and deployment. Existing solutions combine parameter quantization with Low-Rank Adaptation (LoRA), reducing memory usage but causing performance degradation. Additionally, converting fine-tuned models to low-precision representations further degrades performance. In this paper, we identify an imbalance in fine-tuning quantized LLMs with LoRA: overly complex adapter inputs and outputs versus low effective trainability of the adapter, leading to underfitting during fine-tuning. Thus, we propose Quantized LLMs fine-tuning with Balanced Low-Rank Adaptation (Q-BLoRA), which simplifies the adapter's inputs and outputs while increasing the adapter's rank to alleviate underfitting during fine-tuning. For low-precision deployment, we propose Quantization-Aware fine-tuning with Balanced Low-Rank Adaptation (QA-BLoRA), which aligns with the block-wise quantization and facilitates quantization-aware fine-tuning of low-rank adaptation based on the parameter merging of Q-BLoRA. Both Q-BLoRA and QA-BLoRA are easily implemented and offer the following optimizations: (i) Q-BLoRA consistently achieves state-of-the-art accuracy compared to baselines and other variants; (ii) QA-BLoRA enables the direct generation of low-precision inference models, which exhibit significant performance improvements over other low-precision models. We validate the effectiveness of Q-BLoRA and QA-BLoRA across various models and scenarios. Code will be made available at \href{https://github.com/xiaocaigou/qbaraqahira}{https://github.com/xiaocaigou/qbaraqahira}

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

↑