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

Compressing recurrent neural network with tensor train

Andros Tjandra, Sakriani Sakti, Satoshi Nakamura

Abstract

Recurrent Neural Networks (RNNs) are powerful tools for sequential data processing but are often too memory-intensive for deployment on edge devices. This paper presents TT-RNN, a method that utilizes Tensor Train (TT) decomposition to represent large weight matrices as a sequence of low-rank tensors. By replacing massive matrices with TT-cores, the authors achieve significant parameter reduction—up to 43x for sequence classification and 80x for music prediction—with minimal impact on model accuracy.

Introduction

While RNNs and Gated Recurrent Units (GRUs) are the gold standard for processing sequential data like speech and text, their computational weight is a major drawback. State-of-the-art models often contain millions of parameters, necessitating high-end GPUs for inference and creating a bottleneck for real-time applications on memory-constrained hardware like mobile phones and IoT devices. The goal of this research is to bridge the gap between high-performance "huge" models and the efficiency required for low-end hardware without sacrificing the ability to learn complex temporal dependencies.

Methods: Tensor Train Decomposition

The authors propose representing the weight matrices of RNNs in Tensor Train (TT) format. Instead of storing a large $M \times N$ matrix, the weight is reshaped into a high-dimensional tensor and factorized into a sequence of small 3-core tensors, known as TT-cores.

Tensor Train decomposition of a weight matrix into a product of cores.

This reformulation shifts the complexity from the product of dimensions to a summation of smaller core dimensions multiplied by a "TT-rank." The authors apply this to both Simple RNNs (TT-SRNN) and Gated Recurrent Units (TT-GRU). In the case of GRUs, all six major weight matrices (reset gates, update gates, and candidate hidden states) are compressed. To ensure stable training, a modified Glorot (Xavier) initialization was developed specifically for TT-cores to prevent vanishing or exploding gradients across the multiplication chain.

Experimental Setup and Datasets

The models were evaluated on tasks requiring different levels of temporal memory:

  • Sequential MNIST: Digits fed row-by-row (28 steps) or pixel-by-pixel (784 steps).
  • Permuted MNIST (p-MNIST): A shuffled version of MNIST that forces the model to learn long-range dependencies without spatial cues.
  • Polyphonic Music Datasets: Four datasets (Piano-midi.de, Nottingham, MuseData, and JSB Chorales) used for sequence prediction tasks.

Key Insights

  • Redundancy in Weights: Massive weight matrices in RNNs are highly redundant. Enforcing a low TT-rank captures essential features using a fraction of the memory.
  • Initialization is Critical: Standard initialization fails for TT-layers; the adapted Glorot initialization is vital for convergence.
  • Gated Units and Long Sequences: TT-format works exceptionally well with GRUs, which are better suited for the long-term dependencies in pixel-by-pixel tasks.
  • Selective Compression: Bias vectors are not compressed as they contribute negligibly to total parameters, and keeping them dense simplifies computation.

Results

The TT-GRU demonstrated remarkable efficiency. On Sequential MNIST, it matched the accuracy of a standard GRU (~98.2%) while being 43 times smaller (5,100 vs. 221,952 parameters). In the p-MNIST task involving 784 time-steps, the TT-GRU achieved 91.5% accuracy, nearly identical to the baseline.

Validation cost (Negative Log Likelihood) over epochs for various TT-GRU configurations on pixel MNIST.

For music prediction, compression ratios reached up to 153x for simple RNNs and 80x for GRUs, maintaining competitive negative log-likelihood (NLL) scores. As shown in the training curves, various TT-GRU configurations converge reliably, matching or exceeding the performance of standard dense baselines with far fewer parameters.

Limitations and Future Work

Despite the parameter reduction, the backward pass in TT-format can be more computationally complex than standard layers. Additionally, performance is sensitive to hyperparameters like TT-rank and dimension factorization, currently requiring grid searches for optimization. Future work may extend this tensor-based approach to LSTMs or attention-based mechanisms.

Summary updated

BibTeX
@inproceedings{tjandra2017compressing,
  author = {Andros Tjandra and Sakriani Sakti and Satoshi Nakamura},
  title = {{Compressing recurrent neural network with tensor train}},
  booktitle = {IJCNN},
  year = {2017},
  doi = {10.1109/ijcnn.2017.7966420},
}
Figure