压缩,然后提示:利用可迁移提示改进大语言模型推理的精度-效率权衡
Compress, Then Prompt: Improving Accuracy-Efficiency Trade-off of LLM Inference with Transferable Prompt
AI总结:
本文提出软提示学习方法,通过让压缩模型参与提示学习,显著提升8倍压缩LLaMA-7B的性能,并实现提示跨数据集、任务和压缩级别的迁移,优化精度-效率权衡。
摘要:
虽然大语言模型(LLM)中的众多参数有助于其卓越的性能,但这种巨大的规模使其效率低下且内存占用高。因此,它们难以部署在商用硬件上,例如单个GPU。鉴于此类设备的存储器和功率限制,模型压缩方法被广泛采用,以同时减小模型大小和推理延迟,这本质上是以模型质量为代价换取效率的提升。因此,优化这种精度-效率权衡对于LLM在商用硬件上的部署至关重要。在本文中,我们引入了一种新的视角,通过提示压缩模型来优化这种权衡。具体来说,我们首先观察到,对于某些问题,通过添加精心设计的硬提示,压缩LLM的生成质量可以得到显著提高,尽管并非所有问题都如此。基于这一观察,我们提出了一种软提示学习方法,让压缩模型参与提示学习过程,旨在增强提示的性能。我们的实验分析表明,我们的软提示策略极大地提高了8倍压缩的LLaMA-7B模型(采用联合4比特量化和50%权重剪枝压缩)的性能,使其在流行的基准测试上能够与未压缩的对应模型相匹配。此外,我们证明了这些学习到的提示可以跨不同的数据集、任务和压缩级别进行迁移。因此,凭借这种可迁移性,我们可以将软提示拼接(stitch)到新压缩的模型上,以“原位(in-situ)”方式提高测试时的精度。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。