[论文解读] Federated Learning of N-gram Language Models
本文提出了一种联邦学习框架,可在不将用户数据传输至中央服务器的情况下,训练适用于虚拟键盘的高质量n-gram语言模型。通过先在设备端使用联邦平均法训练循环神经网络(RNN),再利用神经推理和外部语料库的拓扑结构将模型近似为n-gram模型,该方法在传统基于服务器的训练方法之上实现了更优的下一个词预测准确率,A/B测试显示在英语上最高提升10.53%的top-1准确率,在巴西葡萄牙语上最高提升9.65%。
We propose algorithms to train production-quality n-gram language models using federated learning. Federated learning is a distributed computation platform that can be used to train global models for portable devices such as smart phones. Federated learning is especially relevant for applications handling privacy-sensitive data, such as virtual keyboards, because training is performed without the users' data ever leaving their devices. While the principles of federated learning are fairly generic, its methodology assumes that the underlying models are neural networks. However, virtual keyboards are typically powered by n-gram language models for latency reasons. We propose to train a recurrent neural network language model using the decentralized FederatedAveraging algorithm and to approximate this federated model server-side with an n-gram model that can be deployed to devices for fast inference. Our technical contributions include ways of handling large vocabularies, algorithms to correct capitalization errors in user data, and efficient finite state transducer algorithms to convert word language models to word-piece language models and vice versa. The n-gram language models trained with federated learning are compared to n-grams trained with traditional server-based algorithms using A/B tests on tens of millions of users of virtual keyboard. Results are presented for two languages, American English and Brazilian Portuguese. This work demonstrates that high-quality n-gram language models can be trained directly on client mobile devices without sensitive training data ever leaving the devices.
研究动机与目标
- 在不将原始用户输入数据传输至中央服务器的情况下,实现面向移动虚拟键盘的生产级n-gram语言模型训练。
- 克服直接对n-gram进行联邦训练的局限性,后者因词汇量庞大及词形丰富的语言中数据稀疏而不可行。
- 开发一种方法,利用联邦RNN训练生成高质量的n-gram近似模型,适用于移动设备上的低延迟推理。
- 解决用户生成训练数据中的数据质量问题,如大小写不一致和未登录词(OOV)问题。
- 在横跨两种语言的数千万名用户的实际A/B测试中评估最终的n-gram模型,证明其预测准确率的提升。
提出的方法
- 在客户端设备上使用联邦平均法训练循环神经网络语言模型(RNN LM),确保用户数据始终不离开设备。
- 使用SampleApprox算法将训练好的RNN LM近似为基于有限状态转换器的n-gram模型,以实现高效的设备端推理。
- 将神经推理得到的n-gram拓扑与外部大规模语料库拓扑(A_W)结合,以提升覆盖范围并减少数据稀疏性,尤其针对罕见词或OOV词。
- 应用一个大小写规范化FST,在模型训练前纠正用户输入文本中的大小写不一致问题。
- 使用修改后的SLL^e指标(排除OOV词)指导模型选择,聚焦于词汇内性能。
- 在虚拟键盘应用的实时生产流量中部署并评估最终的n-gram模型。
实验结果
研究问题
- RQ1能否在移动设备上使用联邦学习直接训练高质量的n-gram语言模型,且不暴露原始用户数据?
- RQ2将联邦RNN LM近似为n-gram模型是否能比直接从集中式日志中训练n-gram模型获得更好的性能?
- RQ3将神经推理得到的n-gram拓扑与外部语料库拓扑结合,在提升模型质量和覆盖范围方面有多有效?
- RQ4大小写规范化和子词建模在缓解联邦n-gram训练中的数据质量问题方面有多大的作用?
- RQ5在真实世界用户预测准确率方面,最终的n-gram模型能否超越传统基于服务器的训练方法?
主要发现
- 基于联邦RNN的n-gram模型(A_P_r)在英语(en_US)上实现了10.53%的top-1预测准确率,显著优于基线模型的10.03%。
- 在巴西葡萄牙语(pt_BR)上,最佳联邦模型(A_P_r)实现了9.65%的top-1准确率,而基线模型为8.55%。
- 子词模型(P_4K-L)在en_US上的SLL^e为10.49,优于同语言中词模型(W_30K)的10.46 SLL^e。
- 使用插值拓扑(A_r)的模型始终优于仅使用神经推理或仅使用外部语料库拓扑的模型。
- SLL^e指标表明,4K子词模型搭配GLSTM架构的性能优于16K和30K子词模型,表明该设置下存在最优词汇量。
- 所有联邦模型在A/B测试中均显著优于基线模型,证明了联邦训练在n-gram模型上的可行性与优越性。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。