Rotational Unit of Memory

Rumen Dangovski, Li Jing, Marin Soljacic

Recurrent Neural Networks (RNNs) like LSTMs and GRUs have long been the workhorses of sequential data processing. However, they suffer from two primary bottlenecks: vanishing and exploding gradients, and limited memory capacity. During backpropagation through time, gradients often shrink to zero or blow up, making it nearly impossible for the model to learn dependencies across long sequences. Furthermore, standard RNNs store information in a fixed-size hidden state vector. To handle complex reasoning or large-scale memorization, researchers usually have to bolt on external "attention" mechanisms or complex associative memory structures, which increase model size and training difficulty.

The Rotational Unit of Memory (RUM) is a novel RNN architecture designed to offer a "best of both worlds" solution. It unifies unitary evolution matrices with associative memory through a differentiable rotation operation. By encoding information in the "pose" (orientation) of hidden states, RUM effectively eliminates vanishing and exploding gradients while achieving state-of-the-art results on long-term dependency tasks.

The RUM Architecture

The core innovation of RUM is the Rotation operation. Instead of using standard weight matrices to transform the hidden state, RUM computes a dynamic orthogonal matrix $R$ based on the current input and a learned "memory target."

Geometric intuition and architecture of the RUM cell.
  • The Rotation Kernel: The model learns to embed inputs into a vector space and defines a rotation between two vectors: an embedded input $\tilde{\epsilon}$ and a target $\tau$. This rotation is strictly orthogonal, meaning it preserves the norm of the hidden state and keeps gradients mathematically stable.
  • Associative Memory: Unlike static weights, the rotation matrix $R_t$ can be accumulated over time via the equation $R_t = (R_{t-1})^\lambda \cdot \text{Rotation}(\tilde{\epsilon}_t, \tau_t)$. This allows the weights themselves to act as a dynamic memory that changes based on the input sequence.
  • Phase-Encoding: RUM treats hidden states as "capsules" in Euclidean space. It manipulates the orientation (phase) of these vectors to store information, rather than just their magnitude.
  • Time Normalization: To keep the ReLU activations stable, the authors introduce a normalization step that ensures the hidden state maintains a consistent norm $\eta$ across the sequence.

Key Insights and Mechanisms

RUM is the first model to successfully merge unitary/orthogonal evolution (for gradient stability) with the dynamic structure of associative memory. Visualizing the learned kernels reveals a distinct diagonal activation pattern, suggesting that RUM learns to assign specific "neurons" or dimensions to specific linguistic features (like grammar or vocabulary), allowing them to evolve independently through rotations.

Furthermore, while most RNNs rely on the magnitude of hidden state elements to represent information, RUM demonstrates that the relative angle between vectors is a much more robust way to encode long-term memory. Despite its representational power, RUM remains highly parameter-efficient, solving complex tasks with significantly fewer parameters than competing models.

Experimental Results

The authors evaluated RUM across a spectrum of difficulty, including synthetic memory tasks, question answering, and language modeling.

Performance on the Copying Memory Task (T=200 and T=500).
  • Solving Synthetic Memory: RUM completely solved the Copying Memory task (testing the ability to recall a sequence after a long delay), whereas standard LSTMs and GRUs failed to beat a random-guessing baseline. It also achieved 100% accuracy on the $T=50$ Associative Recall task.
  • State-of-the-Art on Language Modeling: RUM (specifically the "Fast-Slow" RUM variant) achieved a test loss of 1.189 bits-per-character (BPC) on the Character Level Penn Treebank (PTB) task, surpassing previous records held by complex LSTM variants.
  • Competitive Question Answering: On the bAbI dataset—which consists of 20 different reasoning tasks—RUM achieved a mean accuracy of 73.2%. While slightly behind specialized Memory Networks that use explicit attention, it significantly outperformed standard LSTMs (49%) and other unitary models (60%) without relying on any external attention mechanisms.

Limitations and Future Work

While highly effective, RUM does have limitations. The model relies heavily on "time normalization" to stay stable. The authors found that the choice of the norm hyperparameter $\eta$ is crucial; if it is too large, the loss can "blow up" during training. Additionally, extending the associative power $\lambda$ to real numbers (rather than just integers) is mathematically difficult because it requires defining the logarithm of a matrix in the Lie algebra $so(N_h)$.

Looking forward, the authors suggest that the rotational operation isn't limited to RNNs. It could potentially be applied to Convolutional Neural Networks (CNNs) or Generative Adversarial Networks (GANs) to improve their representational power and training stability.

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