A Study of Performance of Optimal Transport

Yihe Dong, Yu Gao, Richard Peng, Ilya P. Razenshteyn, Saurabh SawlaniarXiv 2020

Introduction

Optimal Transport (OT) distances, often referred to as Earth Mover's Distance, are essential for comparing probability distributions in fields like image retrieval and natural language processing. Despite their utility, computing these distances is computationally intensive. Recently, the machine learning community has favored entropic regularization—specifically the Sinkhorn algorithm—due to its perceived scalability and differentiability. However, a comprehensive comparison between these modern numerical methods and classical combinatorial algorithms across diverse real-world datasets has been lacking. This study addresses this gap, evaluating which approach provides the best computational efficiency.

Methodology

The study benchmarks two primary families of algorithms:

  1. Numerical Matrix Scaling: Including Sinkhorn and its greedy variant, Greenkhorn. These methods use entropic regularization to transform OT into a matrix scaling problem.
  2. Combinatorial Methods: Including Network Simplex (Lemon NS), the Kuhn-Munkres (KM) algorithm, and the Auction Algorithm.
  3. Batched KM: A novel variant of the Hungarian algorithm introduced by the authors. It routes maximal sets of paths among "tight" edges to amortize search costs, specifically targeting performance gains on real-world data with many small integer costs.

The evaluation utilizes four dataset types: synthetic geometric data (CircleSquare), word embeddings (NLP), pixel intensities (MNIST), and color pixel distributions (CIFAR).

Key Insights: Combinatorial vs. Numerical Performance

A primary finding is that combinatorial methods consistently outperform numerical ones for computing OT distances. Even when Sinkhorn is permitted a 10% margin of error, it often remains an order of magnitude slower than an exact solver like Network Simplex.

Performance profile showing that combinatorial methods (Auction, KM-sparse) reach maximum dataset coverage at much lower performance factors than numerical methods (Sinkhorn, Greenkhorn).

The "high accuracy wall" is a significant hurdle for numerical methods. Achieving high precision requires increasing the regularization parameter ($\eta$), which leads to a super-linear increase in iterations and potential numerical instability. Furthermore, the rounding overhead required by Sinkhorn to produce feasible flows adds significant time without necessarily improving the objective value.

Key Results

The results demonstrate the dominance of combinatorial approaches across various scenarios:

  • Network Simplex Dominance: The Lemon NS implementation was the overall winner for exact computations.
  • Speed Comparisons: In assignment problems (unit demands), Batched KM and AuctionScaled were orders of magnitude faster than Sinkhorn. For instance, on the CS4900 dataset, Batched KM completed in ~1.35s compared to Sinkhorn's ~620s.
  • Non-Unit Demands: On MNIST and NLP datasets, Network Simplex remained faster than Sinkhorn, even when the latter only targeted a 1.1-approximation.
Comparison of runtimes between exact Lemon NS and 1.1-approximate Sinkhorn/Greenkhorn across MNIST and NLP datasets.

Limitations and Future Work

While combinatorial methods excel in raw speed for distance computation, Sinkhorn retains a critical advantage in deep learning: differentiability. This allows it to function as a loss function in backpropagation. Additionally, Sinkhorn is highly parallelizable on GPUs, a factor not fully explored in this CPU-focused study. Future research aims to develop differentiable analogs of high-performance combinatorial algorithms to combine their speed with the requirements of modern neural networks.

Summary updated

BibTeX
@misc{dong2020study,
  author = {Yihe Dong and Yu Gao and Richard Peng and Ilya P. Razenshteyn and Saurabh Sawlani},
  title = {{A Study of Performance of Optimal Transport}},
  year = {2020},
  eprint = {2005.01182},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2005.01182},
}
Figure