← Blog/blog/discount-yourself-fresh-neighbor-limit

A stale client can discount itself—but not invent a fresh neighbor

Imagine a phone returning after eight missed training rounds. It averages its old model with two neighbors that kept learning. Uniform gossip still gives the phone one-third of the vote. A rule that discounts only received models can be worse: it protects the stale model merely because it is local.

01

The stale model in the room is your own

Decentralized federated learning means devices train private local models and exchange them with neighbors, without a central server holding a fresh global checkpoint. A returning receiver therefore aggregates the model it froze before the outage with whatever its live neighbors currently hold.

Self-inclusive Freshness-weighted Gossip (SFG) assigns every candidate—receiver included—a score γ raised to its staleness gap from the freshest candidate, then normalizes the scores. Here γ is a discount factor between zero and one. With lags [2, 0, 0] and γ = 0.5, the receiver gets only 11.1% of the aggregate, not 33.3%.

def freshness_step(models, lags, gamma, online=True):
    if not online:
        return models[0], lags[0] + 1
    freshest = min(lags)
    scores = [gamma ** (lag - freshest) for lag in lags]
    total = sum(scores)
    weights = [score / total for score in scores]
    model = sum(weight * value for weight, value in zip(weights, models))
    lag = sum(weight * value for weight, value in zip(weights, lags))
    return model, lag

The TypeScript core drives every illustrative chart below; Python and C++ are faithful translations. The toy treats lag as a one-dimensional model error so the mechanism is visible without pretending to reproduce image-classification training.

uniformneighbor-onlyself-inclusive
Illustrative receiver weight with two fresh neighbors and γ = 0.5. Uniform and neighbor-only rules keep the receiver at one-third; self-inclusive weighting shrinks its vote geometrically.
02

Why self-discounting changes the error curve

The paper models each candidate as an older collaborative state plus dispersion. Any non-negative rule that keeps the receiver's weight at least as large as every neighbor's has an error lower bound proportional to the receiver's staleness variance. As the outage grows, that bound grows without limit. No clever discount on neighbors repairs a rule that refuses to discount itself.

uniform, fresh neighborsSFG, fresh neighborsSFG, regional outage
Seed-free scalar illustration: squared lag of the aggregate. SFG stays near the fresh neighbors when they exist. If all three clients share the same outage, equal relative lags force equal weights and the error grows again.
03

Age can be laundered by one local update

Age is the number of rounds since a model last trained. Effective lag instead tracks how much collaborative progress the model is missing. After aggregation, lag becomes the weighted mean of candidate lags. Local training resets age to zero, but it does not erase lag inherited from stale neighbors.

Illustrative age laundering. A model with lag 8 mixes at weights 0.25/0.75 with a fresh neighbor, then trains locally: age resets to zero while effective lag remains 2.
Momentreported ageeffective lagWhat the model still carries
returns88.0eight missed rounds
mixes with fresh neighbor82.0weighted inherited deficit
trains locally02.0deficit persists
Illustrative values computed by the core module, not measurements from the paper.
04

The empirical win has a boundary

Across CIFAR-10, CIFAR-100, and FEMNIST under synthetic and smartphone-derived outages, SFG-Cut improves mean personalized accuracy over decentralized federated averaging by 4.0 percentage points in 119 of 120 paired runs. The best age-of-information baseline gains 1.8 points. Yet topology and outage correlation decide whether the method has fresh candidates to use.

Paper-reported mean accuracy gains over decentralized federated averaging. These bars summarize different experimental conditions and are not a single controlled ranking.
Paper conditionmean gainWhy
main SFG-Cut evaluation+4.0 ppfresher candidates usually available
ring communication graph+1.6 ppfewer paths to freshness
regional outages+0.7 ppneighbors fail and return together
Paper-reported gains; pp means percentage points.
05

What to probe next

The theory studies aggregation error under stylized drift, not convergence of the full training process. The cut margin is chosen empirically, and the pilot was run after results for two candidate margins were known. Experiments are synchronous, map real availability traces randomly onto synthetic graphs, and cover at most 300 clients. Several close comparisons remain statistically unresolved.

The most useful follow-up is therefore not a larger image benchmark. It is a topology-aware test where availability and neighborhood structure are coupled, with an adaptive margin chosen without looking at test seeds. To inspect how the local models themselves train, continue with the site's interactive neural-network walkthrough.