LaCo: Large Language Model Pruning via Layer Collapse
作者: Yifei Yang, Zouying Cao, Hai Zhao
分类: cs.CL, cs.AI
发布日期: 2024-02-17 (更新: 2024-10-15)
备注: Accepted as Findings of EMNLP2024
🔗 代码/项目: GITHUB
💡 一句话要点
提出LaCo以解决大语言模型剪枝问题
🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture) 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大语言模型 模型剪枝 层崩溃 变换器 性能优化 深度学习
📋 核心要点
- 现有的大语言模型在规模扩展上面临高昂的训练和推理成本,现有剪枝方法存在硬件限制和训练需求等问题。
- 本文提出的LaCo方法通过将后层崩溃到前层,快速减少模型规模,同时保持其结构完整性。
- 实验结果显示,在25-30%的剪枝比率下,LaCo方法的任务性能超过80%,显著优于现有的剪枝技术。
📝 摘要(中文)
基于变换器的大语言模型(LLMs)正经历显著的规模扩展趋势,这给模型训练和推理带来了巨大的成本。然而,现有的方法如模型量化、知识蒸馏和模型剪枝受到硬件支持限制、需要大量训练和模型内部结构改变等问题的制约。本文提出了一种简洁的层级结构剪枝方法——层崩溃(LaCo),通过将后面的模型层崩溃到前一层,实现快速减小模型规模,同时保持模型结构。综合实验表明,在25-30%的剪枝比率下,我们的方法保持了超过80%的平均任务性能,显著优于现有的最先进结构剪枝方法。我们还进行了后训练实验,以确认LaCo有效继承了原始模型的参数,并对LaCo的各种设置进行了消融研究。最后,我们从层级相似性的角度讨论了我们的动机,并评估了不同剪枝比率下剪枝后的LLMs的性能。
🔬 方法详解
问题定义:本文旨在解决大语言模型在规模扩展过程中带来的高成本问题。现有的剪枝方法如量化和蒸馏存在硬件支持不足、训练时间长和模型结构改变等痛点。
核心思路:LaCo方法的核心思想是通过将后面的模型层崩溃到前一层,快速减小模型的规模,同时保持模型的结构不变。这种设计旨在提高剪枝效率,减少对训练资源的需求。
技术框架:LaCo的整体架构包括层级结构的定义、剪枝策略的实施以及后训练参数的继承。具体流程是先识别可剪枝的层,然后将其参数整合到前一层,最后进行性能评估。
关键创新:LaCo的主要创新在于其层崩溃机制,这与传统的剪枝方法不同,后者通常需要对模型进行复杂的重训练或结构调整。LaCo通过简单的层合并实现了高效剪枝。
关键设计:在LaCo中,剪枝比率的设置为25-30%,并通过消融实验验证了不同设置对模型性能的影响。此外,损失函数和参数继承机制的设计确保了剪枝后模型性能的稳定性。
🖼️ 关键图片
📊 实验亮点
实验结果显示,LaCo在25-30%的剪枝比率下,平均任务性能超过80%,显著优于现有的最先进结构剪枝方法。这一结果表明,LaCo不仅在剪枝效率上具有优势,同时在保持模型性能方面也表现出色。
🎯 应用场景
该研究的潜在应用领域包括自然语言处理、对话系统和文本生成等。通过有效减小模型规模,LaCo可以降低模型的训练和推理成本,使得大语言模型在资源受限的环境中更具可用性,推动其在实际应用中的广泛部署。
📄 摘要(原文)
Large language models (LLMs) based on transformer are witnessing a notable trend of size expansion, which brings considerable costs to both model training and inference. However, existing methods such as model quantization, knowledge distillation, and model pruning are constrained by various issues, including hardware support limitations, the need for extensive training, and alterations to the model internal structure. In this paper, we propose a concise layer-wise structured pruner called \textit{Layer Collapse (LaCo)}, in which rear model layers collapse into a prior layer, enabling a rapid reduction in model size while preserving the model structure. Comprehensive experiments show that our method maintains an average task performance of over 80\% at pruning ratios of 25-30\%, significantly outperforming existing state-of-the-art structured pruning methods. We also conduct post-training experiments to confirm that the \textit{LaCo} effectively inherits the parameters of the original model. Additionally, we perform ablation studies on various settings of \textit{LaCo}. Finally, we discuss our motivation from the perspective of layer-wise similarity and evaluate the performance of the pruned LLMs across various pruning ratios\footnote{\url{https://github.com/yangyifei729/LaCo}}.