用概率决策量化技术,让大模型剪枝后更省内存且不丢精度。
QPruner: Probabilistic Decision Quantization for Structured Pruning in Large Language Models
- 剪枝后分层混合精度量化,按层重要性分配精度
- 用贝叶斯优化调优精度分配,内存减少超40%且性能不降
- 适合需要轻量化部署的大模型应用者
大语言模型在自然语言处理任务中表现优异,但资源消耗巨大。结构化剪枝虽能缩小模型规模,却常导致性能下降,需微调恢复,而微调耗内存,限制了实际应用。为此,本文将量化引入结构化剪枝框架,降低微调与推理时的内存占用。然而,剪枝与量化联合误差使微调更难,需更精细的量化方案。因此,我们提出QPruner:先进行结构化剪枝,再采用逐层混合精度量化,根据各层对目标任务的重要性分配精度,并利用贝叶斯优化改进精度分配策略,平衡精度与内存效率。在基准数据集上的大量实验表明,QPruner在显著节省内存的同时,性能保持或优于现有方法。
原文摘要 · Abstract (English)
The rise of large language models (LLMs) has significantly advanced various natural language processing (NLP) tasks. However, the resource demands of these models pose substantial challenges. Structured pruning is an effective approach to reducing model size, but it often results in significant accuracy degradation, necessitating parameter updates to adapt. Unfortunately, such fine-tuning requires substantial memory, which limits its applicability. To address these challenges, we introduce quantization into the structured pruning framework to reduce memory consumption during both fine-tuning and inference. However, the combined errors from pruning and quantization increase the difficulty of fine-tuning, requiring a more refined quantization scheme. To this end, we propose QPruner, a novel framework that employs structured pruning to reduce model size, followed by a layer-wise mixed-precision quantization scheme. Quantization precisions are assigned to each layer based on their importance to the target task, and Bayesian optimization is employed to refine precision allocation strategies, ensuring a balance between model accuracy and memory efficiency. Extensive experiments on benchmark datasets demonstrate that QPruner significantly outperforms existing methods in memory savings while maintaining or improving model performance.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。