用於壓縮基於Transformer視覺模型的高效混合剪枝策略
An Efficient Hybrid Pruning Strategy for Compressing Transformer-based Vision Models
摘要
近年來,基於Transformer 架構的模型在計算機視覺領域取得了顯著成就。然而,這些模型的高計算成本仍然是其實際部署的一大障礙。模型壓縮技術已成為將此類大型模型部署到邊緣設備上的常用方法。過往的剪枝技術通常僅對某一部分進行壓縮,如令牌 ( 的 數量、多頭自注意力 (Multi Head Self Attention) 和多層感知機 ( 層的維度。然而,這些方法在高壓縮率下會導致單一部分過度剪枝,從而對模型性能產生顯著影響。
本論文中 提出了一種混合剪枝策略,在模型訓練過程中同時進行 動態 令牌合併和多頭自注意力及多層感知機的漸進式剪枝,並 找出這些部分的適當比例,實現對模型全局的壓縮,充分發揮各種方法的優勢。實驗結果表明, 所提出的 混合剪枝策略在 CIFAR10 、 CIFAR 100 和 SVHN 等 資料 集上的表現優於單一部分剪枝方法,展示了更佳的壓縮效果和模型性能。
本論文中 提出了一種混合剪枝策略,在模型訓練過程中同時進行 動態 令牌合併和多頭自注意力及多層感知機的漸進式剪枝,並 找出這些部分的適當比例,實現對模型全局的壓縮,充分發揮各種方法的優勢。實驗結果表明, 所提出的 混合剪枝策略在 CIFAR10 、 CIFAR 100 和 SVHN 等 資料 集上的表現優於單一部分剪枝方法,展示了更佳的壓縮效果和模型性能。
In recent years, models based on the Transformer architecture have achieved remarkable success in the field of computer vision. However, their high computational cost remains a significant obstacle to practical deployment. Model compression techniques have become a common approach to deploying these large models on edge devices. Traditional pruning techniques usually compress only a specific part of the model, such as the number of tokens, the dimensions of the multi-head self-attention (MHSA), or the multi-layer perceptron (MLP) layers. However, these methods tend to cause over-pruning of a single part at high compression rates, which significantly impacts model performance.
This thesis proposes a hybrid pruning strategy that simultaneously performs dynamic token merging and progressive pruning of the MHSA and MLP layers during the training process. By determining the appropriate proportions for these parts, this strategy achieves global compression of the model, fully leveraging the strengths of each method. Experimental results demonstrate that the proposed hybrid pruning strategy outperforms single-part pruning methods on the CIFAR-10, CIFAR-100, and SVHN datasets, showing superior compression effects and model performance.
This thesis proposes a hybrid pruning strategy that simultaneously performs dynamic token merging and progressive pruning of the MHSA and MLP layers during the training process. By determining the appropriate proportions for these parts, this strategy achieves global compression of the model, fully leveraging the strengths of each method. Experimental results demonstrate that the proposed hybrid pruning strategy outperforms single-part pruning methods on the CIFAR-10, CIFAR-100, and SVHN datasets, showing superior compression effects and model performance.