用激活方差剪枝,一剪就提速,少调就能保精度。
Variance-Based Pruning for Accelerating and Compressing Trained Networks
- 基于激活方差选要剪的神经元,同时保留均值信息稳性能。
- 剪后DeiT-Base在ImageNet上保留70%原精度,10轮微调恢复99%。
- 适合想快速压缩模型又不想重训的工程师或部署场景。
随着视觉变压器等大模型训练成本不断上升,复用已训练好的先进模型成为迫切需求。但其高延迟、高算力与大内存消耗限制了在资源受限设备上的部署。现有结构化剪枝方法虽可降低开销,却常需耗时数百度甚至从头训练来恢复精度,难以维持原模型性能。为此,本文提出方差剪枝(Variance-Based Pruning),一种简单高效的单次结构化剪枝方法,只需少量微调即可实现模型压缩。该方法先收集激活统计量,据此选择剪枝神经元,并将均值信息回填模型以保持性能。在ImageNet-1k图像分类任务中,剪枝后的DeiT-Base仍保持超过70%原始性能,仅经10轮微调即恢复至原精度的99%,同时减少35%的计算量(MACs)和36%的模型大小,推理速度提升1.44倍。代码已开源。
原文摘要 · Abstract (English)
Increasingly expensive training of ever larger models such as Vision Transfomers motivate reusing the vast library of already trained state-of-the-art networks. However, their latency, high computational costs and memory demands pose significant challenges for deployment, especially on resource-constrained hardware. While structured pruning methods can reduce these factors, they often require costly retraining, sometimes for up to hundreds of epochs, or even training from scratch to recover the lost accuracy resulting from the structural modifications. Maintaining the provided performance of trained models after structured pruning and thereby avoiding extensive retraining remains a challenge. To solve this, we introduce Variance-Based Pruning, a simple and structured one-shot pruning technique for efficiently compressing networks, with minimal finetuning. Our approach first gathers activation statistics, which are used to select neurons for pruning. Simultaneously the mean activations are integrated back into the model to preserve a high degree of performance. On ImageNet-1k recognition tasks, we demonstrate that directly after pruning DeiT-Base retains over 70% of its original performance and requires only 10 epochs of fine-tuning to regain 99% of the original accuracy while simultaneously reducing MACs by 35% and model size by 36%, thus speeding up the model by 1.44x. The code is available at: https://github.com/boschresearch/variance-based-pruning
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。