arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2310.06927cs.CLcs.AI
收藏

面向大型语言模型推理加速的稀疏微调

Sparse Fine-tuning for Inference Acceleration of Large Language Models

IST Austria(奥地利科学技术研究所);Skoltech(斯科尔科沃科学技术研究院);Yandex(扬德克斯);Neural Magic(神经魔法公司)

Eldar Kurtic, Denis Kuznedelev, Elias Frantar, Michael Goin, Dan Alistarh

AI总结:

本文提出稀疏微调方法SquareHead,通过L2蒸馏损失在高稀疏度下恢复精度,并在CPU/GPU上利用稀疏性加速推理,首次实现MPT模型75%稀疏度无精度损失。

摘要:

我们考虑大型语言模型(LLMs)的精确稀疏微调问题,即在专用任务上微调预训练的LLMs,同时在其权重中引入稀疏性。在精度方面,我们观察到基于标准损失的微调可能无法恢复精度,尤其是在高稀疏度下。为解决这一问题,我们对蒸馏类型损失进行了详细研究,确定了一种基于L2的蒸馏方法,我们称之为SquareHead,它能够在所有模型类型中实现高稀疏度下的精确恢复。在实际效率方面,我们展示了稀疏LLMs可以通过利用稀疏性在CPU和GPU运行时获得加速。虽然标准方法是利用稀疏性来减少计算量,但我们观察到,在内存受限的LLMs情况下,稀疏性也可以用于减少内存带宽。我们展示了端到端的结果,显示在T5(语言翻译)、Whisper(语音翻译)和开放GPT类型(MPT用于文本生成)上,稀疏性带来了加速,同时恢复了精度。对于MPT文本生成,我们首次展示了稀疏微调可以达到75%的稀疏度而不会降低精度,为CPU和GPU推理提供了显著的端到端加速,并强调稀疏性也与量化方法兼容。复现我们结果的模型和软件在第6节中提供。

英文摘要:

We consider the problem of accurate sparse fine-tuning of large language models (LLMs), that is, fine-tuning pretrained LLMs on specialized tasks, while inducing sparsity in their weights. On the accuracy side, we observe that standard loss-based fine-tuning may fail to recover accuracy, especially at high sparsities. To address this, we perform a detailed study of distillation-type losses, determining an L2-based distillation approach we term SquareHead which enables accurate recovery even at higher sparsities, across all model types. On the practical efficiency side, we show that sparse LLMs can be executed with speedups by taking advantage of sparsity, for both CPU and GPU runtimes. While the standard approach is to leverage sparsity for computational reduction, we observe that in the case of memory-bound LLMs sparsity can also be leveraged for reducing memory bandwidth. We exhibit end-to-end results showing speedups due to sparsity, while recovering accuracy, on T5 (language translation), Whisper (speech translation), and open GPT-type (MPT for text generation). For MPT text generation, we show for the first time that sparse fine-tuning can reach 75% sparsity without accuracy drops, provide notable end-to-end speedups for both CPU and GPU inference, and highlight that sparsity is also compatible with quantization approaches. Models and software for reproducing our results are provided in Section 6.

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

↑