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

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Xu, Mingxue, Xu, Yao Lei, Mandic, Danilo P.
Format: Preprint
Publié: 2023
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866910631476592640
author Xu, Mingxue
Xu, Yao Lei
Mandic, Danilo P.
author_facet Xu, Mingxue
Xu, Yao Lei
Mandic, Danilo P.
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2307_00526
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle TensorGPT: Efficient Compression of Large Language Models based on Tensor-Train Decomposition
Xu, Mingxue
Xu, Yao Lei
Mandic, Danilo P.
Computation and Language
Machine Learning
Numerical Analysis
Neural and Evolutionary Computing
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.
title TensorGPT: Efficient Compression of Large Language Models based on Tensor-Train Decomposition
topic Computation and Language
Machine Learning
Numerical Analysis
Neural and Evolutionary Computing
url https://arxiv.org/abs/2307.00526