arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2009.07453cs.LGcs.CLstat.ML
收藏

用于设备上神经机器翻译的极低比特Transformer Quantization

Extremely Low Bit Transformer Quantization for On-Device Neural Machine Translation

Samsung Research(三星研究院)

Insoo Chung, Byeongwook Kim, Yoonjung Choi, Se Jung Kwon, Yongkweon Jeon, Baeseong Park, Sangha Kim, Dongsoo Lee

摘要:

广泛使用的Transformer架构的部署是具有挑战性的,因为在推理期间的繁重计算负载和存储器开销,特别是当目标设备在计算资源方面受到限制时,例如移动或边缘设备。量化是应对这些挑战的有效技术。我们的分析表明,对于给定数量的量化位,每个块的Transformer有助于翻译质量和推理计算以不同的方式。此外,即使在一个嵌入块中,每个单词的贡献也大不相同。相应地,我们提出了一种混合精度量化策略,以通过极低数量的比特来表示Transformer权重(例如,低于3比特)。例如,对于嵌入块中的每个字,我们基于统计特性分配不同的量化比特。我们的量化Transformer模型实现了比基线模型小11.8 $\times$的模型大小,具有小于-0.5 BLEU。我们实现了8.3 $\times$减少运行时内存占用和3.5 $\times$加速(银河N10+),使我们提出的压缩策略,使设备上的NMT的有效实施。

英文摘要:

The deployment of widely used Transformer architecture is challenging because of heavy computation load and memory overhead during inference, especially when the target device is limited in computational resources such as mobile or edge devices. Quantization is an effective technique to address such challenges. Our analysis shows that for a given number of quantization bits, each block of Transformer contributes to translation quality and inference computations in different manners. Moreover, even inside an embedding block, each word presents vastly different contributions. Correspondingly, we propose a mixed precision quantization strategy to represent Transformer weights by an extremely low number of bits (e.g., under 3 bits). For example, for each word in an embedding block, we assign different quantization bits based on statistical property. Our quantized Transformer model achieves 11.8$\times$ smaller model size than the baseline model, with less than -0.5 BLEU. We achieve 8.3$\times$ reduction in run-time memory footprints and 3.5$\times$ speed up (Galaxy N10+) such that our proposed compression strategy enables efficient implementation for on-device NMT.

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

↑