TL;DR
This paper introduces the Unitary Evolution Recurrent Neural Network (uRNN), an architecture designed to solve the vanishing and exploding gradient problems in RNNs. By constraining weight matrices to be unitary (preserving the norm of the hidden state), the authors enable the training of models that can remember information across hundreds of time steps, significantly outperforming LSTMs on tasks requiring long-term dependencies.
The Challenge: Vanishing and Exploding Gradients
Recurrent Neural Networks (RNNs) are theoretically powerful but notoriously difficult to train. The core issue is the vanishing and exploding gradient problem:
- Vanishing Gradients: As gradients are backpropagated through time, they are repeatedly multiplied by the weight matrix. If the eigenvalues of this matrix are less than 1, the gradient shrinks exponentially, and the model "forgets" the distant past.
- Exploding Gradients: If eigenvalues are greater than 1, gradients grow exponentially, making optimization unstable.
While architectures like LSTMs and GRUs use "gates" to mitigate these issues, they are essentially heuristics. This paper seeks a more fundamental mathematical solution: what if we force the weight matrix to have eigenvalues with an absolute value of exactly 1? This ensures that the gradient norm remains stable regardless of the sequence length.
The uRNN Solution: Unitary Matrices
The authors propose using unitary matrices (the complex-domain version of orthogonal matrices) for the hidden-to-hidden weights. A unitary matrix $U$ satisfies $U^*U = I$, meaning it preserves the $L_2$ norm of the vectors it transforms.
Parameterization for Efficiency
Directly optimizing a matrix while keeping it unitary is computationally expensive. Standard methods like eigendecomposition are $O(n^3)$, which is too slow for deep learning. To solve this, the authors represent the unitary weight matrix $W$ as a product of several simple, structured components: $$W = D_3 R_2 F^{-1} D_2 \Pi R_1 F D_1$$ Where:
- $D$ (Diagonal): Complex phases ($e^{i\omega}$).
- $R$ (Reflection): Householder reflections.
- $F, F^{-1}$: Fourier and Inverse Fourier transforms (allowing $O(n \log n)$ computation).
- $\Pi$: A fixed permutation matrix.
This composition is expressive yet computationally efficient, requiring only $O(n \log n)$ time and $O(n)$ memory. This efficiency allows for much larger hidden layers than traditional RNNs for the same computational budget.
Complex-Valued Hidden States and modReLU
To make this parameterization work, the hidden states are complex-valued. The authors introduce a new nonlinearity called modReLU: $$\sigma_{modReLU}(z) = \text{ReLU}(|z| + b) \frac{z}{|z|}$$ This function only affects the magnitude of the complex number (based on a learnable bias $b$) while preserving its phase. The authors argue that preserving the phase is crucial for maintaining information over time, whereas standard ReLUs on real/imaginary parts perform poorly.
Evaluation and Key Results
The model was evaluated on several "pathologically hard" synthetic benchmarks designed to test long-term memory, including the Copying Memory Problem, the Adding Problem, and Pixel-by-pixel MNIST (both sequential and permuted).
Key Findings: * Mathematical Stability: By using unitary matrices, the authors provide a mathematical proof that the gradient norm can be bounded, effectively "solving" the exploding gradient problem by design. * Saturation Avoidance: Unlike LSTMs, which can "saturate" (where gates stay closed and stop accepting new info), uRNNs maintain a more consistent flow of information. * Copying Task: The uRNN solved the task perfectly for time lags up to $T=500$, while the LSTM failed to beat a simple baseline (the "memoryless" strategy) for any length over $T=100$.
- Permuted MNIST: The uRNN achieved 91.4% accuracy, setting a new state-of-the-art at the time. It outperformed the LSTM (88%) despite having significantly fewer parameters (9k vs 60k).
- Convergence Speed: In the MNIST tasks, the uRNN converged in a fraction of the iterations required by the LSTM.
Limitations and Future Directions
- Expressivity Limits: The specific composition of structured matrices used ($D, R, F, \Pi$) might not span the entire space of unitary matrices. Finding the "optimal" set of building blocks remains an open question.
- Implementation Complexity: Working with complex numbers and Fourier Transforms requires more specialized implementation than standard real-valued matrix multiplications.
- Memory Efficiency: The authors suggest that because unitary matrices are invertible, one could potentially recompute hidden states during the backward pass (similar to Gradient Checkpointing). This could drastically reduce memory usage for extremely long sequences and is proposed as a direction for future work.
Summary updated