製品向けオンデバイス言語モデルのためのプライベートトレーニングの進展
Google Researchは、Gboardなどのオンデバイス言語モデルにおいて、ユーザーデータのプライバシーを保護しながら効用性能を向上させるためのプライベートトレーニング技術の進展について発表した。
キーポイント
オンデバイス言語モデルの実用性と課題
Gboardの次の単語予測やスマート補完などの機能に言語モデルが活用されており、オンデバイス展開により低遅延とプライバシー向上の利点があるが、ユーザーデータを用いたモデルトレーニングにおけるプライバシー保護が重要課題である。
プライベートトレーニング技術の進展
ユーザーデータのプライバシーを保護しながら、オンデバイスモデルのトレーニングを直接行うことで、次の単語予測やスマートテキスト選択などのアプリケーションの効用性能を効果的に向上させることができる。
実用アプリケーションへの統合
この技術は既にGboardの機能に統合されており、具体的なユースケースとして次の単語予測、スマートコンポーズ、スマート補完、スライド入力、校正支援などが挙げられている。
Gboardにおけるプライバシー原則と実践
Gboardでは、透明性とユーザー制御、データ最小化、データ匿名化という3つのプライバシー原則が実践されている。これには、データ使用の開示、FLによる焦点を絞った更新の集約、DPによる個別ユーザーデータの保護が含まれる。
Gboardの差分プライバシー保証の規模と強度
Gboardの30以上のオンデバイス言語モデルは、δ=10⁻¹⁰、ε=0.994〜13.69の(ε,δ)-DP保証を満たしている。これは、ユーザーデータで直接訓練されたモデルでε<1の強力なDP保証が発表された初めてのケースであり、Google内外で最大規模のユーザーレベルDP導入とされている。
差分プライバシーの実装と公開
主要なアルゴリズムアプローチとプライバシー計算をオープンソースコードとして公開し、監査可能性と検証可能性を確保している。
差分プライバシーの進展と実績
2020年にクリッピングとノイズ付加による有限DP保証を実現し、2022年にはDP-FTRLアルゴリズムを用いて正式なDP保証(ε=8.9, δ=10^-10)を持つ初の生産ニューラルネットワークを訓練した。
影響分析・編集コメントを表示
影響分析
この技術進展は、プライバシー規制が強化される中で、オンデバイスAIの実用化を加速させる重要な一歩となる。特にモバイルデバイスにおける言語モデルの応用範囲を拡大し、ユーザー体験とデータ保護の両立を実現する基盤技術として業界に影響を与える可能性が高い。
編集コメント
Googleの研究開発力が、実用製品への迅速な統合を通じて、プライバシーと性能の両立という業界共通課題に取り組んでいる好例。技術詳細の開示が限定的な点は、競争優位性を維持するための戦略的配慮と見られる。
Google の研究科学者 Zheng Xu とソフトウェアエンジニア Yanxiang Zhang が投稿

入力テキストに基づいて与えられた単語を予測するように訓練された言語モデル(LM)は、多くのアプリケーションにおける中核技術です [1, 2]。Gboard においては、言語モデルは 次単語予測(NWP)、スマートコンポーズ、スマート補完、提案機能、スライド入力、および 校正 といった機能をサポートすることで、ユーザーのタイピング体験を向上させるために活用されています。モデルを企業のサーバーではなくユーザーの端末にデプロイすることには、低遅延やモデル利用におけるプライバシー保護などの利点があります。ユーザーデータから直接オンデバイスモデルを訓練することは、NWP や スマートテキスト選択 といったアプリケーションの有用性パフォーマンスを効果的に向上させますが、モデル訓練におけるユーザーデータのプライバシー保護も重要です。
言語モデルによって駆動される Gboard の機能。
本ブログでは、2017 年に 連合学習(FL)の概念実証開発から始まり、2022 年に正式な 差分プライバシー(DP)保証が確立されて以来、長年の研究の進展がいかにして Gboard の言語モデルにおけるプライベートトレーニングを可能にしたかについて解説します。FL は、すべてのトレーニングデータを端末上に保持したまま、モバイルフォンが協調してモデルを学習することを可能にし、DP はデータの匿名化に対する定量化可能な指標を提供します。形式的には、DP は通常 (*ε*, *δ*) で特徴づけられ、より小さな値がより強力な保証を表します。機械学習(ML)モデルは、*δ* が小さい場合、ε=10 に対して 合理的な DP 保証 を持ち、ε=1 に対しては強力な DP 保証を持つとみなされます。
本日現在、Gboard のすべての NWP ニューラルネットワーク言語モデルは、形式的な差分プライバシー(DP)保証を備えた連合学習(FL)でトレーニングされており、ユーザーデータ上でトレーニングされた Gboard 言語モデルの今後のリリースにはすべて DP が必須となっています。これら 30 以上の Gboard オンデバイス言語モデルは、7 以上の言語と 15 カ国以上で展開されており、δが 10 のマイナス 10 乗という非常に小さな値であり、εが 0.994 から 13.69 の範囲にある (*ɛ*, *δ*)-DP 保証を満たしています。私たちの知る限り、これは Google 内あるいは世界中において、本番環境で展開されているユーザーレベルの差分プライバシー(DP)における最大規模の事例であり、εが
Gboard におけるプライバシー原則と実践
「Gboard におけるプライベート連合学習」において、異なる プライバシー原則 がどのように現在の本番環境モデルに反映されているかについて議論しました。これには以下が含まれます:
- 透明性とユーザー制御:使用されるデータ、その利用目的、各チャネルでの処理方法、および Gboard ユーザーが学習モデルにおけるデータ利用をどのように容易に設定できるかについて開示を行います。
- データ最小化:連合学習(FL)は、特定のモデルの改善に焦点を当てた更新のみを即座に集約します。安全な集約(SecAgg)は、一時的な更新の結果を集計したものしかアクセスできないことをさらに保証するための暗号化手法です。
- データ匿名化:DP は、モデルが個々のユーザーのトレーニングデータ内の固有情報を記憶することを防ぐためにサーバー側で適用されます。
- 監査可能性と検証可能性:主要なアルゴリズムアプローチおよびプライバシー会計(TFF アグリゲーター、TFP DPQuery、DP 会計、FL システム)をオープンソースコードとして公開しました。
近年、FL(Federated Learning)は、ユーザーデータからGboard on-device LMs を訓練するためのデフォルト手法となっています。2020 年には、スペインでスペイン語 LM を訓練する際に、モデル更新に対してクリップとノイズの付加を行う DP(Differential Privacy:差分プライバシー)メカニズムが使用され、記憶化の防止 が図られました。これは有限な DP 保証を満たしており、「How to DP-fy ML」ガイドに記載されているTier 3 に該当します。
2022 年には、DP-Follow-The-Regularized-Leader (DP-FTRL) アルゴリズム の支援により、スペイン語 LM は、ユーザーデータ上で直接訓練された最初の生産用ニューラルネットワークとして、形式化された DP 保証(ε=8.9, δ=10-10)-DP)[https://blog.research.google/2022/02/federated-learning-with-formal.html] を伴って発表されました。これは報告されている*ρ=0.81* ゼロ集中差分プライバシー(Zero-Concentrated-Differential-Privacy) と同等であり、したがって妥当なプライバシー保証(Tier 2)を満たしています。
フェデレーテッドラーニングにおけるデフォルトの差分プライバシー
「Differential Privacy を用いた Gboard 言語モデルの連合学習」において、Gboard のすべての NWP ニューラルネットワーク言語モデルに DP(差分プライバシー)の保証があり、ユーザーデータを用いて訓練された今後の Gboard モデルのリリースにも同様の DP 保証が必要であることを発表しました。FL(連合学習)における DP は、以下の実践を適用することで有効化されます:
- 多言語 C4 データセットでモデルを事前訓練する。
- パブリックデータセットを用いたシミュレーション実験により、高い有用性を維持しつつ大きな DP ノイズ対信号比を実現できる値を見出す。1 ラウンドのモデル更新に貢献するクライアント数を増やすことで、ノイズ比を固定したままプライバシーを向上させることができる。これは DP の目標が達成されるか、システムおよび人口規模によって許容される最大値に至るまで有効である。
- FL システムにおける計算リソース予算と推定人口に基づき、各クライアントが貢献できる頻度を制限するパラメータを設定する(例:数日ごとに 1 回)。
- DP-FTRL 訓練を実行し、アダプティブクリッピングまたは経験に基づく固定値によって選択された、デバイスごとの更新の大きさに対する制限を設ける。
また、スケールと感度に対する計算および通信の改善に関する進展 を採用することで、SecAgg(安全な集約)を追加で適用することも可能です。
差分プライバシーおよび SecAgg を備えた連合学習。
DP 保証の報告
公開された Gboard NWP LM の DP(差分プライバシー)保証は、以下の棒グラフに視覚化されています。*x*-軸には言語と地域をラベル付けした LM が表示され、対応する人口集団で訓練されたモデルが並んでいます。*y*-軸は、(ε, δ)-DP において *δ* を小さな値である 10⁻¹⁰ に固定したときの *ε* 値を示しており、数値が小さいほど望ましいです。これらのモデルの有用性は、A/B テスト中のユーザーインタラクション指標に基づいて測定された結果、生産環境における以前の非ニューラルモデルよりも著しく優れているか、DP を適用しない以前の LM と同等であることが示されています。例えば、ベストプラクティスを適用することで、スペインにおけるスペイン語モデルの DP 保証は *ε=8.9* から *ε*=5.37 に改善されました。また、スペインにおけるスペイン語モデルと米国における英語モデルの訓練には、SecAgg(安全な集約)が追加で利用されています。DP 保証の詳細については、「How to DP-fy ML」 で概説された ガイドライン に従い、付録 に報告されています。
より強力な DP 保証に向けて
多くの公開された言語モデルの *ε*~10 の差分プライバシー(DP)保証は、実務における機械学習モデルにとってすでに妥当と見なされていますが、Gboard における DP 連合学習(FL)の取り組みは、ユーザーの入力体験を向上させつつデータプライバシーを保護し続けるために継続中です。私たちは、ブラジルのポルトガル語およびラテンアメリカのスペイン語における生産環境向け言語モデルが、*ε* ≤ 1 の差分プライバシー保証をもって初めて訓練され、公開されたことを発表できることを嬉しく思います。これはティア 1 の強力なプライバシー保証を満たすものです。具体的には、高度な行列分解 DP-FTRL(MF-DP-FTRL)アルゴリズムを実行することで、(*ε*=0.994, *δ*=10⁻¹⁰)-DP 保証が達成されました。これは、サーバーモデルの更新における各トレーニングラウンドで 6,500 台以上のデバイスという一般的な設定よりも多い 12,000 台以上のデバイスが参加し、ブラジルの大規模なポルトガル語ユーザー層において、14 日間の合計 2,000 ラウンドのトレーニング中に各クライアントが最大 2 回しか参加できないよう慎重に設定されたポリシーを採用した結果です。同様の設定を用いて、es-US(米国スペイン語)言語モデルはラテンアメリカの複数の国をまたぐ大規模な人口集団で訓練され、(*ε*=0.994, *δ*=10⁻¹⁰)-DP を達成しました。*ε* ≤ 1 の es-US モデルは多くの国で有用性が大幅に向上し、コロンビア、エクアドル、グアテマラ、メキシコ、ベネズエラで公開されました。スペインのような小規模な人口集団においては、es-ES(スペインスペイン語)言語モデルの DP 保証が、参加デバイスの数を増やすことなく、DP-FTRL を MF-DP-FTRL に置き換えるだけで、*ε=5.37* から *ε*=3.42 へと改善されました。プライバシー会計に関するより詳細な技術情報は、colab で公開されています。
Gboard NWP LM における DP(差分プライバシー)保証について(紫色の棒グラフは ε=8.9 の最初の es-ES 版リリースを表し、シアン色の棒グラフは MF-DP-FTRL を用いて訓練されたモデルに対するプライバシー向上を示します。tiers は「How to DP-fy ML」ガイドからのものです。en-US* および es-ES* はさらに SecAgg(安全な集約)を用いて訓練されています)。
考察と今後のステップ
私たちの経験から、クライアント参加に関するシステムとアルゴリズムの共同設計を通じて DP を実用上達成でき、かつ人口規模が大きく多数のデバイスの寄与が集約される場合、プライバシーと有用性の両方を強く保つことが可能であることが示唆されます。プライバシー・有用性・計算コストのトレードオフは、公開データの活用、新しい MF-DP-FTRL アルゴリズム、および 集計精度の向上 によって改善できます。これらの技術を用いれば、*ε* ≤ 1 という強力な DP 保証が可能ですが、依然として課題は残ります。実証的なプライバシー監査に関する活発な研究 [1, 2] は、DP モデルが最悪ケースの DP 保証が示唆するよりも潜在的によりプライバシー保護に優れている可能性を示しています。アルゴリズムの最先端を押し広げ続ける中で、プライバシー・有用性・計算コストのどの次元を優先すべきでしょうか?
私たちは機械学習のすべてのプライバシー側面に取り組んでおり、DP-FTRL を 分散 DP に拡張し、監査可能性と検証可能性 の向上を図っています。信頼実行環境(Trusted Execution Environment) は、プライバシーを証明可能にしたままモデルサイズを大幅に拡大する機会を開きます。最近の 大規模言語モデル(LLMs)における画期的進展 は、プライベートトレーニングにおける公開情報 の利用や、LLM、オンデバイス LM、Gboard 生産環境間のより多くの将来の相互作用について再考 を促しています。
謝辞
*著者らは、本ブログ記事自体に対する初期フィードバックを提供してくれた Peter Kairouz、Brendan McMahan、Daniel Ramage に感謝します。また、アニメーション図の作成を支援してくれた Shaofeng Li と Tom Small、アルゴリズム設計、インフラ実装、生産環境の維持に貢献した Google の各チームにも謝意を表します。以下の協力者は、提示された結果に直接寄与しています:*
*研究およびアルゴリズム開発:Galen Andrew、Stanislav Chiknavaryan、Christopher A. Choquette-Choo、Arun Ganesh、Peter Kairouz、Ryan McKenna、H. Brendan McMahan、Jesse Rosenstock、Timon Van Overveldt、Keith Rush、Shuang Song、Thomas Steinke、Abhradeep Guha Thakurta、Om Thakkar、Yuanbo Zhang。*
インフラ、プロダクション、リーダーシップのサポート:Mingqing Chen, Stefan Dierauf, Billy Dou, Hubert Eichner, Zachary Garrett, Jeremy Gillula, Jianpeng Hou, Hui Li, Xu Liu, Wenzhi Mao, Brett McLarnon, Mengchen Pei, Daniel Ramage, Swaroop Ramaswamy, Haicheng Sun, Andreas Terzis, Yun Wang, Shanshan Wu, Yu Xiao, および Shumin Zhai。
原文を表示
Posted by Zheng Xu, Research Scientist, and Yanxiang Zhang, Software Engineer, Google

Language models (LMs) trained to predict the next word given input text are the key technology for many applications [1, 2]. In Gboard, LMs are used to improve users’ typing experience by supporting features like next word prediction (NWP), Smart Compose,smart completion and suggestion, slide to type, and proofread. Deploying models on users’ devices rather than enterprise servers has advantages like lower latency and better privacy for model usage. While training on-device models directly from user data effectively improves the utility performance for applications such as NWP and smart text selection, protecting the privacy of user data for model training is important.
Gboard features powered by on-device language models.
In this blog we discuss how years of research advances now power the private training of Gboard LMs, since the proof-of-concept development of federated learning (FL) in 2017 and formal differential privacy (DP) guarantees in 2022. FL enables mobile phones to collaboratively learn a model while keeping all the training data on device, and DP provides a quantifiable measure of data anonymization. Formally, DP is often characterized by (*ε*, *δ*) with smaller values representing stronger guarantees. Machine learning (ML) models are considered to have reasonable DP guarantees for ε=10 and strong DP guarantees for ε=1 when *δ* is small.
As of today, all NWP neural network LMs in Gboard are trained with FL with formal DP guarantees, and all future launches of Gboard LMs trained on user data require DP. These 30+ Gboard on-device LMs are launched in 7+ languages and 15+ countries, and satisfy (*ɛ*, *δ*)-DP guarantees of small *δ* of 10-10 and ɛ between 0.994 and 13.69. To the best of our knowledge, this is the largest known deployment of user-level DP in production at Google or anywhere, and the first time a strong DP guarantee of *ɛ*
Privacy principles and practices in Gboard
In “Private Federated Learning in Gboard”, we discussed how different privacy principles are currently reflected in production models, including:
- Transparency and user control: We provide disclosure of what data is used, what purpose it is used for, how it is processed in various channels, and how Gboard users can easily configure the data usage in learning models.
- Data minimization: FL immediately aggregates only focused updates that improve a specific model. Secure aggregation (SecAgg) is an encryption method to further guarantee that only aggregated results of the ephemeral updates can be accessed.
- Data anonymization: DP is applied by the server to prevent models from memorizing the unique information in individual user’s training data.
- Auditability and verifiability: We have made public the key algorithmic approaches and privacy accounting in open-sourced code (TFF aggregator, TFP DPQuery, DP accounting, and FL system).
A brief history
In recent years, FL has become the default method for training Gboard on-device LMs from user data. In 2020, a DP mechanism that clips and adds noise to model updates was used to prevent memorization for training the Spanish LM in Spain, which satisfies finite DP guarantees (Tier 3 described in “How to DP-fy ML“ guide). In 2022, with the help of the DP-Follow-The-Regularized-Leader (DP-FTRL) algorithm, the Spanish LM became the first production neural network trained directly on user data announced with a formal DP guarantee of (ε=8.9, δ=10-10)-DP (equivalent to the reported *ρ=0.81* zero-Concentrated-Differential-Privacy), and therefore satisfies reasonable privacy guarantees (Tier 2).
Differential privacy by default in federated learning
In “Federated Learning of Gboard Language Models with Differential Privacy”, we announced that all the NWP neural network LMs in Gboard have DP guarantees, and all future launches of Gboard LMs trained on user data require DP guarantees. DP is enabled in FL by applying the following practices:
- Pre-train the model with the multilingual C4 dataset.
- Via simulation experiments on public datasets, find a large DP-noise-to-signal ratio that allows for high utility. Increasing the number of clients contributing to one round of model update improves privacy while keeping the noise ratio fixed for good utility, up to the point the DP target is met, or the maximum allowed by the system and the size of the population.
- Configure the parameter to restrict the frequency each client can contribute (e.g., once every few days) based on computation budget and estimated population in the FL system.
- Run DP-FTRL training with limits on the magnitude of per-device updates chosen either via adaptive clipping, or fixed based on experience.
SecAgg can be additionally applied by adopting the advances in improving computation and communication for scales and sensitivity.
Federated learning with differential privacy and (SecAgg).
Reporting DP guarantees
The DP guarantees of launched Gboard NWP LMs are visualized in the barplot below. The *x*-axis shows LMs labeled by language-locale and trained on corresponding populations; the *y*-axis shows the *ε* value when *δ* is fixed to a small value of 10-10 for (ε, δ)-DP (lower is better). The utility of these models are either significantly better than previous non-neural models in production, or comparable with previous LMs without DP, measured based on user-interactions metrics during A/B testing. For example, by applying the best practices, the DP guarantee of the Spanish model in Spain is improved from *ε=8.9* to *ε*=5.37. SecAgg is additionally used for training the Spanish model in Spain and English model in the US. More details of the DP guarantees are reported in the appendixfollowing the guidelines outlined in “How to DP-fy ML”.
Towards stronger DP guarantees
The *ε*~10 DP guarantees of many launched LMs are already considered reasonable for ML models in practice, while the journey of DP FL in Gboard continues for improving user typing experience while protecting data privacy. We are excited to announce that, for the first time, production LMs of Portuguese in Brazil and Spanish in Latin America are trained and launched with a DP guarantee of *ε* ≤ 1, which satisfies Tier 1 strong privacy guarantees. Specifically, the (*ε*=0.994, *δ*=10-10)-DP guarantee is achieved by running the advanced Matrix Factorization DP-FTRL (MF-DP-FTRL) algorithm, with 12,000+ devices participating in every training round of server model update larger than the common setting of 6500+ devices, and a carefully configured policy to restrict each client to at most participate twice in the total 2000 rounds of training in 14 days in the large Portuguese user population of Brazil. Using a similar setting, the es-US Spanish LM was trained in a large population combining multiple countries in Latin America to achieve (*ε*=0.994, *δ*=10-10)-DP. The *ε* ≤ 1 es-US model significantly improved the utility in many countries, and launched in Colombia, Ecuador, Guatemala, Mexico, and Venezuela. For the smaller population in Spain, the DP guarantee of es-ES LM is improved from *ε=5.37* to *ε*=3.42 by only replacing DP-FTRL with MF-DP-FTRL without increasing the number of devices participating every round. More technical details are disclosed in the colab for privacy accounting.
DP guarantees for Gboard NWP LMs (the purple bar represents the first es-ES launch of ε=8.9; cyan bars represent privacy improvements for models trained with MF-DP-FTRL; tiersare from “How to DP-fy ML“ guide; en-US* and es-ES* are additionally trained with SecAgg).
Discussion and next steps
Our experience suggests that DP can be achieved in practice through system algorithm co-design on client participation, and that both privacy and utility can be strong when populations are large *and* a large number of devices' contributions are aggregated. Privacy-utility-computation trade-offs can be improved by using public data, the new MF-DP-FTRL algorithm, and tightening accounting. With these techniques, a strong DP guarantee of *ε* ≤ 1 is possible but still challenging. Active research on empirical privacy auditing [1, 2] suggests that DP models are potentially more private than the worst-case DP guarantees imply. While we keep pushing the frontier of algorithms, which dimension of privacy-utility-computation should be prioritized?
We are actively working on all privacy aspects of ML, including extending DP-FTRL to distributed DP and improving auditability and verifiability. Trusted Execution Environment opens the opportunity for substantially increasing the model size with verifiable privacy. The recent breakthrough in large LMs (LLMs) motivates us to rethink the usage of public information in private training and more future interactions between LLMs, on-device LMs, and Gboard production.
Acknowledgments
*The authors would like to thank Peter Kairouz, Brendan McMahan, and Daniel Ramage for their early feedback on the blog post itself, Shaofeng Li and Tom Small for helping with the animated figures, and the teams at Google that helped with algorithm design, infrastructure implementation, and production maintenance. The collaborators below directly contribute to the presented results:*
*Research and algorithm development: Galen Andrew, Stanislav Chiknavaryan, Christopher A. Choquette-Choo, Arun Ganesh, Peter Kairouz, Ryan McKenna, H. Brendan McMahan, Jesse Rosenstock, Timon Van Overveldt, Keith Rush, Shuang Song, Thomas Steinke, Abhradeep Guha Thakurta, Om Thakkar, and Yuanbo Zhang.*
*Infrastructure, production and leadership support: Mingqing Chen, Stefan Dierauf, Billy Dou, Hubert Eichner, Zachary Garrett, Jeremy Gillula, Jianpeng Hou, Hui Li, Xu Liu, Wenzhi Mao, Brett McLarnon, Mengchen Pei, Daniel Ramage, Swaroop Ramaswamy, Haicheng Sun, Andreas Terzis, Yun Wang, Shanshan Wu, Yu Xiao, and Shumin Zhai.*
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み