arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2401.07159cs.LGcs.AI
收藏

量化侧调优:量化大语言模型的快速且内存高效调优

Quantized Side Tuning: Fast and Memory-Efficient Tuning of Quantized Large Language Models

Peng Cheng Laboratory(鹏城实验室);Tsinghua Shenzhen International Graduate School(清华大学深圳国际研究生院);Carnegie Mellon University(卡内基梅隆大学);Tsinghua University(清华大学)

Zhengxin Zhang, Dan Zhao, Xupeng Miao, Gabriele Oliaro, Qing Li, Yong Jiang, Zhihao Jia

AI总结:

本文提出量化侧调优QST,通过4位量化LLM权重、引入独立侧网络避免反向传播,并利用低秩适配器和无梯度下采样模块减少可训练参数,从而同时降低模型权重、中间激活和优化器状态的内存占用,实现最高2.3倍内存节省和3倍加速,且性能保持竞争力。

摘要:

微调大语言模型(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$.

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

↑