[Paper Review] TensorGPT: Efficient Compression of Large Language Models based on Tensor-Train Decomposition
This paper proposes TensorGPT, a novel method for compressing the embedding layer of large language models (LLMs) like GPT-2 using Tensor-Train Decomposition (TTD). By treating each token embedding as a Matrix Product State (MPS), the approach enables efficient, low-rank compression with up to 38.4× parameter reduction and achieves improved performance over the original GPT-2 at a 3.31× compression rate, demonstrating both high fidelity and computational efficiency.
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 imes$ - $65.64 imes$ 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 imes$ 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.
Motivation & Objective
- To address the high storage and parameter count of large language model (LLM) embedding layers, which hinder deployment on edge devices.
- To enable efficient, dynamic compression of embeddings that supports incremental updates (e.g., new tokens) without full re-computation.
- To explore the use of Matrix Product States (MPS) as a low-rank tensor format for storing and computing token embeddings efficiently.
- To evaluate the fidelity and performance of compressed embeddings in downstream language generation tasks.
Proposed method
- Each token embedding is treated as a separate tensor and decomposed using Tensor-Train Decomposition (TTD), forming a Matrix Product State (MPS) representation.
- The embedding matrix is not decomposed as a whole; instead, each row (token embedding) is independently tensorized and stored in TT format to allow local updates.
- The TT decomposition reduces the number of parameters by representing high-dimensional embeddings in a sequence of low-rank tensors.
- The compressed embeddings are reconstructed on-the-fly during inference using distributed tensor operations, enabling efficient computation.
- The method avoids retraining by applying TTD directly to a pre-trained GPT-2 model’s embedding layer.
- Evaluation uses reconstruction fidelity metrics (MAE, norm-MAE) and downstream text generation loss on GLUE/MRPC.
Experimental results
Research questions
- RQ1Can Tensor-Train Decomposition be effectively applied to compress individual token embeddings in LLMs without retraining?
- RQ2How does the compression fidelity of per-token embedding decomposition compare to full-matrix decomposition in terms of reconstruction error?
- RQ3Does compressing the embedding layer via TT decomposition preserve or even improve downstream language generation performance?
- RQ4Can the proposed method efficiently handle dynamic vocabulary changes (e.g., adding new tokens) without full recomputation?
- RQ5Can the MPS-based compressed embedding format be efficiently computed in a distributed or streaming manner?
Key findings
- The proposed method achieved a maximum compression rate of 38.40× for the GPT-2 embedding layer while maintaining high reconstruction fidelity.
- At a compression rate of 3.31×, the compressed model outperformed the original GPT-2 in the text reconstruction task, with a text generation loss of 9.01.
- The normalized mean absolute error (norm-MAE) for token embeddings was low, indicating high fidelity in the compressed representation.
- Visualizations of reconstruction error (MAE) showed non-uniform error distribution, suggesting certain embedding dimensions are more amenable to compression.
- The method demonstrated adaptability to dynamic vocabularies, as each token embedding can be decomposed and stored independently.
- The approach enables distributed computation of embeddings, as the TT format supports efficient, parallelizable tensor operations.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.