Alternating Multi-bit Quantization for Recurrent Neural Networks
arXiv:1802.00150
Abstract
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.
arXiv commentPublished as a conference paper at ICLR 2018
Cited by in corpus (14)
- Recurrent Neural Networks: An Embedded Computing Perspective
- ProxQuant: Quantized Neural Networks via Proximal Operators
- Q-BERT: Hessian Based Ultra Low Precision Quantization of BERT
- Spartus: A 9.4 TOp/s FPGA-based LSTM Accelerator Exploiting Spatio-Temporal Sparsity
- Run-Time Efficient RNN Compression for Inference on Edge Devices
- AutoQ: Automated Kernel-Wise Neural Network Quantization
- AdaBits: Neural Network Quantization with Adaptive Bit-Widths
- Vau da muntanialas: Energy-efficient multi-die scalable acceleration of RNN inference
- FleXOR: Trainable Fractional Quantization
- Learning Recurrent Binary/Ternary Weights
- Structured Compression by Weight Encryption for Unstructured Pruning and Quantization
- Modulating Regularization Frequency for Efficient Compression-Aware Model Training
- Learning to Skip Ineffectual Recurrent Computations in LSTMs
- Low-bit Quantization of Recurrent Neural Network Language Models Using Alternating Direction Methods of Multipliers