The Unbalanced Gromov Wasserstein Distance: Conic Formulation and Relaxation

Thibault Séjourné, François‐Xavier Vialard, Gabriel Peyré

Abstract

Comparing metric measure spaces (i.e., a metric space endowed with a probability distribution) is at the heart of many machine learning problems. The most popular distance between such spaces is the Gromov-Wasserstein (GW) distance, which is the solution of a quadratic assignment problem. However, GW is limited to probability distributions. To alleviate this, we introduce two Unbalanced Gromov-Wasserstein formulations: a distance and a more tractable upper-bounding relaxation. Both allow the comparison of metric spaces equipped with arbitrary positive measures up to isometries. The first formulation is a positive and definite divergence based on a relaxation of the mass conservation constraint using a novel type of quadratically-homogeneous divergence. This works with entropic regularization and an efficient, GPU-friendly iterative scheme. The second formulation is a distance between mm-spaces up to isometries based on a conic lifting. Numerical experiments on synthetic examples and domain adaptation data highlight the salient features of the unbalanced divergence.

Introduction

In machine learning, comparing datasets across different metric spaces—such as matching 3D molecular structures to 2D graphs or aligning word embeddings from different languages—is a fundamental challenge. The Gromov-Wasserstein (GW) distance is a powerful tool for this, as it compares the internal geometry (pairwise distances) of spaces rather than absolute coordinates.

However, standard GW requires both datasets to be probability distributions with a total mass of one. This "balanced" constraint forces the algorithm to match every point, leading to distortions when datasets contain outliers, noise, or varying numbers of points. This paper introduces the Unbalanced Gromov-Wasserstein (UGW) divergence and the Conic Gromov-Wasserstein (CGW) distance to overcome these limitations.

Methodology

The authors propose two complementary formulations:

  1. Unbalanced Gromov-Wasserstein (UGW): A tractable relaxation that replaces strict mass conservation with quadratic $\phi$-divergences (e.g., Kullback-Leibler). This "soft" constraint allows for mass creation and destruction, enabling the algorithm to ignore outliers if the geometric cost of matching them is too high.
  2. Conic Gromov-Wasserstein (CGW): A theoretical distance defined by "lifting" metric spaces into a mathematical cone where mass is treated as a coordinate. The authors prove that UGW serves as a computationally efficient upper bound for CGW.

To solve the non-convex UGW problem, the paper introduces an alternate Sinkhorn minimization scheme. By applying entropic regularization, the optimization becomes a series of highly parallelizable iterations suitable for GPU acceleration.

Experimental Evaluation

The proposed methods were evaluated on synthetic shapes and the Caltech Office domain adaptation benchmark.

Outlier Robustness and Alignment

A key advantage of UGW is its ability to perform "lazy" transport—paying a penalty to ignore an outlier rather than distorting the alignment to include it.

Comparison of standard GW and UGW matching on synthetic datasets. GW (left panels) produces distorted, cross-cluster matches to satisfy mass conservation, while UGW (right panels) correctly identifies cluster correspondences by relaxing these constraints.

Key Results

  • Positive-Unlabeled (PU) Learning: UGW achieved competitive accuracy (~85-90%) on Caltech-Office tasks, matching or exceeding specialized state-of-the-art methods like Partial-GW.
  • Cross-Feature Alignment: UGW successfully matched disparate feature types (e.g., Surf to Decaf) across domains, where balanced methods typically fail to find coherent mappings.

Discussion

While UGW offers significant flexibility, it inherits the non-convexity of the GW framework, making results sensitive to initialization. Additionally, while GPU-optimized, the $O(n^3)$ complexity remains a challenge for very large datasets. Future work may explore debiasing the entropic regularization or developing hierarchical approximation schemes to scale the method further.

Summary updated

Abstract

Comparing metric measure spaces (i.e. a metric space endowed with aprobability distribution) is at the heart of many machine learning problems. The most popular distance between such metric measure spaces is theGromov-Wasserstein (GW) distance, which is the solution of a quadratic assignment problem. The GW distance is however limited to the comparison of metric measure spaces endowed with a probability distribution. To alleviate this issue, we introduce two Unbalanced Gromov-Wasserstein formulations: a distance and a more tractable upper-bounding relaxation.They both allow the comparison of metric spaces equipped with arbitrary positive measures up to isometries. The first formulation is a positive and definite divergence based on a relaxation of the mass conservation constraint using a novel type of quadratically-homogeneous divergence. This divergence works hand in hand with the entropic regularization approach which is popular to solve large scale optimal transport problems. We show that the underlying non-convex optimization problem can be efficiently tackled using a highly parallelizable and GPU-friendly iterative scheme. The second formulation is a distance between mm-spaces up to isometries based on a conic lifting. Lastly, we provide numerical experiments onsynthetic examples and domain adaptation data with a Positive-Unlabeled learning task to highlight the salient features of the unbalanced divergence and its potential applications in ML.
BibTeX
@inproceedings{sejourne2021unbalanced,
  author = {Thibault Séjourné and François‐Xavier Vialard and Gabriel Peyré},
  title = {{The Unbalanced Gromov Wasserstein Distance: Conic Formulation and Relaxation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=PFSqfPhGFro},
}
Figure