通过自适应剪枝大幅减少视觉Transformer的参数,几乎不损失性能。
Adaptive MLP Pruning for Large Vision Transformers
- 基于标签无关熵准则评估MLP神经元重要性,更准确。
- 自适应二分搜索剪枝,实现40%参数与计算量减少。
- 无需微调即优于其他方法,适合部署优化场景。
大型视觉Transformer虽具强大可扩展性,但参数庞大导致计算和内存开销巨大。分析发现,多层感知机(MLP)模块占模型参数的主要部分。本文提出自适应MLP剪枝(AMP)方法,在几乎不降低性能的前提下显著减少参数。首先,采用基于泰勒的方法评估MLP神经元重要性;为克服单热交叉熵损失忽略其他类别预测的问题,引入无标签信息熵准则,更全面建模原始模型输出以提升重要性评分准确性。其次,根据重要性分数对隐藏神经元排序,并利用二分搜索算法自适应剪枝,依据不同MLP模块冗余程度动态调整剪枝比例,避免预设压缩率限制。在CLIP和DINOv2等先进大模型上的实验表明,该方法实现约40%的参数和浮点运算量(FLOPs)减少,近乎无损。且在未微调情况下,性能显著优于现有剪枝方法。源代码与训练权重已开源。
原文摘要 · Abstract (English)
Large vision transformers present impressive scalability, as their performance can be well improved with increased model capacity. Nevertheless, their cumbersome parameters results in exorbitant computational and memory demands. By analyzing prevalent transformer structures, we find that multilayer perceptron (MLP) modules constitute the largest share of the model's parameters. In this paper, we propose an Adaptive MLP Pruning (AMP) method to substantially reduce the parameters of large vision transformers without obvious performance degradation. First, we adopt Taylor based method to evaluate neuron importance of MLP. However, the importance computation using one-hot cross entropy loss ignores the potential predictions on other categories, thus degrading the quality of the evaluated importance scores. To address this issue, we introduce label-free information entropy criterion to fully model the predictions of the original model for more accurate importance evaluation. Second, we rank the hidden neurons of MLP by the above importance scores and apply binary search algorithm to adaptively prune the ranked neurons according to the redundancy of different MLP modules, thereby avoiding the predefined compression ratio. Experimental results on several state-of-the-art large vision transformers, including CLIP and DINOv2, demonstrate that our method achieves roughly 40\% parameter and FLOPs reduction in a near lossless manner. Moreover, when the models are not finetuned after pruning, our method outperforms other pruning methods by significantly large margin. The source code and trained weights are available at https://github.com/visresearch/AMP.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。