ReplaceMe: Network Simplification via Layer Pruning and Linear Transformations
ReplaceMe 是一种创新的神经网络剪枝方法,通过线性变换替换变压器块,在保持高性能的同时实现模型压缩,且无需额外的训练或微调。
更新于 2025-05-06。作者:Dmitriy Shopkhoev、Ammar Ali、Magauiya Zhussip、Valentin Malykh、Stamatios Lefkimmiatis、Nikos Komodakis、Sergey Zagoruyko。
中文摘要
我们引入了ReplaceMe,这是一种通用的无需训练的深度剪枝方法,它有效地用线性运算替换了transformer块,同时在低压缩比下保持高性能。与需要额外训练或微调的传统剪枝方法不同,我们的方法只需要一个小型的校准数据集,用于估计一个线性变换来近似被剪枝的块。这个估计的线性映射可以无缝地与剩余的transformer块合并,消除了对任何额外网络参数的需求。我们的实验表明,ReplaceMe始终优于其他无需训练的方法,并且与涉及大量重新训练/微调和架构修改的最先进剪枝方法保持高度竞争力。应用于几个大型语言模型(LLMs)时,ReplaceMe实现了高达25%的剪枝,同时在公开基准测试中保留了大约90%的原模型性能——无需任何训练或修复步骤,从而带来最小的计算开销(见图1)。我们提供了一个开源库,实现了ReplaceMe以及几种最先进的深度剪枝技术,可在本仓库找到。
英文摘要
We introduce ReplaceMe, a generalized training-free depth pruning method that effectively replaces transformer blocks with a linear operation, while maintaining high performance for low compression ratios. In contrast to conventional pruning approaches that require additional training or fine-tuning, our approach requires only a small calibration dataset that is used to estimate a linear transformation to approximate the pruned blocks. This estimated linear mapping can be seamlessly merged with the remaining transformer blocks, eliminating the need for any additional network parameters. Our experiments show that ReplaceMe consistently outperforms other training-free approaches and remains highly competitive with state-of-the-art pruning methods that involve extensive retraining/fine-tuning and architectural modifications. Applied to several large language models (LLMs), ReplaceMe achieves up to 25% pruning while retaining approximately 90% of the original model's performance on open benchmarks - without any training or healing steps, resulting in minimal computational overhead (see Fig.1). We provide an open-source library implementing ReplaceMe alongside several state-of-the-art depth pruning techniques, available at this repository.
解读
一句话总结
ReplaceMe 是一种创新的神经网络剪枝方法,通过线性变换替换变压器块,在保持高性能的同时实现模型压缩,且无需额外的训练或微调。
问题1:这篇论文想要解决什么具体问题?
- 问题背景:现代大型语言模型(LLMs)参数量庞大,计算和内存需求高,限制了其部署和实用性。
- 现有方案不足:传统的剪枝方法需要额外的训练或微调,计算量大且耗时。
- 研究目标:提出一种无需额外训练或微调的剪枝方法,以降低计算成本并提高效率。
问题2:论文的核心创新点是什么?
- 技术创新:提出 ReplaceMe,一种基于线性变换的剪枝方法,通过估计线性映射来补偿移除的块。
- 方法改进:无需重新训练或微调,只需一个小型校准数据集来估计线性变换。
- 优势:在合理的压缩比下,保持模型性能,减少计算开销。
问题3:实验结果如何验证了方法的有效性?
- 关键实验:在多个 LLMs 和视觉Transformer架构上进行实验,包括 LLaMA-2-7B、LLaMA-3-8B-Instruct、Qwen2.5-7B 和 Falcon-11B。
- 性能提升:在 25% 的剪枝率下,ReplaceMe 实现了大约 90% 的原始模型性能,同时保持了高效的压缩时间、低能耗和减少的排放。
- 对比结果:ReplaceMe 在性能上优于其他无训练剪枝方法,与需要大量重新训练或微调的先进剪枝方法相比也具有竞争力。
问题4:这个研究的实际应用价值是什么?
- 应用场景:适用于需要高性能和低资源消耗的设备,如移动设备、嵌入式系统和边缘计算。
- 实施建议:使用小型校准数据集来估计线性变换,并集成到现有模型中。
- 局限与展望:在高压缩比下,可能需要额外的“修复”过程。未来研究可以探索更复杂的线性变换和更有效的校准数据集。
来源
机器可读索引:llms.txt