arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2402.09773cs.CL
收藏

NutePrune:面向大型语言模型的多教师高效渐进式剪枝

NutePrune: Efficient Progressive Pruning with Numerous Teachers for Large Language Models

Tsinghua University(清华大学);Microsoft Research Asia(微软亚洲研究院)

Shengrui Li, Junzhe Chen, Xueting Han, Jing Bai

AI总结:

针对大型语言模型部署受限问题,提出NutePrune渐进式多教师剪枝方法,通过单模型加载结合掩码和LoRA无缝切换师生角色以降低内存开销,在LLaMA-7B零样本实验中20%和25%稀疏度下分别保留97.17%和95.07%性能。

摘要:

大型语言模型(LLMs)庞大的参数规模带来了显著的部署挑战,尤其是在资源受限的硬件上。结构化剪枝提供了一种有效的LLM压缩手段,从而降低存储成本并提升推理速度,实现更高效的利用。在本研究中,我们探索了数据高效且资源高效的结构化剪枝方法,以获取更小但依然强大的模型。知识蒸馏非常适合剪枝任务,因为完整的模型可以作为剪枝后学生模型的优秀教师。然而,由于内存限制,这在LLM场景下变得极具挑战。为解决此问题,我们提出了一种高效的渐进式多教师剪枝方法(NutePrune)。NutePrune通过仅加载一个完整模型,并将其与各种掩码和LoRA模块相结合,使其能够在教师与学生角色之间无缝切换,从而缓解了过高的内存开销。该方法使我们能够利用具有不同容量的众多教师来渐进式地指导剪枝模型,进而提升整体性能。跨多种任务的广泛实验证明了NutePrune的有效性。在LLaMA-7B的零样本实验中,NutePrune在20%稀疏度下保留了原始模型97.17%的性能,在25%稀疏度下保留了95.07%的性能。我们的代码可在https://github.com/Lucius-lsr/NutePrune获取。

英文摘要:

The considerable size of Large Language Models (LLMs) presents notable deployment challenges, particularly on resource-constrained hardware. Structured pruning, offers an effective means to compress LLMs, thereby reducing storage costs and enhancing inference speed for more efficient utilization. In this work, we study data-efficient and resource-efficient structure pruning methods to obtain smaller yet still powerful models. Knowledge Distillation is well-suited for pruning, as the intact model can serve as an excellent teacher for pruned students. However, it becomes challenging in the context of LLMs due to memory constraints. To address this, we propose an efficient progressive Numerous-teacher pruning method (NutePrune). NutePrune mitigates excessive memory costs by loading only one intact model and integrating it with various masks and LoRA modules, enabling it to seamlessly switch between teacher and student roles. This approach allows us to leverage numerous teachers with varying capacities to progressively guide the pruned model, enhancing overall performance. Extensive experiments across various tasks demonstrate the effectiveness of NutePrune. In LLaMA-7B zero-shot experiments, NutePrune retains 97.17% of the performance of the original model at 20% sparsity and 95.07% at 25% sparsity. Our code is available at https://github.com/Lucius-lsr/NutePrune.

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

↑