State-of-the-art language models are becoming increasingly large in an effort to achieve the highest performance on large corpora of available textual data. However, the sheer size of the Transformer architectures makes it difficult to deploy models within computational, environmental or device-specific constraints. We explore data-driven compression of existing pretrained models as an alternative to training smaller models from scratch. To do so, we scale Kronecker-factored curvature approximations of the target loss landscape to large language models. In doing so, we can compute both the dynamic allocation of structures that can be removed as well as updates of remaining weights that account for the removal. We provide a general framework for unstructured, semi-structured and structured pruning and improve upon weight updates to capture more correlations between weights, while remaining computationally efficient. Experimentally, our method can prune rows and columns from a range of OPT models and Llamav2-7B by 20%-30%, with a negligible loss in performance, and achieve state-of-the-art results in unstructured and semi-structured pruning of large language models.
翻译:最先进的语言模型正变得日益庞大,以期在可用文本数据的大规模语料库上实现最高性能。然而,Transformer架构的巨大规模使得在计算、环境或设备特定约束下部署模型变得困难。我们探索基于数据驱动的现有预训练模型压缩方法,作为从头训练更小模型的替代方案。为此,我们将目标损失景观的克罗内克因子曲率近似扩展到大型语言模型。通过这种方式,我们既可以计算可移除结构的动态分配,也可以计算考虑移除影响的剩余权重更新。我们为非结构化、半结构化和结构化剪枝提供了一个通用框架,并在保持计算效率的同时改进了权重更新以捕获权重之间更多的相关性。实验结果表明,我们的方法可以将一系列OPT模型和Llama-v2-7B的行和列剪枝20%-30%,且性能损失可忽略不计,并在大型语言模型的非结构化和半结构化剪枝中实现了最先进的结果。