Federated learning на собеседовании Data Scientist
Карьерник — Duolingo для аналитиков: 10 минут в день тренируй SQL, Python, A/B, статистику, метрики и ещё 3 темы собеса. 1500+ вопросов в Telegram-боте. Бесплатно.
Содержание:
Идея federated learning
Train model на data, которая никогда не покидает client device.
Server → send model к clients
Clients → train на local data → send только updates
Server → aggregate updates → updated modelData privacy preserved.
FedAvg
Standard algorithm (Google 2017).
1. Server initializes model w_0.
2. Каждый round:
a. Send w_t to N selected clients.
b. Каждый client trains несколько epochs локально → получает w_i_t+1.
c. Send updates back.
d. Server averages: w_t+1 = sum(n_i * w_i_t+1) / sum(n_i).n_i — sample count client i.
Variations: FedProx (regularization), FedNova, SCAFFOLD.
Privacy techniques
Secure aggregation. Cryptographic protocol — server видит aggregate, не individual updates.
Differential privacy. Add noise to gradients перед send. Bounded info leak per client.
Homomorphic encryption. Compute на encrypted data. Powerful, dorogo.
Cross-device vs cross-silo
Cross-device. Millions устройств (mobile phones, wearables). Each has small data.
- Examples: Google Gboard, Apple Siri.
- Challenges: massive scale, intermittent connectivity, device heterogeneity.
Cross-silo. Несколько organizations (hospitals, banks). Each имеет large data.
- Examples: medical research across hospitals.
- Challenges: trust, governance, IID violation.
Применения
Mobile keyboards. Personalized predictions без uploading typing history.
Medical research. Multiple hospitals collaborate без sharing patients data.
Finance. Banks fraud detection cross-bank без sharing customer data.
IoT. Devices learn без sending raw sensor data.
В РФ: federated learning редкость в production. Иногда research projects.
Связанные темы
- Privacy и 152-ФЗ для SA
- MLOps на собесе DS
- Gradient descent для DS
- Bias и fairness для DS
- Подготовка к собесу Data Scientist
FAQ
Это официальная информация?
Нет. Статья основана на работах McMahan 2017 (FedAvg), документации TFF / Flower.
Тренируйте Data Science — откройте тренажёр с 1500+ вопросами для собесов.