NutePrune: Efficient Progressive Pruning with Numerous Teachers for Large Language Models
作者: Shengrui Li, Junzhe Chen, Xueting Han, Jing Bai
分类: cs.CL
发布日期: 2024-02-15 (更新: 2024-06-27)
🔗 代码/项目: GITHUB
💡 一句话要点
提出NutePrune以解决大语言模型的高效剪枝问题
🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture) 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大语言模型 结构化剪枝 知识蒸馏 模型压缩 LoRA模块 渐进式剪枝 多教师模型
📋 核心要点
- 现有的剪枝方法在大语言模型中面临内存限制,难以有效利用多个教师模型进行知识蒸馏。
- NutePrune通过仅加载一个完整模型,结合多种掩码和LoRA模块,实现了高效的渐进式剪枝。
- 在LLaMA-7B的实验中,NutePrune在20%和25%稀疏率下分别保留了97.17%和95.07%的性能,显示出显著的效果提升。
📝 摘要(中文)
大语言模型(LLMs)的庞大规模在资源受限的硬件上部署时面临显著挑战。结构化剪枝是一种有效的压缩LLMs的方法,可以降低存储成本并提高推理速度。本文研究了数据高效和资源高效的结构剪枝方法,以获得更小但仍强大的模型。我们提出了一种高效的渐进式多教师剪枝方法NutePrune,通过仅加载一个完整模型并结合多种掩码和LoRA模块,减轻了过高的内存成本。NutePrune能够在教师和学生角色之间无缝切换,利用不同能力的多个教师逐步指导剪枝模型,提升整体性能。实验表明,在LLaMA-7B的零-shot实验中,NutePrune在20%稀疏率下保留了97.17%的原始模型性能,在25%稀疏率下保留了95.07%。
🔬 方法详解
问题定义:本文旨在解决大语言模型在资源受限环境下的高效剪枝问题。现有方法在内存使用上存在瓶颈,难以充分利用多个教师模型进行知识蒸馏。
核心思路:NutePrune的核心思路是通过加载一个完整的教师模型,并结合多种掩码和LoRA模块,来实现高效的渐进式剪枝。这种设计旨在减轻内存负担,同时利用多个教师模型的知识。
技术框架:NutePrune的整体架构包括一个完整的教师模型和多个剪枝学生模型。通过动态切换教师和学生角色,结合不同的掩码,逐步指导学生模型的剪枝过程。
关键创新:NutePrune的主要创新在于其渐进式的多教师剪枝方法,能够有效地在内存受限的情况下利用多个教师模型的知识,与传统方法相比,显著提高了剪枝模型的性能。
关键设计:在技术细节上,NutePrune采用了LoRA模块来增强模型的适应性,并通过精心设计的掩码策略来实现不同层次的剪枝,确保在稀疏率较高的情况下仍能保持较好的性能。
🖼️ 关键图片
📊 实验亮点
在LLaMA-7B的零-shot实验中,NutePrune在20%稀疏率下保留了97.17%的原始模型性能,而在25%稀疏率下保留了95.07%的性能。这些结果表明,NutePrune在剪枝效率和模型性能之间取得了良好的平衡,显著优于传统剪枝方法。
🎯 应用场景
NutePrune的研究成果在大语言模型的部署中具有广泛的应用潜力,尤其是在移动设备和边缘计算等资源受限的环境中。通过有效的模型压缩和加速,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.