arXiv:2501.03289cs.LG2025-01ICLR被引 5

一次训练实现任意稀疏率的Transformer剪枝,省时省力。

Adaptive Pruning of Pretrained Transformer via Differential Inclusions

  • 用微分包含动态调整掩码,生成全稀疏路径
  • 支持多种稀疏率,无需重复训练
  • 适用于主流Transformer模型,适合部署优化

大型Transformer模型虽表现优异,但推理成本高,需压缩以降低开销。现有压缩方法在固定稀疏率下进行剪枝,每个比率需独立训练,计算成本高。本文提出基于掩码参数微分包含的自适应剪枝方法(SPP),可在单次剪枝阶段实现任意目标稀疏率。该方法通过动态生成掩码参数的完整正则化解路径,其支撑集对应网络结构。由此得到一组具有不同稀疏度的权重家族,显著提升灵活性。我们还将Transformer分割为成对模块(如查询-键对、值投影对、顺序线性层),并对其应用低秩压缩,在保持输出结构的同时实现内部状态的结构化压缩。在多个知名Transformer骨干网络上的大量实验验证了SPP的有效性。

原文摘要 · Abstract (English)

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.

模型剪枝Transformer稀疏性

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