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

Effective Quantization Methods for Recurrent Neural Networks

Qinyao He, He Wen, Shuchang Zhou, Yuxin Wu, Cong Yao, Xinyu Zhou, Yuheng ZouarXiv 2016

TL;DR

This paper introduces effective techniques for quantizing Recurrent Neural Networks (RNNs) down to as few as 2-4 bits with minimal performance loss. By employing a novel "balanced quantization" method and redesigning LSTM/GRU gate structures to handle low-precision arithmetic, the authors achieve results that match or exceed previous state-of-the-art quantized models on language modeling and sentiment analysis tasks.

Introduction

Deep learning models, particularly Recurrent Neural Networks (RNNs) like LSTMs and GRUs, are notoriously memory-intensive and computationally expensive. While quantization—reducing the precision of weights and activations from 32-bit floats to low-bit integers—has been highly successful for Convolutional Neural Networks (CNNs), RNNs have proven much more fragile.

Previous attempts at aggressive RNN quantization often led to significant accuracy drops or model divergence. The challenge lies in the recurrent nature of these networks: errors introduced by quantization can accumulate over many time steps, and the complex "gate" structures are highly sensitive to the precision of their inputs.

Methodology

The authors propose two primary innovations to bridge the performance gap between full-precision and low-precision RNNs.

Balanced Deterministic Quantization ($Q^{bal}_k$)

Standard quantization often results in an unbalanced distribution where most values cluster into a few "bins," wasting the limited representational capacity of low-bit numbers. The authors introduce a scaling factor based on the mean of absolute weights: $scale = \text{mean}(|X|) \times 2.5$. This "auto-balancing" effect ensures that quantized values are distributed more uniformly across the available bit-space, maximizing the information the model can retain.

Quantization-Friendly RNN Structures

The authors identify specific "interlinks" within LSTM and GRU cells that cause issues during quantization and propose structural modifications:

  • Gate Quantization: They explicitly quantize the outputs of gates and the results of element-wise multiplications.
  • Activation Swapping: In GRUs, they replace the $tanh$ activation with a $sigmoid$ function to keep values bounded within the $[0, 1]$ range, making them easier to quantize.
  • LSTM Cell State: Acknowledging that the LSTM cell state ($C_t$) is unbounded and difficult to quantize, they keep $C_t$ in floating-point format while quantizing the rest of the cell to maintain stability.

Experimental Results

The methods were evaluated on two standard Natural Language Processing (NLP) benchmarks: the Penn Treebank (PTB) for language modeling and the IMDB dataset for sentiment classification.

Language Modeling (PTB)

Performance on PTB is measured using Perplexity Per Word (PPW), where lower is better. The results demonstrate that the proposed balanced quantization method significantly improves stability and performance at low bit-widths. For instance, a 4-bit GRU achieved a PPW of 104, very close to the 100 PPW of the 32-bit baseline. Notably, the 2-bit weight/3-bit activation LSTM achieved 142 PPW, significantly outperforming previous quantized models like those by Hubara et al. (2016a), which reached 220 PPW.

PPW results on the Penn Treebank (PTB) dataset.

Sentiment Analysis (IMDB)

On the IMDB classification task, 4-bit models achieved approximately 88% accuracy, nearly matching the 32-bit baseline of 89-90%. Even at extreme compression levels, such as 1-bit weights with 2-bit activations, the models remained functional and reached 86-87% accuracy.

Accuracy results on the IMDB sentiment classification task.

Key Insights

  • The Power of Balance: How values are distributed into bins is as critical as the number of bins. By forcing a balanced distribution, a 2-bit weight can carry significantly more useful information.
  • Structural Sensitivity: RNNs are "deep" in time, requiring specific accounting for gating mechanisms and unbounded internal states.
  • Efficiency: 4-bit quantization for both weights and activations is virtually "lossless" for these tasks, offering an 8x reduction in model size with negligible impact on accuracy.

Conclusion and Future Work

While this work proves the algorithmic viability of low-bit RNNs, some challenges remain. The LSTM cell state ($C_t$) remains difficult to quantize due to its unbounded nature. Future research could explore novel scaling schemes for these internal states. Additionally, while the "auto-balancing" theory is robust for 2-bit quantization, more effective methods for inducing balance in 4-bit and higher precisions are still needed. Finally, realizing the full speedup potential of these methods will require specialized hardware capable of efficient bitwise operations.

Summary updated

BibTeX
@misc{he2016effective,
  author = {Qinyao He and He Wen and Shuchang Zhou and Yuxin Wu and Cong Yao and Xinyu Zhou and Yuheng Zou},
  title = {{Effective Quantization Methods for Recurrent Neural Networks}},
  year = {2016},
  eprint = {1611.10176},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1611.10176},
}
Figure