Massively scalable Sinkhorn distances via the Nyström method

Jason M. Altschuler, Francis R. Bach, Alessandro Rudi, Jonathan Weed

TL;DR

This paper introduces a novel algorithm, NYS-SINK, that dramatically speeds up the computation of Sinkhorn distances, a crucial tool in machine learning for comparing probability distributions. By combining the Nyström method for low-rank kernel approximation with Sinkhorn scaling, the authors achieve significant computational gains, enabling the analysis of datasets hundreds of times larger than previously feasible.

What Problem Does This Paper Address?

The Sinkhorn distance, a regularized version of the Wasserstein distance, has become a popular metric for comparing probability distributions in various machine learning applications, including image recognition, domain adaptation, and generative modeling. However, standard algorithms for computing the Sinkhorn distance have a computational complexity that scales quadratically with the number of data points ($O(n^2)$). This quadratic bottleneck makes it prohibitively expensive to apply these methods to large-scale datasets, which are increasingly common in modern machine learning. The paper aims to overcome this limitation by developing a method that can compute Sinkhorn distances efficiently for massive datasets.

Methods

The core of the paper's contribution lies in the combination of two key techniques:

  • Nyström Method: This is a technique for approximating a large kernel matrix (like the Gaussian kernel used in this context) with a low-rank matrix. The paper introduces new theoretical guarantees for Nyström approximations, particularly for data that lies on low-dimensional manifolds, which is crucial for adaptivity. The ADAPTIVENYSTRÖM algorithm is proposed, which adaptively determines the rank of the approximation.
  • Sinkhorn Scaling: This is an iterative algorithm for computing the Sinkhorn projection, which is a key component in calculating the Sinkhorn distance. The paper analyzes the stability properties of Sinkhorn scaling when applied to approximate kernel matrices.

The proposed algorithm, NYS-SINK, first uses ADAPTIVENYSTRÖM to obtain a low-rank approximation of the kernel matrix. Then, it applies the SINKHORN algorithm to this approximate kernel to compute the Sinkhorn projection and an approximate cost. Finally, a ROUND procedure ensures the output is a valid probability coupling. A key aspect of the implementation is that the full kernel matrix is never explicitly formed, allowing for efficient matrix-vector multiplications.

Datasets

The paper does not introduce new datasets. Instead, it uses synthetic data for theoretical analysis and experimental validation. For empirical evaluation, it mentions using "random point clouds" and a "benchmark dataset used in computer graphics" from "The Stanford 3D Scanning Repository" for experiments involving 3D cloud points.

Key Insights and Ideas

  • The Power of Adaptivity: The paper highlights that the computational cost of their method depends on the intrinsic dimension of the data, not just the ambient dimension. This is a significant advantage when dealing with data that lies on low-dimensional structures within a high-dimensional space.
  • Synergy of Nyström and Sinkhorn: The core insight is that combining the Nyström method's ability to approximate kernel matrices with Sinkhorn scaling's efficient projection mechanism leads to a provably accurate and significantly faster algorithm for Sinkhorn distances.
  • Theoretical Guarantees for Approximation: The paper provides new theoretical analyses for both the Nyström method and Sinkhorn scaling, establishing error bounds and runtime guarantees that are crucial for the proposed algorithm's effectiveness.
  • Practical Scalability: The algorithm is designed to avoid explicit computation of large matrices, relying instead on low-rank factorizations and matrix-vector products, which is key to its scalability.

Key Results

  • Near-Linear Time Complexity: The proposed algorithm, NYS-SINK, achieves a runtime that is near-linear in the number of data points ($O(nr)$), where $r$ is the approximation rank, which is adaptively chosen. This is a dramatic improvement over the $O(n^2)$ complexity of standard methods.
  • Significant Speedups: Experiments show that NYS-SINK is orders of magnitude faster than standard Sinkhorn algorithms, enabling computations on datasets hundreds of times larger. For example, on datasets of size $n \approx 20000$, NYS-SINK achieves the same accuracy in a fraction of the time.
  • Adaptive Rank: The approximation rank $r$ is shown to be independent of the ambient dimension $d$ when data lies on a low-dimensional manifold, depending instead on the manifold's intrinsic dimension $k$. For instance, for a $k$-dimensional manifold, the rank is bounded by $O((\log n)^{5k/2})$.
  • Error Guarantees: The paper provides theoretical guarantees for the accuracy of the computed Sinkhorn distance, ensuring it is within a specified additive error $\epsilon$.

Limitations and Future Work

  • Randomized Algorithm: The algorithm is randomized, and the theoretical guarantees hold with high probability. While the paper provides deterministic guarantees on the output quality, the runtime and rank depend on random sampling.
  • Parameter Tuning: While the algorithm is adaptive, some parameters (like the regularization parameter $\eta$) still need to be set. The paper notes that in experiments, the rank $r$ was chosen by hand to balance precision and time complexity, suggesting that further investigation into adaptive rank selection or automatic parameter tuning could be beneficial.
  • Generalization to Other Costs: The paper focuses on the squared Euclidean cost. While the authors mention that the Nyström method can be applied to any PSD kernel matrix, extending the theoretical analysis to other cost functions for Sinkhorn distances might be an interesting future direction.
  • Empirical Success vs. Theoretical Analysis: The authors note that their experiments show good empirical performance even when the chosen rank $r$ is smaller than theoretically required. Investigating this discrepancy and understanding the practical benefits of this further is suggested as a topic for future study.

Summary updated

BibTeX
@inproceedings{altschuler2019massively,
  author = {Jason M. Altschuler and Francis R. Bach and Alessandro Rudi and Jonathan Weed},
  title = {{Massively scalable Sinkhorn distances via the Nyström method}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2019},
  url = {https://openreview.net/forum?id=JATc6dIsKEm},
}
Figure