# Federated Learning for Mobile Keyboard Prediction

기기에서 키보드 다음 단어 예측 모델 학습

Andrew Hard, Kanishka Rao, Rajiv Mathews, Swaroop Ramaswamy, Françoise Beaufays, Sean Augenstein 외 3명 · arXiv · 2018년 11월 8일

- **연구 문제** 다음 단어 예측 모델에는 실제 입력 텍스트가 필요하지만, 이를 서버로 모으면 보안과 개인정보 부담이 크고 사용자도 꺼립니다.
- **연구 방법** 저자들은 CIFG 언어 모델을 기기에서 FederatedAveraging으로 학습하고, 원시 텍스트 대신 가중치만 서버로 보냅니다.
- **주요 결과** 클라이언트 캐시 평가에서 연합 CIFG의 top-1 recall은 15.8±0.3으로, 서버 학습 CIFG의 15.0±0.5보다 높았습니다.

## 모바일 키보드 학습 데이터의 한계

다음 단어 예측 모델을 학습하려면 실제 사용자가 입력한 텍스트와 비슷한 데이터가 필요합니다. 공개 데이터셋은 쉽게 쓸 수 있지만 키보드 사용자의 입력 분포와 잘 맞지 않는 경우가 많습니다. 사용자 입력을 서버로 모아 학습하는 방법은 데이터 품질을 높일 수 있지만, 로깅과 저장, 보안 부담이 따르고 사용자가 개인 텍스트의 원격 저장을 꺼릴 수 있습니다. 이 논문은 이 문제를 줄이기 위해 연합 학습을 Gboard의 다음 단어 예측에 적용해 처음부터 학습한 모델이 서버 학습 모델과 n-gram 베이스라인보다 recall에서 나은지 확인합니다.

## CIFG 모델 구조와 크기 제약

모델은 LSTM의 변형인 CIFG를 사용합니다. CIFG는 입력 게이트 it와 forget 게이트 ft를 ft = 1−it로 묶어 하나의 게이트로 입력과 순환 셀 연결을 함께 제어합니다. 이렇게 하면 셀당 파라미터가 25% 줄어듭니다. 어휘는 V = 10,000개이고, 입력 임베딩과 CIFG 출력 투영의 차원 D는 96입니다. 임베딩 행렬 W와 출력 투영을 공유하는 tied 구조로 모델 크기를 줄였습니다. 결과적으로 파라미터는 1.4 million개이며, 양자화 후 Gboard 기기에 배포되는 모델은 1.4 megabytes입니다.

## FederatedAveraging의 집계 방식

연합 학습에서는 각 라운드마다 서버가 전역 모델 wt를 일부 클라이언트에 보냅니다. 각 클라이언트는 자신의 로컬 데이터로 평균 기울기를 계산하고, 하나 이상의 SGD 단계로 로컬 갱신을 만듭니다. 서버는 클라이언트 데이터 수 nk에 비례한 가중 평균으로 새 전역 모델을 만듭니다. 클라이언트 갱신은 저장되지 않고 메모리에서 집계된 뒤 버려집니다. 이 구조에서 서버가 받는 것은 원시 텍스트가 아니라 모델 가중치 업로드입니다.

## 서버 로그 학습과 연합 학습의 설정

서버 학습은 Gboard 사용자가 공유에 동의한 로그 스니펫으로 CIFG를 비동기 SGD로 학습했습니다. 연합 학습은 클라이언트 캐시에서 SGD 갱신을 계산하고, 서버가 FederatedAveraging 결과에 Nesterov 가속 기울기를 쓰는 Momentum optimizer로 전역 모델을 갱신했습니다. 연합 CIFG는 3000 라운드 후 수렴했습니다. 두 방식의 SGD 종류가 다르므로 완전히 같은 조건의 비교는 아닙니다.

## 클라이언트 캐시와 로그 데이터의 recall

클라이언트 캐시 평가에서 Federated CIFG의 top-1 recall은 15.8±0.3을 기록했고, Server CIFG는 15.0±0.5, n-gram은 12.5±0.2였습니다. 서버 호스팅 로그 데이터에서는 Server CIFG가 top-1 16.5%, Federated CIFG가 16.4%, n-gram이 13.0%였고 top-3는 각각 27.1%, 27.0%, 22.1%였습니다. 클라이언트 캐시에서 연합 CIFG는 서버 CIFG 대비 top-1을 상대 5%(절대 0.8%) 높였습니다. 로그 데이터에서는 두 CIFG의 recall이 비슷했습니다.

## 라이브 트래픽 실험

라이브 실험에서 prediction impression recall의 top-1은 Federated CIFG 5.82±0.03, Server CIFG 5.76±0.03, n-gram 5.24±0.02였습니다. CTR은 Federated CIFG 2.35±0.03, Server CIFG 2.36±0.03, n-gram 2.13±0.03이었습니다. 따라서 impression recall에서는 연합 CIFG가 서버 CIFG보다 약간 높았지만, CTR에서는 연합 CIFG가 서버 CIFG보다 낮았습니다. 이 실험의 신뢰구간은 사용자 버킷 기반 jackknife로 계산했습니다.

## 데이터 대표성과 비교 조건

로그 데이터는 짧은 구절로 잘린 스니펫이라 실제 입력 분포를 충분히 대표하지 않습니다. 서버 학습과 연합 학습은 서로 다른 SGD 방식을 썼으므로 비교 조건이 완전히 같지는 않습니다. 연합 학습 절차는 사용자가 집계 서버가 개별 가중치 업로드를 검사하지 않는다고 신뢰해야 합니다. CTR에서는 연합 CIFG가 서버 CIFG보다 낮았으므로 recall 개선이 모든 지표의 개선으로 이어지지는 않았습니다.

## 논문 정보

- **저자**: Andrew Hard, Kanishka Rao, Rajiv Mathews, Swaroop Ramaswamy, Françoise Beaufays, Sean Augenstein, Hubert Eichner, Chloé Kiddon, Daniel Ramage
- **학회·저널**: arXiv · 프리프린트
- **최초 공개일**: 2018년 11월 8일
- **등록일**: 2026년 11월 12일
- **수정일**: 2019년 2월 28일
- **버전**: v2
- **arXiv**: 1811.03604
- **분류**: cs.CL
- **원문 이용 조건**: [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)
- **제공 범위**: 논문 정보, 해설

[논문 원문 ↗](https://arxiv.org/abs/1811.03604v2) · [원문 PDF ↗](https://arxiv.org/pdf/1811.03604v2)

AI 해설은 논문 원문과 별개의 설명이며 오류가 있을 수 있습니다. 원문과 그림은 각 출처의 이용 조건과 따로 표시된 권리를 따릅니다.

## 원문 인용

Andrew Hard, Kanishka Rao, Rajiv Mathews, Swaroop Ramaswamy, Françoise Beaufays, Sean Augenstein, Hubert Eichner, Chloé Kiddon, Daniel Ramage (2018). Federated Learning for Mobile Keyboard Prediction. arXiv:1811.03604v2. https://arxiv.org/abs/1811.03604v2

**BibTeX**

```
@misc{hard2018federated,
  title = {{Federated Learning for Mobile Keyboard Prediction}},
  author = {Andrew Hard and Kanishka Rao and Rajiv Mathews and Swaroop Ramaswamy and Françoise Beaufays and Sean Augenstein and Hubert Eichner and Chloé Kiddon and Daniel Ramage},
  year = {2018},
  eprint = {1811.03604},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1811.03604v2}
}
```

## 이 논문의 용어

- [LSTM](https://refivu.com/terms/ba10547646d9-lstm)
- [recall](https://refivu.com/terms/3774987267f3-recall)
- [Federated Learning](https://refivu.com/terms/c6fc55e6f812-federated-learning)
- [recurrent neural networks (RNNs)](https://refivu.com/terms/ba404e59b4ae-recurrent-neural-networks-rnns)
- [Nesterov accelerated gradient](https://refivu.com/terms/aa6d727717e1-nesterov-accelerated-gradient)
- [FederatedAveraging](https://refivu.com/terms/2033f8afe384-federatedaveraging)

## 다른 논문 해설

- [Ethical and social risks of harm from Language Models](https://refivu.com/papers/d42d41ba-833b-45f6-8837-7bfc3f4d36d8-ethical-and-social-risks-of-harm-from-language.md)
- [PaLM 2 Technical Report](https://refivu.com/papers/9930c339-e7c2-4330-9ea3-867aad7f3368-palm-2-technical-report.md)
- [A Survey on In-context Learning](https://refivu.com/papers/e3dcb216-0b54-4a23-8e0d-f077c493f505-a-survey-on-in-context-learning.md)
- [LaMDA: Language Models for Dialog Applications](https://refivu.com/papers/9474e307-9624-4203-a346-57d881b1a5d9-lamda-language-models-for-dialog-applications.md)
- [Cross-lingual Language Model Pretraining](https://refivu.com/papers/8d4c53c4-5c75-4330-9085-1b84a43703b6-cross-lingual-language-model-pretraining.md)
- [G-Eval: NLG Evaluation using GPT-4 with Better Human Alignment](https://refivu.com/papers/d14a3666-4caf-4371-83b0-d44fc50735f5-g-eval-nlg-evaluation-using-gpt-4-with.md)
- [ConvNeXt V2: Co-designing and Scaling ConvNets with Masked Autoencoders](https://refivu.com/papers/d6599a02-0aa8-4eec-a1c3-2bdc45716f23-convnext-v2-co-designing-and-scaling-convnets-with.md)
- [Deeper Depth Prediction with Fully Convolutional Residual Networks](https://refivu.com/papers/4ef3d92a-82ea-4f76-8b77-ec72d726dd77-deeper-depth-prediction-with-fully-convolutional-residual.md)
- [Deep Learning for Sensor-based Activity Recognition: A Survey](https://refivu.com/papers/2047ba14-2bcc-42f2-a0fe-57280553acee-deep-learning-for-sensor-based-activity-recognition-a.md)
- [Attention-Based Models for Speech Recognition](https://refivu.com/papers/3c2117c0-4216-4c2d-8001-0377fd293004-attention-based-models-for-speech-recognition.md)
- [A Comprehensive Survey of Graph Embedding: Problems, Techniques and Applications](https://refivu.com/papers/ec23e11b-6984-4611-aa20-93a65865b536-a-comprehensive-survey-of-graph-embedding-problems.md)
- [Learning Fine-Grained Bimanual Manipulation with Low-Cost Hardware](https://refivu.com/papers/8d8af879-da03-4506-b5c4-b0f829b285cf-learning-fine-grained-bimanual-manipulation-with-low-cost.md)

---

AI 해설에는 오류가 있을 수 있습니다. [Refivu](https://refivu.com/papers/e56197ce-a521-4965-9369-f978e10dc5fe-federated-learning-for-mobile-keyboard-prediction)
