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.
翻译:大语言模型(LLMs)的庞大规模在部署过程中带来显著挑战,尤其在资源受限硬件上尤为突出。结构化剪枝提供了一种有效压缩LLMs的手段,从而降低存储成本并提升推理速度以实现更高效的利用。本文研究数据高效与资源高效的结构化剪枝方法,旨在获得更小但仍保持强大能力的模型。知识蒸馏天然适配剪枝场景,因为完整模型可作为剪枝后模型的优秀教师。然而,在LLMs中由于内存限制,这一方法面临挑战。为此,我们提出一种高效渐进多教师剪枝方法(NutePrune)。通过仅加载单个完整模型并集成多种掩码与LoRA模块,NutePrune能够无缝切换教师与学生角色,从而缓解内存开销过高的问题。该方法允许我们利用多个具有不同容量的教师模型渐进指导剪枝过程,提升整体性能。广泛的任务实验验证了NutePrune的有效性:在LLaMA-7B零样本实验中,NutePrune在20%稀疏度下保留了原始模型97.17%的性能,在25%稀疏度下保留95.07%的性能。