---
title: Sliced Wasserstein Distance
url: https://www.emergentmind.com/topics/sliced-wasserstein-distance-swd
type: topic
---

# Sliced Wasserstein Distance

The Sliced Wasserstein Distance (SWD) is a computational optimal transport metric that leverages one-dimensional projections to define tractable discrepancies between probability measures on high-dimensional spaces. SWD enjoys genuine metric structure, efficient Monte Carlo approximations via quantile sorting, and dimension-free statistical rates. Its fundamental properties and extensions have made it a core method in statistical machine learning, generative modeling, geometric data analysis, and scalable optimal transport.

## 1. Formal Definition and Metric Structure

Let $\mu, \nu$ be two Borel probability measures with finite $p$-th moments on $\mathbb R^d$. For a unit vector $\theta \in S^{d-1}$ (the unit sphere in $\mathbb R^d$), denote by $P_\theta: x \mapsto \langle\theta, x\rangle$ the one-dimensional projection. The pushforward (marginal) measures are $\mu_\theta = P_{\theta\#} \mu$, $\nu_\theta = P_{\theta\#} \nu$. The one-dimensional $p$-Wasserstein distance has a closed form in terms of quantile functions,
$$
W_p^p(\mu_\theta, \nu_\theta) = \int_0^1 |F_{\mu_\theta}^{-1}(t) - F_{\nu_\theta}^{-1}(t)|^p\, dt,
$$
where $F_{\mu_\theta}^{-1}$ is the quantile function. The $p$-Sliced Wasserstein distance is defined as
$$
SW_p(\mu, \nu) = \left( \int_{S^{d-1}} W_p^p(\mu_\theta, \nu_\theta)\, d\sigma(\theta) \right)^{1/p}
$$
with $\sigma$ the uniform measure over $S^{d-1}$ [2502.06525].

SWD is a bona-fide metric on $\mathcal{P}_p(\mathbb R^d)$ (the space of probability measures with finite $p$-th moment), satisfying non-negativity, symmetry, definiteness, and the triangle inequality. SWD metrizes the weak topology induced by $W_p$, and there exist constants $c_1, c_2>0$ (depending on compact support) such that $c_1 SW_p(\mu, \nu) \leq W_p(\mu, \nu) \leq c_2 SW_p(\mu, \nu)$ [2306.10601].

## 2. Computational and Statistical Properties

**Computational advantages** are central to the appeal of SWD. Each slice (projection) reduces the high-dimensional OT problem to a one-dimensional case; for discrete measures supported on $N$ points, the 1D $W_p$ requires $O(N\log N)$ (sorting-based) complexity per slice. Approximating the integral by averaging over $L$ random projections (Monte Carlo estimation) yields overall $O(L N \log N)$ complexity, independent of $d$ except for the cost to project.

**Sample complexity** of SWD is dimension-free: for log-concave distributions with covariance $\Sigma$, the empirical SWD converges at rate
$$
\mathbb{E}[SW_p^{avg}(\widehat{\mu}_n, \mu)] \lesssim_p \|\Sigma\|_{op}^{1/2} n^{-1/(2\vee p)}
$$
(with possible log factors at $p=2$), independent of the ambient dimension $d$ [2210.09160]. This circumvents the curse of dimensionality inherent to classical $W_p$.

Furthermore, for empirical SWD estimators over $m$ projections, the expected error decays as $O(m^{-1/2})$, with constants also dimension-free or even improving in $d$ under matching means and identity covariance—an instance of the "blessing of dimensionality" [2210.09160]. Concentration inequalities and limit theorems (including Banach-space CLTs) have been established in the $p=1$ case [2205.14624].

## 3. Generalizations and Variants

Several extensions and variants of classical SWD have been developed to focus on informative projections or adapt to non-Euclidean settings.

**Max-Sliced Wasserstein (MSW):**
$$
MSW_p(\mu, \nu) = \max_{\theta \in S^{d-1}} W_p(\mu_\theta, \nu_\theta)
$$
emphasizes the largest discrepancy direction. While affording greater discrimination power, estimation and optimization are typically nonconvex [2210.09160, 2205.14624].

**Adaptive and Distributional Sliced Wasserstein:** Rather than averaging over the uniform measure, adaptive schemes learn a slicing measure concentrated on discriminative directions. Distributional Sliced Wasserstein (DSW) finds a measure $\psi$ on $S^{d-1}$ maximizing
$$
DSW_\lambda(\mu, \nu) = \sup_{\psi \in \mathcal{P}(S^{d-1})} \mathbb{E}_{\theta \sim \psi}[W_2(\mu_\theta, \nu_\theta)] - \lambda R(\psi)
$$
where $R(\psi)$ penalizes directional alignment. DSW interpolates between classic SW (uniform $\psi$) and MSW (atomic $\psi$) [2002.07367].

**Energy-Based SW (EBSW):** The slicing law is specified via an energy function of the projected Wasserstein cost, $p(v) \propto f(W_p^p(P_v, Q_v))$ for monotone $f$, concentrating samples on informative directions—no parametric optimization required. It is a semi-metric, satisfies SW $\leq$ EBSW $\leq$ MSW $\leq W_p$, and admits practical estimators with similar computational complexity to SW [2304.13586].

**Manifold and Spherical Extensions:** SWD has been defined on Cartan–Hadamard manifolds via geodesic projections and on the sphere using the spherical Radon transform, yielding analogues like CH–Sliced Wasserstein and Spherical Sliced Wasserstein (SSW) for manifold-valued data [2403.06560, 2206.08780].

**Multi-marginal SW:** Sliced multi-marginal Wasserstein (SMW) integrates multi-marginal 1D OT, providing a generalized metric with dimension-free sample complexity and connections to Wasserstein barycenters, used in multitask and reinforcement learning [2102.07115].

## 4. Algorithmic Developments and Practical Estimation

**Monte Carlo SWD:** The expectation over the sphere is approximated by $L$ iid (or orthogonal) samples $\theta_1, ..., \theta_L$, with the SWD empirical estimator
$$
\widehat{SW}_p^p(\mu, \nu) = \frac{1}{L} \sum_{\ell=1}^L W_p^p(\mu_{\theta_\ell}, \nu_{\theta_\ell}).
$$
Variance reduction via orthogonal projections or control variates (e.g., using Gaussian approximations to projected marginals) can yield significant acceleration, especially in large-scale or deep learning settings [1903.03784, 2305.00402].

**Streaming and Deterministic Approximations:** Recent approaches support SWD computation on streaming data via compact quantile sketches for each projection, enabling constant-memory and single-pass computation with theoretical error guarantees [2505.06835]. Under high-dimensional weak dependence, the SWD of two measures can be closely approximated by a deterministic expression derived from their means and second moments, with sublinear error in $d$ and dramatic speed gains [2106.15427].

**Learning Orthogonal Projections:** For integration in neural nets, both AEs and GANs can be equipped with differentiable SWD blocks, which learn a small set of orthogonal projections aligned with data discrepancies. This approach dramatically reduces the number of required projections relative to random sampling, yielding efficient and end-to-end differentiable objectives with competitive or superior performance [1706.02631].

## 5. Gradient Flows, Stability, and Optimization

Minimizing $F(\mu) = \tfrac{1}{2} SW_2^2(\mu, \rho)$ via gradient flows defines a formal Wasserstein gradient flow
$$
\partial_t\mu_t + \nabla \cdot (v_{\mu_t} \mu_t) = 0,
$$
with explicit velocity field $v_\mu$ defined via barycentric projections of 1D optimal plans across all directions. Existence, uniqueness, and convergence properties are governed by the semi-convexity of $F$ along Wasserstein geodesics. In particular, measures that concentrate mass along line segments cannot be stable critical points—any such configuration is a saddle, not a local minimum. Discrete gradient flows admit particle approximations with provable monotonicity and collision-avoidance, and only the target measure can be a stable absolutely continuous critical point under mild regularity [2502.06525].

## 6. Robustness, Statistical Guarantees, and Applications

**Robustness:** SWD exhibits minimax-optimal, dimension-free robust estimation risk under contamination, and sliced 1-Wasserstein is tightly linked to robust mean estimation—algorithms and guarantees for the latter directly transfer [2210.09160]. This robustness is critical in high-dimensional inference and contaminated or heavy-tailed settings.

**Statistical Estimation and Testing:** Central limit theorems, empirical process theory, and concentration inequalities for both SWD and its max-sliced variant underpin applications in hypothesis testing and model comparison [2205.14624].

**Applications:** SWD is now central in generative modeling (SWAE, SWGAN variants), point-cloud analysis, density estimation on manifolds (SSW), representation learning, and regression with distributional responses. Its statistical and computational scalability enable image, video, and 3D shape synthesis at high resolutions, distribution regression, and multi-task structure transfer, among others [1706.02631, 2306.10601, 2102.07115, 2206.08780].

## 7. Limitations, Open Problems, and Practitioner Guidance

**Curse of uninformative projections:** In high dimensions, most random projections are nearly orthogonal to data subspaces and thus “uninformative.” Theoretical analysis shows that under a $k$-dimensional subspace model, a global rescaling of SWD by a constant factor suffices to match low-dimensional ground truth, justifying simple learning rate adjustment in practice rather than more complex slicing-adaptation schemes [2411.10651].

**Slice distribution learning vs. complexity:** Adapting or learning the slicing distribution (PAC-SW, DSW, EBSW) can enhance contrast and learning speed but at the cost of additional complexity, tuning, or instability. Many recent findings suggest that well-chosen, classical SWD metrics—properly scaled—can match or surpass these variants in common workflows.

**Parameter selection:** For gradient-based learning, recommended practice is $p=2$ for gradient stability, $L=50\text{--}100$ projections per minibatch, and tuning the learning rate $\eta$ over several orders of magnitude, with no need for explicit subspace estimation [2411.10651].

**Summary Table: Core Algorithmic Components**

| Component              | Typical Complexity  | Role                            |
|------------------------|--------------------|---------------------------------|
| 1D $W_p$ (sorting)     | $O(N\log N)$       | Per projection                  |
| Monte Carlo SWD        | $O(LN\log N)$      | $L$ projections                 |
| Streaming SWD          | $O(L n/k + Lk + Ldn)$ | Quantile sketches, streaming |
| Variance-reduced SWD   | $O(LN\log N)$      | Leverages control variates      |
| Deterministic SWD est. | $O(dn)$            | For high $d$, fast CLT approx   |

Practitioners should consider the structure of their data (e.g., subspace concentration), computational resources, and need for discriminative slicing when choosing between classical SWD, its adaptive variants, or control-variates and streaming schemes.

---

**References:**  
- [2502.06525] Properties of Wasserstein Gradient Flows for the Sliced-Wasserstein Distance  
- [1706.02631] Sliced Wasserstein Generative Models  
- [2210.09160] Statistical, Robustness, and Computational Guarantees for Sliced Wasserstein Distances  
- [2304.13586] Energy-Based Sliced Wasserstein Distance  
- [2002.07367] Distributional Sliced-Wasserstein and Applications to Generative Modeling  
- [2206.03230] Shedding a PAC-Bayesian Light on Adaptive Sliced-Wasserstein Distances  
- [2403.06560] Sliced-Wasserstein Distances and Flows on Cartan-Hadamard Manifolds  
- [2505.06835] Streaming Sliced Optimal Transport  
- [2411.10651] Understanding Learning with Sliced-Wasserstein Requires Rethinking Informative Slices  
- [1903.03784] Orthogonal Estimation of Wasserstein Distances  
- [2306.10601] Sliced Wasserstein Regression  
- [2102.07115] Sliced Multi-Marginal Optimal Transport  
- [2205.14624] Central limit theorem for the Sliced 1-Wasserstein distance and the max-Sliced 1-Wasserstein distance  
- [2305.00402] Sliced Wasserstein Estimation with Control Variates  
- [2106.15427] Fast Approximation of the Sliced-Wasserstein Distance Using Concentration of Random Projections  
- [2206.08780] Spherical Sliced-Wasserstein  
- [2509.20508] Fast Estimation of Wasserstein Distances via Regression on Sliced Wasserstein Distances

Source: https://www.emergentmind.com/topics/sliced-wasserstein-distance-swd