A Scalable Method for Partially Native Federated Studying


Federated studying allows customers to coach a mannequin with out sending uncooked knowledge to a central server, thus avoiding the gathering of privacy-sensitive knowledge. Usually that is achieved by studying a single international mannequin for all customers, despite the fact that the customers might differ of their knowledge distributions. For instance, customers of a cell keyboard software might collaborate to coach a suggestion mannequin however have completely different preferences for the strategies. This heterogeneity has motivated algorithms that may personalize a worldwide mannequin for every person.

Nevertheless, in some settings privateness concerns might prohibit studying a totally international mannequin. Think about fashions with user-specific embeddings, equivalent to matrix factorization fashions for recommender methods. Coaching a totally international federated mannequin would contain sending person embedding updates to a central server, which might probably reveal the preferences encoded within the embeddings. Even for fashions with out user-specific embeddings, having some parameters be utterly native to person gadgets would scale back server-client communication and responsibly personalize these parameters to every person.

Left: A matrix factorization mannequin with a person matrix P and gadgets matrix Q. The person embedding for a person u (Pu) and merchandise embedding for merchandise i (Qi) are skilled to foretell the person’s score for that merchandise (Rui). Proper: Making use of federated studying approaches to be taught a worldwide mannequin can contain sending updates for Pu to a central server, probably leaking particular person person preferences.

In “Federated Reconstruction: Partially Native Federated Studying”, offered at NeurIPS 2021, we introduce an method that permits scalable partially native federated studying, the place some mannequin parameters are by no means aggregated on the server. For matrix factorization, this method trains a recommender mannequin whereas preserving person embeddings native to every person machine. For different fashions, this method trains a portion of the mannequin to be utterly private for every person whereas avoiding communication of those parameters. We efficiently deployed partially native federated studying to Gboard, leading to higher suggestions for a whole lot of hundreds of thousands of keyboard customers. We’re additionally releasing a TensorFlow Federated tutorial demonstrating easy methods to use Federated Reconstruction.

Federated Reconstruction

Earlier approaches for partially native federated studying used stateful algorithms, which require person gadgets to retailer a state throughout rounds of federated coaching. Particularly, these approaches required gadgets to retailer native parameters throughout rounds. Nevertheless, these algorithms are likely to degrade in large-scale federated studying settings. In these instances, the vast majority of customers don’t take part in coaching, and customers who do take part seemingly solely achieve this as soon as, leading to a state that’s not often obtainable and might get stale throughout rounds. Additionally, all customers who don’t take part are left with out skilled native parameters, stopping sensible purposes.

Federated Reconstruction is stateless and avoids the necessity for person gadgets to retailer native parameters by reconstructing them each time wanted. When a person participates in coaching, earlier than updating any globally aggregated mannequin parameters, they randomly initialize and prepare their native parameters utilizing gradient descent on native knowledge with international parameters frozen. They’ll then calculate updates to international parameters with native parameters frozen. A spherical of Federated Reconstruction coaching is depicted beneath.

Fashions are partitioned into international and native parameters. For every spherical of Federated Reconstruction coaching: (1) The server sends the present international parameters g to every person i; (2) Every person i freezes g and reconstructs their native parameters li; (3) Every person i freezes li and updates g to supply gi; (4) Customers’ gi are averaged to supply the worldwide parameters for the following spherical. Steps (2) and (3) usually use distinct components of the native knowledge.

This straightforward method avoids the challenges of earlier strategies. It doesn’t assume customers have a state from earlier rounds of coaching, enabling large-scale coaching, and native parameters are all the time freshly reconstructed, stopping staleness. Customers unseen throughout coaching can nonetheless get skilled fashions and carry out inference by merely reconstructing native parameters utilizing native knowledge.

Federated Reconstruction trains higher performing fashions for unseen customers in comparison with different approaches. For a matrix factorization activity with unseen customers, the method considerably outperforms each centralized coaching and baseline Federated Averaging.

RMSE ↓ Accuracy ↑
Centralized 1.36 40.8%
FedAvg .934 40.0%
FedRecon (this work) .907 43.3%
Root-mean-square-error (decrease is healthier) and accuracy for a matrix factorization activity with unseen customers. Centralized coaching and Federated Averaging (FedAvg) each reveal privacy-sensitive person embeddings to a central server, whereas Federated Reconstruction (FedRecon) avoids this.

These outcomes will be defined through a connection to meta studying (i.e., studying to be taught); Federated Reconstruction trains international parameters that result in quick and correct reconstruction of native parameters for unseen customers. That’s, Federated Reconstruction is studying to be taught native parameters. In follow, we observe that only one gradient descent step can yield profitable reconstruction, even for fashions with about a million native parameters.

Federated Reconstruction additionally supplies a strategy to personalize fashions for heterogeneous customers whereas decreasing communication of mannequin parameters — even for fashions with out user-specific embeddings. To judge this, we apply Federated Reconstruction to personalize a subsequent phrase prediction language mannequin and observe a considerable improve in efficiency, attaining accuracy on par with different personalization strategies regardless of lowered communication. Federated Reconstruction additionally outperforms different personalization strategies when executed at a set communication degree.

Accuracy ↑ Communication ↓
FedYogi 24.3% Complete Mannequin
FedYogi + Finetuning 30.8% Complete Mannequin
FedRecon (this work) 30.7% Partial Mannequin
Accuracy and server-client communication for a subsequent phrase prediction activity with out user-specific embeddings. FedYogi communicates all mannequin parameters, whereas FedRecon avoids this.

Actual-World Deployment in Gboard

To validate the practicality of Federated Reconstruction in large-scale settings, we deployed the algorithm to Gboard, a cell keyboard software with a whole lot of hundreds of thousands of customers. Gboard customers use expressions (e.g., GIFs, stickers) to speak with others. Customers have extremely heterogeneous preferences for these expressions, making the setting match for utilizing matrix factorization to foretell new expressions a person may wish to share.

Gboard customers can talk with expressions, preferences for that are extremely private.

We skilled a matrix factorization mannequin over user-expression co-occurrences utilizing Federated Reconstruction, preserving person embeddings native to every Gboard person. We then deployed the mannequin to Gboard customers, resulting in a 29.3% improve in click-through-rate for expression suggestions. Since most Gboard customers had been unseen throughout federated coaching, Federated Reconstruction performed a key function on this deployment.

Additional Explorations

We’ve offered Federated Reconstruction, a way for partially native federated studying. Federated Reconstruction allows personalization to heterogeneous customers whereas decreasing communication of privacy-sensitive parameters. We scaled the method to Gboard in alignment with our AI Rules, enhancing suggestions for a whole lot of hundreds of thousands of customers.

For a technical walkthrough of Federated Reconstruction for matrix factorization, try the TensorFlow Federated tutorial. We’ve additionally launched general-purpose TensorFlow Federated libraries and open-source code for working experiments.


Karan Singhal, Hakim Sidahmed, Zachary Garrett, Shanshan Wu, Keith Rush, and Sushant Prakash co-authored the paper. Because of Wei Li, Matt Newton, and Yang Lu for his or her partnership on Gboard deployment. We’d additionally wish to thank Brendan McMahan, Lin Ning, Zachary Charles, Warren Morningstar, Daniel Ramage, Jakub Konecný, Alex Ingerman, Blaise Agüera y Arcas, Jay Yagnik, Bradley Inexperienced, and Ewa Dominowska for his or her useful feedback and assist.


Leave a Reply

Your email address will not be published. Required fields are marked *