šFederated Learning
Training together without sharing raw data
Take your time with this one. The interactive parts are here to help you test the idea, not rush through it.
Pause and experiment as you go.
Before We Begin
What we are learning today
Federated learning changes where training happens. Instead of sending all raw data to one central server, each device or organization trains locally and shares model updates that can be aggregated into a stronger global model.
How this lesson fits
This module looks beyond the standard supervised-learning workflow. Students explore systems that learn from delayed rewards and systems that train collaboratively while keeping raw data distributed, which introduces the real-world constraints of strategy, privacy, and deployment.
The big question
How can AI systems keep improving in realistic environments where feedback is delayed, data is sensitive, and decisions have long-term consequences?
Why You Should Care
Modern AI does not live only in ideal laboratory settings. It has to respect privacy, bandwidth, regulation, and uneven device quality. Federated learning is a practical response to those constraints, and it shows students how engineering tradeoffs shape model design.
Where this is used today
- āOn-device predictive text systems that learn from typing behavior without uploading every message
- āCross-hospital or cross-clinic modeling where patient data cannot be freely centralized
- āDistributed consumer devices that adapt locally while contributing to a shared global model
Think of it like this
It is like a study group where every student works problems at home, then the group compares lessons learned without photocopying everyone's notebook. Useful knowledge is shared, but the private raw material stays local.
Easy mistake to make
Federated learning improves privacy but does not solve every security or fairness problem by itself. Updates can still leak information, and participating clients may contribute unevenly.
By the end, you should be able to say:
- Explain the core workflow of local training followed by global aggregation
- Describe why privacy, regulation, and data ownership motivate federated approaches
- Identify practical challenges such as non-identically distributed data, dropped clients, and device limitations
Think about this first
Why might a hospital, school, or phone user refuse to upload raw data to a central server even if doing so would make training simpler? What risks are they trying to avoid?
Words we will keep using
Federated Learning
Imagine a hospital wants to train an AI to spot diseases, but it can't share patient records because of privacy laws. Federated Learning is the solution: bring the model to the data, not the data to the model.
FedAvg Algorithm
FedAvg works like a potluck dinner. Everyone cooks a dish at home (trains on local data), brings it to the party, and mixes it all together into one giant feast (the global model).
- The server sends the current shared model to selected clients
- Each client trains on its own private data for a short time
- The clients send back updated model weights
- The server averages those updates into a new global model
where nā is the number of samples at client k and n = Ī£nā.
Interactive Federated Training
Select participating clients:
Training loss curve