arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 1802.00150cs.LGstat.ML
收藏

用于循环神经网络的交替多比特Quantization

Alternating Multi-bit Quantization for Recurrent Neural Networks

Peking University(北京大学);Alibaba Group(阿里巴巴集团);Shanghai Jiao Tong University(上海交通大学)

Chen Xu, Jianqiang Yao, Zhouchen Lin, Wenwu Ou, Yuanbin Cao, Zhirong Wang, Hongbin Zha

摘要:

循环神经网络在许多应用中取得了优异的性能。然而,在资源有限的便携式设备上,模型通常太大而无法部署。对于服务器上具有大规模并发请求的应用程序,推理期间的延迟对于昂贵的计算资源也可能非常关键。在这项工作中,我们通过将网络(包括权重和激活)量化为多个二进制代码{-1,+1}来解决这些问题。我们制定的量化作为一个优化问题。在关键的观察,一旦量化系数是固定的二进制码可以得到有效的二叉搜索树,交替最小化,然后应用。我们测试了两个众所周知的RNN的量化,即,长短期记忆(LSTM)和门控递归单元(GRU),在语言模型上。与全精度计数器部分相比,通过2位量化,我们可以在CPU上实现约16倍的内存节省和约6倍的实推理加速,而精度只有合理的损失。通过3位量化,我们可以实现几乎没有损失的准确性,甚至超过原始模型,节省约10.5倍的内存和约3倍的实际推理加速。这两个结果都比现有的量化作品有很大的差距。我们扩展我们的交替量化图像分类任务。在RNN和前馈神经网络中,该方法也取得了优异的性能。

英文摘要:

Recurrent neural networks have achieved excellent performance in many applications. However, on portable devices with limited resources, the models are often too large to deploy. For applications on the server with large scale concurrent requests, the latency during inference can also be very critical for costly computing resources. In this work, we address these problems by quantizing the network, both weights and activations, into multiple binary codes {-1,+1}. We formulate the quantization as an optimization problem. Under the key observation that once the quantization coefficients are fixed the binary codes can be derived efficiently by binary search tree, alternating minimization is then applied. We test the quantization for two well-known RNNs, i.e., long short term memory (LSTM) and gated recurrent unit (GRU), on the language models. Compared with the full-precision counter part, by 2-bit quantization we can achieve ~16x memory saving and ~6x real inference acceleration on CPUs, with only a reasonable loss in the accuracy. By 3-bit quantization, we can achieve almost no loss in the accuracy or even surpass the original model, with ~10.5x memory saving and ~3x real inference acceleration. Both results beat the exiting quantization works with large margins. We extend our alternating quantization to image classification tasks. In both RNNs and feedforward neural networks, the method also achieves excellent performance.

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

↑