Byzantine-Resilient Aggregation for Decentralized Federated Learning

Median, trimmed mean and trust under local adversarial and non-IID conditions

Enrique Tomás Martínez Beltrán

Updated: 7 min read
Byzantine-Resilient Aggregation for Decentralized Federated Learning
In this article

Byzantine-robust aggregation limits the influence of faulty or malicious updates during collaborative training. In decentralized federated learning, each node must make that decision using the information available in its neighborhood, so the defense is only as strong as the local majority of honest peers. The practical answer is to start from simple baselines (coordinate-wise median, trimmed mean, trust weighting), size them to the local adversarial budget, and measure what they cost legitimate non-IID clients when nobody is attacking.

The problem

In centralized FL, the server can apply a defense before producing the global model. In DFL, each node may aggregate updates from neighbors. That makes poisoning more subtle because influence is local, repeated and topology-dependent.

The practical question is: how can a node decide whether to accept, reduce or reject a peer update?

Defense families

Three families are especially useful as a baseline:

  • median-based aggregation,
  • trimmed mean,
  • trust-weighted aggregation.

They are not perfect. Their value is that they are understandable, cheap enough for many settings and useful for comparing more advanced defenses.

Median, trimmed mean and trust: what changes

Coordinate-wise median selects the middle value of each parameter. Trimmed mean removes extremes in each coordinate and averages the remainder. Trust weighting retains contributions with different weights. These are different operations: none identifies a participant's intent by itself. Yin and colleagues, ICML 2018 analyze median and trimmed mean under specific statistical assumptions; transferring their guarantees to a DFL neighborhood requires checking those assumptions again.

Consider an arithmetic illustration, not a benchmark: for scalar contributions 0.9, 1.0, 1.1, 1.2, 20.0, the mean is 4.84, the median is 1.1, and trimming one value at each end also produces 1.1. Neural-network coordinates form a correlated vector, however. Combining central values does not guarantee a valid update or preserve a minority class.

The adversarial budget must be local

A federation may contain few malicious nodes, yet all of them may surround the same client. That client can receive a majority of harmful contributions. Record the number of received and accepted neighbors per round, the adversarial fraction within that neighborhood, and the fallback when filtering leaves insufficient support.

Measure the cost without an attack as well. Yang and colleagues, ICML 2025 analyze the tension between Byzantine tolerance and aggregation error without attackers. The experimental consequence is concrete: compare the defense enabled and disabled on both clean and attacked data, including legitimate non-IID clients.

For protocol design, continue with measuring DFL robustness and combining privacy with robust aggregation.

Interpretability

In cyberdefense, a defense mechanism should be explainable to an operator or researcher. If an update is down-weighted, the system should expose why: distance from neighbors, historical trust, abnormal parameter shift, delay pattern or disagreement with local validation.

Robust aggregation is not just math. It is part of the trust layer of DFL.

Choosing between median, trimmed mean and trust weighting

The three baselines answer different questions, and the right choice depends on node degree, data heterogeneity and how much history each node keeps. The table summarizes general properties; it is a starting point for an experiment, not a ranking.

RuleWhat the node computesMain assumptionTypical weakness in DFLDecision it can explain
Coordinate-wise medianMiddle value of each parameter across received updatesHonest values form a majority in every coordinate of the neighborhoodDiscards information from honest outliers, such as a client that holds the only examples of a rare classWhich coordinates were set by which neighbors
Trimmed meanMean after removing a fixed share of the highest and lowest values per coordinateThe trim share is at least the local adversarial fractionWith low degree, trimming leaves very few values to averageHow many values were removed per coordinate
Trust weightingWeighted average with weights from history, similarity or reputationThe trust signal itself is hard to manipulateAttackers can behave well to earn trust and then poison; new peers start without historyWhich signal lowered each peer's weight

Node degree matters more in DFL than in a server-based setting. As an illustration with hypothetical numbers: a node with four neighbors plus its own model aggregates five values; trimming one from each side leaves three, so two coordinated neighbors are already enough to place a poisoned value at the boundary of what survives. The same trim rule on a node with twenty neighbors behaves very differently. Report the degree distribution alongside any robustness result.

Reputation-based approaches extend trust weighting with richer signals. The author's work includes RepuNet, which combines model similarity, parameter changes, message latency and communication volume into a reputation score, and DFLShield, which uses historical models, cosine similarity and clustering to exclude potentially harmful updates. Sentinel is an aggregation function designed specifically to secure DFL.

Common pitfalls and how to detect them

Most misleading robustness results come from the evaluation rather than from the aggregation rule. The following checks are cheap to add to any DFL experiment.

  1. Reporting only the global adversarial fraction. Ten percent of malicious nodes overall can mean a majority around one victim. Detect it by logging, per node and per round, the share of malicious senders among received updates.
  2. Silent loss of support. Filtering can leave a node with one or zero accepted neighbors, which turns aggregation into local training. Log the number of accepted neighbors and define the fallback explicitly (keep the local model, widen the neighborhood, or skip the round).
  3. Treating heterogeneity as an attack. Honest non-IID clients often look like outliers. Run the defense on a clean federation and measure the false rejection rate and per-client accuracy, not only the mean.
  4. Testing only naive attacks. Large-norm or random updates are easy to trim. Include an attacker that knows the rule and keeps its update inside the accepted range, because that is the realistic threat once the defense is published.
  5. Averaging away the victims. A mean accuracy over all nodes can hide the few nodes surrounded by attackers. Report the worst node and the nodes adjacent to malicious peers separately.
  6. Leaving the node's own model undocumented. Whether a node includes its own update in the robust statistic changes the effective majority. State it in the protocol.

The DART study compares CFL and DFL under diverse poisoning attacks and examines whether defenses designed for CFL are compatible with DFL, which is a useful reference for structuring these comparisons.

Key takeaway

Byzantine-resilient aggregation should be evaluated as both a statistical defense and an operational trust mechanism. A peer update is not only accepted or rejected; it should leave an auditable reason for that decision.

Open research question

How can a peer explain why it reduced or rejected another peer's update without exposing sensitive local validation data or creating a new attack surface? Related limits are discussed in robust DFL: limits and open questions.

Frequently asked questions

What is a Byzantine attack in federated learning?

A Byzantine participant can send arbitrary updates instead of the result of honest local training, whether because of a fault or deliberate manipulation. Typical examples are model poisoning, scaled or sign-flipped updates and data poisoning that produces harmful gradients. The term comes from distributed systems, where Byzantine faults cover any behavior, including coordinated and adaptive behavior.

Is trimmed mean better than median for Byzantine-robust aggregation?

Neither dominates. Trimmed mean averages more values and usually discards less honest information, but it needs a trim share that covers the local adversarial fraction. Median needs no such parameter but is coarser and can suppress honest minority signals. Compare both on clean and attacked runs with the same node degrees.

Does robust aggregation work with non-IID data?

Partly. Rules that treat distance from the center as suspicious will also penalize honest clients whose data differs from their neighbors. That is why the false rejection rate on a clean non-IID federation should be reported next to any attack result.

How many malicious neighbors can a node tolerate?

It depends on the rule and on the neighborhood, not on the federation as a whole. As a general guide, median-style rules need honest values to be a majority among the updates a node receives, and trimmed mean needs its trim share to be at least the malicious share in that neighborhood. For an overview of how DFL topologies shape this, see the decentralized federated learning topic hub.

Estimated text reading time: 7 minutes. Equations, code and references may take longer.

Decentralized Federated Learning · Trustworthy AI · Adversarial ML · Cybersecurity

Related Research