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

VTrans:利用基于变分信息瓶颈的剪枝加速 Transformer 压缩

VTrans: Accelerating Transformer Compression with Variational Information Bottleneck based Pruning

Indian Institute of Technology, Delhi(印度德里理工学院);Carnegie Mellon University(卡内基梅隆大学)

Oshin Dutta, Ritvik Gupta, Sumeet Agarwal

AI总结:

本文提出由 VIB 指导的迭代剪枝框架 VTrans,可压缩嵌入、注意力头和层,并通过 Fast/Faster 变体以少量数据和最高 25 倍加速实现更高压缩率。

摘要:

近年来,为资源受限设备压缩大型预训练 transformer 模型日益受到重视。然而,传统剪枝方法通常不处理嵌入层,导致模型参数过剩。此外,它们需要利用大型数据集进行漫长压缩,才能保持剪枝后模型的性能。为应对这些挑战,我们提出 VTrans,这是一个由变分信息瓶颈(VIB)原则指导的迭代剪枝框架。我们的方法使用经 VIB 训练的掩码压缩所有结构组件,包括嵌入、注意力头和层。该方法仅保留每层中的必要权重,从而确保满足指定的模型规模或计算约束。值得注意的是,与此前任务无关和任务特定的最先进方法相比,我们的方法实现了最高达 70% 的更高压缩率。我们进一步提出该方法的更快变体:仅使用 3% 数据的 Fast-VTrans,以及通过专门微调 VIB 掩码实现的时间高效替代方案 Faster-VTrans;与以往方法相比,其将压缩加速最高达 25 倍,且性能损失极小。在 BERT、ROBERTa 和 GPT-2 模型上的大量实验证实了该方法的有效性。此外,我们的方法在压缩 LLaMA-2-7B 等大型模型时展现出可扩展性,并取得了优于以往剪枝方法的性能。我们还使用基于注意力的探测来定性评估模型冗余并解释本方法的效率。值得注意的是,本方法将未剪枝模型中高度关注特殊 token 和当前 token 的注意力头视为首要剪枝候选,而观察到保留的注意力头会更多关注对任务至关重要的关键词。

英文摘要:

In recent years, there has been a growing emphasis on compressing large pre-trained transformer models for resource-constrained devices. However, traditional pruning methods often leave the embedding layer untouched, leading to model over-parameterization. Additionally, they require extensive compression time with large datasets to maintain performance in pruned models. To address these challenges, we propose VTrans, an iterative pruning framework guided by the Variational Information Bottleneck (VIB) principle. Our method compresses all structural components, including embeddings, attention heads, and layers using VIB-trained masks. This approach retains only essential weights in each layer, ensuring compliance with specified model size or computational constraints. Notably, our method achieves upto 70% more compression than prior state-of-the-art approaches, both task-agnostic and task-specific. We further propose faster variants of our method: Fast-VTrans utilizing only 3% of the data and Faster-VTrans, a time efficient alternative that involves exclusive finetuning of VIB masks, accelerating compression by upto 25 times with minimal performance loss compared to previous methods. Extensive experiments on BERT, ROBERTa, and GPT-2 models substantiate the efficacy of our method. Moreover, our method demonstrates scalability in compressing large models such as LLaMA-2-7B, achieving superior performance compared to previous pruning methods. Additionally, we use attention-based probing to qualitatively assess model redundancy and interpret the efficiency of our approach. Notably, our method considers heads with high attention to special and current tokens in un-pruned model as foremost candidates for pruning while retained heads are observed to attend more to task-critical keywords.

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

↑