arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2501.03289cs.LG
收藏

基于微分包含的预训练Transformer自适应剪枝

Adaptive Pruning of Pretrained Transformer via Differential Inclusions

School of Data Science, Fudan University(复旦大学数据科学学院)

Yizhuo Ding, Ke Fan, Yikai Wang, Xinwei Sun, Yanwei Fu

AI总结:

提出基于微分包含的SPP剪枝方法,在单次剪枝阶段内实现任意比例的Transformer剪枝,通过低秩压缩配对模块,兼顾性能与灵活性。

摘要:

大型Transformer已展现出显著的成功,因此有必要压缩这些模型以降低推理成本,同时保持其性能。当前的压缩算法以固定的压缩比例对Transformer进行剪枝,每种比例都需要独特的剪枝过程,这导致高昂的计算成本。相比之下,我们提出在单次剪枝阶段内,基于掩码参数的微分包含,以任意期望比例对预训练Transformer进行剪枝。该动态过程能够生成掩码参数的整个正则化解路径,其支撑集识别网络结构。因此,解路径识别出具有不同稀疏度的Transformer权重族,提供更大的灵活性和定制性。在本文中,我们引入了这种有效的剪枝方法,称为SPP(解路径剪枝)。为了实现有效剪枝,我们将Transformer分割成配对模块,包括查询-键对、值-投影对和顺序线性层,并对这些配对应用低秩压缩,在保持输出结构的同时,实现内部状态的结构压缩。在多种知名Transformer骨干网络上进行的大量实验证明了SPP的有效性。

英文摘要:

Large transformers have demonstrated remarkable success, making it necessary to compress these models to reduce inference costs while preserving their perfor-mance. Current compression algorithms prune transformers at fixed compression ratios, requiring a unique pruning process for each ratio, which results in high computational costs. In contrast, we propose pruning of pretrained transformers at any desired ratio within a single pruning stage, based on a differential inclusion for a mask parameter. This dynamic can generate the whole regularization solution path of the mask parameter, whose support set identifies the network structure. Therefore, the solution path identifies a Transformer weight family with various sparsity levels, offering greater flexibility and customization. In this paper, we introduce such an effective pruning method, termed SPP (Solution Path Pruning). To achieve effective pruning, we segment the transformers into paired modules, including query-key pairs, value-projection pairs, and sequential linear layers, and apply low-rank compression to these pairs, maintaining the output structure while enabling structural compression within the inner states. Extensive experiments conducted on various well-known transformer backbones have demonstrated the efficacy of SPP.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑