arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2407.20584cs.CLcs.AI
收藏

使用半结构化自适应稀疏训练剪枝大型语言模型

Pruning Large Language Models with Semi-Structural Adaptive Sparse Training

Tsinghua University(清华大学)

Weiyu Huang, Yuezhou Hu, Guohao Jian, Jun Zhu, Jianfei Chen

AI总结:

提出半结构化自适应稀疏训练框架AST,通过动态学习掩码和知识蒸馏以极低训练成本恢复LLaMA2-7B剪枝性能,实现高压缩部署。

摘要:

大型语言模型(LLMs)的显著成功在很大程度上依赖于其庞大的规模,这在模型部署期间在延迟和内存消耗方面带来了重大挑战。最近,许多研究尝试使用一次性剪枝方法来压缩LLMs。然而,这些方法在复杂的语言理解任务上经常出现相当大的性能下降,引发了对在LLMs中进行剪枝可行性的担忧。为了解决这个问题,我们提出了Adaptive Sparse Trainer (AST),一种为半结构化稀疏模型量身定制的新型高效重训练框架。AST使模型能够在权重更新过程中学习最优掩码,而不会产生额外的计算开销。此外,我们证明,结合知识蒸馏显著提高了重训练效率,并增强了在固定计算约束下的模型性能。另外,集成了一组初始化良好的补充参数,以进一步增强模型的效能。AST以最小的训练成本实现了最先进的性能。当应用于LLaMA2-7B模型时,AST将稠密模型和2:4半结构化稀疏模型之间的困惑度和零样本准确率差距分别缩小到0.6和1.16%,使用的预训练token和GPU小时数不到0.4%。我们的工作证明了部署半结构化稀疏LLMs的可行性,并在与现有量化技术结合时,为实现高度压缩的模型提供了一个有前景的替代方案。

英文摘要:

The remarkable success of Large Language Models (LLMs) relies heavily on their substantial scale, which poses significant challenges during model deployment in terms of latency and memory consumption. Recently, numerous studies have attempted to compress LLMs using one-shot pruning methods. However, these methods often suffer from considerable performance degradation on complex language understanding tasks, raising concerns about the feasibility of pruning in LLMs. To address this issue, we propose Adaptive Sparse Trainer (AST), a novel and efficient retraining framework tailored for semi-structured sparse models. AST enables models to learn optimal masks during the weight update process without incurring additional computational overhead. Furthermore, we demonstrate that incorporating knowledge distillation significantly improves retraining efficiency and enhances model performance under fixed computational constraints. Additionally, a supplementary set of well-initialized parameters is integrated to further augment the model's efficacy. AST achieves state-of-the-art performance with minimal training cost. When applied to the LLaMA2-7B model, AST reduces the perplexity and zero-shot accuracy gap between dense and 2:4 semi-structured sparse models to 0.6 and 1.16%, respectively, utilizing less than 0.4% of the pretraining tokens and GPU hours. Our work demonstrates the feasibility of deploying semi-structured sparse LLMs and offers a promising alternative for achieving highly compressed models when combined with existing quantization techniques.

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

↑