arXiv:2504.21553cs.CL2025-04被引 3

针对大模型激活值突增,精准提升特定层精度以优化量化效果。

Precision Where It Matters: A Novel Spike Aware Mixed-Precision Quantization Strategy for LLaMA-based Language Models

  • 识别并聚焦于激活突增集中的投影层,仅对这些层使用高精度。
  • 在LLaMA2/3和Mistral上实现8位量化下更低困惑度与更高零样本准确率。
  • 适合追求高效部署的开发者,尤其关注资源受限场景下的模型优化。

大型语言模型(LLMs)在自然语言处理任务中表现出色,但其规模给部署与推理带来挑战。本文研究基于LLaMA架构及其衍生模型的量化方法,挑战了现有对激活异常值的认知,提出一种面向LLaMA类模型的新型混合精度量化策略。该方法发现:在LLaMA架构中,激活突增主要集中于特定投影层。通过仅对这些关键层采用FP16或FP8高精度,其余部分低比特量化,相比现有通用量化技术取得显著性能提升。在LLaMA2、LLaMA3和Mistral模型上的实验表明,尤其在每张量8位量化条件下,困惑度与零样本准确率均有明显改善。本方法优于适用于所有架构的通用异常值处理方案,凸显了针对模型结构设计专用量化策略的价值。研究为提升大模型效率与可部署性提供新思路,有望支持在资源受限环境中的应用。核心在于识别并精准优化少数集中突增的投影层。

原文摘要 · Abstract (English)

Large Language Models (LLMs) have demonstrated remarkable capabilities in various natural language processing tasks. However, their size presents significant challenges for deployment and inference. This paper investigates the quantization of LLMs, focusing on the LLaMA architecture and its derivatives. We challenge existing assumptions about activation outliers in LLMs and propose a novel mixed-precision quantization approach tailored for LLaMA-like models. Our method leverages the observation that activation spikes in LLaMA architectures are predominantly concentrated in specific projection layers. By applying higher precision (FP16 or FP8) to these layers while quantizing the rest of the model to lower bit-widths, we achieve superior performance compared to existing quantization techniques. Experimental results on LLaMA2, LLaMA3, and Mistral models demonstrate significant improvements in perplexity and zero-shot accuracy, particularly for 8-bit per-tensor quantization. Our approach outperforms general-purpose methods designed to handle outliers across all architecture types, highlighting the benefits of architecture-specific quantization strategies. This research contributes to the ongoing efforts to make LLMs more efficient and deployable, potentially enabling their use in resource-constrained environments. Our findings emphasize the importance of considering model-specific characteristics in developing effective quantization pipelines for state-of-the-art language models by identifying and targeting a small number of projections that concentrate activation spikes.

量化LLaMA混合精度部署优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。