ArticleslgStudy

computer science

Federated learning

Federated learning is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Federated learning rather than just read about it. In short: Federated learning (also known as collaborative learning) is a machine learning technique in a setting where multiple entities (often called clients) collaboratively train a model while keeping their data decentralized, rather than centrally stored. A defining characteristic of federated learning is data heterogeneity.

Federated learning — main illustration
Federated learning — illustration

Key takeaways

  • Federated learning belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Federated learning to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Federated learning from memory before moving on to harder problems.

Reference excerpt

Federated learning (also known as collaborative learning) is a machine learning technique in a setting where multiple entities (often called clients) collaboratively train a model while keeping their data decentralized, rather than centrally stored. A defining characteristic of federated learning is data heterogeneity. Because client data is decentralized, data samples held by each client may not be independently and identically distributed. Federated learning is generally concerned with and motivated by issues such as data privacy, data minimization, and data access rights. Its applications involve a variety of research areas including defence, telecommunications, the Internet of things, and pharmaceuticals.

Definition Federated learning aims at training a machine learning algorithm, for instance deep neural networks, on multiple local datasets contained in local nodes without explicitly exchanging data samples. The general principle consists in training local models on local data samples and exchanging parameters (e.g. the weights and biases of a deep neural network) between these local nodes at some frequency to generate a global model shared by all nodes. The main difference between federated learning and distributed learning lies in the assumptions made on the properties of the local datasets, as distributed learning originally aims at parallelizing computing power where federated learning originally aims at training on heterogeneous datasets. While distributed learning also aims at training a single model on multiple servers, a common underlying assumption is that the local datasets are independent and identically distributed (i.i.d.) and roughly have the same size. None of these hypotheses are made for federated learning; instead, the datasets are typically heterogeneous and their sizes may span several orders of magnitude. Moreover, the clients involved in federated learning may be unreliable as they are subject to more failures or drop out since they commonly rely on less powerful communication media (i.e. Wi-Fi) and battery-powered systems (i.e. smartphones and IoT devices) compared to distributed learning where nodes are typically datacenters that have powerful computational capabilities and are connected to one another with fast networks.

Mathematical formulation The objective function for federated learning is as follows: f(𝐱1,…,𝐱K)=1K∑i=1Kfi(𝐱i) where K is the number of nodes, 𝐱i are the weights of model as viewed by node i, and fi is node i's local objective function, which describes how model weights 𝐱i conforms to node i's local dataset. The goal of federated learning is to train a common model on all of the nodes' local datasets, in other words:

Optimizing the objective function f(𝐱1,…,𝐱K). Achieving consensus on 𝐱i. In other words, 𝐱1,…,𝐱K converge to some common 𝐱 at the end of the training process.

Centralized federated learning In the centralized federated learning setting, a central server is used to orchestrate the different steps of the algorithms and coordinate all the participating nodes during the learning process. The server is responsible for the nodes selection at the beginning of the training process and for the aggregation of the received model updates. Since all the selected nodes have to send updates to a single entity, the server may become a bottleneck of the system.

Decentralized federated learning In the decentralized federated learning setting, the nodes are able to coordinate themselves to obtain the global model. This setup prevents single point failures as the model updates are exchanged only between interconnected nodes without the orchestration of the central server. Nevertheless, the specific network topology may affect the performances of the learning process. See blockchain-based federated learning and the references therein.

Personalized federated learning In many application domains, not all clients are the same. Clients may share the same model architecture, but each have a different data distribution—which is known as Personalized federated learning (PFL), or even have different model architectures, like mobile phones and IoT devices—which is known as Heterogeneous federated learning. The key challenge in training a PFL model is to keep each client different from others, and at the same time benefit from generalizing across clients.

Heterogeneous federated learning Most of the existing federated learning strategies assume that local models share the same global model architecture. In 2020, a federated learning framework named HeteroFL was developed to address heterogeneous clients equipped with very different computation and communication capabilities. The HeteroFL technique can enable the training of heterogeneous local models with dynamically varying computation and non-IID data complexities while still producing a single accurate global inference model.

Main features

Iterative learning The iterative process of federated learning is composed of a series of fundamental client-server interactions, each of which is known as a federated learning round. Each round of this process consists in transmitting the current global model state to participating nodes, training local models on these local nodes to produce a set of potential model updates at each node, and then aggregating and processing these local updates into a single global update and applying it to the global model. In the methodology below, a central server is used for aggregation, while local nodes perform local training depending on the central server's orders. However, other strategies lead to the same results without central servers, in a peer-to-peer approach, using gossip or consensus methodologies. Assuming a federated round composed by one iteration of the learning process, the learning procedure can be summarized as follows:

… excerpt ends here. Continue reading the full article.

Illustrations

Federated learning: Diagram of a Federated Learning protocol with smartphones training a global AI model
Diagram of a Federated Learning protocol with smartphones training a global AI model
Federated learning: Diagrams of a centralized federated learning (on the left) and a decentralized federated learning (on the right)
Diagrams of a centralized federated learning (on the left) and a decentralized federated learning (on the right)
Federated learning: Federated learning general process in central orchestrator setup
Federated learning general process in central orchestrator setup
Federated learning: Stylised visualisation of model accuracy versus contributors.
Stylised visualisation of model accuracy versus contributors.

Worked examples

Example 1 — a first encounter with Federated learning

Start with the simplest possible case. Write down what Federated learning claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Federated learning before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Federated learning ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Federated learning

In research
Federated learning appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Federated learning in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Federated learning is common in secondary-school and first-year university syllabi. It links to neighbouring topics Distributed artificial intelligence, Machine learning, so understanding it makes those chapters shorter.
In everyday life
Look for Federated learning outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Federated learning” →

How to study Federated learning in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Federated learning means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Federated learning out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Federated learning in simple terms?

Federated learning (also known as collaborative learning) is a machine learning technique in a setting where multiple entities (often called clients) collaboratively train a model while keeping their data decentralized, rather than centrally stored. A defining characteristic of federated learning i…

Why does Federated learning matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Federated learning?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Federated learning.

Tags

  • Distributed artificial intelligence
  • Machine learning

Keep exploring