Introduction
Recurrent Neural Networks (RNNs) are powerful tools for sequence modeling, but they are notoriously difficult to train on long sequences due to the vanishing and exploding gradient problem. When a hidden state is multiplied by the same weight matrix over many time steps, the signal either vanishes (if eigenvalues are $< 1$) or explodes (if eigenvalues are $> 1$).
One promising solution is the use of unitary matrices, which preserve the norm of a vector (all eigenvalues have a magnitude of exactly 1). However, standard gradient descent is poorly suited for the unitary manifold because additive updates ($W_{new} = W_{old} + \Delta W$) rarely result in a new unitary matrix. This paper introduces a novel method to train RNNs using the full space of unitary matrices by leveraging Lie algebra ($u(n)$).
Methods: Optimization in the Lie Algebra
Instead of optimizing the unitary matrix $U$ directly, the authors propose optimizing an element $L$ in its associated Lie algebra, $u(n)$.
- The Lie Algebra ($u(n)$): Elements of $u(n)$ are skew-Hermitian matrices ($L^\dagger = -L$). Crucially, $u(n)$ is a vector space, meaning standard additive gradient updates stay within the space.
- The Exponential Map: The matrix exponential maps the algebra back to the group: $U = \exp(L)$. Since this map is surjective for the unitary group, any unitary matrix can be represented and learned this way.
- Efficient Gradients: A key technical contribution is an analytical derivation for the derivative of the matrix exponential specifically for skew-Hermitian matrices. By utilizing eigenvalue decomposition and exploiting basis sparsity, the authors significantly reduce the computational overhead of gradient calculation.
- guRNN: This approach is implemented as a "General Unitary RNN" (guRNN), where the hidden-to-hidden transition is a learned unitary operator.
Key Results
Superior Accuracy in Matrix Recovery
In synthetic matrix recovery tasks, where the model must recover a ground-truth unitary matrix, the $u(n)$ parametrization consistently outperformed previous restricted methods, such as those by Arjovsky et al. (2016). The ability to explore the full unitary group, rather than a restricted subset, leads to significantly lower test loss across various matrix dimensions.
Solving Long-Memory Tasks
The authors evaluated the guRNN on classic long-term memory benchmarks: the "Adding Problem" and the "Memory Problem." While standard architectures like LSTMs and IRNNs often fail to learn these tasks at sequence lengths of $T=100$, the unitary models converge rapidly.
Notably, the authors found that adding a simple scaling factor $\beta$ to the transition ($h_t = f(\beta U h_{t-1} + \dots)$) was essential for solving the adding problem, as standard non-linearities can still cause gradient decay even with unitary weights.
Conclusion and Computational Efficiency
Despite the theoretical complexity of the matrix exponential, the optimized gradient implementation proved highly efficient—running 2.6x to 4.8x faster than baseline restricted unitary RNNs (ruRNN). While the $O(n^3)$ cost of eigenvalue decomposition may limit scaling to extremely large hidden layers ($n > 1000$), the $u(n)$ approach provides a robust and mathematically principled framework for learning unitary operators in deep learning.
Summary updated