[论文解读] Memory-Efficient Fine-Tuning of Compressed Large Language Models via sub-4-bit Integer Quantization
PEQA 仅更新量化后的 LLM 的量化尺度,冻结整数量化权重,实现内存高效微调和快速部署,采用小于 4 位的量化,同时保持或提升性能。
Large language models (LLMs) face the challenges in fine-tuning and deployment due to their high memory demands and computational costs. While parameter-efficient fine-tuning (PEFT) methods aim to reduce the memory usage of the optimizer state during fine-tuning, the inherent size of pre-trained LLM weights continues to be a pressing concern. Even though quantization techniques are widely proposed to ease memory demands and accelerate LLM inference, most of these techniques are geared towards the deployment phase. To bridge this gap, this paper presents Parameter-Efficient and Quantization-aware Adaptation (PEQA) - a simple yet effective method that combines the advantages of PEFT with quantized LLMs. By updating solely the quantization scales, PEQA can be directly applied to quantized LLMs, ensuring seamless task transitions. Parallel to existing PEFT methods, PEQA significantly reduces the memory overhead associated with the optimizer state. Furthermore, it leverages the advantages of quantization to substantially reduce model sizes. Even after fine-tuning, the quantization structure of a PEQA-tuned LLM remains intact, allowing for accelerated inference on the deployment stage. We employ PEQA-tuning for task-specific adaptation on LLMs with up to 65 billion parameters. To assess the logical reasoning and language comprehension of PEQA-tuned LLMs, we fine-tune low-bit quantized LLMs using a instruction dataset. Our results show that even when LLMs are quantized to below 4-bit precision, their capabilities in language modeling, few-shot in-context learning, and comprehension can be resiliently restored to (or even improved over) their full-precision original performances with PEQA.
研究动机与目标
- 动机是在 large language models (LLMs) 的微调过程中减少内存和计算需求。
- 将参数高效微调(PEFT)与量化结合,用于量化的 LLM。
- 提出并验证一种方法:仅调整量化尺度(PEQA),同时冻结整数量化权重。
- 展示可扩展性至高达 65B 参数模型,并在量化下恢复性能。
- 展示在任务特定适应和指令微调场景中的优势。
提出的方法
- 引入 PEQA:仅更新每通道的量化尺度,同时保持量化权重量化索引固定。
- 使用每通道的尺度和零点对预训练权重进行量化,并冻结整数量化索引 ${\bm{\bar{W}}}_{0}$。
- 通过标准微调目标对下游任务微调量化尺度 ${\bm{s}}_{0}$(及其更新 ${\bm{\nabla s}}$)。
- 通过交换任务特定的尺度 ${\bm{s}}_{0}+\bm{\nabla s}$ 来实现任务切换,而不修改冻结的整数权重。
- 证明 PEQA 可以应用于重量仅量化的 LLMs 和重量-激活量化。
- 在困惑度方面将 PEQA 与 QAT 和 PEFT+PTQ 进行比较,并在低于 4 位精度下显示具有竞争力的性能。
实验结果
研究问题
- RQ1仅更新量化尺度并冻结整数权重,能否达到或超过全量微调或其他 PEFT 加量化方法的性能?
- RQ2PEQA 是否能扩展到大模型(高达 65B 参数)同时显著降低训练和部署时的内存使用?
- RQ3与全精度基线相比,PEQA 是否能在量化的 LLM 上恢复或提升语言建模、少量示例的上下文学习和理解能力?
- RQ4在多个数据集和模型规模上,PEQA 是否有益于任务特定适应和指令微调?
主要发现
- PEQA 在困惑度方面与 QAT 竞争力相当,并在 3-bit 和 4-bit 设置下超越 LoRA+OPTQ。
- PEQA 在微调和部署阶段显著降低 DRAM 使用,使在内存受限下能够使用更大模型。
- 对于 Wikitext2 和 PennTreeBank,PEQA 显示可扩展性,随着模型规模增大,困惑度趋近于全精度 LoRA。
- 指令微调与 Alpaca 表明,PEQA 能在 RTN-量化的 LLM 中恢复少样本上下文学习和理解性能。
- PEQA 减少可学习参数数量和模型大小,使高达 65B 模型的 DRAM 高效微调成为可能。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。