Federated Learning Systems
Master federated learning: privacy-preserving distributed training, federated averaging, client management, and production deployment.
What is federated learning?
Federated learning is a way to train a shared model across many data owners without first copying their raw examples into one training store. A coordinator distributes a model and a round contract, selected clients train locally, and the coordinator combines bounded updates into the next global model.
It matters when data is sensitive, costly to move, governed by different organizations, or created on intermittently connected devices. The design changes where computation happens, but it does not remove the coordinator, communication, evaluation, or security work.
Core invariant: raw examples remain at their source, while every update, aggregate, metric, and released model is still treated as sensitive data. Review data distribution shifts and MLOps monitoring if population drift and production model evidence are unfamiliar.
Federated learning is a data-placement architecture, not a privacy guarantee. Individual updates may leak information, repeated aggregates compose privacy loss, and malicious clients can poison training.
One training round has four owners
The system advances through rounds. Each stage needs a durable identity, deadline, policy version, and observable outcome so a retry cannot silently apply an update twice or release an unevaluated model.
1 Coordinator
Select an eligible cohort
Filter by consent, software and model version, power and network policy, geography, availability, rate limits, and sampling goals.
2 Client
Train within a client contract
Verify the model and task, load local examples, run bounded work, clip the contribution, and report only approved metrics and update material.
3 Aggregator
Recover a valid aggregate
Authenticate participants, reject incompatible schemas, tolerate bounded dropout, and unmask only after the secure-aggregation survivor threshold is met.
4 Model owner
Evaluate before release
Check global and cohort quality, privacy accounting, integrity canaries, fairness, rollback criteria, and artifact lineage before canary deployment.
Choose cross-device or cross-silo federation deliberately
Both modes move training toward data, but their identity, reliability, governance, and scale assumptions are different.
Many intermittent clients
Cross-device federation
Phones, browsers, vehicles, or edge devices participate briefly. The design emphasizes anonymous or pseudonymous sampling, energy and network policy, high dropout, small per-client weight, and large secure-aggregation cohorts.
Few known organizations
Cross-silo federation
Hospitals, banks, regions, or business units train on managed infrastructure. The design emphasizes identity, contracts, schema alignment, organization-level weighting, governance, and auditable site-specific quality.
Write the federation contract before choosing an optimizer
- Unit of contribution: one person, device, account, organization, or bounded window of records
- Eligibility: consent, jurisdiction, model version, data freshness, device health, and participation frequency
- Round completion: deadline, minimum survivors, maximum retries, late-update handling, and idempotency key
- Release unit: per-round update, periodic checkpoint, personalized model, or site-specific artifact
- Ownership: who approves client code, privacy parameters, model promotion, incident response, and deletion requests
Size the round around survivors, not invitations
Inviting 500 devices does not mean 500 updates will be aggregated. Some are offline, some reject the task, some fail local training, and some disappear during cryptographic unmasking.
Can enough clients finish the round?
Shape a cross-device or cross-silo round. Availability and dropout determine the secure-aggregation quorum; model size and link speed determine the communication envelope.
Round verdict
The expected cohort clears quorum
31 clients remain above the modeled survivor threshold. Keep a timeout and retry policy because the estimate is not a guarantee.
320
64% of invitations
262
231 required for quorum
12.9 GiB
11.2 MiB compressed update per survivor
4.9 min
Local work plus modeled transfer and coordination
Expected round path
500
from 100,000 eligible clients
320
download the current model and round contract
262
0.26% of the eligible fleet
Planning assumptions: the update is 35% of model size, downlink is four times uplink, and coordination adds 35 seconds. Real rounds are gated by tail clients, cryptographic setup, server aggregation, retries, energy policy, and regional network conditions.
Keep four quantities separate
accepted = invitations x observed availabilityexpected survivors = accepted x (1 - dropout rate)quorum margin = expected survivors - required survivorsround transfer = accepted downloads + survivor uploads
The lab models a compressed update as 35% of model size and uses simple link assumptions. In production, estimate distributions rather than averages: p50, p95, and deadline miss rates by device class, region, software version, and network type.
More invitations improve the chance of clearing quorum, but they also increase transfer, energy use, selection bias, and privacy exposure. Oversampling is not a free reliability control.
Client selection determines whose objective is optimized
Availability is rarely random. Devices that are charging on fast networks at night, organizations with larger clusters, or clients that tolerate repeated participation can dominate the training population.
Measure selection as a funnel
- Count eligible clients by relevant cohort before sampling.
- Record invitations, acceptances, successful downloads, completed local jobs, survivors, and accepted updates.
- Compare each stage with the target population, not only with the previous stage.
- Limit repeated participation so a small reliable subset cannot silently become the training distribution.
- Reweight only from documented inclusion probabilities; do not invent weights to force a preferred outcome.
Treat these as release risks
- A language, region, device tier, hospital, or customer segment is rarely eligible.
- High-value but resource-constrained clients time out more often than the average.
- One organization supplies most examples or claims an unbounded sample count.
- Participation incentives change behavior or encourage fabricated clients.
- Consent withdrawal and deletion requirements cannot be traced to release lineage.
Aggregation is an optimization and trust decision
Federated averaging weights bounded client updates and applies their aggregate to the global model. Its behavior depends on heterogeneous data, unequal local work, stale clients, clipping, and the trustworthiness of reported weights.
Baseline
FedAvg
Average client deltas, commonly by bounded local sample count. It is simple and communication-efficient, but local objectives can drift apart on non-IID data.
Heterogeneous work
FedProx
Add a proximal term to each local objective so a client is penalized for moving too far from the current global model.
Drift correction
SCAFFOLD
Maintain control variates that correct client and server update directions. This can reduce drift but adds client state and communication.
Different optima
Personalized federation
Share a representation or initialization while retaining local heads, adapters, normalization, or fine-tuning when one global optimum is not appropriate.
Bound influence before averaging
- Validate model schema, tensor shape, finite values, round ID, and base-model version.
- Clip each contribution to a declared norm or coordinate bound before aggregation.
- Cap sample-count weights or derive them from trusted metadata instead of client claims.
- Reject late and duplicate updates with round-scoped idempotency keys.
- Record clipping and rejection rates by cohort; a rising rate can indicate drift, bugs, or attack traffic.
Build privacy from a specific threat model
The phrase “data stays local” says nothing about who can observe an update, how many releases an attacker sees, whether a client is malicious, or what happens when participants disappear. Choose controls for an explicit attacker and release path.
Loading threat model
Preparing defense stacks and release criteria.
Define the protected unit
- Example-level privacy: neighboring datasets differ by one record.
- User-level privacy: neighboring datasets differ by all records from one person or device.
- Organization-level privacy: neighboring datasets differ by one participating institution.
- Round or release scope: state whether accounting applies to one aggregate, a model checkpoint, all training rounds, or the full product lifetime.
User-level and organization-level guarantees usually require stronger clipping and more noise than example-level guarantees. Publish the adjacency definition with the accountant output; epsilon without that context is incomplete.
Layer controls because they protect different boundaries
Network boundary
Authenticated transport
Encrypt and authenticate client-coordinator traffic, bind messages to a round and model version, rotate credentials, and prevent replay. Transport alone does not hide updates from the coordinator.
Coordinator visibility
Secure aggregation
Recover only a threshold aggregate while masking individual surviving updates. Define setup, dropout recovery, abort, and transcript-retention behavior.
Released information
Differential privacy
Clip contributions, add calibrated noise, and compose privacy loss with a trusted accountant. It bounds leakage; it does not authenticate clients or stop poisoning.
Malicious participation
Integrity controls
Use eligibility, identity or attestation, rate limits, bounded influence, aggregate anomaly checks, poisoning canaries, staged release, and rollback.
Resolve control interactions before launch
- Secure aggregation hides individual updates, which can conflict with server-side anomaly inspection.
- Differential privacy noise may reduce sensitivity to small regressions and minority-slice failures.
- A high survivor threshold improves the anonymity set but increases abort risk under dropout.
- Robust aggregation assumptions can fail when honest updates are naturally diverse.
- Trusted execution and attestation introduce new hardware, key-management, and supply-chain dependencies.
Design the coordinator as a recoverable state machine
Do not represent a round as one long request. Persist transitions so coordinator restarts, duplicate messages, and late clients have deterministic outcomes.
A releaseable round has durable evidence
Only a validated aggregate advances to canary release; failed rounds close without reusing ambiguous material.
Frozen contract
Round manifest
Stores model hash, client-code version, eligibility and sampling policy, deadlines, clipping, quorum, privacy, and metric contracts.
Bounded input
Threshold aggregate
Accepts one valid contribution per participant and either produces an aggregate after quorum or records a typed abort.
Independent gates
Evaluation bundle
Joins global and cohort quality, integrity probes, privacy-accountant output, participation health, lineage, and policy checks.
Reversible release
Canary model
Promotes an immutable artifact through shadow and canary stages with rollback triggers and no mutation of prior evidence.
Make every retry idempotent
- Give the round, participant lease, update, aggregate, evaluation bundle, and release unique stable IDs.
- Bind updates to the exact base-model hash and reject stale or future versions.
- Keep accepted, rejected, duplicate, late, dropped, and unmasked states distinct.
- Never carry masked material or privacy-accountant state into a replacement round without protocol approval.
- Record whether a failed release consumed privacy budget; the answer depends on what was exposed, not whether promotion succeeded.
Expect failure at the tails
Client failures
- Insufficient storage, memory, battery, accelerator support, or local examples
- Interrupted download, training, checkpoint, or upload
- Corrupt local state, incompatible schema, non-finite update, or wrong model version
- Clock skew, duplicated work, expired lease, or update after deadline
Coordinator and protocol failures
- Too few survivors to unmask a secure aggregate
- Key setup or dropout-recovery failure
- Aggregator restart after accepting some contributions
- Evaluation service unavailable after a privacy-consuming release
- Model registry accepts an artifact before every gate is durable
Recovery rules
- Close the failed round with a typed terminal reason.
- Preserve immutable evidence needed for audit and incident analysis.
- Start a new round ID and resample clients under the current eligibility policy.
- Reuse no client update unless the protocol, consent, and privacy accounting explicitly permit it.
- Alert on repeated aborts by cohort because reliability failure can create selection bias.
Evaluate the model, fleet, privacy, and integrity together
One global validation score cannot prove that a federated release is useful or safe.
Does it learn?
Model quality
Track task metrics, calibration, convergence, update norms, and comparison with centralized, local-only, and previous-global baselines.
Who benefits?
Population quality
Measure worst-slice and per-site quality, participation funnel, selection weights, personalization gains, and regressions for underrepresented cohorts.
What leaked?
Privacy evidence
Record clipping distribution, noise parameters, sampling assumptions, adjacency, delta, cumulative accountant output, and empirical inference tests.
Can it be manipulated?
Integrity evidence
Run poisoning and backdoor canaries, contribution-bound checks, Sybil simulations, aggregate anomaly tests, and rollback exercises.
The release-gate example consumes privacy-accountant output; it does not calculate epsilon. Use a reviewed accountant that matches the actual sampling and mechanism instead of a hand-written approximation.
Operate federation as a long-lived product boundary
Before each round
- Freeze and sign the model, client code, manifest, eligibility policy, privacy parameters, and evaluation contract.
- Confirm remaining privacy budget, minimum cohort size, regional capacity, rollback target, and on-call ownership.
- Test key distribution, secure-aggregation dropout recovery, duplicate handling, and coordinator failover.
During each round
- Monitor the participation funnel, deadline distribution, survivor margin, bytes transferred, energy policy, and abort reasons.
- Track update schema failures, clipping, bounded weight, aggregate direction, and integrity canaries without exposing prohibited individual data.
- Apply backpressure to invitations and aggregation rather than allowing unbounded in-flight rounds.
Before release
- Require immutable global and cohort evaluation, privacy accounting, integrity probes, lineage, and policy approval.
- Compare with the previous global model and local-only baselines under the same evaluation protocol.
- Use shadow and canary rollout with client-version compatibility checks and explicit abort signals.
After release
- Monitor serving quality and participation drift by cohort, not only aggregate traffic.
- Retain only protocol-approved artifacts for the declared period and test deletion workflows.
- Rehearse rollback, key compromise, poisoned-round investigation, accountant correction, and coordinator-region loss.
Use federation only when its boundary solves the real constraint
Federation adds orchestration, cryptography, unreliable participants, biased sampling, privacy accounting, and distributed evaluation. Prefer a simpler design when data can be governed and moved safely or when the client population is too small to support the intended guarantee.
Strong fit
- Raw data cannot or should not leave devices or organizations, but a shared objective is legitimate.
- Enough eligible participants can clear quorum without excluding important populations.
- Client compute, networking, consent, and software update channels can support repeated rounds.
- The organization can operate privacy, security, evaluation, and incident-response controls for the system lifetime.
Weak fit
- A centralized de-identified dataset already satisfies policy and produces better auditability.
- Participants have incompatible labels, schemas, objectives, or legal authority to collaborate.
- The global model harms important sites that actually need local or multi-task models.
- The privacy claim depends only on raw data staying local.