Close Menu
    Trending
    • Why the Sophistication of Your Prompt Correlates Almost Perfectly with the Sophistication of the Response, as Research by Anthropic Found
    • From Transactions to Trends: Predict When a Customer Is About to Stop Buying
    • America’s coming war over AI regulation
    • “Dr. Google” had its issues. Can ChatGPT Health do better?
    • Evaluating Multi-Step LLM-Generated Content: Why Customer Journeys Require Structural Metrics
    • Why SaaS Product Management Is the Best Domain for Data-Driven Professionals in 2026
    • Stop Writing Messy Boolean Masks: 10 Elegant Ways to Filter Pandas DataFrames
    • What Other Industries Can Learn from Healthcare’s Knowledge Graphs
    ProfitlyAI
    • Home
    • Latest News
    • AI Technology
    • Latest AI Innovations
    • AI Tools & Technologies
    • Artificial Intelligence
    ProfitlyAI
    Home » Federated Learning, Part 1: The Basics of Training Models Where the Data Lives
    Artificial Intelligence

    Federated Learning, Part 1: The Basics of Training Models Where the Data Lives

    ProfitlyAIBy ProfitlyAIJanuary 10, 2026No Comments11 Mins Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
    Share
    Facebook Twitter LinkedIn Pinterest Email


    I the idea of federated studying (FL) via a comic by Google in 2019. It was an excellent piece and did an important job at explaining how merchandise can enhance with out sending person knowledge to the cloud. Recently, I’ve been wanting to grasp the technical aspect of this area in additional element. Coaching knowledge has grow to be such an necessary commodity as it’s important for constructing good fashions however a number of this will get unused as a result of it’s fragmented, unstructured or locked inside silos.

    As I began exploring this area, I discovered the Flower framework  to be essentially the most easy and beginner-friendly technique to get began in FL. It’s open supply, the documentation is obvious, and the neighborhood round it is rather energetic and useful. It is likely one of the purpose for my renewed curiosity on this area.

    This text is the primary a part of a collection the place I discover federated studying in additional depth, overlaying what it’s, how it’s applied, the open issues it faces, and why it issues in privacy-sensitive settings. Within the subsequent instalments, I’ll go deeper into sensible implementation with the Flower framework, talk about privateness in federated studying and study how these concepts prolong to extra superior use circumstances.

    When Centralised Machine studying shouldn’t be ultimate

    We all know AI fashions rely on giant quantities of information, but a lot of essentially the most helpful knowledge is delicate, distributed, and onerous to entry. Consider knowledge inside hospitals, telephones, vehicles, sensors, and different edge methods. Privateness issues, native guidelines, restricted storage, and community limits make transferring this knowledge to a central place very troublesome and even unattainable. In consequence, giant quantities of precious knowledge stay unused. In healthcare, this downside is particularly seen. Hospitals generate tens of petabytes of information yearly, but research estimate that as much as 97% of this data goes unused.

    Conventional machine studying assumes that each one coaching knowledge could be collected in a single place, often on a centralized server or knowledge middle. This works when knowledge could be freely moved, however it breaks down when knowledge is non-public or protected. In apply, centralised coaching additionally will depend on steady connectivity, sufficient bandwidth, and low latency, that are troublesome to ensure in distributed or edge environments. 

    In such circumstances, two widespread selections seem. One possibility is to not use the info in any respect, which implies precious info stays locked inside silos.

    The opposite possibility is to let every native entity prepare a mannequin by itself knowledge and share solely what the mannequin learns, whereas the uncooked knowledge by no means leaves its authentic location. This second possibility varieties the idea of federated studying, which permits fashions to study from distributed knowledge with out transferring it. A well known instance is Google Gboard on Android, the place options like next-word prediction and Good Compose run throughout lots of of thousands and thousands of units. 

    Federated Studying: Shifting the Mannequin to the Information

    Federated studying could be regarded as a collaborative machine studying setup the place coaching occurs with out amassing knowledge in a single central place. Earlier than the way it works underneath the hood, let’s see a couple of real-world examples that present why this strategy issues in high-risk settings, spanning domains from healthcare to security-sensitive environments.

    Healthcare

    In healthcare, federated studying enabled early COVID screening through Curial AI, a system educated throughout a number of NHS hospitals utilizing routine very important indicators and blood exams. As a result of affected person knowledge couldn’t be shared throughout hospitals, coaching was accomplished regionally at every website and solely mannequin updates have been exchanged. The ensuing international mannequin generalized higher than fashions educated at particular person hospitals, particularly when evaluated on unseen websites.

    Medical Imaging

    A Nature-published study on retinal basis fashions, highlighting how large-scale medical imaging fashions could be educated on delicate eye knowledge | Open Entry

    Federated studying can be being explored in medical imaging. Researchers at UCL and Moorfields Eye Hospital are utilizing it to fine-tune large vision foundation models on sensitive eye scans that can not be centralized. 

    Protection

    Past healthcare, federated studying can be being utilized in security-sensitive domains such as defense and aviation. Right here, fashions are educated on distributed physiological and operational knowledge that should stay native. 

    Several types of Federated Studying

    At a high-level, Federated studying could be grouped into a couple of widespread sorts primarily based on who the purchasers are and how the info is break up.

    • Cross-Gadget vs Cross-Silo Federated Studying

    Cross-device federated studying includes use of many purchasers which can go as much as thousands and thousands, like private units or telephones, every with a small quantity of native knowledge and unreliable connectivity. At a given time, nonetheless, solely a small fraction of units take part in any given spherical. Google Gboard is a typical instance of this setup.

    Cross-silo federated studying, then again, includes a a lot smaller variety of purchasers, often organizations like hospitals or banks. Every shopper holds a big dataset and has steady compute and connectivity. Most real-world enterprise and healthcare use circumstances appear like cross-silo federated studying.

    • Horizontal vs Vertical Federated Studying

    Visualization of Horizontal and Vertical Federated studying methods

    Horizontal federated studying describes how knowledge is break up throughout purchasers. On this case, all purchasers share the identical function area, however every holds completely different samples. For instance, a number of hospitals could document the identical medical variables, however for various sufferers. That is the commonest type of federated studying.

    Vertical federated studying is used when purchasers share the identical set of entities however have completely different options. For instance, a hospital and an insurance coverage supplier could each have knowledge about the identical people, however with completely different attributes. Coaching, on this case requires safe coordination as a result of function areas differ, and this setup is much less widespread than horizontal federated studying.

    These classes aren’t mutually unique. An actual system is commonly described utilizing each axes, for instance, a cross-silo, horizontal federated studying setup.

    How Federated Studying works 

    Federated studying follows a easy, repeated course of coordinated by a central server and executed by a number of purchasers that maintain knowledge regionally, as proven within the diagram under.

    Visualizing a Federated studying loop

    Coaching in federated studying proceeds via repeated federated studying rounds. In every spherical, the server selects a small random subset of purchasers, sends them the present mannequin weights, and waits for updates. Every shopper trains the mannequin regionally utilizing stochastic gradient descent, often for a number of native epochs by itself batches, and returns solely the up to date weights. At a excessive degree it follows the next 5 steps:

    1. Initialisation

    A worldwide mannequin is created on the server, which acts because the coordinator. The mannequin could also be randomly initialized or begin from a pretrained state.

    2. Mannequin distribution

    In every spherical, the server selects a set of purchasers(primarily based on random sampling or a predefined technique) which participate in coaching and sends them the present international mannequin weights. These purchasers could be telephones, IoT units or particular person hospitals.

    3. Native coaching

    Every chosen shopper then trains the mannequin regionally utilizing its personal knowledge. The information by no means leaves the shopper and all computation occurs on machine or inside a company like hospital or a financial institution. 

    4. Mannequin replace communication

    After the native coaching, purchasers ship solely the up to date mannequin parameters (might be weights or gradients) again to the server whereas uncooked knowledge is shared at any level.

    5. Aggregation

    The server aggregates the shopper updates to provide a brand new international mannequin. Whereas Federated Averaging (Fed Avg) is a typical strategy for aggregation, different methods are additionally used. The up to date mannequin is then despatched again to purchasers, and the method repeats till convergence.

    Federated studying is an iterative course of and every cross via this loop known as a spherical. Coaching a federated mannequin often requires many rounds, generally lots of, relying on components comparable to mannequin dimension, knowledge distribution and the issue being solved.

    Mathematical Instinct behind Federated Averaging

    The workflow described above can be written extra formally. The determine under reveals the unique Federated Averaging (Fed Avg) algorithm from Google’s seminal paper. This algorithm later turned the principle reference level and demonstrated that federated studying can work in apply. This formulation in actual fact turned the reference level for many federated studying methods immediately.

    The unique Federated Averaging algorithm, exhibiting the server–shopper coaching loop and weighted aggregation of native fashions | Supply: Communication-Efficient Learning of Deep Networks from Decentralized Data

    The unique Federated Averaging algorithm, exhibiting the server–shopper coaching loop and weighted aggregation of native fashions.
    On the core of Federated Averaging is the aggregation step, the place the server updates the worldwide mannequin by taking a weighted common of the regionally educated shopper fashions. This may be written as:

    Mathematical illustration of the Federated Averaging algorithm

    This equation makes it clear how every shopper contributes to the worldwide mannequin. Purchasers with extra native knowledge have a bigger affect, whereas these with fewer samples contribute proportionally much less. In apply, this easy thought is the explanation why Fed Avg turned the default baseline for federated studying.

    A easy NumPy implementation

    Let’s take a look at a minimal instance the place 5 purchasers have been chosen. For the sake of simplicity, we assume that every shopper has already completed native coaching and returned its up to date mannequin weights together with the variety of samples it used. Utilizing these values, the server computes a weighted sum that produces the brand new international mannequin for the following spherical. This mirrors the Fed Avg equation instantly, with out introducing coaching or client-side particulars.

    import numpy as np
    
    # Consumer fashions after native coaching (w_{t+1}^ok)
    client_weights = [
        np.array([1.0, 0.8, 0.5]),     # shopper 1
        np.array([1.2, 0.9, 0.6]),     # shopper 2
        np.array([0.9, 0.7, 0.4]),     # shopper 3
        np.array([1.1, 0.85, 0.55]),   # shopper 4
        np.array([1.3, 1.0, 0.65])     # shopper 5
    ]
    
    # Variety of samples at every shopper (n_k)
    client_sizes = [50, 150, 100, 300, 4000]
    
    # m_t = complete variety of samples throughout chosen purchasers S_t
    m_t = sum(client_sizes) # 50+150+100+300+400
    
    # Initialize international mannequin w_{t+1}
    w_t_plus_1 = np.zeros_like(client_weights[0])
    
    # FedAvg aggregation:
    
    # w_{t+1} = sum_{ok in S_t} (n_k / m_t) * w_{t+1}^ok
    # (50/1000) * w_1 + (150/1000) * w_2 + ...
    
    for w_k, n_k in zip(client_weights, client_sizes):
        w_t_plus_1 += (n_k / m_t) * w_k
    
    print("Aggregated international mannequin w_{t+1}:", w_t_plus_1)
    -------------------------------------------------------------
    Aggregated international mannequin w_{t+1}: [1.27173913 0.97826087 0.63478261]
    

    How the aggregation is computed

    Simply to place issues into perspective, we are able to increase the aggregation step for simply two purchasers and see how the numbers line up.

    Challenges in Federated Studying Environments

    Federated studying comes with its personal set of challenges. One of many main points when implementing it’s that the info throughout purchasers is commonly non-IID (non-independent and identically distributed). This implies completely different purchasers might even see very completely different knowledge distributions which in flip can sluggish coaching and make the worldwide mannequin much less steady. For example, Hospitals in a federation can serve completely different populations that may comply with completely different patterns. 

    Federated methods can contain something from a couple of organizations to thousands and thousands of units and managing participation, dropouts and aggregation turns into harder because the system scales.

    Whereas federated studying retains uncooked knowledge native, it doesn’t absolutely remedy privateness by itself. Mannequin updates can nonetheless leak non-public info if not protected and so further privateness strategies are sometimes wanted. Lastly, communication could be a supply of bottleneck. Since networks could be sluggish or unreliable and sending frequent updates could be expensive.

    Conclusion and what’s subsequent

    On this article, we understood how federated studying works at a excessive degree and in addition walked via a merely Numpy implementation. Nonetheless, as an alternative of writing the core logic by hand, there are frameworks like Flower which supplies a easy and versatile technique to construct federated studying methods. Within the subsequent half, we’ll utilise Flower to do the heavy lifting for us in order that we are able to deal with the mannequin and the info quite than the mechanics of federated studying. We’ll additionally take a look at federated LLMs, the place mannequin dimension, communication price, and privateness constraints grow to be much more necessary.


    Be aware: All photographs, except in any other case said, are created by the writer.



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleBeyond the Flat Table: Building an Enterprise-Grade Financial Model in Power BI
    Next Article How to Leverage Slash Commands to Code Effectively
    ProfitlyAI
    • Website

    Related Posts

    Artificial Intelligence

    Why the Sophistication of Your Prompt Correlates Almost Perfectly with the Sophistication of the Response, as Research by Anthropic Found

    January 23, 2026
    Artificial Intelligence

    From Transactions to Trends: Predict When a Customer Is About to Stop Buying

    January 23, 2026
    Artificial Intelligence

    Evaluating Multi-Step LLM-Generated Content: Why Customer Journeys Require Structural Metrics

    January 22, 2026
    Add A Comment
    Leave A Reply Cancel Reply

    Top Posts

    Struggling to Land a Data Role in 2025? These 5 Tips Will Change That

    April 29, 2025

    Shaip Expands Availability of High-Quality Healthcare Data throughPartnership with Protege

    April 4, 2025

    Detecting Malicious URLs Using LSTM and Google’s BERT Models

    May 28, 2025

    OpenAI can rehabilitate AI models that develop a “bad boy persona”

    June 18, 2025

    DataRobot + Aryn DocParse for Agentic Workflows

    October 2, 2025
    Categories
    • AI Technology
    • AI Tools & Technologies
    • Artificial Intelligence
    • Latest AI Innovations
    • Latest News
    Most Popular

    ChatGPT får långtidsminne – kommer nu ihåg alla dina konversationer

    April 13, 2025

    New McKinsey Report Shows Mostly Experimentation, Not Transformation, With AI So Far

    November 21, 2025

    The Machine Learning “Advent Calendar” Day 23: CNN in Excel

    December 24, 2025
    Our Picks

    Why the Sophistication of Your Prompt Correlates Almost Perfectly with the Sophistication of the Response, as Research by Anthropic Found

    January 23, 2026

    From Transactions to Trends: Predict When a Customer Is About to Stop Buying

    January 23, 2026

    America’s coming war over AI regulation

    January 23, 2026
    Categories
    • AI Technology
    • AI Tools & Technologies
    • Artificial Intelligence
    • Latest AI Innovations
    • Latest News
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • About us
    • Contact us
    Copyright © 2025 ProfitlyAI All Rights Reserved.

    Type above and press Enter to search. Press Esc to cancel.