arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2307.00526cs.CLcs.LGcs.NAcs.NEmath.NA
收藏

TensorGPT:基于张量列分解的大语言模型高效压缩

TensorGPT: Efficient Compression of Large Language Models based on Tensor-Train Decomposition

Imperial College London(帝国理工学院)

Mingxue Xu, Yao Lei Xu, Danilo P. Mandic

AI总结:

本文提出基于 Tensor-Train Decomposition 的免训练 LLM 嵌入压缩方法 TensorGPT,将 token 嵌入转为 MPS,并在 GPT-2 与 CerebrasGPT 上验证其高压缩率、低设备延迟及接近原模型的性能。

摘要:

高维 token 嵌入支撑着大语言模型(LLM),因为它们能够捕捉细微的语义信息,并显著增强对复杂语言模式的建模。然而,这种高维度也带来了大量模型参数,以及高得令人难以承受的模型存储和内存需求,这对于低端设备而言尤其难以负担。针对没有额外训练数据且计算资源不足的情况,我们提出了一种基于张量列分解(Tensor-Train Decomposition,TTD)的免训练模型压缩方法,通过该方法,每个预训练 token 嵌入都被转换为低维矩阵积态(Matrix Product State,MPS)。随后,我们从压缩率、语言任务性能以及典型低端设备(即 Raspberry Pi)上的延迟方面,全面研究了该方法提取出的低秩结构。以 GPT 系列模型(即 GPT-2 和 CerebrasGPT)作为案例研究,我们的方法在理论上使整个模型的参数减少 46.89%,嵌入层的压缩率达到 39.38×–65.64×。在不同超参数选择下,用我们的方法压缩后的模型在嵌入层约 2.0× 压缩时,能够取得与原始模型相当的语言任务性能。这从经验上证明了 GPT 系列模型中存在低秩结构,并表明嵌入层中约一半的参数是冗余的。

英文摘要:

High-dimensional token embeddings underpin Large Language Models (LLMs), as they can capture subtle semantic information and significantly enhance the modelling of complex language patterns. However, this high dimensionality also introduces considerable model parameters and prohibitively high model storage and memory requirements, which is particularly unaffordable for low-end devices. Targeting no extra training data and insufficient computation cases, we propose a training-free model compression approach based on the Tensor-Train Decomposition (TTD), whereby each pre-trained token embedding is converted into a lower-dimensional Matrix Product State (MPS). We then comprehensively investigate the low-rank structures extracted by this approach, in terms of the compression ratio, the language task performance, and latency on a typical low-end device (i.e. Raspberry Pi). Taking GPT family models (i.e. GPT-2 and CerebrasGPT) as case studies, our approach theoretically results in $46.89\%$ fewer parameters of the entire model, with a compression ratio $39.38\times$ - $65.64\times$ for the embedding layers. With different hyperparameter choices, the model compressed with our approach can achieve a comparable language task performance to the original model with around $2.0\times$ embedding layer compression. This empirically proves the existence of low-rank structure in GPT family models, and demonstrates that about half of the parameters in the embedding layers are redundant.

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

↑