Federated Learning Hyperparameter Tuning From a System Perspective

Huanle Zhang, Lei Fu, Mi Zhang, Pengfei Hu, Xiuzhen Cheng, Prasant Mohapatra, Xin Liu

TL;DR

Federated Learning (FL) faces a significant challenge in optimizing hyperparameters like the number of clients and training passes, which heavily impact system overhead (computation, transmission, etc.) but are application-dependent. This paper introduces FedTune, an automatic, iterative hyperparameter tuning system that dynamically adjusts these parameters during training to minimize overall system overhead, achieving substantial reductions compared to manual tuning.

What Problem Does This Paper Address?

Federated Learning (FL) is a powerful approach for training machine learning models on decentralized data while preserving privacy. However, FL introduces unique hyperparameters beyond standard ML, such as the number of clients participating in each training round and the number of local training passes each client performs. These hyperparameters have a critical but complex impact on four key system overheads: Computation Time (CompT), Transmission Time (TransT), Computation Load (CompL), and Transmission Load (TransL).

The core problem is that different applications have diverse "training preferences" for these overheads. For instance, a real-time security system might prioritize low CompT and TransT, while a resource-constrained IoT device might focus on low CompL and TransL. Manually finding the optimal combination of hyperparameters that satisfies these varied preferences is a daunting task for FL practitioners, as these hyperparameters often have conflicting effects on the system overheads. For example, increasing the number of participants might speed up convergence (reducing CompT per round) but also increase the time per round, potentially negating the benefit. This paper aims to automate this complex tuning process.

Methods

The paper proposes FedTune, an automatic FL hyperparameter tuning algorithm designed to be integrated into existing FL systems. FedTune operates iteratively, adjusting hyperparameters during the FL training process itself.

The core of FedTune's approach involves:

  • Defining a System Overhead Objective: FedTune formulates a weighted objective function that combines the four system overheads (CompT, TransT, CompL, TransL) based on application-specific preferences (represented by weights $\alpha, \beta, \gamma, \delta$). The goal is to minimize this combined objective.
  • Iterative Optimization: Since the exact overheads for different hyperparameter settings are unknown a priori, FedTune uses an iterative approach. At each step, it estimates the impact of changing hyperparameters on the objective function.
  • Gradient-based Updates: FedTune calculates approximate gradients of the objective function with respect to the hyperparameters, specifically focusing on the number of participants ($M$) and the number of training passes ($E$). These gradients guide the adjustment of $M$ and $E$ for the next training round.
  • Penalty Mechanism: To prevent drastic or detrimental changes, FedTune incorporates a penalty mechanism. If a decision leads to a worse overall performance (as measured by a comparison function), the parameters that contributed to this degradation are penalized, making them less likely to be chosen again.
  • Adaptive Hyperparameter Adjustment: FedTune dynamically adjusts $M$ and $E$ based on the calculated gradients and the penalty mechanism. It aims to find a balance that satisfies the application's preferences while minimizing the overall system overhead.

The novelty lies in the online, iterative, and preference-aware nature of FedTune, directly addressing the conflicting effects of hyperparameters on system overheads during the training process.

Datasets

The paper utilizes the following datasets for evaluation:

  • Google Speech-to-Command Dataset: Used for voice command classification. This dataset exhibits the typical FL properties of being massively distributed, having unbalanced data, and non-IID data.
  • EMNIST Dataset: Used for handwriting recognition (digits and letters).
  • CIFAR-100 Dataset: Used for image classification.

The paper does not introduce new benchmark datasets but rather uses established ones to demonstrate FedTune's effectiveness across different data modalities and FL challenges.

Key Insights and Ideas

  • Conflicting Hyperparameter Effects: A major insight is the inherent conflict between different hyperparameters and system overheads. For example, increasing the number of participants ($M$) can improve accuracy per round but also increase the time per round, leading to complex trade-offs.
  • Application-Specific Tuning is Crucial: The paper strongly emphasizes that a one-size-fits-all approach to FL hyperparameters is suboptimal. Different applications have distinct priorities (e.g., speed vs. resource usage), necessitating tailored hyperparameter configurations.
  • Dynamic Tuning Outperforms Static: FedTune's iterative, online tuning approach demonstrates significant advantages over static, manually chosen hyperparameters. The system can adapt to changing conditions and learn optimal settings during training.
  • Model Complexity Matters: The study highlights that smaller models generally lead to better system overheads (CompT, TransT, CompL, TransL) for a given target accuracy. This suggests that model selection is a critical, often overlooked, aspect of FL system design.
  • Penalty Mechanism Stabilizes Tuning: The penalty mechanism is shown to be important for mitigating degradation and ensuring more stable performance, especially in cases where initial hyperparameter choices might be suboptimal.

Key Results

  • Significant System Overhead Reduction: FedTune achieved an average system overhead reduction of 8.48% to 26.75% across various datasets and aggregation methods compared to using fixed hyperparameters.
  • Substantial Gains in Specific Scenarios: In some application scenarios, FedTune achieved overhead reductions of up to 70.51%, particularly when the application prioritized computation load ($\gamma=1$).
  • Adaptability to Preferences: FedTune successfully adapted to different application preferences for CompT, TransT, CompL, and TransL, demonstrating its flexibility. For instance, when prioritizing computation load, it significantly reduced CompL.
  • Improved Stability: FedTune with the penalty mechanism showed improved stability, with a lower standard deviation in performance compared to a non-penalty counterpart.
  • Trace Analysis: Experiments showed that FedTune intelligently tunes $M$ and $E$ throughout the training process, not just monotonically increasing or decreasing them, suggesting a nuanced adaptation strategy.

Limitations and Future Work

  • Homogeneous Client Assumption: The current FedTune assumes homogeneous client devices (hardware and network). The paper acknowledges that real-world FL often involves heterogeneous devices, which would require more sophisticated, device-level hyperparameter tuning. This is identified as a key area for future work.
  • Adaptive Hyperparameter Adjustment Degrees: FedTune currently adjusts hyperparameters by only one unit at a time. The authors suggest exploring adaptive degrees of adjustment for faster convergence.
  • Extension to Other Hyperparameters: While FedTune demonstrated effectiveness for $M$ and $E$, the authors believe it's a general framework applicable to other FL hyperparameters like mini-batch size.
  • Participant Selection: The paper suggests extending FedTune to incorporate guided participant selection strategies beyond random selection, which could further enhance training performance.
  • Adaptive Training Passes: The authors propose supporting different numbers of training passes ($E$) across participants to better handle client heterogeneity.

Summary updated

BibTeX
@article{zhang2023federated,
  author = {Huanle Zhang and Lei Fu and Mi Zhang and Pengfei Hu and Xiuzhen Cheng and Prasant Mohapatra and Xin Liu},
  title = {{Federated Learning Hyperparameter Tuning From a System Perspective}},
  journal = {IEEE Internet of Things Journal},
  year = {2023},
  url = {https://openreview.net/forum?id=TXLpb522tfm},
}
Figure