Importance Sparsification for Sinkhorn Algorithm

Mengyu Li, Jun Yu, Tao Li, Cheng Meng

Abstract

The Sinkhorn algorithm is a cornerstone for approximating Optimal Transport (OT) and Unbalanced Optimal Transport (UOT) solutions. However, its $O(n^2)$ computational complexity per iteration poses a significant barrier for large-scale applications. We present Spar-Sink, a novel importance sparsification method that reduces this complexity to near-linear $\widetilde{O}(n)$. By leveraging natural upper bounds from marginal constraints to define sampling probabilities, Spar-Sink constructs a sparse kernel matrix that accelerates iterations without sacrificing consistency. Empirical evaluations on synthetic and real-world datasets, including echocardiogram video analysis and generative modeling, demonstrate that Spar-Sink achieves substantial speedups—often by orders of magnitude—while maintaining high estimation accuracy.

Introduction

Optimal Transport (OT) has emerged as a powerful tool for comparing probability distributions across various fields, including computer vision, machine learning, and bioinformatics. The introduction of entropy regularization and the subsequent Sinkhorn algorithm transformed OT from a computationally prohibitive linear programming problem into a more manageable iterative process. Despite this, the $O(n^2)$ cost per iteration remains a bottleneck when dealing with datasets containing millions of points. Existing acceleration techniques often rely on low-rank approximations or specific kernel structures, which may not hold in complex scenarios like Unbalanced Optimal Transport (UOT).

The Spar-Sink Method

Spar-Sink addresses these limitations through Importance Sparsification. The core idea is to replace the dense kernel matrix $\mathbf{K}$ (which represents the cost of moving mass between points) with a sparse "sketch" $\tilde{\mathbf{K}}$. Unlike uniform sampling, which might miss critical transport paths, Spar-Sink utilizes importance sampling to preserve the most relevant entries.

The researchers observed that the marginal constraints of the OT problem—the total mass at the source ($a$) and destination ($b$)—provide "free" information. Specifically, the amount of mass transported between two points $i$ and $j$ is naturally bounded by the marginals $a_i$ and $b_j$. By using these bounds to calculate sampling probabilities, Spar-Sink ensures that entries likely to carry significant mass are preserved in the sparse matrix.

The algorithm proceeds by:

  1. Calculating Sampling Probabilities: Using marginal constraints to identify "important" entries.
  2. Constructing a Sparse Sketch: Building $\tilde{\mathbf{K}}$ via Poisson sampling based on those probabilities.
  3. Sparse Iterations: Performing Sinkhorn iterations using sparse matrix-vector multiplications.

This approach reduces the per-iteration complexity from $O(n^2)$ to effectively $\widetilde{O}(n)$, where $n$ is the number of samples.

Theoretical Consistency

A critical contribution of this work is the proof of consistency for the Spar-Sink estimators. The authors demonstrate that under mild regularity conditions, the error introduced by sparsification vanishes as the sample size $n$ and the number of sampled elements $s$ increase. This theoretical foundation ensures that the speed gains do not come at the cost of long-term accuracy, making it a reliable alternative to the standard Sinkhorn algorithm.

Empirical Results and Applications

The effectiveness of Spar-Sink was validated through extensive experiments across multiple domains:

  • Synthetic Benchmarks: In tests involving Gaussian and t-distributions in dimensions up to 50, Spar-Sink outperformed competitors like Nys-Sink and Greenkhorn. As $n$ increased, Spar-Sink maintained low estimation error while being hundreds of times faster than the standard Sinkhorn algorithm.
  • Medical Imaging: Analyzing 10,030 echocardiogram videos from the EchoNet-Dynamic dataset, Spar-Sink successfully identified cardiac cycles (diastole and systole). A task that would traditionally take nearly a hundred days on a standard CPU was completed in just a few hours, with accuracy comparable to the full Sinkhorn method.
  • Generative Modeling: The authors implemented a Spar-Sink Auto-Encoder (SSAE). The SSAE achieved superior FID scores (a measure of image generation quality) compared to standard Sinkhorn Auto-Encoders while cutting training time in half.
  • Color Transfer: Spar-Sink efficiently handled high-resolution image processing, accurately mapping color distributions between complex scenes, demonstrating its versatility in computer vision tasks.

Conclusion and Future Directions

Spar-Sink represents a significant advancement in making Optimal Transport scalable. By breaking the quadratic complexity barrier without requiring low-rank assumptions, it opens new possibilities for UOT and large-scale data analysis. While the current method is highly effective, future work will focus on enhancing robustness to outliers and optimizing sparse matrix operations for modern GPU architectures to further push the boundaries of hardware efficiency.

Summary updated

BibTeX
@article{li2023importance,
  author = {Mengyu Li and Jun Yu and Tao Li and Cheng Meng},
  title = {{Importance Sparsification for Sinkhorn Algorithm}},
  journal = {JMLR},
  year = {2023},
}
Figure