Private federated discovery of out-of-vocabulary words for Gboard

Ziteng Sun, Peter Kairouz, Haicheng Sun, Adrià Gascón, Ananda Theertha SuresharXiv 2024 · DOI

Abstract

Updating the vocabulary of mobile keyboard language models is essential for maintaining utility, yet it poses significant privacy risks. This paper details a production-grade system deployed for Gboard that utilizes federated analytics and differential privacy to discover out-of-vocabulary (OOV) words. By implementing a Trie-based Federated Heavy Hitter (TrieHH) algorithm combined with Local Differential Privacy (LDP) and anonymous shuffling, the researchers achieved a central privacy guarantee of $\epsilon = 0.315$. The system successfully identified trendy and informal terms, accounting for 16.8% of the total OOV volume in the en-US population.

Introduction

Language models (LMs) are the backbone of modern mobile keyboards, enabling features such as next-word prediction and autocorrect. However, the effectiveness of these models is constrained by their underlying vocabulary. When a user types a word not present in the dictionary—an out-of-vocabulary (OOV) word—the LM fails to predict it and may erroneously "correct" it. Traditional methods of updating vocabularies often involve collecting user data, which raises substantial privacy concerns. This research presents a privacy-preserving alternative that discovers "heavy hitters" (frequent items) directly from user devices without compromising individual data.

The Challenge of Vocabulary Discovery

Finding the most frequent OOV words in a massive, decentralized dataset is difficult for several reasons:

  1. Sensitivity: User keystrokes may contain highly sensitive information like passwords or personal identifiers.
  2. Open Domain: The space of possible strings is virtually infinite, unlike closed-set problems (e.g., identifying the most popular emoji).
  3. Heavy Tails: OOV words are inherently less frequent than common words, making them difficult to distinguish from the noise introduced by privacy mechanisms.

Methodology: LDP TrieHH

The proposed solution is the LDP TrieHH algorithm, which constructs a prefix tree (Trie) layer-by-layer through multiple interaction rounds.

Interactive Discovery

Rather than transmitting full words, the server broadcasts a set of known prefixes (e.g., "COV"). Devices containing words starting with these prefixes report only the subsequent character (e.g., "I"). This reduces the infinite domain problem into a series of manageable, closed-domain character selection tasks.

Privacy Mechanisms

To protect user data, the system employs Local Differential Privacy (LDP) using a "Subset Selection" randomizer. Each device adds noise to its report before transmission. To further strengthen privacy, the system utilizes anonymous aggregation (shuffling). By aggregating millions of noisy reports, the "central" privacy guarantee is amplified significantly beyond the local epsilon. To bound the total privacy budget, user participation is strictly capped; each user contributes to only one layer of the trie.

Key Insights: Sampling and Multi-Pass Strategies

The researchers identified two critical optimizations for maximizing utility:

  • Random Sampling (RS) vs. Greedy Sampling (GS): When a user has multiple OOV words, selecting one at random (RS) outperforms selecting the most frequent one (GS). RS prevents the model from over-indexing on a small number of prolific users, leading to better global coverage.
  • Multi-Pass Strategy: Splitting the discovery process into two separate "passes" using different user sets significantly improves the final coverage compared to a single-pass approach.
Comparison of sampling strategies and pass counts on OOV coverage.

As shown in the table above, transitioning from Greedy Sampling to Random Sampling and implementing a two-pass strategy yields a substantial increase in OOV coverage within the simulation environment.

Results and Deployment

The system was deployed to 15 million Gboard users in the en-US population over a 60-day window.

Privacy and Utility Trade-off

The deployment achieved a rigorous central DP guarantee of $\epsilon = 0.315$ and $\delta = 10^{-10}$. The relationship between the local privacy parameter (LDP epsilon) and the resulting utility (OOV coverage) is a critical factor in system tuning.

Privacy-utility trade-off showing OOV coverage as a function of LDP epsilon.

The figure above illustrates that as the LDP epsilon increases (allowing for less local privacy), the OOV coverage improves, approaching the theoretical maximum represented by the non-private baseline ($\epsilon = \infty$).

Qualitative Findings

The system successfully discovered a wide variety of terms, including:

  • Trendy words: "afternoonish", "dragonborn".
  • Informal spellings: "Soooooo", "srry", "yayyy".
  • Non-English terms in context: "quede", "tiene".
  • Non-standard capitalization: "athena", "georgetown".

In total, the discovered words accounted for 16.8% of the total OOV word volume in the production population.

Limitations and Future Work

Despite its success, several challenges remain. The current 16.8% coverage leaves a significant portion of the "heavy tail" undiscovered. Future work may focus on more efficient algorithms to capture these rarer terms. Additionally, the system currently provides "item-level" privacy; achieving "user-level" privacy—protecting all contributions from a single user over time—remains an open research problem. Finally, the reliance on large populations for noise averaging suggests that the method may require adaptation for languages with smaller user bases. The authors also suggest the use of Trusted Execution Environments (TEEs) for further verifiable privacy guarantees.

Summary updated

BibTeX
@misc{sun2024private,
  author = {Ziteng Sun and Peter Kairouz and Haicheng Sun and Adrià Gascón and Ananda Theertha Suresh},
  title = {{Private federated discovery of out-of-vocabulary words for Gboard}},
  year = {2024},
  eprint = {2404.11607},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2404.11607},
}
Figure