微调大语言模型(LLMs)在多种下游任务上已被经验证明有效。现有的LLM微调方法要么专注于参数高效微调,仅更新少量可训练参数,要么试图在微调的训练阶段减少内存占用。通常,微调期间的内存占用来自三个部分:模型权重、优化器状态和中间激活。然而,现有工作仍然需要相当大的内存,且没有一种方法能够同时缓解这三类来源的内存占用。在本文中,我们提出了量化侧调优(Quantized Side Tuning,QST),它通过一个双阶段过程实现LLM的内存高效和快速微调。首先,QST将LLM的模型权重量化为4位,以减少LLM原始权重的内存占用;QST还引入了一个与LLM分离的侧网络,该网络利用LLM的隐藏状态进行任务特定的预测。使用独立的侧网络避免了通过LLM进行反向传播,从而降低了中间激活的内存需求。此外,QST利用多个低秩适配器和无梯度下采样模块来显著减少可训练参数,从而节省优化器状态的内存占用。实验表明,与最先进方法相比,QST可以将总内存占用减少多达2.3倍,并将微调过程加速多达3倍,同时取得有竞争力的性能。与全量微调相比,QST可以将总内存占用减少多达7倍。
英文摘要:
Finetuning large language models (LLMs) has been empirically effective on a variety of downstream tasks. Existing approaches to finetuning an LLM either focus on parameter-efficient finetuning, which only updates a small number of trainable parameters, or attempt to reduce the memory footprint during the training phase of the finetuning. Typically, the memory footprint during finetuning stems from three contributors: model weights, optimizer states, and intermediate activations. However, existing works still require considerable memory and none can simultaneously mitigate memory footprint for all three sources. In this paper, we present Quantized Side Tuing (QST), which enables memory-efficient and fast finetuning of LLMs by operating through a dual-stage process. First, QST quantizes an LLM's model weights into 4-bit to reduce the memory footprint of the LLM's original weights; QST also introduces a side network separated from the LLM, which utilizes the hidden states of the LLM to make task-specific predictions. Using a separate side network avoids performing backpropagation through the LLM, thus reducing the memory requirement of the intermediate activations. Furthermore, QST leverages several low-rank adaptors and gradient-free downsample modules to significantly reduce the trainable parameters, so as to save the memory footprint of the optimizer states. Experiments show that QST can reduce the total memory footprint by up to 2.3 $\times$ and speed up the finetuning process by up to 3 $\times$ while achieving competent performance compared with the state-of-the-art. When it comes to full finetuning, QST can reduce the total memory footprint up to 7 $\times$.
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(南京大学)
One QuantLLM for ALL: Fine-tuning Quantized LLMs Once for Efficient Deployments
South China University of Technology(华南理工大学);The Hong Kong University of Science and Technology(香港科技大学);Salesforce AI Research(Salesforce AI研究院);Tsinghua University(清华大学)
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(国防科技大学)
RESQ: A Unified Framework for REliability- and Security Enhancement of Quantized Deep Neural Networks
University of Zanjan(赞詹大学);Brandenburg Technical University(勃兰登堡技术大学);Leibniz Institute for High Performance Microelectronics(莱比锡高性能微电子研究所);Tallinn University of Technology(塔林技术大学)
Effective Unbounded Drift Control in Heterogeneous Federated Learning: Bayesian Fine-Tuning Using a Reference Model
School of Computer Science and Engineering(计算机科学与工程学院);Center for Biosystems and Biotech Data Science(生物系统与生物技术数据科学中心);Ghent University Global Campus, Incheon, Republic of Korea(因斯布鲁克大学全球校区,韩国)