基于低比特NxM稀疏度压缩预训练的Transformers用于自然语言理解
Compressing Pre-trained Transformers via Low-Bit NxM Sparsity for Natural Language Understanding
摘要:
近年来,大型预训练的Transformer网络在许多自然语言理解任务中表现出显着的改进。然而,由于延迟和成本限制,这些模型的巨大规模为其微调和在线部署带来了重大挑战。支持N:M半结构化稀疏性和低精度整数计算的新硬件是提高DNN模型服务效率的一种有前途的解决方案。然而,很少有研究系统地研究预训练的Transformer网络在多大程度上受益于这些技术的组合,以及如何最好地压缩Transformer的每个组件。我们提出了一个灵活的压缩框架NxMiFormer,使用ADMM和基于ST的QAT同时进行稀疏化和量化。此外,我们还提出了廉价的启发式搜索算法,该算法可以识别满足压缩比约束的有前途的异构压缩配置。当在NLU基准测试的GLUE套件中进行评估时,我们的方法可以实现BERT模型编码器的高达93%的压缩,同时保留98.2%的原始模型精度并充分利用硬件的功能。通过搜索启发式找到的异构配置保持了99.5%的基线准确度,同时仍然将模型压缩了87.5%。
英文摘要:
In recent years, large pre-trained Transformer networks have demonstrated dramatic improvements in many natural language understanding tasks. However, the huge size of these models brings significant challenges to their fine-tuning and online deployment due to latency and cost constraints. New hardware supporting both N:M semi-structured sparsity and low-precision integer computation is a promising solution to boost DNN model serving efficiency. However, there have been very few studies that systematically investigate to what extent pre-trained Transformer networks benefit from the combination of these techniques, as well as how to best compress each component of the Transformer. We propose a flexible compression framework NxMiFormer that performs simultaneous sparsification and quantization using ADMM and STE-based QAT. Furthermore, we present and inexpensive, heuristic-driven search algorithm that identifies promising heterogeneous compression configurations that meet a compression ratio constraint. When evaluated across the GLUE suite of NLU benchmarks, our approach can achieve up to 93% compression of the encoders of a BERT model while retaining 98.2% of the original model accuracy and taking full advantage of the hardware's capabilities. Heterogeneous configurations found the by the search heuristic maintain 99.5% of the baseline accuracy while still compressing the model by 87.5%.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。