Optimal Importance Sampling for Federated Learning

Elsa Rizk, Stefan Vlaski, Ali H. SayedICASSP 2020

Abstract

Federated learning involves a mixture of centralized and decentralized processing tasks, where a server regularly selects a sample of the agents and these in turn sample their local data to compute stochastic gradients for their learning updates. The sampling of both agents and data is generally uniform; however, in this work we consider non-uniform sampling. We derive optimal importance sampling strategies for both agent and data selection and show that under convexity and Lipschitz assumptions, non-uniform sampling without replacement improves the performance of the original FedAvg algorithm. We run experiments on a regression and classification problem to illustrate the theoretical results.

Introduction

Federated Learning (FL) enables collaborative model training across decentralized agents—such as mobile devices or IoT sensors—without requiring the exchange of raw private data. The standard approach, FedAvg, typically relies on uniform sampling for both agent selection and local data batching. However, in heterogeneous (non-IID) environments, uniform sampling is often suboptimal because it fails to account for the varying informativeness of different data points and agents. This paper addresses this inefficiency by introducing optimal importance sampling strategies that prioritize the most relevant updates.

The ISFedAvg Algorithm

The proposed algorithm, ISFedAvg, introduces a two-level importance sampling mechanism performed without replacement. The core innovation lies in the derivation of optimal inclusion probabilities at two distinct levels:

  1. Agent Level: The server selects a subset of agents based on inclusion probabilities proportional to their local gradient magnitudes.
  2. Data Level: Each selected agent samples its local dataset using probabilities derived from individual data point gradient norms.

Since the true optimal probabilities depend on the final global model (which is unknown during training), the authors implement a practical approximation scheme using gradients from the previous iteration. This approach effectively focuses computational resources on the parts of the network that have the most to learn, minimizing the variance of the stochastic gradient updates.

Experimental Results

The researchers evaluated ISFedAvg using simulated datasets to maintain control over experimental variables, focusing on linear regression and logistic regression tasks.

Regression Performance

In the linear regression scenario involving 300 agents, the algorithm demonstrated significantly faster convergence in terms of Mean-Square Deviation (MSD). Notably, the experiments showed that the practical approximation scheme performed nearly as well as the theoretical optimal importance sampling, validating the feasibility of the approach in real-world settings.

Mean-Square Deviation (MSD) comparison for linear regression, showing that approximated importance sampling performs nearly as well as the theoretical optimal.

Classification Performance

In a classification task using logistic regression on non-IID data across 100 agents, ISFedAvg outperformed standard FedAvg by a wide margin. While the standard uniform sampling approach plateaued at a 2% testing error, the importance sampling approach continued to converge, reducing the error to nearly 0%.

Testing error comparison on a logistic regression task, demonstrating the superior convergence of ISFedAvg over standard FedAvg.

Discussion and Key Insights

The success of ISFedAvg stems from its ability to minimize noise in the learning process by prioritizing high-gradient samples. Key insights from the study include:

  • Two-Level Optimization: Simultaneously optimizing both agent and data selection provides a more robust solution for heterogeneous environments than focusing on either level alone.
  • Gradient as a Proxy: Gradient norms serve as an effective proxy for importance, capturing both data variability and model sub-optimality.
  • Robustness: The approximation scheme based on previous time steps is highly effective, mitigating the computational cost of calculating exact importance weights.

While the current theoretical guarantees rely on convexity assumptions, the empirical results suggest that gradient-based importance sampling is a powerful tool for accelerating federated learning in complex, non-IID landscapes.

Summary updated

BibTeX
@inproceedings{rizk2020optimal,
  author = {Elsa Rizk and Stefan Vlaski and Ali H. Sayed},
  title = {{Optimal Importance Sampling for Federated Learning}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2020},
  doi = {10.1109/icassp39728.2021.9413655},
}
Figure