Optimal Transport (OT) is a powerful mathematical tool used in machine learning to measure the distance between probability distributions, with applications ranging from generative models to domain adaptation. Because exact OT is computationally brutal, researchers typically solve an approximation called entropic-regularized OT.
The de facto standard for solving this approximation is the Sinkhorn algorithm. While Sinkhorn is simple and relies on fast matrix-vector multiplications, it behaves like a first-order optimization method. It suffers from a sub-linear convergence rate, meaning it requires a massive number of iterations to reach high precision.
Alternatively, second-order methods (like Newton's method) converge in very few iterations thanks to their quadratic rate. However, standard Newton methods require computing and inverting a dense Hessian matrix at every step, which costs $O(n^3)$ operations—making it entirely impractical for large datasets. Recent attempts to use "sparse" Newton methods are promising but brittle: they often crash due to singular (non-invertible) matrices, require "warm starts" (running Sinkhorn first to get close to the answer), and lack solid mathematical proofs for their convergence.
To address these flaws, researchers have introduced SSNS, a "Safe and Sparse" Newton method that achieves the blazing-fast, few-iteration convergence of second-order methods without the crippling computational bottleneck.
The SSNS Algorithm
The SSNS approach relies on two major technical pillars to make second-order OT computation viable:
- A Novel Hessian Sparsification Scheme: The algorithm adaptively drops small elements from the transport plan matrix while keeping the diagonal elements intact. The authors mathematically prove that this specific masking technique strictly bounds the approximation error.
- Guaranteed Positive Definiteness ("Safety"): Unlike previous methods, the authors prove their sparsified Hessian is always positive definite. To further prevent numerical instability (near-singularity), they add a dynamic shift parameter $\lambda$ to the linear system, inspired by the Levenberg-Marquardt algorithm.
Crucially, both the sparsification threshold and the shift parameter are tied to the current gradient norm. When the algorithm is far from the solution, it uses a highly sparse (computationally cheap) matrix and a large stabilizing shift. As it hones in on the optimum and the gradient approaches zero, the approximations fade away, allowing the algorithm to seamlessly transition into a pure, ultra-precise Newton step.
Key Insights
- Safety Eliminates the Need for Warm Starts: Because the sparsified Hessian is guaranteed to be positive definite and stabilized by the shift parameter, SSNS is globally convergent. It can start from a cold initialization without needing to run Sinkhorn for hundreds of iterations first.
- Adaptive Sparsity: Tying the sparsification threshold to the gradient norm ensures iterations are cheap during initial exploration, but highly accurate during final convergence.
- Theoretical Rigor: The method provides rigorous proofs that SSNS achieves a quadratic local convergence rate, answering an open conjecture in the field regarding sparse Newton methods for OT.
Experimental Results
The authors evaluated SSNS on several benchmarks, including image morphing tasks (MNIST & Fashion-MNIST), Wasserstein distance computation between image classes (ImageNet/Imagenette subset mapped to 30-dimensional feature vectors), and large-scale synthetic data (up to $10,000 \times 10,000$ dimensions).
Across the board, SSNS demonstrated massive speedups. On the MNIST, Fashion-MNIST, and ImageNet datasets, SSNS achieved an order-of-magnitude reduction in total run time compared to standard first-order methods (Sinkhorn/BCD), accelerated first-order methods (APDAGD), and quasi-Newton methods (L-BFGS).
Furthermore, SSNS proved highly robust to low regularization. When the entropic penalty is very small (e.g., $\eta = 0.001$), standard Newton methods fail completely due to near-singular matrices, and Sinkhorn takes far too many iterations. SSNS handles this low-regularization regime gracefully. On massive $10,000 \times 10,000$ synthetic datasets, SSNS maintained its fast quadratic convergence, reaching the error tolerance in seconds while standard Sinkhorn essentially flatlined.
Limitations
The primary limitation of SSNS is that its speed relies heavily on the assumption that the underlying optimal transport plan can be well-approximated by a sparse matrix. If a specific OT problem inherently has a very dense transport plan—for instance, if the regularization parameter is extremely large, blurring the transport map—the sparsified Hessian will remain too dense. In such edge cases, the computational advantage of SSNS over standard methods would diminish.
Summary updated