Saved in:
Bibliographic Details
Main Authors: Li, Zhikai, Liu, Xiaoxuan, Zhu, Banghua, Dong, Zhen, Gu, Qingyi, Keutzer, Kurt
Format: Preprint
Published: 2023
Subjects:
Online Access:https://arxiv.org/abs/2310.07147
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914402953854976
author Li, Zhikai
Liu, Xiaoxuan
Zhu, Banghua
Dong, Zhen
Gu, Qingyi
Keutzer, Kurt
author_facet Li, Zhikai
Liu, Xiaoxuan
Zhu, Banghua
Dong, Zhen
Gu, Qingyi
Keutzer, Kurt
contents Large Language Models (LLMs) have showcased remarkable impacts across a wide spectrum of natural language processing tasks. Fine-tuning these pretrained models on downstream datasets provides further significant performance gains; however, this process typically requires a large number of expensive, high-end GPUs. Although there have been efforts focused on parameter-efficient fine-tuning, they cannot fully unlock the powerful potential of full-parameter fine-tuning. In this paper, we propose QFT, a Quantized Full-parameter Tuning framework for LLMs that quantizes and stores all training states, including weights, gradients, and optimizer states, in INT8 format to reduce training memory, thereby enabling full-parameter fine-tuning on existing GPUs at an affordable cost. To ensure training performance, we make two key efforts: i) for quantized gradients and optimizer states, we theoretically prove that the Lion optimizer, with its property of consistent update magnitudes, is highly robust to quantization; ii) and for quantized weights, we employ the hybrid feature quantizer, which identifies and protects a small subset of sparse critical features while quantizing the remaining dense features, thus ensuring accurate weight updates without FP32 backups. Moreover, to support backpropagation in the integer context, we develop a stack-based gradient flow scheme with O(1) complexity, forming a unified integer training pipeline. As a result, QFT reduces the model state memory to 21% of the standard solution while achieving comparable performance, e.g., tuning a LLaMA-7B model requires only <30GB of memory, making it feasible on a single A6000 GPU.
format Preprint
id arxiv_https___arxiv_org_abs_2310_07147
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle QFT: Quantized Full-parameter Tuning of LLMs with Affordable Resources
Li, Zhikai
Liu, Xiaoxuan
Zhu, Banghua
Dong, Zhen
Gu, Qingyi
Keutzer, Kurt
Computation and Language
Machine Learning
Large Language Models (LLMs) have showcased remarkable impacts across a wide spectrum of natural language processing tasks. Fine-tuning these pretrained models on downstream datasets provides further significant performance gains; however, this process typically requires a large number of expensive, high-end GPUs. Although there have been efforts focused on parameter-efficient fine-tuning, they cannot fully unlock the powerful potential of full-parameter fine-tuning. In this paper, we propose QFT, a Quantized Full-parameter Tuning framework for LLMs that quantizes and stores all training states, including weights, gradients, and optimizer states, in INT8 format to reduce training memory, thereby enabling full-parameter fine-tuning on existing GPUs at an affordable cost. To ensure training performance, we make two key efforts: i) for quantized gradients and optimizer states, we theoretically prove that the Lion optimizer, with its property of consistent update magnitudes, is highly robust to quantization; ii) and for quantized weights, we employ the hybrid feature quantizer, which identifies and protects a small subset of sparse critical features while quantizing the remaining dense features, thus ensuring accurate weight updates without FP32 backups. Moreover, to support backpropagation in the integer context, we develop a stack-based gradient flow scheme with O(1) complexity, forming a unified integer training pipeline. As a result, QFT reduces the model state memory to 21% of the standard solution while achieving comparable performance, e.g., tuning a LLaMA-7B model requires only <30GB of memory, making it feasible on a single A6000 GPU.
title QFT: Quantized Full-parameter Tuning of LLMs with Affordable Resources
topic Computation and Language
Machine Learning
url https://arxiv.org/abs/2310.07147