Skip to main content
Distributed Machine Learning

Model Caching for Decentralized Federated Learning

Published: 2026-09-10
Level: postgraduate
Audience: Postgraduate students in Distributed Machine Learning

Prerequisite Knowledge

This lecture builds on the following concepts from earlier lectures. If any feel unfamiliar, review the linked notes before proceeding.

Previously Covered in This Subject

  • Data, model, and pipeline parallelism — covered in Lectures 1 and 2
  • Caching with prefetch for known batch order — covered in Lecture 2
  • Batches, epochs, and the mini-batch training loop — covered in Lecture 2
  • Horizontal and vertical partitioning with non-IID data — covered in Lecture 1
  • Model aggregation by averaging and weight merging — covered in Lectures 1 and 2

3.1 Recap: Parallelism, Batches, and Caching

3.1.1 Parallelism and the need for a cache

Why does adding more workers sometimes leave training just as slow? Because the workers spend their time waiting on storage, not computing.

Splitting work across many computing units is called parallelism (doing many parts of one job at the same time on separate workers). The lecture named three flavours. Data parallelism (each worker gets a different slice of the data) hands worker A rows 1 to 1000 and worker B rows 1001 to 2000, while both hold a full copy of the model. Model parallelism (each worker holds a different part of one model) places layers 1 to 5 on worker A and layers 6 to 10 on worker B, while the same data flows through both. Code parallelism (different program steps run on different workers) spreads the pipeline stages themselves. All three buy speed in theory and then meet the same bottleneck in practice: a worker that stalls on slow storage throws away the speed that parallelism bought.

A cache (a small, fast store kept close to the compute) removes that wait. Think of a cook who keeps salt, oil, and a sharp knife on the counter instead of walking to the pantry for every dish. The counter is small but instant; the pantry is large but slow. Training hardware has the same two levels. The in-memory cache lives in RAM and answers in nanoseconds. The on-disk cache is larger but slower by orders of magnitude. The strategy is to load the next data chunk into the fast cache before it is needed, so the model running in RAM finds its input already waiting. When the access pattern is known ahead of time, this preloading turns a storage-bound job into a compute-bound one.

A cache is fast, close storage that hides slow storage. Data parallelism splits the data across workers. Model parallelism splits the model across workers. Code parallelism splits the program steps across workers. Prefetch means loading batch while batch trains, so compute never idles.

In plain words: parallelism decides who does what, while the cache decides where the next input waits. One without the other leaves speed on the table. The batch order of epoch training is what makes the cache plan possible, which is the next point.

3.1.2 Known order makes prefetch work

Training in epochs (full passes over the data) gives exactly that known pattern. An epoch is one full sweep: if a dataset has 1000 samples and each batch (a small group of samples processed together) holds 250 samples, then one epoch holds 4 batches. The order of batches is fixed before training starts. Batch 2 is processed after batch 1, batch 3 after batch 2, and so on. Because the batch order is known, the system can hold the current batch in the in-memory cache while fetching the next one. Each batch is placed into RAM, the model consumes it, and the response stays fast.

Picture the access timeline with batch order on the horizontal axis (batch index 1, 2, 3, 4) and time on the vertical axis. Without prefetch the shape is a staircase with flat gaps: compute, pause for load, compute, pause for load. With prefetch the shape is a smooth ramp: the load bar for batch overlaps the compute bar for batch . The landmark to watch is the overlap region — wherever load hides under compute, the gap is gone. The takeaway in one sentence: known batch order lets load and compute overlap, so the cache hides storage delay.

Worked walkthrough — batch prefetch overlap with four batches. One epoch has four batches, B1 to B4, each 250 samples. Step 1: load B1 into RAM (say 2 seconds), train on B1 (say 5 seconds) while copying B2 into the cache in the background. Step 2: B1 finishes, B2 is already in RAM, so training on B2 starts with zero pause while B3 starts copying. Step 3: same overlap for B3, then B4. Total without overlap: 4 loads 2 = 8 seconds of idle load plus 20 seconds of compute = 28 seconds. Total with full overlap: only the first load is exposed, so about 2 + 20 = 22 seconds. Sense-check: prefetch saves close to 6 seconds here, and the saving grows with more batches.

Scope: Prefetch helps when the access order is known ahead of time, as in epoch-based training with a fixed batch order. Assumption: the cache is large enough to hold at least two batches at once (current plus next), and background copying is fast enough to finish before the current batch ends.

If the order is random with no lookahead, or the cache holds only one batch, the overlap breaks and stalls return. Video streaming buffers and database buffer pools use the same idea for the same reason — know what comes next, and fetch it early. That known-order trick is the bridge to the main story: in decentralized learning the "next item" is not the next batch but the next peer model, and a model cache plays the same hiding role.

3.2 Decentralized Learning on Mobile Agents

3.2.1 Agents, devices, and local datasets

What if the data can never be gathered in one place, yet the model must still learn from all of it?

A mobile agent (any compute node that moves, senses, and learns where it stands) can be a phone, a sensor, an edge box, a small board such as a Raspberry Pi, a drone, a vehicle, or a factory machine. Call the devices , where each is one agent and is the total count. In set form:

Here is the fleet (the full set of agents), names agent number , and counts the agents. Every agent owns a private local dataset that keeps growing as the device senses the world. One device collects rows of heart-related readings, another collects skin-related readings, a third collects readings from other instruments. Each row pairs input features with their labels. A heart row might pair features [age, resting pulse, blood pressure] with label healthy or at-risk. A skin row pairs a different feature list with its own label. No two agents promise the same columns.

Decentralized means there is no central machine that sees all the data. The devices are scattered, they move, and any two of them can exchange information only while they are physically close enough to communicate — inside each other's communication range. Outside that range, each device is on its own. Picture a map with dots for agents and short circles for radio reach: an edge appears only where two circles overlap. The graph of who can talk to whom changes every minute as agents move.

A mobile agent is one learning device in a fleet of agents. Each agent holds a private local dataset that never leaves the device. Decentralized means learning happens on the agents with no central pool of data; agents share model weights only, and only when inside communication range.

This setup matches the standard federated picture of agents with local datasets and a shared model goal, except there is no always-on server. Phones that learn typing habits on-device and factory machines that learn vibration patterns locally both follow this shape: sense where you stand, learn where you stand, share only what you learned.

3.2.2 The combined-model goal

Each agent trains its own model on its own data — a small neural network, a convolutional network, or any model family suited to the task. The dream is a combined model: feed it all three feature groups at once — heart features, skin features, instrument features — and get the best possible accuracy at test time. Yet the combined data is never assembled in one place. No device ships its raw rows anywhere. Devices share model updates only: weight vectors learned locally. The combined model must be built out of shared weights, never out of pooled data.

An everyday picture helps. Think of three cooks who each know one cuisine and never share their secret recipes, but mail each other tasting notes. Each cook adjusts their own menu from the notes and slowly all three menus cover all three cuisines. The mapping is direct: secret recipe = private dataset , tasting notes = shared weight vector, menu = local model. The picture breaks in one place: tasting notes are vague, while weight vectors carry precise numeric updates that training can actually use.

Hospital instruments that learn from scans without exporting patient rows show why the goal matters: privacy law forbids pooling, but patients would still gain if heart, skin, and instrument knowledge lived in one model. That is the agents dataset combined model problem in one line — many private datasets, one shared model, no raw data movement.

3.2.3 Student questions on centralization and orchestration

Q: If one device collects the models and merges them, is that centralized training again? Is this still decentralized?

A: Training stays decentralized because every device learns from its own data on its own hardware. Merging is not training — it only combines weight vectors, with no data processing involved. Any device can do the merging, or a separate helper device, sometimes called an orchestrator (a helper that only combines models and sends the result back), can do just the combining. Centralization would mean pooling data and computing gradients on it centrally, which never happens here. The orchestrator only combines models, so decentralized training is preserved.

The confusion is natural because the word central appears in both ideas. Centralized training means data moves to one machine and gradients are computed there. Here data never moves; only weight vectors move, and the heavy work of fitting data stays on the agents. An orchestrator that averages vectors is closer to a post office sorting letters than to a kitchen cooking the meal.

Recap: mobile agents to each hold a private dataset and train locally, aiming at one combined model built from shared weights only. Merging weights is not centralized training. Next, slow devices and broken links force that sharing to be asynchronous, which is why each agent needs a cache.

3.3 Why Model Caching: Slow Devices and Asynchronous Training

3.3.1 When updates arrive late

What happens when one peer answers in seconds and another answers tomorrow?

Real deployments break the tidy assumption that every device answers on time. Three facts dominate. Devices are slow — a sensor or an old phone trains at its own pace, perhaps one local epoch per hour while a plugged-in edge box does ten. Communication is unstable — a device may send its update now and go silent for hours as it drives through a dead zone. Updates arrive delayed, and any scheme that waits for the newest model from every peer stalls. Perfect synchronization, where each client always holds the latest copy of every other client's model, is not possible across scattered, moving hardware.

Asynchronous training (each device keeps learning whenever it can, with whatever peer information it currently holds) accepts this reality. Synchronous training (all devices pause at a barrier until the slowest peer catches up) is the alternative that fails here: one straggler holds the whole fleet hostage. Model caching is what makes the asynchronous style work. Instead of freezing while a peer is out of reach, a device trains with a cached — slightly old — copy of that peer's model and swaps in the fresh copy when contact resumes. Those cached models, not fresh copies, are what each round actually aggregates.

Asynchronous training means no global barrier: device trains at round with the peer models currently in its cache, even if some are stale. Synchronous training means all devices wait for the slowest peer each round. Caching enables the async style by giving every device something reasonable to use right now.

3.3.2 Cached models keep training moving

The rule is simple: never wait for the newest peer model; train with the cached one for now. Suppose device C1 wants device C3's latest weights but C3 is out of range. C1 keeps training with the older C3 weights sitting in its cache. Later, C1 and C3 drift into range and exchange caches directly. Or the update arrives by relay: C3 meets C2 and hands over its cache, then C1 meets C2 and picks up C3's newer weights second-hand. Either path delivers the update, and no device ever idles waiting.

Because of this tolerance for stale information, the system scales: new agents can wander in, swap caches with whoever they meet, and join the shared effort. A fourth phone joining a street needs only one meeting to get a useful starting set of peer models, not a full fleet handshake.

Scope: Caching helps when meetings are frequent enough that cached models stay roughly fresh. Assumption: peers eventually meet directly or through relays, so staleness stays bounded. If a peer vanishes for good, its cached copy must age out rather than steer training forever.

One caution was stated directly and must not be lost: scalability improves, but robustness is not guaranteed — old models can still pull training off course if they are used too long. That danger is exactly what the staleness bound in a later section controls. In other words, stale models keep the engine running, but stale models past their expiry date steer it off the road.

3.3.3 What caching buys: stability, less waiting, lower overhead

Four gains were named. Cached models replace perfect synchronization, which cannot be achieved. Stale updates are tolerated instead of blocking progress. Training stabilizes because every device always has something reasonable to aggregate — the average never collapses to one lonely local model. Communication overhead falls because an unchanged model need not be resent — the peer's cached copy is already correct, so the radio stays quiet. A device whose weights barely moved between rounds simply stays silent, and peers reuse the cached copy.

Picture a chart with wall-clock time on the horizontal axis and number of idle devices on the vertical axis. The synchronous line spikes to full idle every round while waiting for stragglers. The cached async line stays near zero idle, with small bumps at cache swaps. The takeaway in one sentence: use-old-until-fresh removes the wait without removing learning.

Autonomous vehicles that pass each other briefly, delivery drones with patchy links, and remote field sensors all depend on this use-old-until-fresh discipline. Each keeps a small desk drawer of peer models (the cache analogy from the opening recap) and works from the drawer until a fresh delivery arrives.

Recap: Slow hardware plus fickle links make fresh-everywhere sync impossible, so devices train async on cached models. Caching buys stability, less waiting, and lower radio cost, at the price of staleness risk. The next section pins down what each device is actually optimizing while it trains alone yet stays near the group.

3.4 Learning Locally While Staying Close to the Shared Model

3.4.1 The two aims side by side

How can a model fit its own street perfectly without forgetting the whole city?

Every node serves two masters at once. First, it must learn from its own local data — fit the patterns its own sensors actually see. A heart-device must nail heart rhythms; a skin-device must nail skin textures. Second, it must stay close to the global model, the decentralized consensus that averages what all peers have learned. Drift too far from the consensus and accuracy collapses, because the lone model forgets everything the other devices know. The averaged model never exactly equals the model one central machine would have trained on pooled data, but the aim is to land on par with it — close in performance, not identical in weights.

Think of it like a study group, the lecture's own picture. Each member masters their own chapter deeply, then checks their notes against the group's shared summary. A member whose notes contradict the summary on every page has probably overfit to their chapter — memorized chapter quirks instead of learning the course. The fix is to keep personal notes rich but compatible with the shared version. The mapping is exact: own chapter = local data, personal notes = local weights, shared summary = consensus model. The picture breaks where all analogies break: students can argue in words, while devices can only argue in averaged numbers.

Local fit means low loss on the device's own dataset . Consensus means closeness to the shared model formed by blending peer weights. Good training needs both: fit local data and stay near consensus. Drop the first and the device learns nothing new; drop the second and the device drifts alone and loses accuracy on everyone else's data.

3.4.2 Student questions and answers

Q: Are the two aims about sharing the model architecture versus sharing the weights? Do both the architecture and the learned weights travel between machines?

A: Half right. In this design every device runs the same architecture, so there is nothing new to share about structure during training. What travels between machines is the learned weights. The two aims are instead: train on local data, and aggregate peer models so the result stays near the shared consensus. Device architecture is fixed, weights travel, and local data plus aggregate consensus define the twin goals. Architecture sharing matters only if the structure itself ever changes.

Devices agree on the blueprint once, then trade only the numbers that fill it in. That is why the distance math in a later section can compare weight vectors point to point — the layouts match.

Q: So each device trains locally, stores its own model in a cache, stores other devices' models too, and swaps caches on contact — letting training continue even out of contact?

A: Exactly. That is the main concept. Each device trains locally on its own rows, stores its own fresh model plus the cached models of others, and swaps full caches whenever contact allows. The cache of others' models is what lets a lonely device keep improving until the next meeting.

Several students circled the same doubt in different words, and the answer stayed the same: the cache is the memory that bridges meetings.

Q: Does any raw data ever leave a node, and how do we know training really happened there?

A: Data never leaves its node, which gives privacy by construction. What leaves is proof of learning: the updated weight vector. Training happens independently per node — gradients from local batches move local weights — and each node frequently folds newly received peer weights into its own model through aggregation, paced by how often contact and cached models allow. No raw rows move; only learned weights move.

Exam note: State the twin aims — fit local data, stay near consensus — and explain the accuracy cost of dropping either one. Dropping local fit wastes the device's fresh data; dropping consensus lets drift destroy shared accuracy. This twin-aims idea is the central exam focus of the whole design.

3.4.3 Privacy: data stays, models travel

Because rows never move, sensitive sources can collaborate. Hospitals keep patient scans behind their own walls yet contribute heart or skin knowledge through weights. Banks keep account rows private yet contribute fraud patterns through weights. Factories keep vibration logs on the machines yet contribute fault patterns through weights. The shared model still benefits from all of them. That privacy property is a direct consequence of the two-aim setup, not an add-on: local fit never needs to export rows, and consensus only needs to import weights.

Recap: Learn deeply at home, stay compatible with the group summary — local data plus consensus, with data staying put and models traveling. Next, the data itself splits into easy same-schema and hard mixed-schema cases, which decides how hard that twin job really is.

3.5 Non-IID Data: Same Features Versus Mixed Features

3.5.1 IID and why it matters

Why does one shared model work for ten branches but fail for three specialists?

Classical training assumes IID data — independent and identically distributed. Independent (each sample is drawn without influence from the others) means seeing one sample tells you nothing extra about the next beyond the shared pattern; there is no hidden copying. Identically distributed (every sample comes from the same probability distribution, the same data-generating process) means every batch looks statistically alike. One student first offered "unique and non-identical," which mixes the idea up; the correction is that samples must be independent of each other and identical in distribution, not unique. Under IID, a batch from Tirupati looks statistically like a batch from Bhopal, and one model fits all of it.

Here that assumption breaks. One device sees heart features, another sees skin features, a third sees eye features. The distributions differ by construction. Such data is called non-IID — not independent and identically distributed across devices — and also heterogeneous (drawn from different processes with different features). The shared model must reconcile sources that disagree about which features even exist. Independent same distribution IID samples are the textbook ideal; heart, skin, and eye rows are the opposite.

IID means samples are independent draws from one shared distribution. Non-IID means devices draw from different distributions. Heterogeneous stresses different features or schemas across devices. This lecture targets heterogeneous non-IID data, where each device sees different columns and the shared model must still score combined rows it never saw together.

3.5.2 Homogeneous case: same schema, simple problem

When every participant records the same features, life is easy. Two branches of one bank, in two cities, log the same columns: balances, transactions, loan flags. Regulations may differ across regions, yet the schema matches, so the data is homogeneous (same columns, same meaning) and nearly IID. Merging models from such branches is straightforward, and even simple averaging performs well. This is the easy regime, and it is not the target of the caching design.

A marble-bag picture helps. Homogeneous means every bag holds red and blue marbles in about the same mix; a handful from any bag predicts the others. Heterogeneous, coming next, means one bag holds marbles, another holds dice, and a third holds cards — handfuls do not predict each other at all. The picture breaks in that real features are richer than colors, but the sameness idea carries over.

3.5.3 Heterogeneous case: mixed schemas, hard problem

The hard regime — the actual target — mixes unlike sources. A conglomerate wants one financial index from banking records plus loan-repayment records plus transaction streams, each living in a different arm of the business. In health care, one hospital group excels in heart care, another in skin care, a third in eye care, and the goal is one health index per person from all three feature groups. Nobody will pool raw rows, so each party trains on its own slice and shares models only. The shared model must then perform well on combined inputs it never saw together during training — a heart-plus-skin-plus-eye row at test time, built from devices that each saw only one slice.

Dimension Homogeneous (easy) Heterogeneous (hard, this lecture)
Features Same schema everywhere Mixed schemas, unlike feature groups
Example Two bank branches, same columns Banking plus loan plus transaction arms; heart plus skin plus eye hospitals
IID status Near-IID across devices Non-IID by design
Merging Plain averaging works well Needs weighted aggregation plus penalty clamp plus caching
When to pick which view Use when branches share columns Use when arms hold different columns but need one joint index

Pick homogeneous tools for same-schema branches; pick the caching design for unlike-feature conglomerates.

Q: Should we aim at the conglomerate case with unlike businesses, or the global-bank case with branches in many countries sharing one schema?

A: The conglomerate case. Same-schema branches in many countries are the simple homogeneous problem — shared schema, near-IID, easy averaging. The caching design exists for the complex case: unlike feature groups and unlike businesses, unwilling to share rows, yet needing one accurate combined model. The conglomerate with homogeneous versus complex heterogeneous arms is the running example. Regional rule differences, such as banking rules differing across countries, still leave the schema shared, so that global-bank case stays in the easy regime.

Q: What does IID actually require of the data?

A: That samples come from the same distribution and are drawn independently. Same distribution plus independent draws — that is the full test. Heart rows, skin rows, and eye rows violate the same-distribution part, so the setup is non-IID by design.

Card, loan, and payments arms of one financial group building a joint risk index, heart, skin, and eye specialty hospitals building a joint health index, and insurance, banking, and manufacturing arms each contributing their own columns all show the same hard shape.

Recap: IID means independent draws from one shared process; homogeneous same-schema work is easy and near-IID, while heterogeneous mixed-schema work is non-IID and hard. The caching design targets the hard conglomerate case. Next, devices blend their unlike views with weighted aggregation, where neighbor importance decides who pulls hardest.

3.6 Weighted Aggregation with Neighbor Importance

3.6.1 Mathematical formulation

If one neighbor trained on 10,000 fresh rows and another trained on 10 stale rows, should they count the same?

The lecture's plain-language rule was: larger alpha for neighbor means more influence of on my updated model. The reconstruction is a weighted average over the models currently held for the neighborhood. Here is the weight vector of neighbor (a list of numbers, one per model parameter), the set holds the neighbors device currently knows through its cache, each is a non-negative importance weight for neighbor , and is device 's new collaborative model for the next round:

with the normalization condition:

Each names neighbor importance (how much device trusts neighbor this round). The sum-to-one normalization keeps the blend on the same scale as the inputs: without it, weights like 0.6, 0.3, 0.1 would still work only because they already sum to 1.0, while raw scores like 6, 3, 1 must first be divided by their total 10. In standard federated averaging the same idea appears as weighting by dataset size, with samples on client and total samples, which also sums to one by construction. Simple averaging, where every neighbor counts equally with , is the special case of equal trust; the weighted form generalizes it by letting trustworthy or data-rich neighbors count more. Larger alpha pulls the result toward that neighbor — that pull is the whole point of weighted aggregation with neighbor importance blend.

Weighted aggregation forms the next model as an -blend of cached neighbor models: with . Here is neighbor 's weight vector, is the cached neighborhood of device , and is neighbor importance. Simple averaging is the equal- special case.

Compared side by side: simple averaging gives each of neighbors weight and needs no tuning but lets a stale peer drag the mean; weighted averaging gives data-rich or fresh peers larger and stays accurate under heterogeneity but needs a policy for picking . When peers look alike and fresh, pick equal weights; when peers differ in data size, freshness, or trust, pick tuned importance weights.

3.6.2 Worked numbers: 0.6, 0.3, 0.1

A concrete assignment was walked through. Device holds cached models from three peers, C1, C2, C3. It assigns importance to C1, to C2, and to C3. The new model is then times C1's weights plus times C2's weights plus times C3's weights, computed coordinate by coordinate over the whole weight vector.

Full numbers — importance weights blend on coordinate vectors. Keep it tiny with weights so every step shows. Let C1 hold , C2 hold , C3 hold , with (sum ). First coordinate: . Second coordinate: . So . Sense-check: the result sits closest to C1's because C1 carries 60 percent of the weight, while C3 barely nudges it. Change the situation — say C3 returns with a large fresh dataset — and the weights are re-chosen, perhaps , to reflect the new trust.

Picture a bar chart with neighbors C1, C2, C3 on the horizontal axis and alpha on the vertical axis from 0 to 1. The bars stand at 0.6, 0.3, 0.1 — a tall, medium, and short bar. The landmark is the 0.6 bar holding more than half the mass: wherever that bar points, the blend follows. The takeaway in one sentence: bar height is pull strength.

Scope: Weighted blends assume all share the same architecture and layout, so coordinate means the same parameter everywhere. Assumption: alphas are fixed for the round and sum to one; retune them next round as freshness and data size change.

Choosing these weights well is itself a design problem; many aggregation algorithms exist beyond plain averaging, from data-size weighting to trust scores to staleness penalties, and picking among them is where much of the complexity lives. A common beginner trap is leaving raw scores unnormalized (using 6, 3, 1 directly inflates the model by 10 times); always divide by the total first. A second trap is freezing alphas forever while peers drift in freshness; re-pick them each round.

3.6.3 Student questions and answers

Q: Will some procedure maintain the plain average of the C1, C2 models — just add and divide?

A: Plain averaging is where the story starts, and it was covered earlier. Add the C1 and C2 vectors and divide by 2 — that is equal-share averaging. The weighted form goes further: instead of equal shares, each neighbor gets an importance , and the merge becomes a weighted blend with neighbor importance and equal shares as the special case. Many such algorithms have been proposed, and the weight choice is the interesting part.

The same confusion returns in new words, so it is worth locking in: plain average is weighted average with all alphas equal.

Q: Does every device separately collect neighbor weights and compute its own weighted average to get its next model?

A: Yes. Each device gathers the models in its own cache, applies its own importance weights, forms its own next model, trains it on local data again, and the loop continues. The device collects neighbor weights, computes the weighted average for its next model, and repeats the gather-cache-weight loop. There is no single global copy — every device carries its own view of the consensus.

There is no central whiteboard; there are personal whiteboards that slowly agree.

Exam note: Be ready to compute one weighted-aggregation step from given weights (multiply each coordinate, add, check the alphas sum to one) and to explain in words why a larger alpha pulls the result toward that neighbor.

In short, alpha weights aggregation is personal: my cache, my alphas, my next model — and the fleet agrees by repeating that personal step.

Recap: Blend cached neighbors with alphas that sum to one; big alpha means big pull, equal alphas mean plain averaging. Next, each device trains that blend on local batches with a two-part objective that refuses to drift.

3.7 Local Update in Full: Two-Part Objective and K Steps

3.7.1 Mathematical formulation

How do you fit your own data hard without sprinting away from the group?

The local-update function performs training on one node at one global round . Its plain-language specification was: take care of two loss functions — one that trains on the data, and one that penalizes moving away from the global model. The reconstruction uses for the model weight vector being trained (in ), for the ordinary task loss on local samples, for the consensus (global) weight vector at round , and for the penalty strength, a non-negative scalar pronounced "row" in the session:

where is the current mini-batch of local samples. The first part fits the data. The second part, the proximal or regulation term, grows with the squared distance between the local weights and the consensus weights, so wandering far gets expensive. The one-half factor is the standard convention: since the gradient of is exactly , the half cancels the factor of 2 from differentiating a square and leaves a clean penalty gradient . Reference code for this family writes the same term as with in place of ; here we keep the lecture's with the half to match the session, which is the same shape with .

The single gradient-descent step on this two-part local objective with penalty consensus, with learning rate , reads:

in words from the session: new weight equals old weight minus the learning rate times dou L by dou W, where dou L by dou W is the gradient of the loss with respect to the weights. The learning-rate symbol is the standard choice for step size; the session called it a constant learning rate (heard as "n"), and is that same constant in standard notation. Here is the gradient vector (one partial derivative per weight), is where the step starts, is the mini-batch used for the step, and scales how far the step moves. Unfolding the gradient step learning rate weights update in full:

Two-part local objective : pulls toward local data , the proximal term pulls back toward consensus , and sets the grip. Gradient step : move against the combined gradient scaled by learning rate .

Think of a dog on a leash: the dog (local weights) wants to chase every interesting smell (local batches), while the owner (consensus) holds the leash (penalty) at . A short leash (large ) keeps the dog at heel; a long leash (small ) lets it roam. The leash never breaks — it only stretches at a price.

3.7.2 Classification loss or regression loss

The task loss is chosen by problem type. For classification — for example, naming the object in a phone photo — use cross-entropy loss between predicted class scores and true labels. With true label (ground truth, say for cat) and predicted probability (say for cat), the loss is ; a confident wrong answer like pays . For regression — for example, predicting a sensor reading — use mean-squared-error loss between predicted and true values: with truth and prediction , the loss is . Here names a single input sample's features, names its true label, the model maps to a prediction often written , and the loss measures the gap between and . Any other task-appropriate loss fits the same slot.

3.7.3 The penalty term as a clamp

Without the penalty, non-IID data plus delayed peer updates lets local weights sprint off alone. The penalty clamps that sprint — it acts like a speed limiter that charges more the farther weights stray.

Numbers — clamp consensus drift penalty weights. Work in one scalar weight to see every number. Consensus sits at , local training tugs toward , penalty strength , current . Penalty value: . Penalty gradient: , so with the penalty alone pulls the weight back by in one step. A second image with the same math: a weight trying to jump from to faces distance , square , penalty — the leap is not allowed to stand. Sense-check: the farther the drift, the heavier the price, so the update settles much nearer than .

The strength tunes the grip. A large clamps hard and keeps the model glued to consensus; a small loosens control and lets local patterns dominate. Picture a plot with weight value on the horizontal axis and total loss on the vertical axis: the data loss is a valley near 100, the penalty is a valley near 10, and the sum is a valley somewhere between, sliding toward 10 as grows. Under heterogeneous data and stale peer information, the clamp is what keeps the shared effort from flying apart.

Scope: The clamp helps when local data is non-IID or peer models are stale. Assumption: is picked before the round and held fixed; consensus is treated as a constant target during the local steps, not moved mid-round.

A beginner trap is setting "to learn faster" on skewed data — the model then memorizes its own slice and fails the joint test. The opposite trap is cranking sky-high so the model never leaves consensus and learns nothing local. Tune in the middle and watch joint accuracy, not just local loss.

3.7.4 Student questions and answers

Q: Is there a regularization-style correction inside the weight update, on top of the data loss?

A: Yes. That is exactly the second part of the objective. Gradients flow from both parts at once: the data part pulls weights toward fitting local samples (regularization correction starts from data loss), and the penalty part pulls weights back toward the consensus. The second objective combines data gradients plus penalty gradients, and the update rule subtracts the combined gradient scaled by the learning rate.

Regularization here does not mean weight decay toward zero; it means decay toward the shared model.

Q: What is the second expression with the weight difference actually measuring?

A: The gap between the consensus weights and the current local weights — . The second expression with weight difference measures that gap, and penalizing the gap keeps the local model from drifting. Training fits local rows and simultaneously refuses to wander from the shared model, which protects accuracy on data from other devices. Local drifting is priced by that gap, so the clamp acts.

Phone keyboards that adapt to one user's slang without forgetting standard language, factory monitors tuned to one machine that must still agree with the fleet-wide fault model, and hospital models tuned to local patients that must stay compatible with the joint index all live on this same leash.

Recap: Local training minimizes data loss plus a consensus penalty, stepped times with learning rate ; sets how hard the leash pulls. Next, the symbols , , and the batch loop that runs those steps get pinned down exactly.

3.8 Symbols, Batches, and the Update Rule Step by Step

3.8.1 What i, t, and k name

Three letters carry the whole address of every weight — what does each one name?

Three indices remove all ambiguity, and they are worth memorizing. The subscript names the device: node , client , agent are the same thing. The subscript names the global round, also called the global epoch: the -th outer cycle of the whole system. The superscript counts local steps inside that round: the -th mini-batch update on device during round . So is the model where device starts round , is the model after local updates, and is device 's private local dataset, which is never shared. Local step indices with device round batch addressing mean no two updates share a name: can only mean device 2, round 7, after 3 local steps.

Purpose: give every weight snapshot a unique address so local and global progress never get mixed. Inputs and outputs: in comes the round-start model plus dataset ; out goes the round-end model after steps. Here is the device index, is the global round, is the local step, and is the private dataset.

3.8.2 Sampling a mini-batch

Training consumes the dataset mini-batches at a time. At local step , the device draws one mini-batch at random from ; call it , a small bundle of samples, each pairing features with a label . Phone photos split into cat-image and dog-image batches, factory logs split into sensor-signal batches, and hospital archives split into scan batches are the running examples. Because fresh rows keep arriving on the device itself, sampling always reflects the latest local reality. Mini-batch sampling keeps memory small and gradients noisy in a helpful way: small bundles mean many updates per round instead of one giant slow one.

3.8.3 Gradient step and repeat-K loop

One local step runs the same five moves. Start from the current weights. Feed the mini-batch through the model to get predictions. Score predictions against true labels with the task loss and add the drift penalty. Differentiate that combined loss with respect to every weight to get the gradient vector. Subtract the learning-rate-scaled gradient from the old weights to get the new weights. Repeat for , then hand back the final weights as the device's trained model for this round.

Steps (repeat-K loop): for to : draw from ; predict from ; score ; form (dou L by dou W); step . Each line has one job — sample, predict, score, differentiate, move — and the loop chains such moves.

The cost is easy to state: gradient evaluations per round per device, each over one mini-batch, so double roughly doubles local compute. The practical limit is drift: large lets a lonely device wander far before the next aggregation, which is why the penalty term exists.

3.8.4 Worked walkthrough of one step

Trace — one gradient step with batch prediction loss update. Use a scalar model so all arithmetic shows. Device , round , step . Start , consensus , , . Mini-batch holds two samples: features and labels and . Model predicts : and . Task loss (mean squared error): . Penalty: . Total . Gradient of data part: average gives ; penalty gradient ; total gradient . Update: . Sense-check: the large data error pushed the weight down hard, while the penalty added only a small tug back toward 4.0. The first step feeds batch 1, the second feeds batch 2, and so on through all batches, with weights improving after each batch.

This is ordinary mini-batch training, identical in mechanics to single-machine learning — the distributed novelty lies entirely in the penalty term and in where batches come from. When to use this loop as-is: small (say 5 to 20) with fresh consensus nearby. The alternative of huge with no penalty belongs only to IID, always-connected setups, which this lecture explicitly leaves behind.

Recap: names the device, the round, the local step; each of steps samples , predicts, scores, differentiates, and steps. Next, those trained models travel through caches whose freshness is policed by a staleness cutoff.

3.9 Cache Exchange, Staleness Bound, and Freshness

3.9.1 What each cache holds

If you can only meet peers one at a time, what must you remember between meetings?

Every device keeps a small memory holding its own latest model plus the latest models it has received from others. An entry is more than bare weights: it carries which agent the weights came from and a timestamp or version marking when they were produced. A cache might read: my own model at version 5, C2's model at version 4, C3's model at version 1, C4's model at version 3. Because devices meet only pairwise and sporadically, two devices' caches usually disagree about some third device — and that disagreement is normal, not a bug. Think of travelers swapping notebooks: each notebook lists who wrote each page and when, and no two travelers hold identical sets for long.

Purpose: let training continue with no waiting by always having a usable peer set. Inputs and outputs: in come received models with sender ids and stamps plus the current cache; out goes an updated cache of at most fresh entries. Here is the current round, is the stamped round of neighbor 's cached model, and is the cache capacity.

3.9.2 Relay through a middle device

The relay story was told with clocks. C1's cache holds C3's model stamped 1 o'clock. C3 later meets C2 and shares its fresher 2 o'clock model. Now C2's cache holds C3-at-2 while C1 still holds C3-at-1. When C1 and C2 meet, they swap full caches. C1 compares the two C3 entries, sees 2 o'clock beats 1 o'clock, drops the older entry, and keeps the newer one. Symmetrically, C2 absorbs anything fresher from C1's cache. Through such pairwise swaps, fresh models diffuse across the fleet without any device ever contacting the whole fleet at once. The relay with fresher cache diffuse fleet behavior means news hops person to person: C3 tells C2, C2 tells C1, and C1 ends up fresh without ever meeting C3.

Trace — relay clocks with newer keeps older cache. Start: C1 cache = {C3-at-1, C1-at-1}, C2 cache = {C3-at-2, C2-at-2} after C3 met C2 at 2 o'clock. C1 meets C2 and they swap full lists. For agent C3, C1 sees candidates stamped 1 and 2 — newer keeps, older goes, so C1 stores C3-at-2. For agent C1, C2 has no C1 entry, so C2 stores C1-at-1. For agent C2, C1 has no C2 entry, so C1 stores C2-at-2. End: both hold {C3-at-2 plus each other's models}. Sense-check: one meeting spread the 2 o'clock news to a device that never met the source.

3.9.3 Staleness arithmetic and the cutoff

The session's plain words were: t minus tau is the time delay — how old the model is. A neighbor's update came from round 3, the current round is 7, so staleness is 4. With for the current round and for the round stamped on neighbor 's cached model, staleness is:

Here is the staleness (age in rounds) of neighbor 's cached model, is now, and is when that model was born. A cached model survives only while it is fresh enough:

where is the maximum tolerated delay. The symbol is the standard name for this cutoff: the session described setting "this value" as the cutoff age, and is that same value written in symbols. Work it through: current round , cached stamp , so . If the cutoff , the model stays since ; at staleness or more it is discarded. A clock-time version said the same thing: keep a received model for five hours, then remove it, because training on older weights risks huge drift. Five hours remove model huge drift is the wall-clock twin of the round-count rule. The cutoff is the safety valve that answers the robustness worry from the earlier section: staleness current round cached stamp cutoff arithmetic decides, and fresh cutoff delay model survives logic enforces it.

Picture staleness on the horizontal axis (0 to 8 rounds) and usability on the vertical axis (keep or drop). The curve is flat at keep until , then drops like a cliff to drop. The landmark is the cliff edge at 5: a model aged 4 sits safely left of the edge, a model aged 6 lies off the cliff. The takeaway in one sentence: age in, cliff decides.

Scope: The bound assumes rounds tick at a shared pace so means the same age everywhere. Assumption: is picked before training (like 5 rounds or 5 hours) and held fixed; capacity caps how many survivors are kept.

Set the cutoff too large and ancient models steer training off course; set it to zero and the cache empties between meetings so devices train alone. The sweet spot keeps the freshest affordable set.

3.9.4 Cache update procedure

The update runs as a fixed procedure on every meeting:

  1. Collect each newly received model with its sender id and timestamp.
  2. For each cached entry, check its age against the cutoff and delete entries older than the maximum.
  3. For each received model, look for an existing entry from the same agent. If none exists, store it.
  4. If an entry exists, compare timestamps and keep whichever is latest, replacing the older one.
  5. Sort the surviving entries by recency and keep only the first , the cache capacity, returning the trimmed cache.

This runs before aggregation, so aggregation always blends the freshest affordable set of peer models. Complexity is tiny — a handful of timestamp compares per meeting — and the cost it controls is radio and memory: small and tight mean less storage and less risk, at the price of less diversity. Use this procedure whenever meetings are pairwise and random; the alternative of waiting for a full-fleet sync belongs to wired clusters, not moving agents. Cache staleness cutoff policing is what makes that choice safe.

Exam note: Compute staleness as current round minus stamped round, apply the cutoff, and justify discarding old models through drift: old weights pull the blend toward outdated patterns and can undo fresh learning.

That exam skill is the operational half; the conceptual half is what the next section measures.

Recap: Caches hold stamped peer models, relays spread freshness hop by hop, and the staleness bound drops anything older than . Next, drift itself gets a number — Euclidean distance — and the whole fleet gets one shared objective.

3.10 Measuring Drift with Euclidean Distance and the Shared Training Goal

3.10.1 Distance between two weight vectors

Two models share the same blueprint but hold different numbers — how far apart are they?

The plain-language statement was: we compute the distance between the two models — current model versus cached model — using Euclidean distance. With for the current weight vector and for the cached peer vector, both in (lists of real numbers with the same layout):

Here is the drift distance, is the local model, is the peer model from the cache, and is the Euclidean norm (square root of summed squares). The norm expands coordinate-wise over Euclidean distance weight vectors models entries. With and :

Each is the per-weight gap, squaring removes sign, adding pools all gaps, and the square root returns to the original units. A small means the models agree; a large means the local model has wandered. Minimizing such gaps is precisely what the penalty term in the local objective does at training time — the penalty is the squared version of this same distance.

Numbers — drift in 2D. Let and . Differences: and . Squares: and . Sum: . Root: . Sense-check: a 3-4-5 triangle gap reads as distance 5, which matches the geometry. A second pair , gives differences , squares , — near-twins score near zero.

Picture distance on the horizontal axis from 0 outward and loss penalty on the vertical axis. The curve is a parabola through the origin: flat near zero drift, steep far out. The landmark is the elbow where small gaps cost little and large gaps cost a lot — that elbow is where the clamp starts to bite hard.

3.10.2 Why equal architecture is required

Q: When we apply mean-squared error between two models, is there a hidden point — something like correlation, how near they are, how the data spreads across devices?

A: The distance indeed reports how far apart the two weight vectors lie, point to point, and shrinking it is the goal. As a byproduct it reflects how correlated, how mutually close and near, the global and local models are — small mean-squared error means small distance. But the deeper requirement is structural: point-to-point distance is defined only when both vectors have identical layout — same layers, same sizes, same architecture, so coordinate means the same weight on both sides. All clients run the same model structure, and the distance between models is meaningful because of that shared layout. How data spreads across devices does not enter this particular computation at all.

A size mismatch breaks the math before it starts: a 100-weight vector minus a 120-weight vector has 20 gaps with no partner. That is why architecture is fixed once and only weights travel.

Same-architecture precondition: and must live in the same with matching coordinates. Only then do subtraction, norm, and penalty make sense.

3.10.3 Global training objective

Zooming out, the whole fleet optimizes one shared goal. In the session's words: find the model weights that minimize the loss — take any neighbor's dataset, take samples, feed them to the model, and the loss must be small. With for the -dimensional real weight vector, for neighbor 's dataset, for a sample drawn from it, and for the per-sample loss such as cross-entropy:

Read it inside out: pick a participating neighbor , draw a sample from its private data , run the model on it, score the loss , and average over all such draws. The best weights make that global objective expectation average loss as small as possible. Every device's local penalty-pulled training plus weighted aggregation is a decentralized attempt to approach this single minimum without ever centralizing the data. In numbers: three neighbors with mean losses 0.2, 0.5, 0.9 give overall mean ; training chases weights that push that 0.53 down.

Scope: This objective assumes all devices score with the same loss and the same architecture, so one can serve all. Assumption: the expectation runs over participating neighbors and their samples with each draw weighted fairly; skewed participation skews the mean.

A beginner trap is reading the expectation as one fixed batch average — it is the mean over the whole fleet process, not one device's round. Another trap is chasing local loss to zero while the global mean rises; the penalty and aggregation exist to stop exactly that.

3.10.4 What capital E names

Q: What is the capital E in the objective?

A: Expectation — the average, the mean. The capital E names expectation over neighbors and samples: add up over many draws of and and divide by the count. So the objective asks for weights whose mean loss is minimal, not weights that ace one batch.

The slot-machine picture from probability helps: expectation is the long-run average payout, not one lucky pull. Here the payout is negative loss, and training picks the machine settings with the best average.

Recap: Euclidean distance numbers drift (same layout required), and the fleet chases one shared expectation of loss. Next, local training, cache update, and aggregation lock into one repeating loop that chases that minimum without ever gathering the data.

3.11 End-to-End Loop: Local Training, Cache Update, Aggregation

3.11.1 The three functions in order

Three jobs repeat forever — what are they, and in what order do they run?

The complete method is three functions repeating forever. First, local update: each client trains its own data through penalized gradient steps. Second, cache update: each client gathers neighboring and cached models that are not too old, dropping whatever exceeds the staleness cutoff. Third, model aggregation: each client blends the surviving neighbor models with its importance weights into an improved collaborative model for the next round. All clients run all rounds until final trained models emerge on every device. Those three functions repeating cycle form the heartbeat: train, refresh memory, blend — then again.

Purpose: turn isolated local learning into fleet learning with no waiting. Inputs and outputs: in comes the round-start model plus cache; out goes the next round-start model plus a fresher cache. The three steps are local cache aggregation cycle stages — (1) local update on , (2) cache update with cutoff , (3) -aggregation over survivors.

3.11.2 A round from start to finish

Follow device through one full cycle. It starts round from its current model. It samples mini-batches from , stepping weights forward each time while the penalty term tugs toward consensus. It then meets whoever is in range, swaps caches, discards over-age entries, and keeps the freshest models. It forms as the -weighted blend of those survivors. That blend becomes the starting point of round , and the cycle repeats. No step ever waits for the full fleet, which is why the loop survives slow hardware and fickle links.

Walk the timeline once with small numbers: round starts at ; local steps move it with batches ; a meeting swaps caches and drops a C3-at-1 entry aged ; survivors C2-at-6 and C4-at-5 blend with into . One line per job, one job per meeting, no barrier anywhere.

Picture rounds on the horizontal axis and model quality on the vertical axis. Each local-update segment climbs a little, each cache-plus-aggregation segment jumps toward the fleet mean, and the sawtooth trends upward. The landmark is the jump at each blend: without it the lines wander apart; with it they ratchet together.

3.11.3 Open thread: slow convergence

Q: Two sections back there was an underlined line about slow convergence — what is it, and why would we want to achieve low convergence?

A: The question was acknowledged and parked: the convergence discussion belongs with the cache-update analysis, which comes after the local-update deep dive. The recap for now: because models move and meetings are random, sharing is inconsistent, so reaching the shared model takes time and accuracy can suffer — slow convergence means many rounds to agree, and low convergence speed is the problem, not the goal. Convergence with cache update under models move and meetings random plus sharing inconsistent behavior is exactly what caching is meant to tame: fresher caches and tighter cutoffs speed agreement. The full treatment was deferred to the next part of the analysis.

Slow here never means desirable — it names the cost of random meetings. Caching does not remove the randomness; it softens its price by always giving each device something to blend.

Recap: Train locally, refresh the cache, blend survivors — repeat every round with no global wait. That loop is the whole method in miniature, and its speed depends on how fresh the caches stay.

Exam Guidance Summary

No mark split, question pattern, or exempted topic was stated in this session, so there is no distribution to report. The guidance below collects the emphasis signals actually given:

  • State the twin aims — learn from local data, stay close to the consensus — and explain the accuracy cost of dropping either one. Dropping local fit wastes fresh on-device data; dropping consensus lets drift wreck shared accuracy. This is the central exam focus.
  • Define IID (independent draws from the same distribution) and contrast homogeneous same-schema collaboration (two bank branches, same columns, easy averaging) with heterogeneous mixed-schema collaboration (banking plus loan plus transaction arms, or heart plus skin plus eye hospitals, hard joint index), each with one example.
  • Write the two-part local objective in words and symbols, , name every symbol ( weights, task loss, batch, consensus, grip), and explain how the penalty strength tightens or loosens the clamp.
  • Perform one weighted-aggregation computation from stated importance weights (check alphas sum to one, multiply coordinate-wise, add) and interpret what a larger does — it pulls the blend toward that neighbor.
  • Compute staleness as current round minus stamped round (), apply a cutoff (), and justify discarding old models through drift: stale weights pull the blend toward outdated patterns.
  • State the Euclidean drift distance (), its same-architecture precondition (same , same layout, or subtraction is undefined), and the shared global objective with expectation (, the mean loss over neighbors and samples).
  • Carry the open convergence thread: inconsistent sharing slows agreement because models move and meetings are random, and caching with fresh cutoffs is the proposed remedy.

Key Industry Applications

  • Autonomous driving stacks and driver-assist sensors that learn locally with intermittent links: cars trade models at intersections and keep driving on cached peer models between meetings.
  • Smart factories and industrial monitoring where vibration, signal, and scan data stay on the machines: each machine tunes a fault model on its own hum while staying near the fleet consensus.
  • Hospital groups combining heart-care, skin-care, and eye-care features into one health index without moving patient rows: specialty knowledge merges through weights, honoring privacy law.
  • Banking groups combining branch records, loan-repayment streams, and transaction feeds into one financial index under differing regional rules: same-schema branches average easily while mixed-schema arms need the full caching design.
  • Mobile phones, wearables, drones, and vehicles as moving agents that exchange models only inside communication range: on-device typing, health, and navigation models improve with every chance meeting.
  • Small edge boards such as Raspberry Pi devices serving as low-cost learning agents with private local datasets: cheap hardware senses and learns at the edge, contributing through stamped cache entries.
  • Surveillance cameras and city-scale sensor fleets where centralizing video is impractical, so cached peer models stand in for absent neighbors: each camera keeps watch with the freshest affordable set of peer views.

DML Lecture 3 notes · Model Caching for Decentralized Federated Learning

Distributed Machine Learning· postgraduate· 2026-09-10

Sections Breakdown

1Recap: Parallelism, Batches, and Caching

Parallelism splits work; epoch batch order lets the cache prefetch the next batch so compute never waits.

2Decentralized Learning on Mobile Agents

Mobile agents m1 to mn learn on private datasets and build one combined model from shared weights only.

3Why Model Caching: Slow Devices and Asynchronous Training

Slow devices and unstable links force async training on cached models, gaining stability at the price of staleness.

4Learning Locally While Staying Close to the Shared Model

Each node fits local data while staying near the shared consensus; data stays, models travel.

5Non-IID Data: Same Features Versus Mixed Features

Same-schema homogeneous data is easy and near-IID; mixed-schema heterogeneous data is non-IID and the caching target.

6Weighted Aggregation with Neighbor Importance

Next model is an alpha-weighted blend of cached neighbors; alphas sum to one and encode trust.

7Local Update in Full: Two-Part Objective and K Steps

Local training minimizes task loss plus a rho-scaled drift penalty, stepped with learning rate eta.

8Symbols, Batches, and the Update Rule Step by Step

Symbols i, t, k address every update; each of K steps runs sample, predict, score, differentiate, move.

9Cache Exchange, Staleness Bound, and Freshness

Caches hold stamped peer models; relays spread freshness and the staleness bound drops old entries.

10Measuring Drift with Euclidean Distance and the Shared Training Goal

Euclidean distance numbers drift under same architecture; the shared goal minimizes mean loss.

11End-to-End Loop: Local Training, Cache Update, Aggregation

Train locally, refresh the cache, blend survivors; repeat every round without waiting for the fleet.

Postgraduate students in Distributed Machine Learning

Exam Revision Notes

Below is the distilled, exam-ready core. Every entry comes from the full explanation above. Use this section for rapid review; return to the main notes when a point needs more context.

Recap: Parallelism, Batches, and Caching

Must-know: Known batch order lets the cache preload batch k+1 while batch k trains

Top pitfall: Thinking random access still allows prefetch; it needs known batch order

Self-check: With 4 batches, what overlaps while batch 1 trains?

Connects to: 3.3 Why Model Caching: Slow Devices and Asynchronous Training

Decentralized Learning on Mobile Agents

Must-know: n agents each hold private Di and share only weight vectors toward one combined model

Top pitfall: Calling weight merging centralized training; data never moves

Self-check: What travels between devices: rows or weights?

Connects to: 3.3 Why Model Caching: Slow Devices and Asynchronous Training, 3.4 Learning Locally While Staying Close to the Shared Model

Why Model Caching: Slow Devices and Asynchronous Training

Must-know: Async training uses cached peer models so no device waits for stragglers

Top pitfall: Using stale models past expiry; robustness is not guaranteed

Self-check: What lets C1 train while C3 is out of range?

Connects to: 3.1 Recap: Parallelism, Batches, and Caching, 3.9 Cache Exchange, Staleness Bound, and Freshness

Learning Locally While Staying Close to the Shared Model

Must-know: Fit local data and stay near consensus; dropping either hurts accuracy

Top pitfall: Thinking the two aims are architecture vs weights sharing

Self-check: Name the twin aims and the cost of dropping consensus.

Connects to: 3.7 Local Update in Full: Two-Part Objective and K Steps, 3.10 Measuring Drift with Euclidean Distance and the Shared Training Goal

Non-IID Data: Same Features Versus Mixed Features

Must-know: IID means independent same-distribution draws; this lecture targets heterogeneous non-IID

Top pitfall: Calling same-schema branches the hard case; the conglomerate mixed-schema case is the target

Self-check: Is the global-bank same-schema case easy or hard?

Connects to: 3.4 Learning Locally While Staying Close to the Shared Model, 3.6 Weighted Aggregation with Neighbor Importance

Weighted Aggregation with Neighbor Importance

Must-know: Blend cached neighbors with alphas summing to one; larger alpha pulls toward that neighbor

Top pitfall: Leaving raw scores unnormalized; always divide so alphas sum to one

Self-check: With alphas 0.6, 0.3, 0.1 and C1=[4,6], what is coordinate one?

Connects to: 3.9 Cache Exchange, Staleness Bound, and Freshness, 3.7 Local Update in Full: Two-Part Objective and K Steps

Local Update in Full: Two-Part Objective and K Steps

Must-know: Local objective is data loss plus consensus penalty; rho sets the clamp grip

Top pitfall: Setting rho=0 on skewed data and memorizing the local slice

Self-check: With consensus 10, x=100, rho=0.1, what is the penalty value?

Connects to: 3.8 Symbols, Batches, and the Update Rule Step by Step, 3.10 Measuring Drift with Euclidean Distance and the Shared Training Goal

Symbols, Batches, and the Update Rule Step by Step

Must-know: i names device, t round, k local step; K steps sample predict score differentiate move

Top pitfall: Mixing up round t with local step k

Self-check: What does x_{2,7}^{(3)} name?

Connects to: 3.7 Local Update in Full: Two-Part Objective and K Steps, 3.9 Cache Exchange, Staleness Bound, and Freshness

Cache Exchange, Staleness Bound, and Freshness

Must-know: Staleness is current round minus stamp; drop anything older than tau_max

Top pitfall: Keeping ancient models; past tau_max they steer training off course

Self-check: t=7, stamp=3, cutoff 5: keep or drop?

Connects to: 3.3 Why Model Caching: Slow Devices and Asynchronous Training, 3.6 Weighted Aggregation with Neighbor Importance

Measuring Drift with Euclidean Distance and the Shared Training Goal

Must-know: Drift is Euclidean distance; fleet minimizes expected loss over neighbors and samples

Top pitfall: Comparing vectors with different layouts; same architecture is required

Self-check: Distance between [1,2] and [4,6]?

Connects to: 3.7 Local Update in Full: Two-Part Objective and K Steps, 3.11 End-to-End Loop: Local Training, Cache Update, Aggregation

End-to-End Loop: Local Training, Cache Update, Aggregation

Must-know: Each round runs local update, cache update, aggregation with no global wait

Top pitfall: Thinking slow convergence is desirable; it is the cost to tame

Self-check: Name the three functions in order.

Connects to: 3.7 Local Update in Full: Two-Part Objective and K Steps, 3.9 Cache Exchange, Staleness Bound, and Freshness, 3.10 Measuring Drift with Euclidean Distance and the Shared Training Goal

Was this lecture useful?

Loading comments…
🤖

BitsNotes AI Assistant

Subject Notes Assistant

Configure AI Chat

Choose how to access the chatbot
Have your own API key?

Switch to "Bring Your Own Key" tab above for unlimited access with any OpenAI-compatible provider.

🔑 Enter API key above to fetch live models from provider, or enter model name manually.
OpenAI-Compatible API Support

Choose any provider preset (Gemini, DeepSeek, Kimi, GLM, MiniMax, Qwen, OpenAI, Groq, Ollama, etc.) or enter a custom endpoint URL.

Security & Privacy First

Your API key is sent directly from your browser to your specified provider. BitsNotes servers never store or see your key.