我们提出了一种可大幅降低微调显存需求并校正量化大语言模型中量化误差的方法。首先,我们利用低秩适配(Low-Rank Adaptation,LoRA)为量化模型开发了一种极致内存高效微调(extremely memory-efficient fine-tuning,EMEF)方法,并以此为基础构建了一种误差校正算法,旨在最小化量化过程带来的误差。我们的方法将内存需求降低了多达5.6倍,使得在消费级笔记本电脑上微调70亿参数的大语言模型(Large Language Model,LLM)成为可能。\n同时,我们提出了低秩误差校正(Low-Rank Error Correction,LREC)方法,该方法利用新增的LoRA层来缩小量化模型与其浮点版本之间的性能差距。我们的误差校正框架打造出了功能完整的INT2量化LLM,该模型具备生成连贯英文文本的能力。据我们所知,这是首个能够达到如此性能的INT2大语言模型。我们的方法仅带来1.05倍的模型尺寸开销,对应有效精度为INT2.1。\n此外,我们的方法可轻松推广至其他量化标准,如INT3、INT4和INT8,恢复其损失的性能,这标志着模型量化领域的一个重要里程碑。本文阐述的策略对量化模型的未来开发与优化具有广阔的应用前景,标志着低资源机器学习计算格局的关键转变。
英文摘要:
We introduce a method that dramatically reduces fine-tuning VRAM requirements and rectifies quantization errors in quantized Large Language Models. First, we develop an extremely memory-efficient fine-tuning (EMEF) method for quantized models using Low-Rank Adaptation (LoRA), and drawing upon it, we construct an error-correcting algorithm designed to minimize errors induced by the quantization process. Our method reduces the memory requirements by up to 5.6 times, which enables fine-tuning a 7 billion parameter Large Language Model (LLM) on consumer laptops. At the same time, we propose a Low-Rank Error Correction (LREC) method that exploits the added LoRA layers to ameliorate the gap between the quantized model and its float point counterpart. Our error correction framework leads to a fully functional INT2 quantized LLM with the capacity to generate coherent English text. To the best of our knowledge, this is the first INT2 Large Language Model that has been able to reach such a performance. The overhead of our method is merely a 1.05 times increase in model size, which translates to an effective precision of INT2.1. Also, our method readily generalizes to other quantization standards, such as INT3, INT4, and INT8, restoring their lost performance, which marks a significant milestone in the field of model quantization. The strategies delineated in this paper hold promising implications for the future development and optimization of quantized models, marking a pivotal shift in the landscape of low-resource machine learning computations.
LoTA-QAF: Lossless Ternary Adaptation for Quantization-Aware Fine-Tuning
Southwestern University of Finance and Economics(西南财经大学);Artificial Intelligence and Digital Finance Key Laboratory of Sichuan Province(四川省人工智能与数字金融重点实验室);The Hong Kong University of Science and Technology (Guangzhou)(香港科学与艺术大学(广州));Sun Yat-sen University(中山大学);Nanjing University(南京大学)
LeanTTA: A Backpropagation-Free and Stateless Approach to Quantized Test-Time Adaptation on Edge Devices
Paul G. Allen School of Computer Science and Engineering, University of Washington(华盛顿大学保罗·G·艾伦计算机科学与工程学院);University of Cambridge(剑桥大学);School of Computing and Information Systems, University of Melbourne(墨尔本大学计算与信息系统学院);Samsung AI Center(三星人工智能中心)
LQA: A Lightweight Quantized-Adaptive Framework for Vision-Language Models on the Edge
School of Computing(计算机学院);Information Systems, University of Melbourne, Melbourne, Australia(信息系统学院,墨尔本大学,澳大利亚墨尔本);Faculty of Science, Auckland, New Zealand(科学学院,新西兰奥克兰);School of Computing, University of Macquarie, Sydney, Australia(计算机学院,麦考瑞大学,澳大利亚悉尼)
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(国防科技大学)
Test-Time Model Adaptation with Only Forward Passes
College of Computing and Data Science, Nanyang Technological University(南洋理工大学计算与数据科学学院);Joint NTU-WeBank Research Centre on Fintech(南洋理工大学-微众银行金融科技联合研究中心);Joint NTU-UBC Research Centre of Excellence in Active Living for the Elderly (LILY)(南洋理工大学-不列颠哥伦比亚大学老年人积极生活联合卓越研究中心);Tencent AI Lab(腾讯AI实验室)
DoTA: Weight-Decomposed Tensor Adaptation for Large Language Models
Gaoling School of Artificial Intelligence, Renmin University of China(中国人民大学高瓴人工智能学院);University of International Business and Economics, China(对外经济贸易大学);XiaoMi AI Lab, China(小米AI实验室)
LQ-LoRA: Low-rank Plus Quantized Matrix Decomposition for Efficient Language Model Finetuning
Carnegie Mellon University(卡内基梅隆大学);Columbia University(哥伦比亚大学);Mohamed bin Zayed University of Artificial Intelligence(穆罕默德·本·扎耶德人工智能大学);Petuum Inc.(Petuum公司);Massachusetts Institute of Technology(麻省理工学院)
Recover-LoRA for Aggressive Quantization: Reclaiming Accuracy in 2-Bit Language Models via Low-Rank Adaptation with Knowledge Distillation on Synthetic Data
MiLoRA: Efficient Mixture of Low-Rank Adaptation for Large Language Models Fine-tuning
iFLYTEK Co., Ltd(科大讯飞股份有限公司);University of Pennsylvania(宾夕法尼亚大学);Lenovo Connect Co., Ltd(联想智联有限公司);Niuxin Network Technology Co., Ltd(牛信网络科技有限公司);East China Normal University(华东师范大学)