Towards Federated Learning at Scale: System Design

Keith BonawitzHubert EichnerWolfgang GrieskampDzmitry HubaAlex IngermanVladimir IvanovChloe KiddonJakub KonečnýStefano MazzocchiH. Brendan McMahan

article2019MLSys3,326 citations

Presents the production system architecture and communication protocol required to scale federated learning across millions of decentralized mobile devices while resolving real-world challenges in device availability and network efficiency.

Listen

Federated learning enables model training across decentralized data on mobile devices without moving raw user data to central servers, addressing rising privacy concerns and regulatory pressures around personal information. The work describes the design and deployment of a production system built on TensorFlow for Android phones, focused on synchronous rounds of training and evaluation using algorithms such as Federated Averaging.

The authors set out to create a scalable infrastructure that orchestrates device participation, aggregates model updates securely, and supports real-world applications while respecting device constraints and user experience. They implemented a protocol with selection, configuration, and reporting phases, an on-device runtime that runs only when devices are idle and charging, an actor-based server architecture for elastic scaling, and optional Secure Aggregation to keep individual updates encrypted.

The system has operated in production for over a year with a cumulative population of roughly 10 million daily active devices across multiple applications. A few hundred participating devices per round proved sufficient for convergence in most cases, while observed dropout rates ranged from 6 to 10 percent; pace steering balanced load across diurnal cycles and population sizes. In one keyboard application, a recurrent model trained over five days on 1.5 million users improved top-1 recall from 13.0 percent to 16.4 percent, matching or exceeding a centrally trained counterpart. Device health metrics and round visualizations allowed rapid detection and resolution of operational issues.

These results show that synchronous federated training can be made reliable at scale, delivering models that use on-device data while limiting exposure of raw examples and supporting additional privacy tools such as differential privacy. The approach reduces the need to transmit sensitive user interactions and enables applications such as next-word prediction and content suggestion that would otherwise raise privacy or bandwidth barriers.

Further work should quantify participation bias arising from eligibility rules, develop algorithms that exploit greater parallelism to shorten convergence times, and refine device scheduling and compression to lower bandwidth and resource costs. The current design already supports generalization beyond machine learning to broader federated computation tasks.

Limitations include reliance on devices that meet strict eligibility criteria, potential under-representation of users without unmetered networks, and quadratic scaling costs that currently restrict Secure Aggregation to a few hundred participants per group. The reported operational metrics reflect one set of production workloads rather than controlled experiments, so results should be interpreted with caution when applied to new domains or device populations.

arXiv: 1902.01046
Cover for Towards Federated Learning at Scale: System Design

Abstract

Federated Learning is a distributed machine learning approach which enables model training on a large corpus of decentralized data. We have built a scalable production system for Federated Learning in the domain of mobile devices, based on TensorFlow. In this paper, we describe the resulting high-level design, sketch some of the challenges and their solutions, and touch upon the open problems and future directions.

Table of Contents

  • 1 INTRODUCTION
  • 2 PROTOCOL
  • 2.1 Basic Notions
  • 2.2 Phases
  • 2.3 Pace Steering
  • 4 SERVER
  • 4.1 Actor Model
  • 4.2 Architecture
  • 4.3 Pipelining
  • 4.4 Failure Modes
  • 5 ANALYTICS
  • 6 SECURE AGGREGATION
  • 7 TOOLS AND WORKFLOW
  • 7.1 Modeling and Simulation
  • 7.2 Plan Generation
  • 7.3 Versioning, Testing, and Deployment
  • 7.4 Metrics
  • 8 APPLICATIONS
  • 9 OPERATIONAL PROFILE
  • 10 RELATED WORK
  • 11 FUTURE WORK
  • ACKNOWLEDGEMENT
  • A OPERATIONAL PROFILE DATA
  • B FEDERATED AVERAGING

Knowls

  1. Knowl 1 — Three-Phase Synchronous Federated Learning Protocol

    model/method

    The federated learning communication protocol coordinates mobile client devices and a cloud-based distributed server to iteratively advance a shared global machine learning model through synchronous rounds. Each round consists of three sequential phases:

    1. Selection: Devices that satisfy operational eligibility criteria (specifically: device idle, connected to a power charger, and on an unmetered network such as Wi-Fi) check in with the server via bidirectional streaming connections. The server selects a target subset of connected devices using reservoir sampling. To compensate for expected device dropouts (which range from 6% to 10%) and stragglers, the server over-selects by typically recruiting 130% of the target participant count KK. Devices not chosen receive instructions suggesting a future reconnection window.

    2. Configuration: The server transmits an execution package known as an Federated Learning (FL) Plan (containing the TensorFlow computation graph, batching parameters, and local epoch counts) along with an FL Checkpoint (the serialized global model parameters) to all selected devices.

    3. Reporting: The server waits for devices to execute local training on their private on-device data and upload their computed parameter updates. Updates are aggregated into the global model as they arrive using Federated Averaging. Once the target threshold of updates is reached or a timeout expires, the round is committed and the global checkpoint is updated. Devices that fail to report before the reporting window closes are ignored as stragglers.

    To minimize round latency, the server executes pipelining: the Selection phase for round t+1t+1 is run continuously in parallel with the Configuration and Reporting phases of round tt.

  2. Knowl 2 — Actor-Based Server Architecture with In-Memory Aggregation

    model/method

    The federated learning server infrastructure is structured around the Actor Programming Model, where concurrent components interact exclusively via sequential message queues:

    • Coordinators: Long-lived singleton actors registered in a distributed locking service, with one Coordinator owning each FL population. Coordinators synchronize lock-step round advancement, allocate client quotas to Selectors, and instantiate Master Aggregators for individual FL tasks.
    • Selectors: Long-lived actors deployed at the edge close to client devices. They accept incoming client streams, enforce pace steering, and forward eligible devices to active Aggregators based on quotas received from Coordinators.
    • Master Aggregators: Ephemeral actors created per task round to manage model updates. They dynamically spawn and supervise child Aggregators.
    • Aggregators: Ephemeral worker actors that receive connections forwarded by Selectors, collect model updates directly from devices, and compute intermediate update sums.

    All state and model updates within Aggregators and Master Aggregators are maintained strictly in volatile memory (RAM). No per-device updates or intermediate checkpoints are written to persistent disk storage; only the final aggregated model update of a completed round is committed to storage. This ephemeral in-memory processing minimizes distributed storage I/O latency and provides security against data center attacks targeting persistent logs of individual user updates.

  3. Knowl 3 — Two-Tier Hierarchical Secure Aggregation

    model/method

    Secure Aggregation is a multi-party computation protocol that enables a server to compute the sum of client model updates kΔk\sum_{k} \Delta^k while ensuring that individual updates Δk\Delta^k remain cryptographically uninspectable, even in server memory against honest-but-curious adversaries.

    The protocol operates over four communication steps across three phases:

    1. Prepare Phase (Rounds 1 and 2): Devices establish pairwise shared cryptographic secrets via key exchange. If a device drops out during this phase, its update is omitted from aggregation.
    2. Commit Phase (Round 3): Surviving devices upload their model updates masked with the shared cryptographic secrets. The server computes the sum of the masked updates. Every device completing this round must be included in the final aggregation.
    3. Finalization Phase (Round 4): Devices reveal sufficient cryptographic secret shares to allow the server to decrypt and unmask the aggregated sum, without revealing individual masks.

    Because the computational cost for the server in Secure Aggregation scales quadratically (O(N2)O(N^2)) with the number of participating clients NN, single-group Secure Aggregation is constrained to a few hundred users. To scale to thousands of participants per round, the architecture implements a two-tier hierarchical aggregation scheme:

    • Participating devices are partitioned across multiple distributed Aggregator actors.
    • Each Aggregator runs an independent instance of Secure Aggregation over its local subgroup of size at least kk (a configurable privacy threshold parameter), producing an unmasked intermediate sum.
    • The Master Aggregator receives and linearly sums the intermediate aggregates from all Aggregators in plaintext to form the final global round update.
  4. Knowl 4 — Pace Steering Flow Control Mechanism

    model/method

    Pace steering is a server-driven flow control mechanism that regulates device check-in rates by returning a suggested optimal reconnection time window to rejected or completing devices. Devices schedule future connection attempts to match this window, subject to local eligibility constraints.

    Pace steering serves three primary functions:

    1. Small FL Populations: When device availability is low, the server uses a stateless probabilistic scheduling algorithm to synchronize device reconnections into narrow, contemporaneous time windows. This ensures that enough devices arrive concurrently to satisfy the minimum group size (kk) required by Secure Aggregation protocols and to make progress.
    2. Large FL Populations: When device counts are high, the server spreads suggested reconnection times uniformly to prevent 'thundering herd' connection surges and throttles device participation to match the exact scheduling needs of active FL tasks.
    3. Diurnal Adaptation: Pace steering adjusts reconnection distributions to track 24-hour diurnal usage cycles (where availability peaks when users charge phones overnight), avoiding server overload during peak periods while maintaining round throughput during troughs.
  5. Knowl 5 — On-Device Federated Learning Runtime and Example Store Architecture

    model/method

    The client-side architecture on mobile devices consists of three primary components:

    • Application Process and Example Store: Applications maintain local, private event databases (such as SQLite stores logging user interactions) conforming to a standardized Example Store API. Applications enforce data expiration policies and local encryption at rest.
    • FL Runtime: A client library that executes training or evaluation tasks. The runtime communicates with application Example Stores via Inter-Process Communication (Android AIDL), allowing it to run either inside the host app or within a standalone background service.
    • Job Scheduler Constraints: The FL Runtime registers periodic background tasks with the operating system (e.g., Android JobScheduler) configured with strict execution prerequisites: the device must be idle, actively charging, and connected to an unmetered network (Wi-Fi). If any of these conditions ceases during execution, the FL Runtime immediately aborts the task and discards temporary state to prevent user experience degradation, battery drain, or cellular data consumption.

    To ensure fleet safety without identifying individual users, the runtime employs remote hardware attestation (Android SafetyNet) during connection. This cryptographically proves to the server that updates originate from genuine, unmodified devices and applications, mitigating data poisoning attacks while preserving user anonymity.

  6. Knowl 6 — Federated Learning Plan Generation and Computation Graph Versioning

    model/method

    Federated learning tasks are specified declaratively in Python and compiled into a serialized data structure called an FL Plan, which decouples task execution from Python runtimes on both devices and servers.

    An FL Plan contains two complementary components:

    1. Device Plan: Contains the client-side TensorFlow computation graph, criteria for querying local records from the Example Store, batching instructions, local epoch counts, and designated graph node identifiers for loading weights and extracting updates.
    2. Server Plan: Encodes the server-side aggregation and averaging computation graph.

    Because mobile devices in the fleet may run legacy versions of the on-device TensorFlow runtime that lack newer operators or have differing operator signatures, the infrastructure implements FL Plan Versioning. An automated compiler applies graph transformations to the canonical (unversioned) computation graph, translating it into multiple versioned FL plans tailored to older deployed runtimes. Each versioned plan must pass identical release verification and emulator tests under simulated resource limits before deployment.

  7. Knowl 7 — Federated Averaging with Client Over-Selection

    algorithm

    The Federated Averaging algorithm coordinates synchronous model parameter updates across KK reporting clients per round, employing an over-selection factor of 1.3 on the server to handle client dropouts and stragglers.

    Server executes:
        Initialize global model weights w0w_0
        for each round t=1,2,t = 1, 2, \dots do
            Select 1.3K1.3K eligible clients to compute updates
            Wait for updates from the first KK clients (indexed k{1,,K}k \in \{1, \dots, K\})
            for each client k{1,,K}k \in \{1, \dots, K\} do
                (Δk,nk)ClientUpdate(wt)(\Delta^k, n^k) \leftarrow \text{ClientUpdate}(w_t)
            wˉtk=1KΔk\bar{w}_t \leftarrow \sum_{k=1}^K \Delta^k
            nˉtk=1Knk\bar{n}_t \leftarrow \sum_{k=1}^K n^k
            Δtwˉt/nˉt\Delta_t \leftarrow \bar{w}_t / \bar{n}_t
            wt+1wt+Δtw_{t+1} \leftarrow w_t + \Delta_t
    ClientUpdate(ww):
        Divide local dataset into minibatches B\mathcal{B}
        nBn \leftarrow |\mathcal{B}|
        winitww_{\text{init}} \leftarrow w
        for each batch bBb \in \mathcal{B} do
            wwη(w;b)w \leftarrow w - \eta \nabla \ell(w; b)
        Δn(wwinit)\Delta \leftarrow n \cdot (w - w_{\text{init}})
        return (Δ,n)(\Delta, n) to server

    In the algorithm, (w;b)\ell(w; b) denotes the loss on batch bb, η\eta is the client learning rate, nkn^k is the number of local training batches on client kk, Δk\Delta^k is the weighted parameter delta computed by client kk, wˉt\bar{w}_t is the sum of weighted updates across all KK reporting clients, nˉt\bar{n}_t is the total number of batches processed across all clients in the round, and Δt\Delta_t is the average global update applied to the server parameters wtw_t.

  8. Knowl 8 — Distribution of On-Device Training Session Outcomes

    data/table

    Telemetric activity logs from a deployed production federated learning population capture the breakdown of device session life cycles across 1,473,650 recorded training attempts:

    Session Shape Count Percent
    -v[]+̂ 1,116,401 75%
    -v[]+# 327,478 22%
    -v[! 29,771 2%

    The session shape notation represents discrete client state transitions:

    • -: FL server check-in
    • v: Downloaded FL plan and model checkpoint
    • [: Local on-device training started
    • ]: Local on-device training completed
    • +: Model update upload started
    • ^: Model update upload completed successfully
    • #: Model update upload rejected by the server (because the target number of updates was reached and the reporting window closed)
    • !: Training interrupted (e.g., device unplugged or ceased to be idle)

    The data shows that 75% of participants successfully complete both training and upload. 22% of devices complete training but have their updates rejected due to arriving after the round's reporting window closed (straggler cutoff). Only 2% of devices are interrupted mid-computation due to eligibility state changes.

  9. Knowl 9 — Operational Profile and Fleet Dynamics in Production Federated Learning

    empirical result

    Operational telemetry from a production deployment serving over 10 million daily active devices across multiple applications demonstrates the following system characteristics:

    1. Concurrency and Diurnal Variation: Up to 10,000 devices participate in federated training simultaneously. In geographically concentrated populations, device availability exhibits a 4×4\times variation between daily peaks (during local nighttime when devices are charging and idle) and daytime troughs, driving proportional oscillations in round completion rates.
    2. Dropout and Rejection Rates: Unplanned client dropouts due to network errors, execution failures, or changes in charging/idle state account for 6% to 10% of participants per round. Stragglers whose updates arrive after the collection goal is met account for 22% of total initiated client sessions.
    3. Network Traffic Asymmetry: Data downloaded from the server by devices vastly exceeds data uploaded from devices to the server. This asymmetry arises because each client must download both the uncompressed global model checkpoint and the FL plan (which is comparable in size to the model), whereas the client uploads only the weight update vector Δ\Delta, which is sparse, highly compressible, and excludes graph metadata.
  10. Knowl 10 — Federated Recurrent Neural Network for Mobile Next-Word Prediction

    empirical result

    A recurrent neural network (RNN) with 1.4 million parameters was trained on-device for mobile keyboard (Gboard) next-word prediction using the production federated learning system:

    • Scale and Convergence: Training converged in 3,000 federated rounds over a 5-day period (averaging 2 to 3 minutes per round), processing 6×1086 \times 10^8 sentences across 1.5×1061.5 \times 10^6 unique user devices.
    • Model Quality: The federated RNN improved top-1 recall from 13.0% (achieved by an on-device baseline n-gram model) to 16.4%. It matched the prediction accuracy of an identical RNN architecture trained in a data center using 1.2×1081.2 \times 10^8 stochastic gradient descent (SGD) steps on proxy text data.
    • Live Evaluation: In live A/B testing on end-user devices, the federated-trained RNN outperformed both the baseline n-gram model and the data center-trained RNN.

Coverage note — None was omitted; all key architectural components, protocols, algorithms, production empirical profiles, and application deployments described in the paper are covered.

References

  1. 1.Abadi, M., Agarwal, A., Barham, P., Brevdo, E., Chen, Z., Citro, C., Corrado, G. S., Davis, A., Dean, J., Devin, M., Ghemawat, S., Goodfellow, I., Harp, A., Irving, G., Isard, M., Jia, Y., Jozefowicz, R., Kaiser, L., Kudlur, M., Levenberg, J., Mane, D., Monga, R., Moore, S., Murray, D., Olah, C., Schuster, M., Shlens, J., Steiner, B., Sutskever, I., Talwar, K., Tucker, P., Vanhoucke, V., Vasudevan, V., Viegas, F., Vinyals, O., Warden, P., Wattenberg, M., Wicke, M., Yu, Y., and Zheng, X. TensorFlow: Large-scale machine learning on heterogeneous systems. In OSDI, volume 16, pp. 265–283, 2016.
  2. 2.ai.google. Under the hood of the pixel 2: How ai is supercharging hardware, 2018. URL https://ai.google/stories/ai-in-hardware/. Retrieved Nov 2018.
  3. 3.Android Documentation. SafetyNet Attestation API. URL https://developer.android.com/training/safetynet/attestation.
  4. 4.Bagdasaryan, E., Veit, A., Hua, Y., Estrin, D., and Shmatikov, V. How to backdoor federated learning. arXiv preprint arXiv:1807.00459, 2018.
  5. 5.Bonawitz, K., Ivanov, V., Kreuter, B., Marcedone, A., McMahan, H. B., Patel, S., Ramage, D., Segal, A., and Seth, K. Practical secure aggregation for privacy-preserving machine learning. In Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, pp. 1175–1191. ACM, 2017.
  6. 6.Brisimi, T. S., Chen, R., Mela, T., Olshevsky, A., Paschalidis, I. C., and Shi, W. Federated learning of predictive models from federated electronic health records. International journal of medical informatics, 112:59–67, 2018.
  7. 7.Caldas, S., Konecný, J., McMahan, H. B., and Talwalkar, A. Expanding the reach of federated learning by reducing client resource requirements. arXiv preprint 1812.07210, 2018.
  8. 8.Dean, J. and Ghemawat, S. MapReduce: Simplified data processing on large clusters. Communications of the ACM, 51(1):107–113, 2008.
  9. 9.Dean, J., Corrado, G., Monga, R., Chen, K., Devin, M., Le, Q. V., Mao, M., Ranzato, M., Senior, A., Tucker, P., Yang, K., and Ng, A. Y. Large scale distributed deep networks. In Advances in neural information processing systems, pp. 1223–1231, 2012.
  10. 10.Goyal, P., Dollár, P., Girshick, R., Noordhuis, P., Wesolowski, L., Kyrola, A., Tulloch, A., Jia, Y., and He, K. Accurate, large minibatch SGD: Training imagenet in 1 hour. arXiv preprint arXiv:1706.02677, 2017.
  11. 11.Hard, A., Rao, K., Mathews, R., Beaufays, F., Augenstein, S., Eichner, H., Kiddon, C., and Ramage, D. Federated learning for mobile keyboard prediction. arXiv preprint 1811.03604, 2018.
  12. 12.Hewitt, C., Bishop, P. B., and Steiger, R. A universal modular ACTOR formalism for artificial intelligence. In Proceedings of the 3rd International Joint Conference on Artificial Intelligence. Stanford, CA, USA, August 20-23, 1973, pp. 235–245, 1973.
  13. 13.Jacob, B., Kligys, S., Chen, B., Zhu, M., Tang, M., Howard, A., Adam, H., and Kalenichenko, D. Quantization and training of neural networks for efficient integer-arithmetic-only inference. arXiv preprint arXiv:1712.05877, 2017.
  14. 14.Kamp, M., Adilova, L., Sicking, J., Hüger, F., Schlicht, P., Wirtz, T., and Wrobel, S. Efficient decentralized deep learning by dynamic model averaging. arXiv preprint arXiv:1807.03210, 2018.
  15. 15.Konecný, J., McMahan, H. B., Ramage, D., and Richtárik, P. Federated optimization: Distributed machine learning for on-device intelligence. arXiv preprint arXiv:1610.02527, 2016a.
  16. 16.Konecný, J., McMahan, H. B., Yu, F. X., Richtárik, P., Suresh, A. T., and Bacon, D. Federated learning: Strategies for improving communication efficiency. arXiv preprint arXiv:1610.05492, 2016b.
  17. 17.Li, M., Andersen, D. G., Park, J. W., Smola, A. J., Ahmed, A., Josifovski, V., Long, J., Shekita, E. J., and Su, B.-Y. Scaling distributed machine learning with the parameter server. In 11th USENIX Symposium on Operating Systems Design and Implementation (OSDI 14), pp. 583–598. USENIX Association, 2014.
  18. 18.Low, Y., Bickson, D., Gonzalez, J., Guestrin, C., Kyrola, A., and Hellerstein, J. M. Distributed graphlab: A framework for machine learning and data mining in the cloud. Proc. VLDB Endow., 5(8):716–727, April 2012.
  19. 19.McMahan, H. B. and Ramage, D. Federated learning: Collaborative machine learning without centralized training data, April 2017. URL https://ai.googleblog.com/2017/04/federated-learning-collaborative.html. Google AI Blog.
  20. 20.McMahan, H. B., Moore, E., Ramage, D., Hampson, S., and y Arcas, B. A. Communication-efficient learning of deep networks from decentralized data. In Proceedings of the 20th International Conference on Artificial Intelligence and Statistics, pp. 1273–1282, 2017.
  21. 21.McMahan, H. B., Ramage, D., Talwar, K., and Zhang, L. Learning differentially private recurrent language models. In International Conference on Learning Representations (ICLR), 2018.
  22. 22.Nishio, T. and Yonetani, R. Client selection for federated learning with heterogeneous resources in mobile edge. arXiv preprint arXiv:1804.08333, 2018.
  23. 23.Pihur, V., Korolova, A., Liu, F., Sankuratripati, S., Yung, M., Huang, D., and Zeng, R. Differentially-private “draw and discard” machine learning. arXiv preprint arXiv:1807.04369, 2018.
  24. 24.Samarakoon, S., Bennis, M., Saad, W., and Debbah, M. Federated learning for ultra-reliable low-latency v2v communications. arXiv preprint arXiv:1805.09253, 2018.
  25. 25.Smith, S., jan Kindermans, P., Ying, C., and Le, Q. V. Don’t decay the learning rate, increase the batch size. In International Conference on Learning Representations (ICLR), 2018.
  26. 26.Smith, V., Chiang, C.-K., Sanjabi, M., and Talwalkar, A. S. Federated multi-task learning. In Advances in Neural Information Processing Systems, pp. 4424–4434, 2017.
  27. 27.Yang, T., Andrew, G., Eichner, H., Sun, H., Li, W., Kong, N., Ramage, D., and Beaufays, F. Applied federated learning: Improving google keyboard query suggestions. arXiv preprint 1812.02903, 2018.

Citation

MLA
Bonawitz, K., et al. “Towards Federated Learning at Scale: System Design”. arXiv, 2019, http://arxiv.org/abs/1902.01046v2.
APA
Bonawitz, K., Eichner, H., Grieskamp, W., Huba, D., Ingerman, A., Ivanov, V., Kiddon, C., Konečný, J., Mazzocchi, S., McMahan, H. B., Overveldt, T. V., Petrou, D., Ramage, D., & Roselander, J. (2019). Towards Federated Learning at Scale: System Design. arXiv. http://arxiv.org/abs/1902.01046v2
Chicago
Bonawitz, K., H. Eichner, W. Grieskamp, et al. 2019. “Towards Federated Learning at Scale: System Design”. arXiv. http://arxiv.org/abs/1902.01046v2.
Harvard
Bonawitz, K. et al. (2019) “Towards Federated Learning at Scale: System Design”, arXiv [Preprint]. Available at: http://arxiv.org/abs/1902.01046v2.
Vancouver
1. Bonawitz K, Eichner H, Grieskamp W, et al (2019) Towards Federated Learning at Scale: System Design. arXiv

BibTeX

@article{bonawitz2019towards,
  title = {Towards Federated Learning at Scale: System Design},
  author = {Bonawitz, Keith and Eichner, Hubert and Grieskamp, Wolfgang and Huba, Dzmitry and Ingerman, Alex and Ivanov, Vladimir and Kiddon, Chloe and Konečný, Jakub and Mazzocchi, Stefano and McMahan, H. Brendan and Overveldt, Timon Van and Petrou, David and Ramage, Daniel and Roselander, Jason},
  year = {2019},
  journal = {arXiv},
  url = {http://arxiv.org/abs/1902.01046v2},
  eprint = {1902.01046}
}
Metadata:arXiv

Access the Paper

This paper is available from its original source. Click below to access the PDF.

Open PDF

License: Published with permission