DarwinLM: Evolutionary Structured Pruning of Large Language Models
DarwinLM通过进化搜索和训练感知的结构化剪枝,实现了大型语言模型的压缩,同时保持了较高的性能。
更新于 2025-02-17。作者:Shengkun Tang、Oliver Sieberling、Eldar Kurtic、Zhiqiang Shen、Dan Alistarh。
中文摘要
大型语言模型(LLMs)在各种自然语言处理(NLP)任务中取得了显著的成功。然而,它们的巨大计算成本限制了它们的广泛应用,尤其是在实时应用中。结构化剪枝提供了一种有效的解决方案,通过压缩模型并直接提供端到端的速度提升,不受硬件环境的影响。同时,模型的各个组件对剪枝的敏感性各不相同,这要求进行非均匀模型压缩。然而,剪枝方法不仅应该识别出有能力的子结构,还应该考虑压缩后的训练。为此,我们提出了\sysname,这是一种训练感知的结构化剪枝方法。\sysname基于进化搜索过程,通过变异在每个世代中生成多个后代模型,并选择最适应的模型进行生存。为了评估训练后效果,我们在后代群体中引入了一个轻量级的多步骤训练过程,逐步增加标记数,并在每个选择阶段消除表现不佳的模型。我们通过在Llama-2-7B、Llama-3.1-8B和Qwen-2.5-14B-Instruct上的广泛实验验证了我们的方法,实现了结构化剪枝的最新性能。例如,\sysname在压缩后训练过程中所需的训练数据量比ShearedLlama少5倍,却超越了ShearedLlama。
英文摘要
Large Language Models (LLMs) have achieved significant success across various NLP tasks. However, their massive computational costs limit their widespread use, particularly in real-time applications. Structured pruning offers an effective solution by compressing models and directly providing end-to-end speed improvements, regardless of the hardware environment. Meanwhile, different components of the model exhibit varying sensitivities towards pruning, calling for non-uniform model compression. However, a pruning method should not only identify a capable substructure, but also account for post-compression training. To this end, we propose \sysname, a method for training-aware structured pruning. \sysname builds upon an evolutionary search process, generating multiple offspring models in each generation through mutation, and selecting the fittest for survival. To assess the effect of post-training, we incorporate a lightweight, multistep training process within the offspring population, progressively increasing the number of tokens and eliminating poorly performing models in each selection stage. We validate our method through extensive experiments on Llama-2-7B, Llama-3.1-8B and Qwen-2.5-14B-Instruct, achieving state-of-the-art performance for structured pruning. For instance, \sysname surpasses ShearedLlama while requiring 5times less training data during post-compression training.
解读
一句话总结
DarwinLM通过进化搜索和训练感知的结构化剪枝,实现了大型语言模型的压缩,同时保持了较高的性能。
问题1:这篇论文想要解决什么具体问题?
- 问题背景:大型语言模型(LLMs)虽然在各种NLP任务中取得了显著成功,但其巨大的计算成本限制了其广泛应用,特别是在实时应用中。
- 现有方案不足:传统的剪枝方法通常对每个层或块进行均匀剪枝,而不同的LLM层对剪枝的“敏感性”差异较大,需要非均匀模型压缩。
- 研究目标:提出一种训练感知的结构化剪枝方法,以在保证性能的同时实现模型压缩。
问题2:论文的核心创新点是什么?
- 技术创新:利用二阶信息进行结构化剪枝,并引入训练感知的进化搜索,以识别满足性能要求且具有最高精度提升潜力的非均匀稀疏模型。
- 方法改进:结合进化搜索和二阶信息,通过训练感知的子代选择技术,以识别满足性能要求且具有最高精度提升潜力的非均匀稀疏模型。
- 优势:与现有方法相比,DarwinLM在保持较高性能的同时,实现了更有效的模型压缩。
问题3:实验结果如何验证了方法的有效性?
- 关键实验:在Llama-2-7B、Llama-3.1-8B和Qwen-2.5-14B-Instruct上进行了广泛的实验,结果表明DarwinLM在结构化剪枝方面达到了最先进的性能。
- 性能提升:与ShearedLlama相比,DarwinLM在Llama-2-7B上达到了更小的稀疏模型,同时使用5倍更少的训练数据进行后压缩训练。
- 对比结果:在Llama-2、Llama-3.1和Qwen-2.5上,与现有的最先进方法相比,DarwinLM获得了更小的稀疏模型,并且性能下降较少。
问题4:这个研究的实际应用价值是什么?
- 应用场景:在实时应用、移动设备、边缘计算等领域,DarwinLM可以实现大型语言模型的快速部署和高效运行。
- 实施建议:在应用DarwinLM时,应根据具体任务和硬件环境选择合适的剪枝比例和训练数据量。
- 局限与展望:虽然DarwinLM在性能和效率方面取得了显著成果,但仍需进一步研究如何降低训练成本和提高模型的鲁棒性。
来源
机器可读索引:llms.txt