Skip to main content
QUICK REVIEW

[论文解读] An empirical study of LLaMA3 quantization: from LLMs to MLLMs

Wei Huang, Xingyu Zheng|arXiv (Cornell University)|Apr 22, 2024
Advanced Wireless Communication TechniquesEngineering被引用 11
一句话总结

该论文用后训练量化(PTQ)和LoRA微调(LoRA-FT)对Meta的LLaMA3模型进行低比特量化的实证评估,结果在超低比特下性能下降不可忽视,在测试数据集上LLaMA3-70B相较于LLaMA3-8B展现出更强的鲁棒性。

ABSTRACT

The LLaMA family, a collection of foundation language models ranging from 7B to 65B parameters, has become one of the most powerful open-source large language models (LLMs) and the popular LLM backbone of multi-modal large language models (MLLMs), widely used in computer vision and natural language understanding tasks. In particular, LLaMA3 models have recently been released and have achieved impressive performance in various domains with super-large scale pre-training on over 15T tokens of data. Given the wide application of low-bit quantization for LLMs in resource-constrained scenarios, we explore LLaMA3's capabilities when quantized to low bit-width. This exploration can potentially provide new insights and challenges for the low-bit quantization of LLaMA3 and other future LLMs, especially in addressing performance degradation issues that suffer in LLM compression. Specifically, we comprehensively evaluate the 10 existing post-training quantization and LoRA fine-tuning (LoRA-FT) methods of LLaMA3 on 1-8 bits and various datasets to reveal the low-bit quantization performance of LLaMA3. To uncover the capabilities of low-bit quantized MLLM, we assessed the performance of the LLaMA3-based LLaVA-Next-8B model under 2-4 ultra-low bits with post-training quantization methods. Our experimental results indicate that LLaMA3 still suffers from non-negligible degradation in linguistic and visual contexts, particularly under ultra-low bit widths. This highlights the significant performance gap at low bit-width that needs to be addressed in future developments. We expect that this empirical study will prove valuable in advancing future models, driving LLMs and MLLMs to achieve higher accuracy at lower bit to enhance practicality. Our project is released on https://github.com/Macaronlin/LLaMA3-Quantization , and quantized models are released at https://huggingface.co/Efficient-ML .

研究动机与目标

  • 评估 LLaMA3 模型(8B 与 70B)在低比特量化下的性能。
  • 评估从1到8位的广泛PTQ方法与LoRA-FT技术。
  • 识别不同模型规模下的精度下降模式和鲁棒性差异。
  • 提供实用见解以指导未来LLM量化的研究与开发。

提出的方法

  • 使用八种PTQ方法和两种LoRA-FT方法对LLaMA3-8B和LLaMA3-70B进行量化。
  • 在WikiText2、C4、PTB和零-shot任务PIQA、Winogrande、ARC-e、ARC-c、Hellaswag上评估PTQ量化模型。
  • 在MMLU上评估LoRA-FT量化的LLaMA3-8B并验证零-shot任务。
  • 为方法间公平性,使用WikiText2校准(128个标记,2048序列长度)。
  • 在需要时应用通道分组,块大小为128。
  • 与基线FP16/32BIT性能进行比较,并报告困惑度和任务准确率。

实验结果

研究问题

  • RQ1LLaMA3-8B在不同PTQ和LoRA-FT量化方法下在标准基准测试中的表现如何?
  • RQ2在相同方法下,与LLaMA3-8B相比,LLaMA3-70B在对量化的鲁棒性方面如何?
  • RQ3极低位量化(1-2位)是否能取得可接受的性能,哪些方法最能保留准确性?
  • RQ4LoRA-FT量化是否为LLaMA3提供可靠增益,还是预训练规模的限制影响了其有效性?
  • RQ5在资源受限环境中部署量化的LLaMA3有哪些实际意义?

主要发现

  • Quantized LLaMA3-8B and -70B experience non-negligible degradation at ultra-low bit-widths across PTQ methods.
  • Ultra-low-bit (2-bit and below) performance can be significantly worse for 8B than for 70B, with certain ultra-low-bit methods performing poorly.
  • LoRA-FT quantization on LLaMA3-8B does not consistently compensate for quantization errors and can underperform compared to non-LoRA-FT 4-bit baselines.
  • 4-bit LoRA-FT quantized LLaMA3-8B can outperform some 4-bit LLaMA1/2 baselines, suggesting a shift in quantization dynamics with newer models.
  • Certain PTQ methods (e.g., PB-LLM, BiLLM, DB-LLM, QuIP, AWQ, GPTQ) show varying strengths, with ultra-low-bit techniques like BiLLM and PB-LLM pushing 1-2 bit performance but not universally closing the gap to full precision.
  • SmoothQuant helps stabilize activation quantization for some configurations but collapses at very low bit-widths (e.g., 4-bit).

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。