arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2302.04089cs.LGcs.CL

ZipLM:面向推理感知的语言模型结构化剪枝

ZipLM: Inference-Aware Structured Pruning of Language Models

IST Austria(奥地利科学技术学院);Neural Magic(Neural Magic公司)

Eldar Kurtic, Elias Frantar, Dan Alistarh

AI总结:

ZipLM提出一种推理感知的LLM结构化剪枝方法,通过迭代移除损失-运行时间权衡最差的组件,在多种模型和压缩设置下以低成本实现满足目标加速的最先进精度-加速比。

摘要:

大型语言模型(LLMs)的突破性性能伴随着巨大的计算足迹和高昂的部署成本。在本文中,我们通过提出一种新颖的LLM结构化压缩方法ZipLM来推进这一问题的解决。ZipLM在任意给定的推理环境中,既能实现最先进的精度-加速比,又能满足一组期望的目标运行时加速。具体来说,给定一个模型、一个数据集、一个推理环境以及一组加速目标,ZipLM迭代地识别并移除损失-运行时间权衡最差的组件。与先前专门针对训练后/一次性压缩或渐进式压缩设置、且仅适用于特定模型家族(如BERT(编码器)或GPT(解码器))的方法不同,ZipLM在所有这些设置下都能产生最先进的压缩模型。此外,相对于先前的蒸馏和剪枝技术,ZipLM以极低的计算成本取得了更优的结果,使其成为一种经济高效的方法,能够生成一整套更小、更快且高精度的模型,并保证满足期望的推理规格。特别是,ZipLM优于所有先前的BERT-base蒸馏和剪枝技术,如CoFi、MiniLM和TinyBERT。此外,它通过简单地剪枝基线BERT-large模型,就能匹敌经过广泛架构搜索获得的高度优化的MobileBERT模型的性能。在压缩GPT2时,ZipLM优于DistilGPT2,同时模型尺寸减小60%,速度提升30%。我们的代码可在以下地址获取:https://github.com/IST-DASLab/ZipLM。

英文摘要:

The breakthrough performance of large language models (LLMs) comes with major computational footprints and high deployment costs. In this paper, we progress towards resolving this problem by proposing a novel structured compression approach for LLMs, called ZipLM. ZipLM achieves state-of-the-art accuracy-vs-speedup, while matching a set of desired target runtime speedups in any given inference environment. Specifically, given a model, a dataset, an inference environment, as well as a set of speedup targets, ZipLM iteratively identifies and removes components with the worst loss-runtime trade-off. Unlike prior methods that specialize in either the post-training/one-shot or the gradual compression setting, and only for specific families of models such as BERT (encoder) or GPT (decoder), ZipLM produces state-of-the-art compressed models across all these settings. Furthermore, ZipLM achieves superior results for a fraction of the computational cost relative to prior distillation and pruning techniques, making it a cost-effective approach for generating an entire family of smaller, faster, and highly accurate models, guaranteed to meet the desired inference specifications. In particular, ZipLM outperforms all prior BERT-base distillation and pruning techniques, such as CoFi, MiniLM, and TinyBERT. Moreover, it matches the performance of the heavily optimized MobileBERT model, obtained via extensive architecture search, by simply pruning the baseline BERT-large model. When compressing GPT2, ZipLM outperforms DistilGPT2 while being 60% smaller and 30% faster. Our code is available at: https://github.com/IST-DASLab/ZipLM.

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

↑