Skip to main content
QUICK REVIEW

[论文解读] Model Compression and Efficient Inference for Large Language Models: A Survey

Wenxiao Wang, Wei Chen|arXiv (Cornell University)|Feb 15, 2024
Topic ModelingComputer Science被引用 13
一句话总结

本综述评估大语言模型的算法模型压缩和高效推理技术,讨论分类体系、挑战与框架,并区分中等模型与“大型”LLM。

ABSTRACT

Transformer based large language models have achieved tremendous success. However, the significant memory and computational costs incurred during the inference process make it challenging to deploy large models on resource-constrained devices. In this paper, we investigate compression and efficient inference methods for large language models from an algorithmic perspective. Regarding taxonomy, similar to smaller models, compression and acceleration algorithms for large language models can still be categorized into quantization, pruning, distillation, compact architecture design, dynamic networks. However, Large language models have two prominent characteristics compared to smaller models: (1) Most of compression algorithms require finetuning or even retraining the model after compression. The most notable aspect of large models is the very high cost associated with model finetuning or training. Therefore, many algorithms for large models, such as quantization and pruning, start to explore tuning-free algorithms. (2) Large models emphasize versatility and generalization rather than performance on a single task. Hence, many algorithms, such as knowledge distillation, focus on how to preserving their versatility and generalization after compression. Since these two characteristics were not very pronounced in early large models, we further distinguish large language models into medium models and ``real'' large models. Additionally, we also provide an introduction to some mature frameworks for efficient inference of large models, which can support basic compression or acceleration algorithms, greatly facilitating model deployment for users.

研究动机与目标

  • 动员在资源受限设备上部署LLMs时降低内存和计算成本的必要性。
  • 提供LLMs的压缩与加速方法的分类(量化、裁剪、蒸 Distillation、紧凑架构、动态网络)。
  • 强调针对LLMs的两个关键挑战:压缩后微调/训练成本以及保持多样性/泛化能力。
  • 区分中等模型(≈1B参数)与“真正的”大型模型(>1B)以明确适用技术。
  • 提供对成熟高效推理框架的入门性指南,支持压缩方法。

提出的方法

  • 按技术与训练/微调要求对LLM的压缩方法进行调研与分类(PTQ 与 QAT)。
  • 解释Transformer架构的基础概念,为讨论奠定基础(注意力机制、多头注意力、编码器/解码器变体)。
  • 总结各类别中的代表性方法(量化、裁剪、蒸馏、紧凑设计、动态网络),并讨论它们对中等模型与大型模型的适用性。
  • 讨论针对LLMs高微调成本而量身定制的无调优或高效调优的方法。
  • 引入实际考虑因素,如校准、量化粒度,以及静态/动态量化的区分。

实验结果

研究问题

  • RQ1在不需要高昂重训练的情况下,哪些压缩与加速技术最能降低LLMs的内存和计算成本?
  • RQ2如何通过量化、裁剪、蒸馏和动态图结构来在压缩后保持LLMs的泛化与多样性?
  • RQ3中等模型与真正大型LLMs之间存在哪些区别,会影响压缩策略的选择?
  • RQ4哪些框架和实际工具支持高效推理与部署压缩的LLMs?
  • RQ5实际考虑因素(校准、量化粒度、PTQ 与 QAT)在压缩后对性能的影响?

主要发现

  • LLMs在推理阶段需要高内存和计算成本,促使采取压缩与高效推理策略。
  • 一个适用于LLM的压缩方法分类法,包括量化、裁剪、蒸馏、紧凑设计和动态网络,且可组合使用。
  • 大型模型面临两个显著挑战:(1) 压缩后微调/再训练成本高,推动对无调优或高效调优方法的兴趣;(2) 强调在多任务上的通用性/泛化能力,而非单一任务的性能。
  • 本综述引入一个框架,区分中等模型(约1B参数)与大型模型(大于1B参数),以澄清何时传统方法仍然适用,以及何时需要更专门的方法。
  • 本文还对支持基本压缩/加速技术以实现实际部署的成熟推理框架进行了介绍。

阅读本论文

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

在 Nubint 中阅读本论文

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