Rotational Unit of Memory

Rumen Dangovski, Li Jing, Marin Soljacic

TL;DR

The Rotational Unit of Memory (RUM) is a novel RNN architecture that replaces standard gated mechanisms with a differentiable "Rotation" operation. By unifying the stability of unitary evolution matrices with the capacity of associative memory, RUM effectively eliminates the vanishing gradient problem and achieves state-of-the-art performance on long-term dependency tasks without requiring external attention mechanisms.

What Problem Does This Paper Address?

Recurrent Neural Networks (RNNs), such as LSTMs and GRUs, are the workhorses of sequential data processing. However, they face two major hurdles:

  1. The Memory Bottleneck: Standard RNNs store information in a relatively small hidden state, limiting their ability to handle complex, long-term context.
  2. Gradient Instability: During training, gradients often vanish or explode as they are backpropagated through time, making it nearly impossible for the model to learn dependencies across long sequences.

While researchers often turn to external attention mechanisms to bypass these issues, the authors of this paper argue for a more fundamental fix: improving the basic RNN cell itself to be both more stable and more memory-efficient.

Methods

The core innovation is the Rotation operation. Instead of using standard weight matrices that can shrink or blow up gradients, RUM uses an orthogonal rotation matrix $R(a, b)$ that rotates vectors in a two-dimensional subspace.

Figure 1: Rotation is a universal differentiable operation that enables the advantages of the RUM architecture. (a) The rotation R(a, b) in the plane defined by a = ˜ε and b = τ acts on the hidden state h. (b) The RUM cell, in which Rotation encodes the kernel R. The matrix Rt acts on ht−1 and thus keeps the norm of the hidden state.

Key components of the RUM cell include:

  • Rotational Associative Memory: The model learns a "memory target" vector $\tau$ and an embedded input $\tilde{\epsilon}$. The rotation between these two vectors is accumulated into a dynamic matrix $R_t$. Because this matrix is strictly orthogonal, it preserves the norm of the hidden state, ensuring stable gradients.
  • Simplified Gating: Unlike GRUs, RUM does not need a reset gate. The authors show that the "forgetting" mechanism is naturally embedded in the rotation—to forget, the model simply learns to rotate a phase to its negation.
  • Time Normalization: A hyperparameter $\eta$ is used to normalize the hidden state, further stabilizing learning and preventing exploding gradients in deep or long-sequence models.

Datasets

The authors evaluated RUM across a spectrum of synthetic and real-world challenges:

  • Synthetic Memorization: The Copying Memory Task (testing the ability to recall a sequence after a long delay) and the Associative Recall Task (requiring the model to find a "key" and retrieve the subsequent character).
  • Question Answering: The bAbI dataset, consisting of 20 sub-tasks that require reasoning and memory.
  • Language Modeling: The Character Level Penn Treebank (PTB), a standard benchmark for predicting the next character in real-world text.

Key Insights and Ideas

  • Dynamic Weights as Memory: By treating the rotational weights as structures that change based on the input instance, RUM functions as a form of associative memory. This allows for a much larger effective memory space ($O(N_h^2)$) compared to standard RNNs ($O(N_h)$).
  • Phase-Encoding for Forgetting: The theoretical analysis suggests that RUM belongs to a class of "phase-encoding" architectures. This is a powerful paradigm because it allows the model to "cancel out" information mathematically rather than relying on a heuristic gate to block it.
  • Efficient Representation: Visualization of the learned kernels reveals a distinct diagonal activation pattern. This suggests that RUM utilizes the capacity of its hidden state almost completely, with each neuron playing a distinct role in encoding grammar and vocabulary.
Visualization of the RUM kernel showing the diagonal activation pattern that signifies efficient sequential learning.

Key Results

RUM demonstrated significant improvements over traditional and specialized RNN models:

  • Copying Task: RUM solved the task completely (zero loss) at delays where LSTMs and GRUs failed entirely.
  • Associative Recall: RUM achieved 100% accuracy on long sequences ($T=50$) with significantly fewer parameters than competing models like WeiNet.
  • bAbI QA: RUM reached a mean accuracy of 73.2%, far outperforming LSTMs (49%) and GORUs (60%), and approaching the performance of models that use explicit attention mechanisms (86%).
  • Penn Treebank: RUM set a new state-of-the-art result of 1.189 bits-per-character (BPC) when integrated into a "Fast-Slow" hierarchical architecture.
Figure 2: The orthogonal operation Rotation enables RUM to solve the Copying Memory Task. The delay times are 200, 500 and 1000. For all models Nh = 250 except for the RUM models with λ = 1, for which Nh = 100. For the training of all models we use RMSProp optimization with a learning rate of 0.001 and a decay rate of 0.9; the batch size Nb is 128.

Limitations and Future Work

The authors identify a few areas for further exploration:

  • Continuous Rotations: Currently, the associative power $\lambda$ is an integer. Defining $\lambda$ as a real number would require defining the logarithm of a matrix, which could further expand the model's representational power.
  • Architectural Fusion: While RUM works well as a standalone cell, the authors suggest it could be even more powerful if fused with other high-level structures like Recurrent Highway Networks or HyperNetworks.
  • Beyond RNNs: The rotational operation is a general mathematical tool that could potentially be applied to Convolutional Neural Networks (CNNs) or Generative Adversarial Networks (GANs).

Summary updated

BibTeX
@inproceedings{dangovski2018rotational,
  author = {Rumen Dangovski and Li Jing and Marin Soljacic},
  title = {{Rotational Unit of Memory}},
  booktitle = {Workshops @ ICLR},
  year = {2018},
}
Figure