arXiv:2412.07114cs.CV2024-12

无需训练数据,在测试时高效压缩模型并保持精度。

TT-MPD: Test Time Model Pruning and Distillation

  • 用近似微调精度和推理延迟收益指导测试时剪枝。
  • 相比现有方法,剪枝与微调时间减少32%。
  • 适合对隐私敏感或分布偏移场景的模型部署。

剪枝可有效加速大模型推理速度。传统剪枝方法依赖原始训练数据进行剪枝和后续微调,但数据隐私与商业保密限制了其使用。此外,测试数据与训练数据分布差异(协变量偏移)会削弱剪枝后模型的泛化能力。因此,基于测试样本的剪枝与微调至关重要。然而,测试时剪枝与微调带来额外计算开销,影响效率。现有方法在测试时剪枝场景下不够高效,因需对剪枝后的模型进行微调以评估组件重要性。为此,我们引入两个变量近似微调后的准确率,并提出一种考虑该近似值与潜在推理延迟节省的高效剪枝方法。为提升微调效率,我们设计了一种仅需一次性生成少量微调样本伪标签的知识蒸馏方法,显著降低伪标签生成成本。实验表明,本方法在测试准确率与推理延迟之间达到相当或更优的权衡,相比最佳现有方法,剪枝与微调时间减少32%。

原文摘要 · Abstract (English)

Pruning can be an effective method of compressing large pre-trained models for inference speed acceleration. Previous pruning approaches rely on access to the original training dataset for both pruning and subsequent fine-tuning. However, access to the training data can be limited due to concerns such as data privacy and commercial confidentiality. Furthermore, with covariate shift (disparities between test and training data distributions), pruning and finetuning with training datasets can hinder the generalization of the pruned model to test data. To address these issues, pruning and finetuning the model with test time samples becomes essential. However, test-time model pruning and fine-tuning incur additional computation costs and slow down the model's prediction speed, thus posing efficiency issues. Existing pruning methods are not efficient enough for test time model pruning setting, since finetuning the pruned model is needed to evaluate the importance of removable components. To address this, we propose two variables to approximate the fine-tuned accuracy. We then introduce an efficient pruning method that considers the approximated finetuned accuracy and potential inference latency saving. To enhance fine-tuning efficiency, we propose an efficient knowledge distillation method that only needs to generate pseudo labels for a small set of finetuning samples one time, thereby reducing the expensive pseudo-label generation cost. Experimental results demonstrate that our method achieves a comparable or superior tradeoff between test accuracy and inference latency, with a 32% relative reduction in pruning and finetuning time compared to the best existing method.

模型剪枝测试时优化知识蒸馏高效推理

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。