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

结构化剪枝学习紧凑和精确的模型

Structured Pruning Learns Compact and Accurate Models

Princeton University(普林斯顿大学)

Mengzhou Xia, Zexuan Zhong, Danqi Chen

摘要:

随着神经语言模型规模的不断扩大,模型压缩受到越来越多的关注。两种主要的方法是修剪,逐渐从预训练的模型中删除权重,以及蒸馏,训练较小的紧凑模型以匹配较大的模型。剪枝方法可以显着减少模型的大小,但很难实现大的加速比蒸馏。然而,蒸馏方法需要大量未标记的数据,并且训练昂贵。在这项工作中,我们提出了一种特定于任务的结构化修剪方法CoFi(粗粒度和细粒度修剪),它提供了高度并行化的子网络,并在准确性和延迟方面与蒸馏方法相匹配,而无需诉诸任何未标记的数据。我们的关键见解是联合修剪粗粒度(例如,层)和细粒(例如,头和隐藏单元)模块,该模块用不同粒度的掩码控制每个参数的剪枝决策。我们还设计了一个分层蒸馏策略,在优化过程中从未修剪的模型转移知识。我们在GLUE和SQuAD数据集上的实验表明,CoFi产生的模型具有超过10倍的加速比,精度下降较小,与以前的修剪和蒸馏方法相比,显示出其有效性和效率。

英文摘要:

The growing size of neural language models has led to increased attention in model compression. The two predominant approaches are pruning, which gradually removes weights from a pre-trained model, and distillation, which trains a smaller compact model to match a larger one. Pruning methods can significantly reduce the model size but hardly achieve large speedups as distillation. However, distillation methods require large amounts of unlabeled data and are expensive to train. In this work, we propose a task-specific structured pruning method CoFi (Coarse- and Fine-grained Pruning), which delivers highly parallelizable subnetworks and matches the distillation methods in both accuracy and latency, without resorting to any unlabeled data. Our key insight is to jointly prune coarse-grained (e.g., layers) and fine-grained (e.g., heads and hidden units) modules, which controls the pruning decision of each parameter with masks of different granularity. We also devise a layerwise distillation strategy to transfer knowledge from unpruned to pruned models during optimization. Our experiments on GLUE and SQuAD datasets show that CoFi yields models with over 10x speedups with a small accuracy drop, showing its effectiveness and efficiency compared to previous pruning and distillation approaches.

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

↑