• Skip to primary navigation
  • Skip to main content
  • Skip to footer

Codemotion Magazine

We code the future. Together

  • Discover
    • Events
    • Community
    • Partners
    • Become a partner
    • Hackathons
  • Magazine
    • Backend
    • Frontend
    • AI/ML
    • DevOps
    • Dev Life
    • Soft Skills
    • Infographics
  • Talent
    • Discover Talent
    • Jobs
    • Manifesto
  • Companies
  • For Business
    • EN
    • IT
    • ES
  • Sign in
ads

CodemotionJuly 27, 2026 5 min read

Federated Learning: Training Models Without Moving the Data

AI/ML
facebooktwitterlinkedinreddit

For most of the last decade, the ML playbook was simple: collect data, ship it to a central server, train, deploy. It worked, but it came with baggage — transfer costs, latency, and a compliance headache every time “personal data” and “cloud” showed up in the same sentence.

Federated Learning (FL) flips the pipeline. Instead of moving data to the model, it moves the model to the data. Training happens on the device or institution where the data already lives — a phone, a hospital server, a car — and only the learned updates travel back to a central coordinator. Raw data never leaves its source.

Recommended article
July 21, 2026

AI Doesn’t Just Change the Code: 5 Questions Every Tech Leader Should Ask

Arnaldo Morena

Arnaldo Morena

AI/ML

This isn’t a privacy add-on bolted onto existing ML infrastructure. It’s a different architecture, and it’s already running in production at Google, Apple, and a growing list of healthcare and finance systems.

What Federated Learning actually is

FL is a distributed training paradigm where multiple clients — devices or organizations — collaboratively train a shared model without pooling their raw data. Each client trains a local copy of the model on its own dataset and sends back only:

  • Model weights
  • Gradients
  • Aggregated numerical updates

What never leaves the client: photos, messages, medical records, transaction histories — any raw, identifiable data.

The core assumption behind the design: data has gravity, and it’s often cheaper, safer, and legally simpler to move computation to the data than the reverse.

How it works, concretely

Centralized ML: Device → raw data → central server → training → model. Every client’s data ends up in one place, which means one place to secure, one place that can leak, and one dataset transfer that has to clear legal review.

Federated Learning:

  1. A central server initializes a global model and sends it to a subset of participating clients.
  2. Each client trains that model locally, using only its own data.
  3. Each client sends back a small update — not data, just the delta the model learned.
  4. The server aggregates thousands (or millions) of these updates into a new, improved global model.
  5. Repeat.

The server never sees a single raw training example — only the aggregate of what everyone learned.

The architecture, component by component

1. Federated server (coordination) Initializes the base model, selects which clients participate in a given round, receives updates, runs the aggregation algorithm, and redistributes the improved model. Google’s Federated Learning stack, TensorFlow Federated, and Flower all implement this role.

2. Federated clients (local training, edge computing) Each client downloads the current model, trains it on-device against local data, computes the resulting update, and sends that update — nothing else — back to the server. All computation happens at the edge; no raw data is transmitted.

3. Update extraction and protection Before an update leaves the client, it’s typically wrapped in additional protection — secure aggregation or differential privacy — so the server can’t reverse-engineer individual contributions from what it receives. This is the layer that turns “we don’t send raw data” into an actual privacy guarantee rather than a design intention.

4. Central aggregation The server combines incoming updates into a new global model. The standard algorithm here is FedAvg (Federated Averaging), introduced by Google in 2017: each client’s local weights are combined into a weighted average, weighted by how much data that client trained on. The result is a new global model that has absorbed knowledge from every participant without any of them exposing their dataset.

Centralized ML vs. Federated Learning

Centralized MLFederated Learning
Data locationAggregated on one serverStays on each device/institution
What’s transmittedRaw dataModel weights / gradients
Privacy exposureHigh — single point of failureLow — no raw data in transit
Compliance surfaceLarge (data transfer, storage, retention)Smaller (no raw data leaves origin)
Training locationCentral infrastructureEdge devices / local servers

Frameworks worth knowing

  • TensorFlow Federated — Google’s open-source framework, the reference implementation for a lot of current FL research.
  • Flower — framework-agnostic; works with PyTorch, TensorFlow, and scikit-learn.
  • PySyft — focused specifically on privacy-preserving and secure computation.
  • NVIDIA FLARE — enterprise-grade platform for federated deployments, common in healthcare.

Does FL actually guarantee privacy?

No — not by itself. Sending gradients instead of raw data is a real improvement, not a silver bullet. Known attack vectors include:

  • Model inversion — reconstructing approximate training data from model parameters.
  • Membership inference — determining whether a specific record was part of the training set.
  • Gradient leakage — under certain conditions, gradients can leak more information than intended.

That’s why production FL systems layer in additional defenses:

  • Differential privacy — injects calibrated noise so the model learns general patterns instead of memorizing specific examples.
  • Secure aggregation — the server only ever sees the sum of updates, never an individual client’s contribution.
  • Homomorphic encryption — allows computation directly on encrypted data, without ever decrypting it. Still one of the more computationally expensive tools in the stack, but an active research area.

FL narrows the attack surface significantly. It doesn’t eliminate it, and treating it as an automatic privacy guarantee is the kind of assumption that gets systems audited the hard way.

Where it’s already running

  • Healthcare — hospitals jointly training diagnostic models (e.g., tumor detection in radiology) without any patient record leaving its originating institution — a meaningful advantage under HIPAA and similar regimes.
  • FinTech — banks collaborating on fraud and money-laundering pattern detection without exposing customer portfolios to competitors or violating banking secrecy.
  • Smart keyboards (Gboard, predictive text on iOS) — the model learns your vocabulary and corrections locally; only the model update leaves the device, never the message itself.
  • Autonomous vehicles — fleets sharing learned driving patterns and edge cases across vehicles without centralizing raw sensor and camera feeds.

The trade-off it’s actually solving

FL doesn’t resolve the tension between “more data improves the model” and “privacy is non-negotiable” — it changes which side of that trade-off you’re forced to sit on. Less data centralization means a smaller attack surface, lower transfer costs, and a compliance story that doesn’t start with “we have a copy of everyone’s data on our servers.”

It’s not a replacement for good security practice, and it’s not free — coordination overhead, non-IID data across clients, and slower convergence are all real engineering problems. But as a default architecture for any system training on sensitive, distributed data, it’s increasingly the more defensible starting point.

Codemotion Collection Background
ia
Our team’s picks

Want to find more articles like this? Check out the ia collection, where you'll find a curated selection of fresh, new content just for you.

Share on:facebooktwitterlinkedinreddit

Tagged as:Artificial Intelligence Machine Learning

Codemotion
Articles wirtten by the Codemotion staff. Tech news, inspiration, latest treends in software development and more.
AI Doesn’t Just Change the Code: 5 Questions Every Tech Leader Should Ask
Previous Post

Footer

Discover

  • Events
  • Community
  • Partners
  • Become a partner
  • Hackathons

Magazine

  • Tech articles

Talent

  • Discover talent
  • Jobs

Companies

  • Discover companies

For Business

  • Codemotion for companies

About

  • About us
  • Become a contributor
  • Work with us
  • Contact us

Follow Us

© Copyright Codemotion srl Via Marsala, 29/H, 00185 Roma P.IVA 12392791005 | Privacy policy | Terms and conditions