Training Integer-Only Deep Recurrent Neural Networks

Vahid Partovi Nia, Eyyub Sari, Vanessa Courville, Masoud AsgharianSpringer Nature (SN) Computer Science 2026

TL;DR

This paper introduces an "integer-only" training method for Recurrent Neural Networks (RNNs), enabling them to run efficiently on edge devices with minimal accuracy loss. By replacing floating-point operations with integer-only equivalents, they achieve significant speedups and memory reductions, making advanced AI applications like speech recognition more accessible on resource-constrained hardware.

What Problem Does This Paper Address?

Recurrent Neural Networks (RNNs), including LSTMs and GRUs, are fundamental to many AI tasks like language modeling and speech recognition. However, these networks rely on computationally intensive operations such as non-linear activations, normalization, and matrix multiplications, which are typically performed using high-precision floating-point numbers. This makes them slow, power-hungry, and difficult to deploy on edge devices with limited computational resources. While quantization techniques exist, applying them to RNNs is challenging due to error propagation across time steps and layers, often leading to significant performance degradation. This paper aims to bridge this gap by developing a method to train RNNs that can operate entirely with integers, thus overcoming the limitations of floating-point computations on edge hardware.

Methods

The core of this paper is a Quantization-Aware Training (QAT) approach tailored for RNNs, specifically focusing on an integer-only Recurrent Neural Network (iRNN). Key innovations include:

  • Integer-Only Arithmetic: All operations within the RNN cell are re-engineered to use only integer arithmetic. This involves defining integer-only equivalents for matrix multiplications and additions, carefully handling scaling factors and zero-points.
  • Piecewise Linear (PWL) Approximation for Activations: Non-linear activation functions like sigmoid and tanh, which are problematic for integer-only computation, are approximated using Quantization-Aware Piecewise Linear (PWL) functions. This method selects optimal knot points during training to minimize approximation error for quantized inputs.
  • Integer-Friendly Normalization (MadNorm): Standard Layer Normalization, which relies on computationally expensive operations like standard deviation, is replaced with MadNorm. MadNorm uses the Mean Absolute Deviation (MAD), which is more amenable to integer-only computation.
  • Integer-Only Attention: The attention mechanism, crucial for encoder-decoder architectures, is also adapted for integer-only inference.

The overall strategy is to train the network with these integer-only components, ensuring that the model learns to be robust to quantization noise.

Datasets

The paper evaluates its proposed method on several standard datasets:

  • Penn TreeBank (PTB): Used for language modeling experiments.
  • WikiText2: Another dataset for language modeling, used with a state-of-the-art Mogrifier LSTM.
  • LibriSpeech: Used for Automatic Speech Recognition (ASR) experiments with the ESPRESSO LSTM framework.

Key Insights and Ideas

  • RNN Quantization is Harder than CNNs: The paper highlights that error propagation in RNNs (across time and layers) makes them inherently more challenging to quantize than CNNs, where errors are more localized.
  • PWL Approximations are Key for Activations: Replacing complex non-linear activations with carefully chosen PWL functions is crucial for achieving accurate integer-only RNNs. The "quantization-aware" aspect means these approximations are optimized during training for the quantized network.
  • MadNorm is a Practical Alternative to LayerNorm: Replacing standard Layer Normalization with MadNorm demonstrates that efficient integer-only normalization is achievable without sacrificing performance, which is vital for edge deployment.
  • Full Integer Operations are Feasible and Beneficial: The research successfully demonstrates that it's possible to create RNNs that operate entirely on integers, leading to significant practical benefits in terms of speed and memory.

Key Results

  • Speedup and Memory Reduction: The proposed iRNN models achieve up to 2x speedup and 4x memory reduction on a Huawei P20 Pro smartphone compared to full-precision counterparts.
  • Accuracy Preservation: The integer-only models maintain similar accuracy to their full-precision counterparts across various tasks.
  • On the PTB dataset, replacing LayerNorm with MadNorm resulted in a slight improvement in perplexity (e.g., 97.20 ± 0.47 for MadNorm LSTM vs. 98.58 ± 0.35 for LayerNorm LSTM). Using PWL approximations with 8 pieces retained performance, with more pieces offering marginal improvements.
  • On WikiText2, the iRNN achieved comparable performance to a full-precision Mogrifier LSTM, with only a small perplexity increase (around 0.3-0.9).
  • For ASR on LibriSpeech, the quantized model showed a maximum of 1.25% WER drop compared to the full-precision model, even with some components (like cell states and attention denominator) kept at 16-bit for better performance.
  • Ablation Studies: Experiments showed that quantizing weights and matrix multiplications contributed to a perplexity increase of about 0.1, while element-wise operations added about 0.3. Activation quantization had minimal impact.

Limitations and Future Work

  • Bitwidth Considerations: While the primary goal is 8-bit quantization, the paper notes that for certain components like cell states in LSTMs or attention denominators, 16-bit quantization might be necessary to maintain performance, especially for complex tasks.
  • Hardware-Specific Optimizations: The authors mention that further speedup could be achieved through more optimized C++ kernels and better PWL kernel implementations, suggesting that hardware-specific optimizations are a promising avenue.
  • Potential for Further Speedup: The paper suggests that writing a C++ integer-only LSTM cell, fusing operations, and improving PWL kernel implementation could lead to even greater speedups.
  • Broader Applicability: The method is presented as task-agnostic, but further validation on a wider range of RNN architectures and tasks would be beneficial.

Summary updated

BibTeX
@inproceedings{nia2026training,
  author = {Vahid Partovi Nia and Eyyub Sari and Vanessa Courville and Masoud Asgharian},
  title = {{Training Integer-Only Deep Recurrent Neural Networks}},
  booktitle = {Springer Nature (SN) Computer Science},
  year = {2026},
  url = {https://openreview.net/forum?id=uWxErRGkts},
}
Figure