Repository navigation
feat: add the A Little Is Enough Byzantine attack - #28
Draft
maheenunzeelah wants to merge 5 commits into
Draft
maheenunzeelah wants to merge 5 commits into
maheenunzeelah wants to merge 5 commits into
Conversation
FLTest's existing Byzantine attacks (gaussian, sign_flip) perturb an update without reference to the honest ones, so a perturbation large enough to matter is also an outlier -- which is what krum, median and trimmed_mean filter on. That left the project unable to stress-test the robust aggregators its own pitfall checker recommends as the remedy for non-naive attacks. little_is_enough (Baruch et al., NeurIPS 2019) measures the benign population first and moves only as far as its own variance allows, per coordinate: u' = mu - z * sigma. The default z is the largest step still covered by enough honest workers to complete a majority. It runs at before_aggregate, where every submission is visible, and rewrites only the attackers' entries. It also scores itself, because accuracy turns out to be the wrong instrument here: little_is_enough_absorption reports the share of the requested shift the aggregation rule conceded. Over five seeds absorption is reproducible to four decimals while accuracy swings by +/- 0.02, wider than anything the attack does to it -- an earlier single-seed run appeared to show a 4.6 point accuracy drop that four more seeds erased. Measured at z = 1.5, four attackers of ten, five seeds: every robust rule concedes more than plain averaging (0.40) -- trimmed_mean 0.56, median 0.69, krum 1.00. Krum hands over the whole model, because it returns one selected update and selects the attacker's. Keeping client_submissions in step with updates_and_weights is required rather than incidental: this is the first attack to rewrite updates at before_aggregate, and FLDetector rejects a round whose records and aggregation inputs have diverged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ttle-is-enough-byzantine-attack
maheenunzeelah
marked this pull request as draft
September 23, 2026 21:42
The merge brought in main's new tests alongside this branch's, so the figure in the install guide was stale. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
FLTest's Byzantine attacks (gaussian, sign_flip) perturb an update without reference to the honest ones, so any perturbation large enough to matter is also an outlier — which is precisely what krum, median and trimmed_mean filter on. The project could therefore never really stress-test the robust aggregators its own pitfall checker recommends: P6 hands users krum as the counter-experiment for non-naive attacks, and nothing in the repo could show that remedy failing.
This adds A Little Is Enough (Baruch, Baruch & Goldberg, NeurIPS 2019), which measures the honest population before perturbing it.
What it does
Per coordinate, every attacker submits the same crafted update:
u' = mu - z * sigma # mu, sigma over the benign submissions
With n participants and m attackers, s = floor(n/2 + 1) - m honest workers are needed to complete a majority. A step z deviations out is covered by the (n - m) * (1 - Phi(z)) honest workers lying further out still, so staying hidden requires Phi(z) <= (n - m - s) / (n - m); the default z is the largest value satisfying that. Set z explicitly to sweep strength.
It runs at before_aggregate, the only hook exposing every submission, and rewrites just the attackers' entries. Attacks attach before defenses, so a robust aggregator in the same config still sees the crafted updates. NVFlare does not emit before_aggregate and cannot run this attack.
It scores itself, because accuracy is the wrong instrument here
An untargeted Byzantine attack has no natural success metric, and at this scale accuracy cannot supply one. The attack records:
little_is_enough_z — the step requested.
little_is_enough_drift — how far the aggregate actually landed from the benign mean, in benign sigmas.
little_is_enough_absorption — drift / z, the share of the requested shift the aggregation rule conceded. 0 = filtered, 1 = taken whole.
The anchor is plain FedAvg, which concedes exactly the attackers' share of total sample weight (m/n for equal shards — verified analytically and in training). Anything above that line is a defense doing worse than no defense.