Inference-Time Personalized Federated Learning

Ohad Amosy, Gal Eyal, Gal Chechik

TL;DR

Existing Personalized Federated Learning (PFL) methods assume that all clients participate in training with labeled data, failing when an unseen, unlabeled client joins post-deployment. The authors introduce Inference-Time PFL (IT-PFL) and propose IT-PFL-HN, which pairs a permutation-invariant client encoder with a central hypernetwork to synthesize customized client models on demand. This approach outperforms existing FL and PFL baselines under distribution shifts while providing differential privacy guarantees for novel clients.

What Problem Does This Paper Address?

Standard Federated Learning (FL) aggregates updates across decentralized devices into a single global model, which often struggles when client data distributions vary widely. Personalized FL (PFL) addresses this by fitting custom models per client, but it relies on a major assumption: every client must participate in training and possess labeled data.

In practical deployments (e.g., speech recognition apps or diagnostic tools), new clients frequently arrive after training has concluded. These novel clients typically have:

  1. No ground-truth labels.
  2. Distinct data distributions (covariate shift) relative to the training clients.

Standard FL provides only a generic global model, while traditional PFL methods have no mechanism to generate a personalized model for an unseen client.

Methods

The authors formulate the IT-PFL setting and design IT-PFL-HN, consisting of two core components:

[Novel Client: Unlabeled Data {x_k}] 
          │
          ▼
   [Client Encoder g_γ] ──► Client Embedding (ê_new) ──(+ DP Noise)──► [Server: Hypernetwork f_θ]
                                                                               │
[Locally Deployed Personalized Model h_new] ◄──────────────────────────────────┘
  1. Client Encoder ($g_\gamma$): Uses a permutation-invariant Deep Sets architecture (combining per-sample feature extraction with global-mean and global-max pooling) to map a batch of raw, unlabeled data into a dense client embedding vector.
  2. Central Hypernetwork ($f_\theta$): A neural network situated on the server that maps client embeddings to the parameter space of the target task model.
  3. Training Protocol:
  4. Client embeddings and the hypernetwork are first trained jointly on labeled training clients.
  5. The encoder is trained concurrently via mean squared error to predict these learned client embeddings directly from raw input data.
  6. The hypernetwork is then fine-tuned end-to-end on top of the frozen encoder representations.
  7. Inference & Differential Privacy (DP):
  8. At test time, a novel client downloads the encoder, computes its embedding locally, and can add calibrated Gaussian noise for $(\epsilon, \delta)$-Differential Privacy before sending the embedding to the server.
  9. The server queries the hypernetwork with the client embedding and sends back a custom, personalized model.

The authors also derive theoretical generalization bounds for novel clients by unifying multi-task learning covering-number bounds with domain-adaptation divergence metrics ($\mathcal{H}\Delta\mathcal{H}$-distance).

Datasets

The authors evaluated IT-PFL-HN across synthetic and real-world federated benchmarks:

  • CIFAR-10 & CIFAR-100: Evaluated under both pathological splits (allocating 2 or 5 random classes per client) and Dirichlet allocations ($\alpha \in \{0.1, 0.25, 0.5, 1, 10\}$) to simulate varying degrees of non-IID label skew.
  • Corrupted CIFAR-10: Novel client data subjected to five sensor/environment corruptions (blur, rotation, brightness, contrast, saturation).
  • iNaturalist (Geo-300 and Geo-1k): 1,203 species classes partitioned across 1,208 and 368 geographic user splits, evaluated using pretrained MobileNetV2 embeddings.
  • Google Landmarks (User-160k): 2,028 landmark classes across 1,262 author-partitioned users, also using MobileNetV2 features.

Key Insights and Ideas

  • Continuous Client Space vs. Discrete Client IDs: Instead of memorizing discrete client identifiers, the model learns a continuous representation space of client distributions. Unseen clients are simply interpolated within this space.
  • Unsupervised Personalization at Zero Local Training Cost: Novel clients never need to run local backpropagation, compute pseudo-labels, or share raw data; they simply run a forward pass through the encoder to obtain their custom model weights.
  • Sensitivity Drops as Data Grows: Because the Deep Sets encoder averages sample representations, its sensitivity scales as $\mathcal{O}(1/|D|)$. This allows novel clients with moderate unlabeled sample counts to achieve strong differential privacy guarantees ($\epsilon = 0.3$) with negligible noise impact on accuracy.

Key Results

  • CIFAR Benchmarks: Under extreme skew ($\alpha = 0.1$), IT-PFL-HN achieved 61.3% on CIFAR-10 and 24.4% on CIFAR-100, outperforming FedAvg (58.7% and 17.9%) and nearest-neighbor client model selection (pFedHN-nearest, 63.1% and 14.3%).
  • Large Domain Shift & Corruptions: As KL-divergence between the novel client and training clients grew, IT-PFL-HN degraded significantly slower than FedAvg. On corrupted CIFAR-10, IT-PFL-HN led across all five corruptions (e.g., 53.45% vs. 47.48% FedAvg on saturation; 46.17% vs. 42.57% FedAvg on blur).
  • Real-World Benchmarks:
  • iNaturalist Geo-1k: 41.57% accuracy, substantially beating FedAvg (36.89%) and pFedHN-ensemble (36.55%).
  • Landmarks User-160k: 39.4% accuracy, slightly edging out the communication-heavy ensemble baseline (39.08%) while transmitting only a single model.
  • Privacy Trade-off: With $n \ge 3,000$ unlabeled samples per novel client, local differential privacy ($\epsilon = 0.3, \delta = 0.01$) preserved accuracy without performance degradation.

Limitations and Future Work

  • Performance Trade-off on Seen Clients: Fine-tuning the hypernetwork with the client encoder slightly degrades test accuracy on the original labeled training clients (though the server could store checkpointed weights for existing clients).
  • Unlabeled Sample Size Requirements: Effective local embedding estimation and low-noise differential privacy depend on having access to sufficiently large unlabeled pools ($n \ge 1,000\text{--}3,000$ samples).
  • Covariate Shift Assumption: The theoretical bounds and encoder design rely on consistent conditional distributions $P(y|x)$ (covariate shift), meaning performance may drop under concept drift where label definitions vary by user.

Summary updated

BibTeX
@inproceedings{amosy2022inference,
  author = {Ohad Amosy and Gal Eyal and Gal Chechik},
  title = {{Inference-Time Personalized Federated Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=_DqUHcsQfaE},
}
Figure