NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Wasserstein Wormhole: Scalable Optimal Transport Distance with Transformers

Doron Haviv, Russell Zhang Kunes, Thomas Dougherty, Cassandra Burdziak, Tal Nawy, Anna Gilbert, Dana Pe'erarXiv 2024 · DOI

Abstract

Comparing large-scale point cloud datasets using Optimal Transport (OT) is computationally prohibitive due to its quadratic complexity. We present Wasserstein Wormhole, a transformer-based framework that learns to embed point clouds into a Euclidean latent space where distances approximate the Wasserstein metric. This approach reduces the cost of pairwise comparisons from $O(n^2)$ to $O(d)$, enabling the analysis of massive cohorts that were previously unreachable.

Introduction

The Wasserstein metric is a powerful tool for comparing probability distributions as it accounts for the underlying geometry of the data. However, its $O(n^2)$ computational cost for point clouds of size $n$ creates a significant bottleneck when analyzing cohorts of $N$ distributions, where total complexity scales as $O(N^2 \cdot n^2)$. Wasserstein Wormhole addresses this by "linearizing" the process: mapping each distribution to a fixed-dimensional embedding such that Euclidean distance in the latent space reflects the expensive Wasserstein distance.

Methods

The architecture consists of a permutation-invariant Transformer encoder and a decoder designed to handle unordered sets of variable size.

Architecture of the Wasserstein Wormhole, showing the transition from Wasserstein distance in the input space to Euclidean distance in the latent encoding space.
  1. Transformer Encoder: Maps point clouds to a latent vector $\alpha$. The attention mechanism ensures the model is permutation invariant.
  2. Wormhole Loss: The model minimizes the "stress"—the discrepancy between latent Euclidean distances and true Wasserstein distances computed on training mini-batches. This acts as a deep-learning version of Multidimensional Scaling (MDS).
  3. Decoder: A second transformer reconstructs the original point cloud from $\alpha$, ensuring the latent space preserves generative structure and allows for "distributional arithmetic" like computing Wasserstein Barycenters.

Key Results

The model demonstrates exceptional accuracy and scalability across diverse datasets, including 2D MNIST images, 3D CAD models, and high-dimensional biological data.

Comparison of run time versus cohort size for Wasserstein Wormhole against traditional Sinkhorn and Meta OT methods.
  • Accuracy: Wormhole embeddings achieve a Pearson correlation of $\rho \approx 0.98$ to $0.99$ with ground-truth OT distances.
  • Scalability: While traditional Sinkhorn solvers would take a week to process 70,000 MNIST samples, Wormhole completes the task in 10 minutes. As shown in the performance benchmarks, Wormhole maintains near-constant inference time as cohort sizes grow, whereas traditional methods scale poorly.
  • Generalization: The model generalizes well to out-of-distribution classes, maintaining accurate distance approximations for unseen data categories (e.g., training on Fashion-MNIST but testing on excluded classes).

Conclusion

Wasserstein Wormhole provides a scalable "shortcut" for OT analysis. By transforming a quadratic-time bottleneck into a near-instantaneous operation, it opens new possibilities for large-scale geometric data analysis in fields like single-cell biology and 3D computer vision. Future work will focus on extending the framework to non-uniform weights and reducing initial training overhead.

Summary updated

BibTeX
@misc{haviv2024wasserstein,
  author = {Doron Haviv and Russell Zhang Kunes and Thomas Dougherty and Cassandra Burdziak and Tal Nawy and Anna Gilbert and Dana Pe'er},
  title = {{Wasserstein Wormhole: Scalable Optimal Transport Distance with Transformers}},
  year = {2024},
  eprint = {2404.09411},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2404.09411},
}
Figure