Abstract
Optimization on the Stiefel manifold—the set of matrices with orthogonal columns—is essential for modern machine learning architectures like Vision Transformers and tasks such as Optimal Transport. However, existing methods often struggle with the computational overhead of manifold retractions and the complexity of incorporating momentum. We present a novel momentum-based optimizer for the Stiefel manifold derived from a variational principle. By employing operator splitting and a structure-preserving discretization, our algorithm maintains exact orthogonality with low computational cost ($O(nm^2)$). Empirical results demonstrate significant performance gains in Vision Transformer accuracy and faster convergence in Projection Robust Wasserstein (PRW) distance computations.
Introduction
Orthogonality constraints are increasingly recognized as a powerful inductive bias in deep learning, ensuring that weight matrices preserve norms and maintain diverse features. These constraints define the Stiefel manifold. Standard Euclidean optimization techniques are unsuitable here, as they do not respect the manifold's geometry, necessitating expensive "retraction" steps to project weights back onto the manifold. Furthermore, integrating momentum—essential for training deep networks—requires sophisticated "parallel transport" of momentum vectors across the curved surface, which is often numerically unstable or computationally prohibitive.
Methodology
Our approach leverages a physics-inspired variational framework. We model the optimizer's trajectory as a damped mechanical system constrained to the Stiefel manifold. To discretize this continuous-time dynamics into a practical algorithm, we utilize an operator splitting technique:
- System Decomposition: The complex differential equations are partitioned into three simpler, manageable components.
- Structure-Preserving Discretization: Each component is discretized using schemes that inherently preserve the manifold's orthogonal structure.
- Implicit Momentum Handling: The momentum variable is naturally maintained within the correct tangent space, obviating the need for explicit projection or transport operations.
The resulting Momentum Stiefel SGD and Stiefel Adam variants utilize a quadratically-convergent iterative solver for internal updates, ensuring high efficiency ($O(nm^2)$).
Applications and Results
Vision Transformers (ViT)
We evaluated the optimizer by training Vision Transformers from scratch on CIFAR-10 and CIFAR-100. A key finding was the efficacy of "head-wise" orthogonality—enforcing orthogonality within the projection matrices of individual attention heads. On CIFAR-100, Stiefel SGD reduced test error to 30.20%, a notable improvement over the 32.61% achieved by standard ViT.
Optimal Transport
The optimizer was also tested on computing the Projection Robust Wasserstein (PRW) distance, a robust variant of the standard Wasserstein distance. Experiments on MNIST digits and Shakespearean text corpora showed that our method converges faster and identifies superior local minima compared to existing Riemannian Gradient Ascent (RGAS/RAGAS) methods.
Key Insights
- Computational Efficiency: The method achieves the lowest complexity among exact manifold-preserving algorithms, with per-iteration costs comparable to momentumless versions.
- Hyperparameter Consistency: The shared mathematical foundation between Stiefel and Euclidean updates allows for the use of identical learning rates across different layer types, simplifying the tuning process.
- Numerical Robustness: The algorithm maintains exact orthogonality even under low-precision arithmetic, a critical requirement for modern hardware.
Conclusion and Future Work
The Momentum Stiefel Optimizer provides a robust, efficient, and theoretically grounded framework for constrained optimization. While currently limited to the connected component of the starting point (e.g., $SO(n)$ for square matrices), it offers significant practical advantages for deep learning. Future research will explore exact convergence rates under specific geometric conditions and extend the framework to more complex manifold structures.
Summary updated