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

Approximating Real-Time Recurrent Learning with Random Kronecker Factors

Asier Mujika, Florian Meier, Angelika Steger

Introduction

Training Recurrent Neural Networks (RNNs) typically involves a frustrating trade-off: standard algorithms suffer from "truncation bias" that limits their memory, while exact online learning methods demand massive computational resources. This paper introduces Kronecker Factored Real-Time Recurrent Learning (KF-RTRL), a novel online learning algorithm that uses Kronecker product decomposition to approximate gradients. KF-RTRL is unbiased, memory-efficient, and produces significantly less noise than previous approximations, enabling RNNs to learn much longer dependencies than standard methods.

The Problem: Truncation Bias vs. Computational Ruin

The "gold standard" for training RNNs in practice is Truncated Backpropagation Through Time (TBPTT). However, TBPTT has a major flaw: it only looks back a fixed number of steps. If a pattern requires a "memory" longer than that specific window, the model simply cannot learn it—a limitation known as truncation bias.

An alternative is Real-Time Recurrent Learning (RTRL), which propagates gradients forward in time, allowing for infinite horizons without truncation. Unfortunately, RTRL is computationally ruinous. For a network with $n$ units, it requires $O(n^4)$ time and $O(n^3)$ memory per step. Previous attempts to approximate RTRL, such as the Unbiased Online Recurrent Optimization (UORO) algorithm, successfully reduced the cost to $O(n^2)$ but introduced so much "noise" (variance) into the gradients that learning became slow and unstable. The authors seek a middle ground: an algorithm that is computationally feasible but much more accurate than UORO.

The KF-RTRL Method

The authors propose KF-RTRL, where the core innovation lies in how the gradient matrix ($G_t$) is represented and updated:

  1. Kronecker Decomposition: Instead of approximating the gradient with a simple rank-one matrix (as in UORO), KF-RTRL approximates it as a Kronecker product of a vector and a matrix ($u_t \otimes A_t$).
  2. Exploiting RNN Structure: The authors prove that for a large class of RNNs—including Tanh-RNNs and Recurrent Highway Networks (RHNs)—the derivatives naturally decompose into this Kronecker form.
  3. Unbiased Summation: To maintain the recursive update of the gradient, the algorithm must sum two Kronecker products into one. They use a "random sign" trick to ensure this approximation remains unbiased, meaning that on average, the estimated gradient is exactly correct.
  4. Complexity: KF-RTRL requires $O(n^3)$ operations and $O(n^2)$ memory. While $O(n^3)$ is slower than TBPTT's $O(n^2)$, it is a massive improvement over exact RTRL’s $O(n^4)$ and remains practical for moderately sized networks.

Key Insights and Results

By using a matrix-vector product rather than just two vectors, KF-RTRL captures significantly more structural information about the gradient. The authors theoretically prove that the noise in KF-RTRL is asymptotically $n$ times smaller than in UORO, and that this noise remains stable over time rather than exploding.

To test these claims, the researchers evaluated the algorithm on two main tasks: a synthetic Copy Task (testing long-term memorization) and the Penn TreeBank (PTB) dataset (testing complex, stochastic language modeling).

Breaking the Truncation Barrier

Because the algorithm is online and doesn't truncate history, it can solve tasks where the required memory exceeds the typical 20-50 step window used in TBPTT. In the Copy Task, KF-RTRL successfully learned dependencies up to 36 steps, whereas TBPTT failed as soon as the string length exceeded its truncation window. UORO struggled to learn even short sequences due to its high variance.

Learning curves on the Copy Task showing maximum sequence length (T) learned over time.

Superiority over UORO and Variance Analysis

In the Penn TreeBank task, KF-RTRL achieved a score of 1.72 bits per character (BPC), vastly outperforming UORO’s 2.61 BPC. Furthermore, KF-RTRL nearly matched the performance of TBPTT with a 25-step horizon (1.56 BPC), despite the noise inherent in the approximation.

Empirical tests confirmed the theoretical claims about variance. The "alignment" (cosine similarity) between the KF-RTRL estimate and the true gradient is much higher and more stable than that of UORO, especially as the number of hidden units increases.

Cosine similarity between estimated and true gradients.

Limitations and Future Work

While KF-RTRL represents a significant step forward, challenges remain:

  • Computational Scaling: The $O(n^3)$ complexity is still a bottleneck for very large networks (e.g., thousands of units). The authors suggest that fast matrix multiplication or exploiting sparsity could mitigate this.
  • Architectural Constraints: The current derivation applies to a specific (though broad) class of RNNs. Extending this to more complex architectures like standard LSTMs requires further work.
  • Noise Reduction: While much better than UORO, the gradient is still noisy. Future work could explore regularization or specific architectural designs that naturally produce less noisy Kronecker factors.

Summary updated

BibTeX
@inproceedings{mujika2018approximating,
  author = {Asier Mujika and Florian Meier and Angelika Steger},
  title = {{Approximating Real-Time Recurrent Learning with Random Kronecker Factors}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2018},
  url = {https://openreview.net/forum?id=B1ZFo_W_bS},
}
Figure