NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Alternating Multi-bit Quantization for Recurrent Neural Networks

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

Recurrent Neural Networks (RNNs), particularly LSTMs and GRUs, are the workhorses of sequence modeling tasks like language translation and speech recognition. However, they face two major hurdles for real-world deployment: massive memory footprints due to large vocabularies and deep architectures, and high inference latency caused by their sequential nature.

While quantization—reducing the precision of weights and activations—is a known solution to these bottlenecks, existing methods like 1-bit binarization often suffer from significant accuracy drops. Furthermore, "rule-based" uniform quantization struggles to adapt to the non-uniform distribution of weights in deep networks. To bridge this gap, researchers have introduced a novel Alternating Multi-bit Quantization approach that treats quantization as an optimization problem, achieving up to 16× memory savings and 6× inference speedups on CPUs with minimal impact on accuracy.

The Alternating Minimization Method

Instead of using standard 8-bit or 16-bit integers, the proposed method represents weights and activations as a linear combination of multiple binary vectors (using values $\{-1, +1\}$). The core innovation lies in framing this quantization as an optimization problem: minimizing the squared error between the full-precision weights and their multi-bit approximation.

To solve this efficiently, the algorithm toggles between two alternating steps:

  1. Fix the coefficients and optimize the binary codes: The authors observed that if the scaling coefficients (denoted as $\alpha$) are fixed, the optimal binary codes can be found efficiently using a binary search tree rather than an exhaustive search.
  2. Fix the binary codes and refine the coefficients: Once the binary codes are set, the coefficients are refined using a simple least-squares solution.
Binary Search Tree for finding optimal binary codes

Unlike methods that quantize entire matrices at once, this approach quantizes row-by-row. This provides the approximation with more "freedom" to match the original weight distributions tightly. In practice, the authors found that just two alternating cycles are enough to reach a high-precision approximation, making it fast enough to quantize activations "on-the-fly" during inference.

Hardware-Friendly Inference

By converting standard floating-point matrices into multi-bit binary representations, the network can replace expensive floating-point multiplications with highly efficient bitwise XNOR and bit-counting (popcount) operations.

Transforming standard matrix-vector products into efficient multi-bit binary products

This transformation is particularly advantageous on standard CPUs utilizing SIMD (Single Instruction, Multiple Data) instructions, allowing multiple binary operations to be processed in parallel.

Key Results and Insights

The researchers evaluated their method across several domains, including language modeling (PTB, WikiText-2, Text8) and image classification (Sequential MNIST, CIFAR-10). The method significantly outperformed previous state-of-the-art quantization techniques like Greedy and Refined Greedy approximation.

  • 2-bit Quantization: Achieved ~16× memory savings and ~6× real-world inference acceleration on CPUs with only a negligible loss in accuracy.
  • 3-bit Quantization: Achieved ~10.5× memory savings and ~3× acceleration. Remarkably, in some cases (like 3-bit quantization on the PTB dataset), the quantized model actually outperformed the full-precision model. This suggests that the noise introduced by multi-bit quantization can act as a form of regularization, preventing overfitting.
  • Generalization: While designed specifically to tackle the sequential bottlenecks of RNNs, the method also achieved the lowest testing error among compared quantization methods on CNNs and MLPs.

Limitations and Future Work

While highly effective, the approach does have a few limitations. On larger datasets like Text8, the quantized GRU model showed a slight accuracy gap compared to full precision, suggesting a sensitivity to hyper-parameters that requires careful tuning at scale.

Additionally, while the alternating cycles are fast, quantizing activations on-line still adds a small computational overhead (roughly 1.7% to 20% of total execution time, depending on matrix size). This overhead must be balanced against the speedup gained from the binary operations. Finally, while the current implementation and benchmarks focus heavily on CPU SIMD instructions, future work could explore extending these specific multi-bit optimizations to GPUs, ASICs, and FPGAs.

Summary updated

BibTeX
@inproceedings{xu2018alternating,
  author = {Chen Xu and Jianqiang Yao and Zhouchen Lin and Wenwu Ou and Yuanbin Cao and Zhirong Wang and Hongbin Zha},
  title = {{Alternating Multi-bit Quantization for Recurrent Neural Networks}},
  booktitle = {International Conference on Learning Representations},
  year = {2018},
  url = {https://openreview.net/forum?id=S19dR9x0b},
}
Figure