Online Federated Learning

Machine Learning
Introduced by
McMahan, B. et al. (FL foundation); extended to online setting by multiple researchers c. 2019–2021
Year
2019–2021
Type
Distributed sequential learning
Family
Machine learning

What does it do?

Online Federated Learning (OFL) combines the privacy-preserving, decentralised structure of federated learning with the sequential, sample-by-sample update regime of online learning.

Clients, such as mobile devices or edge sensors, receive a global model, update it on newly arriving local data without sharing raw observations, and send model updates to a central server that aggregates them in near-real-time.

The intuition behind the method

Consider many smartphones, each collecting sensor readings over time. Sending all of that raw data to a central server is slow, costly and privacy-invasive. Online Federated Learning lets each device learn from its own incoming data and periodically send a compact model update, not the data, to the server. The server combines updates from participating devices and broadcasts a refined global model back to them. Because devices learn from data as it arrives, the model can be updated as conditions change without pooling raw observations. How well it follows gradual or sudden changes in the data depends on the learning rate, the update frequency and client participation, and should be checked on held-out streams.

History

Federated averaging was introduced by McMahan et al. (2017) for training deep networks from decentralised data, a setting motivated by mobile devices. Damaskinos et al. (2020) describe FLEET, a flexible and efficient federated learning system for edge AI. It is cited here as related edge-deployment work and not as a source for the streaming variant. The online, streaming extension has no originator or date documented in the cited sources, so neither is given here.

When to use it

Use Online Federated Learning when (1) data is naturally distributed across many edge devices or organisations and cannot legally or practically be centralised, (2) data arrives as a continuous stream and the model must adapt in near-real-time rather than from a fixed snapshot, and (3) privacy, bandwidth, or latency constraints rule out uploading raw data. Typical domains include mobile keyboard prediction, medical wearables, IoT sensor networks, and financial fraud detection across institutions. Do NOT use it when you can centralise data freely and have a stable, fixed dataset — standard batch federated learning or centralised deep learning will be simpler and easier to tune. Also avoid OFL when device populations are too small to yield diverse updates or when you have no mechanism to handle severe statistical heterogeneity across clients.

Limitations and considerations

  • Convergence is harder to guarantee than in centralised training: statistical heterogeneity (non-IID data across clients) and system heterogeneity (varying device speeds) can slow or destabilise learning. Standard convergence analyses rely on assumptions such as independent client streams, bounded gradients or losses, a sufficiently small learning rate, and enough clients participating in each round. These conditions may not hold in practice, so the update rules on this page do not by themselves guarantee convergence.
  • Requires careful design of the communication schedule, aggregation rule, and learning rate; naive settings lead to client drift or divergence.
  • Debugging and monitoring are difficult because the training process is opaque; the server cannot inspect local data or local gradients in full.
  • Secure aggregation and differential privacy mechanisms add computational and communication overhead.
  • Evaluation is non-trivial: standard centralised test sets may not reflect the heterogeneous distribution seen across clients.
  • Adaptation to concept drift is not automatic. How quickly the model follows changes depends on the learning rate, update frequency and client participation, and should be validated on time-ordered held-out data.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Raw observations stay on the client device, which is a practical privacy safeguard. This is not a formal privacy guarantee by itself; see the FAQ on differential privacy.
  • The model is updated on each arriving mini-batch rather than retrained from a fixed snapshot, so it can be adjusted as the data distribution changes. How closely it tracks drift depends on the training settings.
  • Raw client data are not uploaded to or stored on the central server. Server-side cost still depends on the number of participating clients and the model size.
  • Each communication round carries model updates or gradients rather than full datasets, which reduces the data sent over the network.
  • Local gradient steps use computation already available on the client devices, so training cost is spread across the client population.

Applications

  • Mobile keyboard and voice assistant personalisation without uploading user input.
  • Medical wearable devices learning patient-specific health patterns under strict data-sharing regulations.
  • Industrial IoT sensor networks detecting anomalies in real time across geographically distributed equipment.
  • Cross-institutional financial fraud detection where banks cannot share transaction records.

How it works

How it works

1

Data arrives as a sequence at each client rather than being held in a fixed dataset. At each time step, a participating client receives one observation or a small mini-batch from its local environment. The model therefore has to update continuously and cannot rely on re-reading a stored training set.

2

Each client takes a gradient step on its newly arrived local observation, starting from the current global model. In the update formula, the step size is the learning rate η and the loss is computed on the local sample x_t^i, so raw data stay on the device. Regularisation towards the global model, as in FedProx, is one way to limit divergence between heterogeneous clients.

Formula
w_i^{t+1} = w_i^t - \eta \nabla \ell(w_i^t; x_t^i)
3

In each round the server selects a subset of clients S_t and combines their returned updates. Each update is weighted by the client's data volume n_i. Because the sum runs over the selected clients only, the weights should be normalised by the total data volume of those clients, so that they sum to one and the result is a weighted average. Implementations should confirm the exact normalisation against the aggregation rule they follow.

4

The updated global model is sent back to the participating clients, which replace their local copies before the next data-arrival cycle. In deployed systems, client scheduling, staleness correction and gradient compression are added to keep training stable when clients drop out or report late. These adaptations are not part of the basic update rules above and vary between implementations.

Common pitfalls

  • Assuming IID data across clients — in practice data distributions differ dramatically, so always test performance under non-IID splits.
  • Ignoring client dropout: in real deployments many devices go offline mid-round; the aggregation rule must be robust to partial participation.
  • Tuning only on the global model's average performance and missing catastrophic forgetting on minority-distribution clients.
  • Neglecting communication budget constraints — too-frequent aggregation rounds may exceed bandwidth limits on mobile or IoT networks.
  • Treating the global model as final without evaluating personalisation: a single global model may perform poorly for individual clients with atypical data distributions.

Frequently asked questions

How is Online Federated Learning different from standard Federated Learning?

Standard federated learning assumes a fixed, pre-collected local dataset on each client and trains over multiple rounds on that static data. Online Federated Learning extends this to streaming settings in which new data arrive continuously and the model is updated sequentially, which makes it suited to non-stationary data. Whether it tracks concept drift well depends on the learning rate, update frequency and client participation, and should be checked empirically.

Does it provide formal privacy guarantees?

Not automatically. The basic OFL framework keeps raw data local, which is a strong practical privacy safeguard, but a formal differential privacy guarantee requires adding calibrated noise to local gradients or the aggregated update before transmission. Secure aggregation and local differential privacy are often combined with federated learning in practice; their use depends on the deployment.

How do I handle non-IID data distributions across clients?

Several strategies exist. FedProx adds a proximal term that regularises local updates toward the global model, and personalised federated learning fine-tunes the global model locally for each client. The best choice depends on how heterogeneous the client distributions are and should be checked empirically.

What sample size is needed per client?

There is no universal minimum local sample size for OFL. Very small local batches produce noisy updates, and aggregating over more clients partially compensates for the noise in individual updates. As a practical starting point, use a small local batch, measure the variance of the updates on held-out client data, and increase the number of participating clients per round until the global validation curve stabilises.

Can Online Federated Learning be used without a central server?

Yes. Decentralised or peer-to-peer federated learning variants allow devices to exchange model updates directly via a gossip protocol or ring topology, eliminating the central server bottleneck. This adds complexity but improves fault tolerance and removes a single point of trust.

Related methods

Sources

  1. Damaskinos, G., Guerraoui, R., Kermarrec, A.-M., Guirguis, A., Riviere, M., & Tempo, R. (2020). FLEET: Flexible and Efficient Federated Learning for Edge AI. Proceedings of Machine Learning and Systems (MLSys).

    Open publication reference
  2. McMahan, B., Moore, E., Ramage, D., Hampson, S., & Aguera y Arcas, B. (2017). Communication-Efficient Learning of Deep Networks from Decentralized Data. Proceedings of the 20th International Conference on Artificial Intelligence and Statistics (AISTATS), 54, 1273–1282.

    Open publication reference