arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2412.03599cs.CLcs.LG
收藏

CPTQuant——一种面向大语言模型的新型混合精度训练后量化技术

CPTQuant - A Novel Mixed Precision Post-Training Quantization Techniques for Large Language Models

UC San Diego(加州大学圣迭戈分校)

Amitash Nanda, Sree Bhargavi Balija, Debashis Sahoo

AI总结:

针对大语言模型内存与计算需求高的问题,提出包含三种混合精度策略的CPTQuant训练后量化技术,可在精度损失极小的情况下实现高压缩比与效率提升,不同策略适配不同任务。

摘要:

大语言模型已变革了自然语言任务的理解与生成方式,但它们存在极高的内存与计算需求。量化技术已成为应对这些挑战的可行方向,同时能兼顾精度保持与能效提升。我们提出CPTQuant,这是一套综合策略,引入了基于相关性(CMPQ)、基于剪枝(PMPQ)和基于泰勒分解(TDMPQ)的混合精度技术。CMPQ基于不同层的典型相关分析调整精度等级;PMPQ根据各层对稀疏性的敏感度逐层优化精度;TDMPQ利用泰勒分解评估每一层对输入扰动的敏感度,进而调整精度。这些策略为敏感度更高的层分配更高精度,同时降低鲁棒性较强层的精度。CPTQuant在BERT、OPT-125M、OPT-350M、OPT-1.3B和OPT-2.7B上评估了性能。我们证明,与Hugging Face FP16相比,该方法可实现最高4倍的压缩比和2倍的效率提升,且精度下降极小。其中PMPQ在实现更高模型压缩率方面表现突出。针对多种大语言模型的敏感度分析显示,初始和末尾30%的层比其余层表现出更高的敏感度。在分类任务中,PMPQ的压缩率比其他方法高11%;而在语言建模任务中,TDMPQ的压缩率高出30%。

英文摘要:

Large language models have transformed the comprehension and generation of natural language tasks, but they come with substantial memory and computational requirements. Quantization techniques have emerged as a promising avenue for addressing these challenges while preserving accuracy and making energy efficient. We propose CPTQuant, a comprehensive strategy that introduces correlation-based (CMPQ), pruning-based (PMPQ), and Taylor decomposition-based (TDMPQ) mixed precision techniques. CMPQ adapts the precision level based on canonical correlation analysis of different layers. PMPQ optimizes precision layer-wise based on their sensitivity to sparsity. TDMPQ modifies precision using Taylor decomposition to assess each layer's sensitivity to input perturbation. These strategies allocate higher precision to more sensitive layers while diminishing precision to robust layers. CPTQuant assesses the performance across BERT, OPT-125M, OPT-350M, OPT-1.3B, and OPT-2.7B. We demonstrate up to 4x compression and a 2x-fold increase in efficiency with minimal accuracy drop compared to Hugging Face FP16. PMPQ stands out for achieving a considerably higher model compression. Sensitivity analyses across various LLMs show that the initial and final 30% of layers exhibit higher sensitivities than the remaining layers. PMPQ demonstrates an 11% higher compression ratio than other methods for classification tasks, while TDMPQ achieves a 30% greater compression ratio for language modeling tasks.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑