[论文解读] Efficient Transformer-based Large Scale Language Representations using Hardware-friendly Block Structured Pruning
本文提出了一种硬件友好的分块结构化剪枝方法,可高效地在资源受限设备上部署大规模Transformer语言模型。通过将重加权组Lasso正则化整合到分块剪枝中,该方法在GLUE基准测试中对BERT、RoBERTa和DistilBERT实现了高达5.0×的模型压缩,且精度损失极小,并与知识蒸馏技术正交,可进一步实现压缩。
Pre-trained large-scale language models have increasingly demonstrated high accuracy on many natural language processing (NLP) tasks. However, the limited weight storage and computational speed on hardware platforms have impeded the popularity of pre-trained models, especially in the era of edge computing. In this work, we propose an efficient transformer-based large-scale language representation using hardware-friendly block structure pruning. We incorporate the reweighted group Lasso into block-structured pruning for optimization. Besides the significantly reduced weight storage and computation, the proposed approach achieves high compression rates. Experimental results on different models (BERT, RoBERTa, and DistilBERT) on the General Language Understanding Evaluation (GLUE) benchmark tasks show that we achieve up to 5.0x with zero or minor accuracy degradation on certain task(s). Our proposed method is also orthogonal to existing compact pre-trained language models such as DistilBERT using knowledge distillation, since a further 1.79x average compression rate can be achieved on top of DistilBERT with zero or minor accuracy degradation. It is suitable to deploy the final compressed model on resource-constrained edge devices.
研究动机与目标
- 为解决大规模预训练Transformer模型在边缘设备上带来的高计算与存储成本问题。
- 开发一种硬件友好的剪枝方法,在大幅降低模型大小和推理成本的同时保持模型精度。
- 实现在NLP模型中实现高比例压缩,这些模型对稀疏性更敏感,原因在于其语法和语义分布不均。
- 确保与现有模型压缩技术(如知识蒸馏)的兼容性,支持顺序应用以实现进一步的尺寸缩减。
提出的方法
- 对权重矩阵应用分块结构化剪枝,即整块权重同时被剪枝,以保持硬件效率。
- 引入重加权组Lasso正则化,动态调整每一块的惩罚项,实现灵活且高效的稀疏性诱导。
- 使用混合损失函数,结合标准训练损失与逐块L2范数惩罚项,以在微调过程中引导剪枝。
- 通过迭代重加权组惩罚项优化剪枝过程,实现在最小精度损失下实现更高压缩率。
- 将该方法应用于BERT、RoBERTa和DistilBERT,并对分块数量、微调周期数和惩罚因子进行消融研究。
- 在GLUE基准上验证该方法,以衡量在多个NLP任务中精度与压缩效率的表现。
实验结果
研究问题
- RQ1结合重加权组Lasso的分块结构化剪枝能否在不造成显著精度下降的前提下,实现大规模Transformer模型的高比例压缩?
- RQ2剪枝结构中的分块数量如何影响模型性能与稀疏性灵活性?
- RQ3在压缩率与精度之间实现最佳平衡的最优惩罚因子与微调周期数是多少?
- RQ4所提出的剪枝方法是否与知识蒸馏兼容,从而实现进一步的模型压缩?
- RQ5该方法能否在多种预训练模型(如BERT、RoBERTa和DistilBERT)上有效应用?
主要发现
- 所提方法在BERT和RoBERTa上实现了高达5.0×的模型压缩率,且在GLUE任务中精度损失可忽略或为零。
- 在DistilBERT上,该方法实现了平均1.79×的压缩率,且精度损失极小,表明其与知识蒸馏正交。
- 增加分块数量(减小分块大小)可提升性能,其中768个分块在DistilBERT的CoLA任务上实现了最高的MCC得分53.4。
- 微调16个周期的精度优于4或8个周期,BERT BASE在STS-B任务上的Spearman相关系数从84.2提升至84.6。
- 惩罚因子为3e-4时精度表现最优,BERT BASE在MNLI任务上达到82.9%的准确率;而更高的值(1e-3)则导致显著精度下降。
- 在不同随机种子下结果稳定,SST-2、CoLA、STS-B和MRPC任务上的性能方差极小,五次种子运行结果一致。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。