eDKM:一种用于大型语言模型的高效且准确的训练时权重聚类方法
eDKM: An Efficient and Accurate Train-time Weight Clustering for Large Language Models
AI总结:
本文提出内存高效的可微KMeans聚类实现eDKM,通过张量去重和分片技术大幅降低训练时内存占用,成功将LLaMA 7B模型微调压缩至2.5GB且保持良好精度。
摘要:
由于大型语言模型(LLM)在许多复杂语言任务上展现出高质量的性能,将 LLM 引入移动设备以实现更快响应和更好隐私保护引起了极大兴趣。然而,LLM 的庞大参数量(即数十亿参数)需要极其高效的压缩才能适配存储受限的设备。在众多压缩技术中,权重聚类作为一种非线性量化形式,是 LLM 压缩的主要候选方案之一,并已获现代智能手机支持。然而,其训练开销对 LLM 微调而言过于庞大。特别是,可微 KMeans 聚类(DKM)在压缩率与精度回归之间展现了最先进的权衡,但其巨大的内存复杂度使其几乎无法应用于训练时 LLM 压缩。本文提出了一种内存高效的 DKM 实现,即 eDKM,它依托创新技术将 DKM 的内存占用降低了数个数量级。对于需要在 CPU 上保存以供 DKM 反向传播使用的给定张量,我们在检查之前未复制到 CPU 的重复张量后,通过应用去重和分片来压缩该张量。实验结果表明,eDKM 能够利用 Alpaca 数据集,将预训练的 LLaMA 7B 模型从 12.6 GB 微调并压缩至 2.5 GB(3bit/weight),同时将解码器层的训练时内存占用降低 130 倍,并在更广泛的 LLM 基准上保持良好精度(即 PIQA 为 77.7%,Winograde 为 66.1% 等)。
英文摘要:
Since Large Language Models or LLMs have demonstrated high-quality performance on many complex language tasks, there is a great interest in bringing these LLMs to mobile devices for faster responses and better privacy protection. However, the size of LLMs (i.e., billions of parameters) requires highly effective compression to fit into storage-limited devices. Among many compression techniques, weight-clustering, a form of non-linear quantization, is one of the leading candidates for LLM compression, and supported by modern smartphones. Yet, its training overhead is prohibitively significant for LLM fine-tuning. Especially, Differentiable KMeans Clustering, or DKM, has shown the state-of-the-art trade-off between compression ratio and accuracy regression, but its large memory complexity makes it nearly impossible to apply to train-time LLM compression. In this paper, we propose a memory-efficient DKM implementation, eDKM powered by novel techniques to reduce the memory footprint of DKM by orders of magnitudes. For a given tensor to be saved on CPU for the backward pass of DKM, we compressed the tensor by applying uniquification and sharding after checking if there is no duplicated tensor previously copied to CPU. Our experimental results demonstrate that \prjname can fine-tune and compress a pretrained LLaMA 7B model from 12.6 GB to 2.5 GB (3bit/weight) with the Alpaca dataset by reducing the train-time memory footprint of a decoder layer by 130$\times$, while delivering good accuracy on broader LLM benchmarks (i.e., 77.7% for PIQA, 66.1% for Winograde, and so on).
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。