TL;DR
This paper introduces a privacy-preserving method to discover out-of-vocabulary (OOV) words—like new slang, trending celebrity names, or typos—for mobile keyboards using Federated Learning (FL). By training a character-level recurrent neural network (RNN) directly on user devices and performing parallel Monte Carlo sampling on the server, the system successfully learns new words without ever exporting raw, sensitive user text.
What Problem Does This Paper Address?
Mobile keyboards like Gboard rely on a local dictionary (vocabulary) to provide accurate autocorrect, gesture typing, and next-word predictions. However, human language evolves rapidly. New pop culture references, trending news words, and localized slang emerge daily. When a word is missing from the keyboard's vocabulary, it cannot be predicted and is often aggressively "autocorrected" to a different word, frustrating the user.
Traditionally, discovering these missing words required uploading user keystrokes to a central server to find frequent terms. This approach poses massive user privacy risks. The challenge addressed here is how to discover these popular OOV words across a massive user base while ensuring that raw user text never leaves individual mobile devices.
Methods
Instead of adapting traditional data structures like hash maps or tries to a decentralized setting, the authors use a generative machine learning approach. They train a character-level LSTM variant using the FederatedAveraging (FedAvg) algorithm.
Key components of their approach include:
- On-Device Model Architecture: A multi-layer LSTM utilizing Coupled Input and Forget Gates (CIFG) to reduce parameters by 25% (saving on-device memory), alongside peephole connections and a projection layer to accelerate training.
- Server-Side Monte Carlo Sampling: Once the global model updates are aggregated on the server, the server does not just read the weights; it uses parallel Monte Carlo sampling to generate words from the model's joint posterior distribution. Multiple independent threads start with a "start-of-word" token and iteratively predict the next character until hitting an "end-of-word" token. This parallel approach avoids the sequential dependencies found in beam search.
- Optimization & Stability: To prevent model divergence across heterogeneous devices, the authors apply Nesterov accelerated gradient updates, momentum, and adaptive $L_2$-norm gradient clipping on the client side.
- Heuristic Filtering: A post-processing filter removes invalid patterns such as emojis, numbers, repetitive text (e.g., "hahaha"), and words shorter than three characters.
Datasets
The authors evaluated their approach in two distinct environments:
- Simulated FL (Reddit Dataset): A publicly available Reddit conversation corpus consisting of 492 million comments from 763,000 unique users. The data was sharded by user ID to mimic a decentralized mobile client cache, providing a ground truth to calculate precision and recall.
- Live On-Device FL (Gboard Data): Real-world, live data hosted on active Gboard user devices across three languages: American English (
en_US), Brazilian Portuguese (pt_BR), and Indonesian (in_ID).
Key Insights and Ideas
- Generative Models as Privacy Aggregators: A character-level RNN can implicitly learn the frequency distribution of words across a population without explicitly storing or transmitting any single user's private text.
- The Power of Massive Sampling: The accuracy of discovering true OOV words heavily depends on the volume of server-side sampling. Moving from $10^6$ to $10^8$ independent samples drastically improves both precision and recall, allowing the server to reliably extract the true distribution of rare words.
- Client-Side Tuning is Essential: Standard SGD without momentum or clipping easily diverges under the non-IID (independent and identically distributed) data realities of mobile devices. Introducing adaptive clipping and client-side learning rate tuning is critical for stable convergence.
Key Results
- High Precision and Recall: In the Reddit simulation, the model achieved 90.56% precision and 81.22% recall for the top $10^5$ unique words when utilizing $10^8$ parallel samplings.

- Real-World Convergence: On live Gboard client data, the models successfully converged in about 4 days (~2000 training rounds), achieving a 55.8% top-3 character-level prediction accuracy and a cross-entropy loss of 2.35.

- Qualitative Success: The live on-device model successfully captured real-world trending words relevant to the time of the experiment (e.g., "kavanaugh", "khabib", and "cardi" for English), alongside common abbreviations and localized slang across all three tested languages.
Limitations and Future Work
- Memorization and Privacy Risks: Although Federated Learning avoids centralizing raw text, deep models can still unintentionally memorize rare or sensitive user inputs. The authors note that integrating Differential Privacy (DP) techniques is a necessary next step to formally bound these privacy risks.
- "Daydreaming": The generative model occasionally outputs plausible-sounding character sequences that are not actual words, which can degrade precision if the sampling volume is too low.
- Typo Filtering: The current system struggles to separate intentional slang from accidental, unintended typos. The authors propose that future iterations will use a cyclical approach, incorporating manually curated blacklists and whitelists to filter out profanity and typos, allowing the model to focus its capacity entirely on genuine new words.
Summary updated