[Paper Review] Compress, Then Prompt: Improving Accuracy-Efficiency Trade-off of LLM Inference with Transferable Prompt
This paper proposes a soft prompt learning method that enhances the accuracy of compressed large language models (LLMs) without retraining, by learning transferable prompts during compression. The approach enables an 8× compressed LLaMA-7B model (with 4-bit quantization and 50% pruning) to match the performance of the full model on standard benchmarks, with strong cross-compression transferability across datasets, tasks, and compression levels.
While the numerous parameters in Large Language Models (LLMs) contribute to their superior performance, this massive scale makes them inefficient and memory-hungry. Thus, they are hard to deploy on commodity hardware, such as one single GPU. Given the memory and power constraints of such devices, model compression methods are widely employed to reduce both the model size and inference latency, which essentially trades off model quality in return for improved efficiency. Thus, optimizing this accuracy-efficiency trade-off is crucial for the LLM deployment on commodity hardware. In this paper, we introduce a new perspective to optimize this trade-off by prompting compressed models. Specifically, we first observe that for certain questions, the generation quality of a compressed LLM can be significantly improved by adding carefully designed hard prompts, though this isn't the case for all questions. Based on this observation, we propose a soft prompt learning method where we expose the compressed model to the prompt learning process, aiming to enhance the performance of prompts. Our experimental analysis suggests our soft prompt strategy greatly improves the performance of the 8x compressed LLaMA-7B model (with a joint 4-bit quantization and 50% weight pruning compression), allowing them to match their uncompressed counterparts on popular benchmarks. Also, we demonstrate that these learned prompts can be transferred across various datasets, tasks, and compression levels. Hence with this transferability, we can stitch the soft prompt to a newly compressed model to improve the test-time accuracy in an ``in-situ'' way.
Motivation & Objective
- To address the critical trade-off between inference efficiency and accuracy in compressed LLMs deployed on commodity hardware.
- To investigate whether learnable prompts can improve the generation quality of compressed LLMs beyond manually designed hard prompts.
- To explore the transferability of learned prompts across different datasets, tasks, and compression levels (e.g., sparsity, quantization bit-width).
- To develop a method that enables in-situ accuracy improvement of newly compressed models by stitching pre-learned prompts at test time.
Proposed method
- A soft prompt learning framework is introduced, where learnable prompt tokens are trained directly on the compressed LLM during the compression process.
- The method applies additive prompt tokens to the input sequence, which are optimized via gradient descent to improve generation quality on downstream tasks.
- The prompt learning is performed on the training set of a target dataset (e.g., C4), and the resulting prompt is applied at inference time to the compressed model.
- The approach combines model compression techniques—specifically 4-bit weight quantization and 50% weight pruning—before prompt learning to achieve high efficiency.
- Transferability is evaluated by applying prompts learned on one compression level or type (e.g., 4-bit quantization) to models with different compression settings (e.g., 50% sparsity or 8-bit quantization).
- The method enables 'in-situ' accuracy improvement by attaching the pre-learned prompt to a newly compressed model without retraining.
Experimental results
Research questions
- RQ1Can learnable prompts significantly improve the generation quality of a compressed LLM, especially when the model is heavily compressed?
- RQ2Can the prompts learned on a compressed model be transferred effectively to other compressed models with different compression levels or types?
- RQ3Does the proposed prompt learning method maintain high performance when combining multiple compression techniques, such as sparsification and quantization?
- RQ4Can the learned prompt improve performance across diverse datasets and tasks without retraining?
- RQ5Is the performance of the compressed model with the learned prompt comparable to that of the full, uncompressed model?
Key findings
- The 8× compressed LLaMA-7B model (50% sparsity + 4-bit quantization) with the learned prompt achieves a perplexity (PPL) of 7.38 on the C4 validation set, matching the full model’s PPL of 7.59.
- On Wikitext-2, the compressed model with prompt reduces PPL from 9.67 (without prompt) to 7.31, approaching the full model’s 6.34.
- On PTB, the PPL drops from 17.39 (no prompt) to 10.64 (with prompt), significantly improving over the compressed baseline.
- Prompts learned from higher sparsity (e.g., 62.5%) or lower bit quantization (e.g., 4-bit) can be successfully transferred to models with lower sparsity or higher bit-width, improving performance.
- Prompts learned from sparse models can be transferred to quantized models and vice versa, demonstrating cross-compression transferability, especially at lower compression levels.
- The method enables in-situ accuracy improvement: a newly compressed model can achieve better test-time performance by simply attaching the pre-learned prompt without retraining.
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.