Kronecker Recurrent Units

Cijo Jose, Moustapha Cissé, François Fleuret

Recurrent Neural Networks (RNNs) are the workhorses of sequential data, but they suffer from a fundamental "weight" problem. As the size of the hidden state increases to capture more complex information, the number of parameters explodes quadratically. This leads to massive models that are slow to train, memory-intensive, and prone to numerical instability.

In the paper "Kronecker Recurrent Units", researchers propose a clever mathematical workaround: using Kronecker products to build massive recurrent matrices out of tiny, efficient building blocks. Kronecker Recurrent Units (KRU) drastically reduce the parameter count of RNNs—sometimes by three orders of magnitude—without sacrificing statistical performance.

The Problem: Over-parametrization and Ill-conditioning

Standard RNNs face two major mathematical hurdles:

  1. Over-parametrization: The recurrent weight matrix $W$ requires $N \times N$ parameters, where $N$ is the hidden state size. A hidden state of 1024 requires over a million parameters for a single matrix, leading to high sample complexity and slow training.
  2. Ill-conditioning: During training, gradients often "vanish" (become zero) or "explode" (become infinite) as they are repeatedly multiplied by $W$ over many time steps. While architectures like LSTMs use gating mechanisms to mitigate this, they do not solve the underlying mathematical instability of the weight matrix itself.

Previous attempts to solve this involved Unitary RNNs, which force the weight matrix to be exactly unitary to preserve the norm of the gradient. However, strict unitary models are often too restrictive—limiting the network's expressive capacity—or computationally expensive to maintain during optimization.

The Solution: Kronecker Recurrent Units (KRU)

The core innovation of this paper is replacing the giant $N \times N$ matrix $W$ with a series of very small matrices ($W_0, W_1, \dots$) combined using the Kronecker product ($\otimes$).

The Kronecker product acts as a matrix "tiling" operation. By repeatedly applying it, a massive matrix can be generated using only a handful of parameters. For example, a $1024 \times 1024$ matrix can be represented by ten $2 \times 2$ matrices, reducing the parameter count from roughly 1,000,000 to just 40.

To ensure training remains stable and expressive, KRU introduces two additional techniques:

  • Soft Unitary Constraints: Instead of forcing the matrix to be perfectly unitary (which makes it hard for the network to "forget" irrelevant noise), the authors add a regularization term. This encourages the small factors to stay close to unitary, allowing for "good" vanishing gradients when the model needs to discard useless information.
  • Complex-Valued Weights: The model operates in the complex plane. Mathematically, the space of unitary matrices is connected in complex space but disconnected in real space, allowing the optimization process to traverse the solution space much more smoothly.

Key Insights and Results

The authors evaluated KRU across a diverse range of benchmarks, including synthetic long-term memory tasks (Copy Memory, Adding Problem), image classification (Pixel MNIST), language modeling (Penn TreeBank), and polyphonic music modeling.

Dimension vs. Capacity The most striking insight from KRU is that while RNNs benefit from a high-dimensional hidden space to store information, they do not necessarily need high capacity (parameter complexity) in the recurrent transformation itself. KRU proves you can maintain a massive hidden state with a highly compressed transformation matrix.

Massive Compression On the Pixel-by-pixel MNIST task, KRU achieved state-of-the-art results with only 11K parameters, compared to 540K for a Full Capacity Unitary RNN and 68K for a standard LSTM.

Superior Stability and Convergence In long-term memory tasks, KRU consistently outperformed baselines.

Cross entropy over training steps for long sequences (1000 and 2000). KRU (red) converges rapidly and stably compared to standard RNNs, LSTMs, and other unitary RNN variants.

As sequence lengths increase, standard RNNs and even LSTMs struggle to converge due to vanishing gradients. KRU's soft unitary constraint allows it to maintain stable gradients over thousands of steps.

Mean squared error on the Adding Problem (sequence length 200). KRU (red) demonstrates faster and more stable convergence than LSTMs (green).

In the "Adding Problem," KRU was the only model that consistently converged as the sequence length increased, outperforming LSTMs in both speed and final error. Furthermore, in polyphonic music modeling, KRU-based models generalized better to unseen data, likely because the drastically reduced parameter count acts as a natural regularizer against overfitting.

Limitations and Future Work

A current practical limitation is hardware optimization. Standard deep learning libraries do not yet have highly optimized, out-of-the-box support for arbitrary Kronecker products, requiring the authors to write custom CUDA kernels to achieve their reported speeds.

For future work, the authors suggest exploring dynamic capacity: starting with a very small number of Kronecker factors and dynamically adding more as the model learns, allowing the network to "grow" its complexity based on the specific difficulty of the task.

Summary updated

BibTeX
@inproceedings{jose2018kronecker,
  author = {Cijo Jose and Moustapha Cissé and François Fleuret},
  title = {{Kronecker Recurrent Units}},
  booktitle = {Workshops @ ICLR},
  year = {2018},
  url = {https://openreview.net/forum?id=poAWrpXcXT0},
}
Figure