Tree-Sliced Approximation of Wasserstein Distances.

Tam Le, Makoto Yamada, Kenji Fukumizu, Marco Cuturi

Abstract

Optimal Transport (OT) provides a mathematically rigorous framework for comparing probability distributions, yet its cubic computational complexity ($O(n^3)$) often renders it impractical for large-scale datasets. This paper introduces Tree-Sliced Wasserstein (TSW) distances, a scalable alternative that approximates complex data geometries using random tree structures. By leveraging the closed-form solution of Wasserstein distances on trees, TSW achieves significant speedups—often orders of magnitude faster than exact OT—while preserving competitive accuracy in applications such as document classification and topological data analysis.

Introduction

Comparing probability distributions is a fundamental task in machine learning, from word frequency analysis in documents to point cloud comparison in computer vision. While the Wasserstein distance (or Earth Mover's Distance) is a robust metric for these tasks, it faces two primary hurdles: high computational cost and poor statistical efficiency in high dimensions.

Existing solutions like Sliced Wasserstein (SW) project data onto random 1D lines to utilize fast closed-form solutions. However, 1D projections frequently fail to capture the intricate, multi-dimensional structures of complex data. This research proposes a more flexible geometry—the tree metric—which remains computationally efficient while offering greater structural representation.

The Tree-Sliced Wasserstein Framework

The core innovation lies in using tree metrics as the ground cost for Optimal Transport.

Tree-Wasserstein (TW)

When the distance between points is defined by the shortest path on a tree, the Wasserstein distance admits a closed-form solution. It is calculated as the weighted sum of the differences in mass across every edge of the tree. This transformation turns a complex optimization problem into a simple weighted $\ell_1$ distance calculation between feature maps.

A tree structure illustrating the Tree-Wasserstein distance calculation, where distances are computed as weighted sums across edges $e_i$ connecting nodes $x_i$.

Slicing with Trees

Similar to how SW averages results over multiple random lines, Tree-Sliced Wasserstein (TSW) averages the TW distance over multiple random trees. This averaging process smooths out errors introduced by any single tree structure and provides a more robust distance metric. The authors propose two primary methods for tree construction:

  1. Partition-based (Quadtrees): Suitable for low-dimensional data, recursively splitting space into hypercubes.
  2. Clustering-based: Designed for high-dimensional data, using farthest-point clustering to adaptively build trees based on the data distribution.

Furthermore, the authors prove that the TSW distance is "negative definite," enabling the creation of a positive definite kernel ($k = \exp(-t \cdot TSW)$) for use with Support Vector Machines (SVMs) and other kernel-based methods.

Experimental Evaluation

The TSW method was evaluated across two distinct domains: document classification and Topological Data Analysis (TDA).

Document Classification

Using word embeddings to represent documents as distributions of words, TSW was tested on datasets including TWITTER, RECIPE, CLASSIC, and AMAZON. On the CLASSIC dataset, TSW completed computations in less than 3 hours, whereas exact OT (Word Mover's Distance) required more than 8 days. Despite the speedup, TSW consistently outperformed Sliced Wasserstein and remained competitive with exact OT.

Topological Data Analysis

In TDA, TSW was used to compare persistence diagrams for tasks such as orbit recognition in dynamical systems and object shape classification (MPEG7). TSW frequently outperformed specialized kernels, demonstrating that tree structures are particularly well-suited for the "birth-death" coordinates characteristic of persistence diagrams.

Key Insights

  • Generalization of Slicing: Sliced Wasserstein is a special case of TSW where the tree is a simple chain. Trees offer significantly more degrees of freedom to capture data structure.
  • Regularization Effect: Exactly solving the OT problem can sometimes lead to overfitting. The inherent "distortion" of tree metrics can act as a form of regularization, improving generalization on unseen data.
  • Efficiency: The closed-form solution allows TSW to scale linearly with the number of points, making it viable for massive datasets.

Conclusion

Tree-Sliced Wasserstein distances bridge the gap between the computational efficiency of 1D slicing and the structural richness of exact Optimal Transport. By transforming OT into a weighted $\ell_1$ problem on trees, TSW provides a powerful, scalable tool for modern machine learning. Future work may explore parametric inference, where tree structures or weights are learned dynamically as part of a neural network architecture.

Summary updated

BibTeX
@inproceedings{le2019tree,
  author = {Tam Le and Makoto Yamada and Kenji Fukumizu and Marco Cuturi},
  title = {{Tree-Sliced Approximation of Wasserstein Distances.}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2019},
  url = {https://openreview.net/forum?id=d3oVU9z6PJD},
}
Figure