Can Public Large Language Models Help Private Cross-device Federated Learning?

Boxin Wang, Yibo Jacky Zhang, Yuan Cao, Bo Li, H. Brendan McMahan, Sewoong Oh, Zheng Xu, Manzil Zaheer

TL;DR

This paper demonstrates how to leverage public large language models (LLMs) to significantly boost the performance of small, on-device models trained via Differentially Private Federated Learning (DP-FL). By combining knowledge distillation from LLMs with a novel distribution matching algorithm, the authors achieve state-of-the-art accuracy while using only a tiny fraction (0.08%) of public data, effectively bridging the gap between privacy and utility.

What Problem Does This Paper Address?

Training language models on personal devices (like smartphones) is a double-edged sword. Federated Learning (FL) allows models to learn from decentralized data without it ever leaving the device, but it isn't a silver bullet for privacy. To provide formal guarantees against data leakage, researchers use Differential Privacy (DP), which adds noise to the training process.

The catch? DP often severely degrades model performance (utility). Furthermore, on-device models must be small (often <10M parameters) due to hardware constraints, making them less capable than their massive cloud-based counterparts. The authors set out to answer: Can we use the "intelligence" of public, non-private LLMs to help these small, private models learn better and faster?

Methods

The researchers propose a three-pronged strategy to enhance private FL:

  1. Public Tokenizers: Instead of building a vocabulary from sensitive private data (which costs privacy budget), they use public sub-word tokenizers (like SentencePiece from Google's LaMDA). This handles out-of-vocabulary words better and provides a "free" utility boost.
  2. LLM Distillation: During pre-training, the small on-device "student" model doesn't just learn from raw text; it tries to mimic the output probability distributions of a massive "teacher" LLM. This transfers complex linguistic knowledge much more efficiently than standard training.
  3. Distribution Matching (The "Mid-training" Secret Sauce): The authors introduce a novel algorithm to select the most relevant public data. They privately train the on-device model for a few rounds to get a "sense" of the private data distribution. Then, they use both this private model and a public LLM to score public data samples. They only keep public records that are highly probable under both distributions.
Visualization of PPL distribution showing how private data concentrates in low-perplexity regions compared to diverse public data.

Datasets

  • Private Data: The StackOverflow benchmark dataset, which contains millions of questions and answers keyed by user, simulating a cross-device FL environment.
  • Public Data: The C4 (Colossal Clean Crawled Corpus) dataset, specifically the realnewslike variant. The authors rigorously verified there was no overlap between the public and private sets to ensure the integrity of their privacy claims.

Key Insights and Ideas

  • Tokenizers Matter: Switching from a private unigram tokenizer to a public LLM-based sub-word tokenizer significantly improved accuracy, especially under strict privacy regimes.
  • Efficiency through Distillation: Distilling from an LLM on just 1% of public data achieved better accuracy than pre-training on 100% of the same data without distillation.
  • The Power of "Mid-training": By selecting only 0.08% of public data that closely matches the private distribution, the authors achieved performance comparable to using the entire massive public corpus. This reduced pre-training time from over a week to just a few hours.
  • Theoretical Synergy: The authors proved that a combined estimator—using both public LLM knowledge and noisy private model updates—is theoretically superior to using either one alone for characterizing the private data distribution.

Key Results

The results show that "public help" is transformative for private models:

  • Accuracy Boost: Distillation led to a >7% accuracy improvement for on-device LSTMs under a tight privacy bound ($\epsilon = 1.77$).
  • Sample Efficiency: As shown in Figure 2, the distillation method converges extremely quickly. The "top-k" logit strategy (using the top 10 predictions from the LLM) was found to be the sweet spot for balancing dataset size and performance.
Ablation studies showing how distillation coverage and top-k logits impact accuracy.
  • Distribution Matching Success: Their "public mid-training" approach (Algorithm 1) allowed a model trained on a tiny, curated subset of public data to match the performance of a model trained on the full C4 dataset.

Limitations and Future Work

While the paper marks a significant step forward, the authors acknowledge a few hurdles:

  • Hyperparameter Sensitivity: The current method uses a fixed weight ($\beta = 0.5$) to combine public and private distribution estimates. Finding a way to dynamically optimize this weight for different datasets is an open question.
  • Resource Intensity: Even though sample efficiency is high, running distillation from a 2B-parameter LLM still requires substantial server-side computational resources.
  • Scaling Up: The study focused on a 2B-parameter teacher model; exploring whether even larger models (e.g., 175B+) provide diminishing returns or further breakthroughs is a promising future direction.

Summary updated

BibTeX
@inproceedings{wang2024can,
  author = {Boxin Wang and Yibo Jacky Zhang and Yuan Cao and Bo Li and H. Brendan McMahan and Sewoong Oh and Zheng Xu and Manzil Zaheer},
  title = {{Can Public Large Language Models Help Private Cross-device Federated Learning?}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.findings-naacl.59},
}
Figure