通过分组结构剪枝提升视觉Transformer在跨域任务中的效率与性能。
The Effects of Grouped Structural Global Pruning of Vision Transformers on Domain Generalisation
- 基于依赖图分析,按组剪除冗余注意力头与神经元。
- 50%剪枝下精度损失不足3%,推理速度提升达2.5倍。
- 适合资源受限设备上部署高效跨域泛化模型的开发者。
随着大语言模型和视觉变换器(ViT、BeiT、DeiT)规模不断增大,在计算资源有限的设备上部署面临挑战,尤其在跨域泛化(DG)任务中。本文提出一种新型分组结构剪枝方法,针对预训练视觉变换器,在PACS和Office-Home DG基准上进行评估。该方法利用依赖图分析识别并移除变换器内冗余的神经元、权重、滤波器或注意力头,采用多种选择度量指标。在50%、75%和95%的剪枝率下应用剪枝,并在DG基准的选定分布上微调模型以评估整体性能。结果表明,推理速度和微调时间显著提升,精度与跨域性能损失极小。例如在PACS基准上,使用赫斯蒂安(Hessian)度量对ViT、BeiT、DeiT进行50%剪枝后,准确率下降分别为-2.94%、-1.42%、-1.72%,但推理速度分别提升2.5倍、1.81倍和2.15倍。实验验证了该方法在模型效率与跨域泛化性能之间取得良好平衡。
原文摘要 · Abstract (English)
With the growing sizes of AI models like large language models (LLMs) and vision transformers, deploying them on devices with limited computational resources is a significant challenge particularly when addressing domain generalisation (DG) tasks. This paper introduces a novel grouped structural pruning method for pre-trained vision transformers (ViT, BeiT, and DeiT), evaluated on the PACS and Office-Home DG benchmarks. Our method uses dependency graph analysis to identify and remove redundant groups of neurons, weights, filters, or attention heads within transformers, using a range of selection metrics. Grouped structural pruning is applied at pruning ratios of 50\%, 75\% and 95\% and the models are then fine-tuned on selected distributions from DG benchmarks to evaluate their overall performance in DG tasks. Results show significant improvements in inference speed and fine-tuning time with minimal trade-offs in accuracy and DG task performance. For instance, on the PACS benchmark, pruning ViT, BeiT, and DeiT models by 50\% using the Hessian metric resulted in accuracy drops of only -2.94\%, -1.42\%, and -1.72\%, respectively, while achieving speed boosts of 2.5x, 1.81x, and 2.15x. These findings demonstrate the effectiveness of our approach in balancing model efficiency with domain generalisation performance.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。