Computing Wasserstein Barycenters through Gradient Flows

Eduardo Fernandes Montesuma, Yassir Bendou, Mike GartrellarXiv 2025 · DOI

Introduction

Wasserstein barycenters are a fundamental tool for "averaging" probability distributions while preserving their intrinsic geometric properties. Despite their utility in fields ranging from computer vision to neuroscience, computing these barycenters at scale remains a significant challenge. Traditional discrete solvers often fail to handle large datasets due to memory constraints, while neural network-based approaches introduce complex min-max optimization hurdles. Furthermore, standard objectives often lack the flexibility to incorporate task-specific structural constraints, such as class separation.

The Wasserstein Gradient Flow Framework

This paper proposes a scalable and regularized framework that re-imagines the barycenter problem as a Wasserstein Gradient Flow (WGF). Instead of treating the barycenter as a static optimization target, the authors initialize a measure (e.g., Gaussian noise) and evolve it toward the optimal solution using a time-discretized continuity equation.

Conceptual illustration of the gradient flow and the effect of modular energy functionals on the resulting barycenter.

The core of this approach lies in its modularity and computational efficiency:

  • Time Discretization: A forward Euler scheme is employed to discretize the flow, resulting in an iterative update rule that is computationally straightforward to implement.
  • Vectorized Mini-batch OT: To achieve scalability, the authors compute Optimal Transport (OT) on small random samples. By ensuring every mini-batch has the same number of samples, the authors can stack Sinkhorn iterations into a single tensor operation. This leverages GPU parallelism to solve multiple OT problems simultaneously, bypassing the sequential bottlenecks of traditional solvers.
  • Modular Energy Functionals: The objective is decomposed into three distinct "energies":
  • Internal Energy ($\mathbb{B}$): Controls the smoothness or diffusion of the distribution (e.g., entropy).
  • Potential Energy ($\mathbb{V}$): Drives the samples toward specific regions of interest.
  • Interaction Energy ($\mathbb{U}$): Manages pairwise relationships between samples, such as enforcing a "repulsion" term to keep different classes from overlapping.

Key Insights: Labels and Inductive Bias

A standout contribution of this work is the integration of label information into the barycenter computation. By defining a metric that accounts for both data features ($x$) and labels ($y$), the authors create "labeled" barycenters. This provides a strong inductive bias, as even without explicit labels, feature embeddings often naturally cluster by class due to the geometry of the feature space. Explicitly incorporating this structure through a "repulsion" functional ensures that the resulting barycenter is task-aware, maintaining clear separation between classes—a critical requirement for downstream classification tasks where overlap leads to error.

Experimental Results and Performance

The WGF framework was validated across a diverse set of benchmarks, including synthetic datasets (the "Swiss Roll"), computer vision (Office 31, Office Home), neuroscience (EEG motor imagery and sleep staging), and chemical engineering (fault detection in the Tennessee Eastman Process).

Key findings include:

  • Significant Speedups: WGF achieved 2x to 50x speedups compared to traditional discrete solvers, largely due to the power of vectorization.
  • State-of-the-Art Accuracy: In Multi-Source Domain Adaptation (MSDA), the method consistently outperformed existing state-of-the-art solvers, including DaDiL and various neural barycenter methods, across all five benchmarks.
  • The Value of Supervision: Labeled barycenters consistently outperformed their unlabeled counterparts, demonstrating that structured costs are essential for practical machine learning performance.

Conclusion and Future Directions

The introduction of a gradient flow perspective for Wasserstein barycenters offers a powerful, scalable, and flexible alternative to existing methods. While the authors provide a convergence proof based on the Polyak-Łojasiewicz (PL) inequality, it is currently limited to "location-scatter" families of distributions (like Gaussians). Proving this for more general, non-convex distributions remains an open challenge. Additionally, for domain adaptation, the method relies on the quality of a pre-trained feature extractor (backbone). Future work aims to extend this framework to Riemannian manifolds and further integrate label information into purely continuous neural solvers.

Summary updated

BibTeX
@misc{montesuma2025computing,
  author = {Eduardo Fernandes Montesuma and Yassir Bendou and Mike Gartrell},
  title = {{Computing Wasserstein Barycenters through Gradient Flows}},
  year = {2025},
  eprint = {2510.04602},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.04602},
}
Figure