Introduction
In Federated Learning (FL), a central server trains a global model using data distributed across many local clients without ever moving the raw data to the server. While this preserves privacy, it creates a challenge: how can we measure how different the datasets on two clients are? Knowing the distance between client datasets is crucial for evaluating data heterogeneity, clustering similar clients, or finding representative "coresets."
The paper introduces FedWaD (Federated Wasserstein Distance), a novel algorithm to compute the Wasserstein (Optimal Transport) distance between two datasets stored on separate clients without sharing the raw data. By cleverly leveraging the geometric properties of optimal transport, the method iteratively exchanges "interpolating measures" to estimate the distance.
The Geometry of Federated Optimal Transport
The authors solve the distributed measurement problem using the geometry of the Wasserstein distance. The Wasserstein metric satisfies the triangle inequality. If you have distributions $\mu$ (on Client A) and $\nu$ (on Client B), the distance $W(\mu, \nu)$ is exactly equal to $W(\mu, \xi^*) + W(\xi^*, \nu)$ if and only if $\xi^*$ is a point exactly on the shortest path—the geodesic—between them.
FedWaD turns this geometric property into an iterative, federated algorithm:
- The server guesses an intermediate distribution $\xi$ and sends it to the clients.
- Client A computes a new point on the geodesic between its data $\mu$ and $\xi$. Client B does the same for its data $\nu$ and $\xi$.
- The clients send these intermediate points back to the server.
- The server calculates a new, better guess for $\xi^*$ based on these points.
- Once converged, the clients compute their distance to the final $\xi^*$, and the server adds them together.
The Approximation Trick
A major challenge with exact optimal transport is that it creates intermediate measures with growing support sizes (the number of data points), which quickly becomes computationally heavy. To fix this, the authors introduce an approximation using McCann's interpolation and barycentric mapping. This forces the intermediate measures to have a fixed, small number of support points (e.g., 10 or 100), drastically reducing communication and computation costs without sacrificing utility.
Key Results and FL Performance Boosts
The authors evaluated FedWaD across toy datasets (2D/50D Gaussians) and image datasets (MNIST, FashionMNIST, KMNIST, USPS, CIFAR10).
- Speed and Efficiency: The approximated
FedWaDis at least 10x faster than exact optimal transport for sample sizes over 100, while maintaining a very low relative error (e.g., $10^{-3}$ on 2D Gaussians). - Accurate Dataset Distances:
FedWaDsuccessfully recovered the semantic distance matrix (Optimal Transport Dataset Distance, or OTDD) between various image datasets using only 20 communication epochs. - Tackling Heterogeneity: Heterogeneity is a primary cause of "client drift" in FL. By using
FedWaDto measure dataset distances, clients with similar data can be clustered together. Training FL models within these clusters—rather than globally—yielded massive performance uplifts. For instance, FedRep accuracy jumped by up to 29 points on MNIST and 9 points on CIFAR10 when client data had a cluster structure.
Limitations and Future Work
While FedWaD obfuscates data by only sharing intermediate interpolating measures, it does not currently offer formal Differential Privacy (DP) guarantees. Integrating DP-Wasserstein techniques is a necessary next step for strict privacy compliance. Additionally, like many Optimal Transport methods, FedWaD suffers from the curse of dimensionality, struggling to provide accurate absolute distance values in high-dimensional spaces. However, the relative ordering of distances remains preserved, allowing it to still perform exceptionally well for practical downstream tasks like clustering.
Summary updated