Federated Learning with Heterogeneous Architectures using Graph HyperNetworks

Or Litany, Haggai Maron, David Acuna, Jan Kautz, Gal Chechik, Sanja Fidler

TL;DR

Standard Federated Learning (FL) requires every participant to run the exact same neural network architecture, limiting real-world collaboration across edge devices or competitive organizations. This paper introduces FLHA-GHN, a framework that uses a shared Graph HyperNetwork to generate model parameters directly from private computational graph structures. This enables clients with completely different architectures to collaboratively train without ever revealing their private network designs or relying on proxy datasets.

What Problem Does This Paper Address?

Traditional FL algorithms like Federated Averaging (FedAvg) rely on coordinate-wise parameter averaging across clients. This creates a hard constraint: every client must share an identical neural architecture.

In practical multi-organization collaborations (e.g., competitive medical centers) or cross-device deployments (e.g., edge sensors and smartphones with varying compute budgets), this constraint breaks down:

  1. Devices require different network capacities.
  2. Organizations consider their network architectures proprietary trade secrets.

Existing alternatives rely on knowledge distillation over external, public proxy datasets or require disclosing model architectures to a central server. The authors tackle Federated Learning with Heterogeneous Architectures (FLHA) under strict privacy constraints: how can clients collaboratively learn without sharing raw data, without using external proxy data, and without disclosing their private model architectures?

Methods

Instead of sharing and averaging model weights, clients share and train a central Graph HyperNetwork (GHN):

  • Neural Architectures as Graphs: Each client models its private neural network as a directed computational graph $\mathcal{A} = (\mathcal{V}, \mathcal{E}, \mathcal{X})$, where nodes represent parametric layers (e.g., convolutions) or non-parametric operations (e.g., skip additions, concatenations), and edges indicate tensor flow. Initial node features encode layer types (kernel size, stride, channels, etc.).
  • The GHN Architecture: The hypernetwork consists of two stages:
  • A $T$-layer message-passing Graph Neural Network (GNN, using $T=6$) that contextualizes each layer based on its structural neighborhood in the computational graph.
  • A collection of small Multi-Layer Perceptrons (MLPs), each dedicated to a specific layer type, which map node embeddings directly into layer parameter weights.
  • Federated Optimization Loop:
  • The server broadcasts the current GHN parameters $(W_G, W_H)$ to all clients.
  • Each client locally feeds its private architecture graph into the GHN to instantiate client-specific weights $\theta_c$.
  • Clients compute task loss on local data and backpropagate gradients into the local GHN parameters.
  • Clients send their updated GHN weights back to the server, where they are aggregated using standard parameter averaging.
  • Initialization & Fine-Tuning: The authors develop a variance-scaled Xavier/Kaiming initialization tailored for hypernetworks. At inference, clients generate their model weights via the GHN and run a single fast local refinement epoch on the final classification head.
                    [ Central Server ]
                  (Aggregates GHN: W)
                      ▲          │
     Local GHN grads  │          │ Broadcasts shared GHN
                      │          ▼
       [ Client 1 ]              [ Client 2 ]
   Architecture: ResNet-18   Architecture: 10-Layer CNN
   Graph A1 ──► [ GHN ]      Graph A2 ──► [ GHN ]
                  │                         │
                  ▼                         ▼
            Weights θ1                Weights θ2

Datasets

  • CIFAR-10 & CIFAR-100: Standard natural image classification benchmarks (60,000 $32 \times 32$ images across 10 and 100 classes).
  • NIH ChestX-ray8: Medical imaging benchmark comprising 112,120 frontal-view X-ray images from 30,805 unique patients evaluated across 14 binary thoracic disease classification tasks.
  • Data Partitions: Data was split across 4, 8, and 16 clients using balanced splits and non-IID Dirichlet distributions ($\alpha \in \{0.1, 1, 100\}$).

The experimental architecture pool consists of four variants derived from ResNet-18 (varying depth and placement of skip connections), alongside a minimal 4-layer CNN used for generalization stress-testing.

Key Insights and Ideas

  • FedAvg is a Special Case: If all clients share the same network, the GNN implements an identity map, and the prediction MLPs are linear, FLHA-GHN mathematically collapses into standard FedAvg.
  • GNN Message Passing Encodes Architectural Context: Directly parameterizing layers by type fails because an early convolutional layer needs different parameters than a late one. The $T$-hop message passing in the GNN provides positional and topological context, which ablation experiments prove is critical to performance.
  • Compositional Generalization to Unseen Networks: Because GNNs operate over local structural motifs, a GHN trained on a set of architectures can initialize completely unseen network topologies (or smaller edge networks) "out of the box."

Key Results

  • Substantial Gains Over Baselines: On CIFAR-10 and CIFAR-100, FLHA-GHN consistently outperforms local training, adapted pFedHN, and ensemble distillation baselines.
  • Robustness in Low-Data Regimes: While local distillation collapses when local data volume is small, FLHA-GHN degrades gracefully. At 6.25% local data on CIFAR-100, FLHA-GHN achieves 46.9%–50.4% accuracy, beating local distillation (23.1%–30.0%) by 17 to 25 percentage points.
  • Clinical Imaging Efficacy: On the Chest X-ray benchmark, FLHA-GHN achieves superior mean AUC across all data splits (e.g., 74.0% AUC vs. 66.4% for distillation at 12.5% local data).
  • Rapid Convergence for Unseen Architectures: In leave-one-architecture-out experiments, held-out architectures initialized with the GHN matched fully federated performance within a fraction of the iterations needed when training from scratch.
  • Communication Efficiency: Reducing client-server communication frequency by $5\times$ dropped CIFAR-10 accuracy by less than 1%.

Limitations and Future Work

  • Fixed Set of Building Blocks: Networks must be composed from a predefined set of node types (e.g., specific kernel sizes and channel widths). Generalizing across completely disjoint architectural primitives remains an open challenge.
  • Gap to Identical-Architecture FL: While FLHA-GHN significantly beats distillation, it does not yet match the theoretical upper bound where all clients coordinate on the single most expressive architecture.
  • Severe Data Scarcity: Performance still degrades when local sample counts are extremely constrained, highlighting the need for more robust aggregation algorithms tailored for hypernetworks.

Summary updated

BibTeX
@inproceedings{litany2022federated,
  author = {Or Litany and Haggai Maron and David Acuna and Jan Kautz and Gal Chechik and Sanja Fidler},
  title = {{Federated Learning with Heterogeneous Architectures using Graph HyperNetworks}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=7x_47XJULn},
}
Figure