NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Cheap Orthogonal Constraints in Neural Networks: A Simple Parametrization of the Orthogonal and Unitary Group

Mario Lezcano Casado, David Martínez-RubioICML 2019

Introduction

This paper introduces a simple yet powerful way to enforce orthogonality in neural networks using the matrix exponential map. By transforming constrained optimization over orthogonal groups into unconstrained optimization in Euclidean space, the authors create EXPRNN, an architecture that effectively eliminates vanishing and exploding gradients in Recurrent Neural Networks (RNNs) with negligible computational overhead.

The Exploding and Vanishing Gradient Problem

Training deep neural networks, especially RNNs, is notoriously difficult due to the exploding and vanishing gradient problem. When multiplying many matrices together—as happens across time-steps in an RNN—the gradients tend to either blow up or shrink to zero unless the eigenvalues of the recurrent weight matrix are exactly one.

Matrices with this property are called orthogonal (or unitary in the complex case). While researchers have long known that orthogonal matrices solve the gradient problem, enforcing these constraints during training has historically been a "pick your poison" scenario:

  1. Expensive: Methods like Riemannian gradient descent require costly operations at every step.
  2. Incomplete: Some parametrizations (like those based on FFTs) cannot represent all possible orthogonal matrices, limiting the model's expressive power.
  3. Degenerate: Common tricks like the Cayley transform suffer from numerical instabilities when eigenvalues approach -1.

Methods: The Exponential Map

The authors leverage Lie Group theory to bridge the gap between constrained and unconstrained optimization.

Bridging the Gap

The core idea relies on the exponential map. In mathematics, for every "Lie Group" (like the group of orthogonal matrices $SO(n)$), there is an associated "Lie Algebra" (the space of skew-symmetric matrices).

  • The Trick: If you take any skew-symmetric matrix $A$ (where $A = -A^T$) and compute its matrix exponential ($e^A$), the result is guaranteed to be an orthogonal matrix.
  • The Optimization: Instead of optimizing an orthogonal matrix $B$ directly, the network optimizes a skew-symmetric matrix $A$ in standard Euclidean space. It then uses $B = \exp(A)$ in the network. This allows the use of standard optimizers like Adam or Adagrad without any special modifications.

Numerical Efficiency

Computing a matrix exponential is usually $O(n^3)$, which sounds expensive. However, the authors point out a crucial implementation trick: the parametrization only needs to be computed once per batch, not once per sequence element or per training example. For a hidden size of 512, the overhead is virtually unnoticeable compared to the standard operations of an RNN. They use Padé approximants and the scale-squaring trick to compute these exponentials with machine-level precision.

Key Insights

  • Surjectivity is Key: Unlike the Cayley transform, the exponential map is surjective for compact connected Lie groups. This means it can represent any rotation matrix, ensuring the optimizer can reach the true global minimum.
  • Change of Metric: The paper proves that this parametrization acts as a change of metric on the group. This "warping" of the optimization landscape actually helps gradient descent converge faster and more stably.
  • Hard Constraints: Unlike "soft" penalties (which just encourage orthogonality), this method enforces hard orthogonality. The matrix is orthogonal by construction, regardless of how large the gradient updates are.
  • Initialization Matters: The authors provide a structured initialization (the "Henaff" or "Cayley" init) that biases the starting eigenvalues, helping the network learn long-range dependencies from the very first iteration.

Datasets and Key Results

The authors evaluated EXPRNN on three standard benchmarks for long-term dependencies, consistently outperforming previous orthogonal methods and standard LSTMs:

  • Copying Memory Task: A synthetic test where the network must remember a sequence of symbols and recall them after a long delay ($L=1000$ or $L=2000$). On the difficult $L=2000$ task, EXPRNN was the only architecture that fully converged to the correct answer, whereas methods like SCORNN showed unstable training.
Cross entropy loss over iterations for the Copying Memory Task, showing expRNN's superior convergence.
  • Pixel-by-pixel MNIST & Permuted MNIST: The MNIST digits are flattened into a sequence of 784 pixels. EXPRNN achieved a test accuracy of 98.7% on MNIST and 96.6% on Permuted MNIST, setting a high bar for orthogonal RNNs.
Test accuracy over epochs on the MNIST task, comparing expRNN against LSTM and scoRNN across different hidden sizes.
  • TIMIT Speech Dataset: A real-world dataset of audio recordings used for predicting the log-magnitude of speech frames. This yielded the most dramatic result: EXPRNN achieved a Test Mean Squared Error (MSE) of 4.38, nearly twice as good as the next best orthogonal method (SCORNN at 7.36) and far better than LSTMs (12.62).

Limitations and Future Work

  • Architecture Scope: This paper focuses primarily on the recurrent weights of an RNN. Future work should investigate coupling this exponential parametrization with more complex cells like LSTMs or GRUs to see if performance can be pushed even further.
  • Feed-Forward Networks: While the benefits for RNNs are clear, it would be interesting to see if orthogonal constraints help generalization in deep feed-forward or convolutional networks.
  • Manifold Generalization: The current work is specific to Lie Groups. The authors suggest generalizing these results to other "homogeneous Riemannian manifolds," such as the Stiefel manifold (non-square orthogonal matrices).

Summary updated

BibTeX
@inproceedings{casado2019cheap,
  author = {Mario Lezcano Casado and David Martínez-Rubio},
  title = {{Cheap Orthogonal Constraints in Neural Networks: A Simple Parametrization of the Orthogonal and Unitary Group}},
  booktitle = {International Conference on Machine Learning},
  year = {2019},
}
Figure