The Prospect of Enhancing Large-Scale Heterogeneous Federated Learning with Transformers

Yulan Gao, Zhaoxiang Hou, Chengyi Yang, Zengxiang Li, Han YuarXiv 2023

Introduction

Federated Learning (FL) has emerged as a critical framework for training machine learning models on decentralized, private data. However, two persistent challenges hinder its real-world deployment: data heterogeneity (non-IID data) and scalability. As the number of participants grows, the diversity of local data distributions typically causes global model performance to degrade. While researchers often turn to complex Personalized Federated Learning (pFL) algorithms to mitigate these issues, this study investigates whether a fundamental shift in model architecture—from Convolutional Neural Networks (CNNs) to Vision Transformers (ViTs)—can provide a more robust solution.

Methodology

The research evaluates the performance of Vision Transformers (ViTs) against ResNet-50 within a standard FL framework. Using the CIFAR-10 dataset, the authors simulated a highly heterogeneous environment by partitioning data such that each participant only accessed 4 out of 10 possible labels. The study tested scenarios with 10, 20, 50, and 100 participants under two conditions: fixed total data (where more clients mean less data per client) and fixed data per client.

To understand the underlying mechanics of model performance, the researchers employed Centered Kernel Alignment (CKA) to analyze the similarity of internal representations across different clients and layers throughout the training process.

The Performance Gap in Scaling

A primary finding of the study is the stark difference in how architectures handle scaling. In a 100-participant scenario, the ResNet-based global model experienced a dramatic accuracy drop of 44.55% compared to the 10-participant baseline. In contrast, the ViT-based model remained remarkably stable, maintaining a global accuracy of over 90%.

Figure 4: Accuracy comparison between ViT and ResNet across varying data scales (500 vs 1000 samples) and participant counts (10 to 100).

Furthermore, the ViT architecture outperformed state-of-the-art personalized FL methods. At the 100-client scale, ViT achieved 90.6% accuracy, significantly surpassing ResNet-based implementations of MOON (42.4%) and FedALA (49.7%).

Why Transformers Excel: Representation Consensus

The robustness of Transformers appears rooted in their "self-attention" mechanism, which captures global relationships rather than local pixel patterns. This makes them less sensitive to the specific distribution shifts of individual users.

CKA analysis revealed that ViTs achieve a "representation consensus" much earlier and more consistently than CNNs. As shown in the heatmaps below, the internal features learned by ViTs across different clients are highly similar from the early stages of training, facilitating more effective model aggregation at the central server.

Figure 6: CKA heatmaps illustrating that ViT layers reach higher representation similarity across clients much earlier in training compared to ResNet.

Conclusion and Future Directions

The study suggests that architecture choice is a more potent lever for scaling FL than algorithmic complexity. By adopting Transformers, developers can achieve high performance in heterogeneous environments without the overhead of specialized personalization loops.

However, challenges remain. Transformers are computationally intensive, posing potential hurdles for resource-constrained edge devices. Future research should explore the impact of pre-training on this robustness and determine if these advantages extend to other domains, such as Natural Language Processing and time-series analysis.

Summary updated

BibTeX
@misc{gao2023prospect,
  author = {Yulan Gao and Zhaoxiang Hou and Chengyi Yang and Zengxiang Li and Han Yu},
  title = {{The Prospect of Enhancing Large-Scale Heterogeneous Federated Learning with Transformers}},
  year = {2023},
  eprint = {2308.03945},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2308.03945},
}
Figure