RotRNN: Modelling Long Sequences with Rotations

Kai Biegun, Rares Dolga, Harry Jake Cunningham, David Barber · Submission to ICLR 2025 · Withdrawn

TL;DR

Linear Recurrent Units (LRUs) and State Space Models (SSMs) excel at processing long sequences, but their stability relies on ad-hoc normalizations or delicate initialization schemes that drift during training. RotRNN solves this by parameterizing the recurrent state transition as a decayed rotation matrix, yielding an exact, provable normalization that keeps the hidden state norm constant throughout training while remaining competitive on long-sequence benchmarks.

What Problem Does This Paper Address?

Modern deep learning on long sequences has shifted toward linear recurrent architectures—such as S4, S5, and LRU—because they combine the sub-quadratic inference speed of traditional RNNs with parallelizable training via associative scans or convolutions.

However, existing approaches suffer from a gap between theory and practice:

  • SSMs rely on continuous-time differential equations and HiPPO polynomial projections for initialization, yet it remains unclear why models perform well when weights diverge from these mathematical foundations during training.
  • LRUs diagonalize recurrent matrices in the complex plane to compute fast powers, but they drop structural constraints (e.g., enforcing conjugate eigenvalue pairs) and rely on an asymptotic normalization that only holds at initialization for infinite sequences. In practice, hidden state magnitudes in LRUs can fluctuate wildly across network layers and training steps.

RotRNN bridges this gap with an alternative parameterization that is simple, mathematically transparent, and rigorously normalized from step one through the end of training.

Methods

RotRNN parameterizes the hidden state recurrence as: $$x_t = \gamma A x_{t-1} + \xi B u_t$$

The key design choices include:

  1. Recurrence via Rotations ($A \in \mathrm{SO}(N)$): By definition, rotation matrices are orthogonal ($A^\top A = I$), preserving vector norms without expansion or contraction.
  2. Decomposition for Fast Matrix Powers: Any rotation matrix can be decomposed into $A = P \Theta P^\top$, where $\Theta$ is a block-diagonal matrix of $2 \times 2$ planar rotations (parameterized by rotation angles $\theta_i$) and $P$ is an orthogonal transformation generated via a matrix exponential of a skew-symmetric matrix: $P = \exp(M - M^\top)$. Because $P^\top P = I$, computing powers reduces to rotating each $2\mathrm{D}$ block by $k\theta_i$, which integrates cleanly into parallel associative scans.
  3. Multi-Head Structure: A single global scalar decay $\gamma$ struggles to capture multiple timescales. RotRNN addresses this by running $H$ independent recurrent heads in parallel (each with its own rotation and scalar decay $\gamma^{(h)} \in (0, 1)$), followed by a linear mixing projection $C$.
  4. Exact Hidden State Normalization: Because rotations preserve $L_2$ norms, under standard zero-mean unit-variance input assumptions, scaling the input projection matrix $B$ by: $$\xi = \sqrt{\frac{1 - c\gamma^2}{\mathrm{Tr}[B^\top B]}}$$ guarantees that $\mathbb{E}[\|x_t\|^2] = c$ (set to $c = 1$) for all timesteps $t$, entirely preventing vanishing or exploding hidden state trajectories.

Datasets

The authors evaluated RotRNN on standard long-context benchmarks without proposing new datasets:

  • Long Range Arena (LRA): Six synthetic and real-world tasks with sequence lengths spanning $1\mathrm{K}$ to $16\mathrm{K}$ tokens: ListOps (hierarchical reasoning), Text (IMDb sentiment classification), Retrieval (byte-level document matching via AAN), Image (sequential CIFAR-10), Pathfinder, and Path-X (long-range visual connectivity).
  • Speech Commands: A 35-way natural audio classification dataset evaluated on raw 1-second waveforms sampled at 16kHz (length $16,000$).

Key Insights and Ideas

  • Geometry Simplifies Normalization: Because rotations isolate directional change from magnitude change, any variance growth across time is driven entirely by the scalar decay $\gamma$ and the input injection $B$. This turns state normalization from an empirical heuristic into simple closed-form algebra.
  • Demystifying the LRU: The authors prove that when LRU eigenvalues form complex conjugate pairs, a multi-head RotRNN with 2D heads ($D_h = 2$) is algebraically equivalent to the LRU (up to normalization). This frames complex-diagonal recurrence simply as independent 2D planar rotations.
  • Empirical State Stability: While LRU hidden state norms swing unpredictably between 0 and 350+ across layers and initialization seeds, RotRNN maintains an almost perfectly flat hidden state norm throughout training.

Key Results

  • Long Range Arena (LRA): RotRNN achieves an overall average accuracy of 84.8%, outperforming the reproduced LRU baseline (84.1%) and staying competitive with S4D (84.9%).
  • Discrete & Text Domains: RotRNN achieved the highest score among all baselines on IMDb text classification (89.6% vs. S4's 86.8% and S5's 89.3%) and scored strongly on ListOps (61.1%) and Retrieval (89.9%).
  • Raw Audio: On Speech Commands (16kHz), RotRNN matched the LRU with 95.2% test accuracy under a compact parameter budget ($\sim 284\mathrm{K}$ parameters).

Limitations and Future Work

  • Visual / Spatial Benchmark Lag: RotRNN fell behind state-of-the-art SSMs on dense pixel-level tasks (e.g., 89.2% on Path-X vs. S5's 98.6%, and 85.9% on Image vs. S4's 91.1%).
  • Input Assumptions in Normalization: The constant-norm derivation assumes independent and identically distributed (i.i.d.) zero-mean inputs, which real-world sequence data rarely satisfy perfectly.
  • Static Recurrence: RotRNN currently relies on linear time-invariant dynamics. The authors note that incorporating input-dependent selective gating (analogous to Mamba or Griffin) is an open and promising next step.

Summary updated

BibTeX
@misc{biegun2024rotrnn,
  author = {Kai Biegun and Rares Dolga and Harry Jake Cunningham and David Barber},
  title = {{RotRNN: Modelling Long Sequences with Rotations}},
  year = {2024},
  eprint = {2407.07239},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.07239},
}
Figure