Markovian Sliced Wasserstein Distances: Beyond Independent Projections

Khai Nguyen, Tongzheng Ren, Nhat Ho

Introduction

The Sliced Wasserstein (SW) distance is a popular, computationally efficient alternative to the standard Wasserstein distance. However, it relies on random, independent projections that are often uninformative. To address this, researchers have introduced Markovian Sliced Wasserstein (MSW) distances. By utilizing a first-order Markov chain to sequentially generate highly informative projections, MSW achieves better performance and faster convergence in tasks like generative modeling and color transfer, all while retaining strict mathematical guarantees.

The Problem with Independent Projections

Comparing two high-dimensional probability distributions is a core problem in machine learning. The standard Wasserstein distance (often conceptualized as Optimal Transport or "Earth Mover's Distance") is highly effective but computationally expensive.

To accelerate this process, the Sliced Wasserstein (SW) distance projects high-dimensional data down to 1D lines, calculates the cheaper 1D Wasserstein distance, and averages the results over many random directions. Because these directions are chosen independently and randomly, many are "uninformative"—they fail to capture meaningful differences between the two distributions.

Previous attempts to fix this include Max-SW (finding the single best projection direction) and Max-K-SW (finding $K$ orthogonal best directions). Unfortunately, these methods rely on gradient ascent optimization, which often gets stuck in local optima. Because they do not find the true global maximum, they lose their mathematical guarantee of being a valid "metric" (e.g., satisfying the triangle inequality). Furthermore, forcing projections to be strictly orthogonal is computationally expensive. The goal of MSW is to generate highly informative projections efficiently without sacrificing mathematical rigor.

The Markovian Sliced Wasserstein (MSW) Approach

Instead of drawing projection directions independently, MSW links them sequentially using a first-order Markov chain. This means the next projection direction depends entirely on the current one, allowing the sequence to "hunt" for the most informative angles.

The authors define specific variants based on how the next step is chosen:

  • Orthogonal-based transition (oMSW): The next direction is sampled uniformly but is constrained to be orthogonal to the previous one.
  • Input-aware transition (iMSW & viMSW): This method uses the data itself to steer the projections. It calculates the gradient of the distance between the two distributions to push the next projection toward the most discriminative direction.
  • iMSW takes a deterministic step in the direction of the gradient.
  • viMSW adds controlled randomness using a von Mises-Fisher (vMF) distribution centered around the gradient step, balancing the exploitation of the best direction with the exploration of new ones.

To save memory and compute time, MSW borrows Burning and Thinning techniques from Markov Chain Monte Carlo (MCMC) methods. The algorithm discards the first few uninformative projections ("burning") and only keeps every $N$-th projection ("thinning").

Key Results

Gradient Flows

MSW variants demonstrate significant improvements in gradient flow tasks, such as morphing a 2D blob of points into a target S-shape.

Gradient flows comparing SW, Max-SW, iMSW, and viMSW

As shown above, iMSW and viMSW converge to target distributions significantly faster than baselines. For example, iMSW achieved a lower Wasserstein-2 distance ($0.0064 \times 10^{-2}$ vs $0.0098 \times 10^{-2}$) in less than half the computational time of Max-SW (1.41s vs 3.48s) at step 300.

Color Transfer

In image processing tasks like color palette transfer, MSW produces visually superior results while drastically reducing the distance metric.

Color transfer results across different SW variants

Quantitatively, iMSW and viMSW dropped the Wasserstein distance metric to approximately 16-17, compared to a massive 414.51 for standard SW, while remaining computationally efficient. The visual fidelity of the transferred images closely matches the target palette without the artifacts seen in standard SW.

Deep Generative Models

MSW variants matched or outperformed existing methods in training deep generative models. On CIFAR10, viMSW achieved the best Fréchet Inception Distance (FID) of 13.98 (compared to SW's 14.21). On CelebA, iMSW hit an FID of 8.89 (vs SW's 8.93), all without increasing the overall training time.

Limitations and Future Work

While MSW preserves valid metric properties (non-negativity, symmetry, triangle inequality) by starting with a uniform prior distribution, some theoretical gaps remain. The exact stationary distribution of the Markov chain as time approaches infinity is still unclear for certain transition types.

Currently, the input-aware transitions use standard sub-gradient ascent. Future work could explore more advanced optimization techniques, such as momentum or adaptive step sizes. Additionally, the Markovian framework is highly adaptable and could be applied to other SW variants (like Generalized or Convolutional SW) for downstream tasks like clustering, Bayesian inference, and domain adaptation.

Summary updated

BibTeX
@inproceedings{nguyen2023markovian,
  author = {Khai Nguyen and Tongzheng Ren and Nhat Ho},
  title = {{Markovian Sliced Wasserstein Distances: Beyond Independent Projections}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=FT2q2B4cKZ},
}
Figure