Skip to main content
QUICK REVIEW

[Paper Review] On the quantization of recurrent neural networks

Jian Li, Raziel Álvarez|arXiv (Cornell University)|Jan 14, 2021
Advanced Neural Network ApplicationsComputer Science18 references7 citations
TL;DR

This paper presents an integer-only quantization strategy for Long Short-Term Memory (LSTM) networks that enables accurate, efficient, and hardware-portable inference using only 8-bit integer operations. By leveraging pre-computed zero points and symmetric quantization, the method achieves near-lossless accuracy post-training and up to 2x faster inference than FP32 on CPU, with minimal memory footprint and no floating-point operations during inference.

ABSTRACT

Integer quantization of neural networks can be defined as the approximation of the high precision computation of the canonical neural network formulation, using reduced integer precision. It plays a significant role in the efficient deployment and execution of machine learning (ML) systems, reducing memory consumption and leveraging typically faster computations. In this work, we present an integer-only quantization strategy for Long Short-Term Memory (LSTM) neural network topologies, which themselves are the foundation of many production ML systems. Our quantization strategy is accurate (e.g. works well with quantization post-training), efficient and fast to execute (utilizing 8 bit integer weights and mostly 8 bit activations), and is able to target a variety of hardware (by leveraging instructions sets available in common CPU architectures, as well as available neural accelerators).

Motivation & Objective

  • To develop a fully integer quantization strategy for LSTM networks that maintains high model accuracy while enabling efficient deployment on diverse hardware.
  • To eliminate reliance on floating-point operations during inference, improving energy efficiency and hardware compatibility.
  • To enable post-training quantization with minimal data and no fine-tuning, ensuring practical deployment in production systems.
  • To optimize integer execution by pre-computing zero-point corrections and folding them into bias terms.
  • To provide a scalable foundation for quantizing other RNN variants, including GRUs and SRUs.

Proposed method

  • Uses symmetric 8-bit integer quantization for both weights and activations, with learned scale and zero-point parameters.
  • Applies post-training quantization with statistics collected on a small subset of data (100 utterances) without fine-tuning.
  • Pre-computes zero-point terms offline and folds them into the bias, eliminating runtime quantization overhead.
  • Rewrites the TensorFlow graph to decouple input and recurrent weight/activation concatenation for accurate per-tensor quantization.
  • Employs layer normalization and peephole connections in the quantization pipeline, preserving numerical stability.
  • Supports both standard LSTM and CIFG variants, with sparsity-aware quantization for model compression.

Experimental results

Research questions

  • RQ1Can a fully integer-only quantization strategy be designed for LSTM networks that maintains high inference accuracy without floating-point operations?
  • RQ2How effective is post-training quantization with minimal data for LSTM models, especially on long sequences?
  • RQ3What optimizations can be applied to integer LSTM inference to achieve maximum speedup and energy efficiency on CPU architectures?
  • RQ4Can the proposed quantization strategy be generalized to other RNN variants like GRUs and SRUs?
  • RQ5How does the quantization strategy perform across diverse speech recognition datasets with varying sequence lengths?

Key findings

  • Post-training quantization with only 100 utterances achieves negligible accuracy loss across all datasets, including long 16.5-minute YouTube utterances.
  • The fully integer quantized model achieves 6.7% WER on VoiceSearch, 19.8% on YouTube, and 8.2% on Telephony, matching the float baseline.
  • Integer quantization reduces model size from 466MB (FP32) to 117MB (8-bit integer), a 75% reduction.
  • The optimized integer LSTM runs 5% faster than hybrid quantization and 2x faster than FP32 on CPU, with no runtime scale computation.
  • The method supports sparse LSTMs with 50% sparsity, reducing model size to 71MB (integer) and 57MB (sparse integer) with minimal accuracy degradation.
  • The strategy is directly applicable to bidirectional LSTMs, GRUs, and other RNN variants, with consistent performance and accuracy.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.