wikillm

Paper · 2021-10-02 · cs.LG, cs.CY

FairFed: Enabling Group Fairness in Federated Learning

Server-side aggregation rule for federated learning. It reweights client models by how closely each client's local equal-opportunity gap matches the global gap, so fairness can improve without sharing per-group statistics, with any local debiasing method. Author-reported: at alpha=0.1, Adult EOD goes from -0.174 (FedAvg) to -0.017 (FairFed with reweighting), accuracy from 0.835 to 0.830.

Algorithmic fairnessFederated learningFederated aggregationfederated-learninggroup-fairnessaggregationequal-opportunitynon-iid

arXivPDFMarkdown15 min read

AI-compiled by claude-haiku-5-5 on 2026-10-18, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.

In plain words

Several organisations can train one model together without pooling their data. Each one trains locally and sends only model updates to a central server. The catch is that the combined model can be unfair to some group of people, such as one gender or one ethnic group, even when every local model looks fair on its own. A fix that needs the server to see each group's results is often not allowed, because the data is private.

FairFed changes only how the server averages the client models. Each client checks how fair the current global model looks on its own data, and compares that with the fairness of the global model across all data. Clients whose local view is close to the global view get a bit more weight in the next average, and clients whose view is far off get less. The method keeps the group-level details private, and any local fairness method can be used at each client.

TL;DR

  • Server-side fairness-aware aggregation for federated learning, on top of FedAvg §4.1 §4.2.
  • Each round, the server gets the global equal-opportunity gap and the global accuracy through secure aggregation, then nudges each client's aggregation weight toward clients whose local gap is close to the global gap §4.2 eq. 6.
  • The local debiasing method is a free choice per client; the paper uses reweighting, FairRep and FairBatch §5.1.4 §4.2.2.
  • Author-reported gains are largest under strong data heterogeneity (Dirichlet alpha = 0.1); at large alpha, gains over local debiasing are small except with FairBatch §5.2.1 tab. 1.
  • Several percentage claims in the results text do not match the tables (see Pitfalls). Recompute from the tables before quoting.

Problem

Group fairness in centralised training usually needs the sensitive attribute and group-level performance of every datapoint. Federated learning forbids pooling data, so those methods do not directly transfer §1 §2.

A simple option is local debiasing with plain FedAvg aggregation. The paper argues this performs poorly when client data distributions are highly heterogeneous §1 fig. 1. Another option is global debiasing, but it needs clients to reveal per-group information to the server §1 §2.

The paper's setting: K clients, a shared parameter vector, binary labels Y, a binary sensitive attribute A (privileged A=1, unprivileged A=0), and the equal opportunity difference (EOD) and statistical parity difference (SPD) as fairness metrics §3.1 §3.2 eq. 1 eq. 2 eq. 3.

Method

Setup. Clients minimise a weighted sum of local empirical losses, f(theta) = sum_k omega_k L_k(theta), with omega_k >= 0 summing to 1 §3.1 eq. 1. Standard FedAvg sets omega_k to n_k over the sum of all n_k, so weights depend only on dataset size §4.1.

Fairness metrics. EOD is Pr(Yhat=1 | A=0, Y=1) minus Pr(Yhat=1 | A=1, Y=1). SPD is Pr(Yhat=1 | A=0) minus Pr(Yhat=1 | A=1). Values closer to zero mean fairer §3.2 eq. 2 eq. 3.

Global and local metrics. The global EOD F_global uses the full mixed dataset §3.3 eq. 4. The local metric F_k is computed on client k's data only §3.3 eq. 5. If the two distributions match, the metrics agree; with non-IID data they can differ greatly §3.3.

Aggregation (the FairFed rule).

  1. Start from FedAvg weights omega_k^0 = n_k / sum_i n_i alg. 1 §4.2.
  2. Each round, the server obtains F_global^t and the global accuracy Acc-bar^t through secure aggregation (SecAgg) over the clients' local metrics at the previous global model §4.3 alg. 1.
  3. Each client computes a gap Delta_k^t. If its local EOD is defined, Delta_k^t = |F_global^t - F_k^t|. If it is undefined (EOD needs Pr(A=a, Y=1) > 0 for both a), Delta_k^t = |Acc_k^t - Acc-bar^t| §4.2 eq. 6 [fn. 2 in §4.2.1].
  4. The server returns the mean gap, the average of Delta_i over all K clients (not weighted by n_i) alg. 1 §4.2 eq. 6.
  5. Each client updates its unnormalised weight Omega-bar_k^t = Omega-bar_k^(t-1) - beta * (Delta_k^t - mean Delta), then normalises it across clients §4.2 eq. 6.
  6. Each client trains locally and sends its weighted model; the server takes the weighted average and divides by the sum of the unnormalised weights alg. 1.

With beta = 0 the weights never change and FairFed reduces to FedAvg §4.2. Clients whose gap is above the mean lose weight; clients below the mean gain weight §4.2.1.

\Delta_k^t = \begin{cases} \left|Acc_k^t - \overline{Acc^t}\right| & \text{if } F_k^t \text{ is undefined} \\ \left|F_{global}^t - F_k^t\right| & \text{otherwise} \end{cases} \qquad \bar{\omega}_k^t = \bar{\omega}_k^{t-1} - \beta\left(\Delta_k^t - \frac{1}{K}\sum_{i=1}^K \Delta_i^t\right), \qquad \omega_k^t = \frac{\bar{\omega}_k^t}{\sum_{i=1}^K \bar{\omega}_i^t} eq. 6 §4.2

Computing F_global without sharing group data. For EOD, F_global can be written as a sum over clients. Each client k computes a term m_global,k from its own conditional rates and the global group-positive rates Pr(Y=1, A=a) §4.3 eq. 7:

F_{global} = \sum_{k=1}^{K} \frac{n_k}{n} \Big[ \frac{\Pr(\hat{Y}=1 \mid A=0, Y=1, C=k)\,\Pr(A=0, Y=1 \mid C=k)}{\Pr(Y=1, A=0)} - \frac{\Pr(\hat{Y}=1 \mid A=1, Y=1, C=k)\,\Pr(A=1, Y=1 \mid C=k)}{\Pr(Y=1, A=1)} \Big] eq. 7 §4.3

Here n = sum_k n_k §4.3. The four global statistics Pr(Y=1, A=a) are aggregated once at the start with SecAgg and then sent to clients §4.3 alg. 1.

Pseudocode
# Server loop for FairFed, tracking EOD  [alg. 1]
# Input:  theta (initial global model), client sizes n_k, beta, rounds
# Output: final global model

def fairfed_train(theta, clients, sizes, beta, rounds):
    # Initial FedAvg weights omega^0 = n_k / sum(n)  [alg. 1] [§4.2]
    weights = [n / sum(sizes) for n in sizes]              # (K,)
    # Global positive-group rates Pr(Y=1, A=a), once, via SecAgg  [§4.3]
    rates = secagg([c.positive_group_counts() for c in clients])
    for client in clients:
        # Rates are sent to every client  [alg. 1]
        client.receive(rates)
    for t in range(rounds):
        # Global EOD and accuracy at the previous model  [§4.3] [alg. 1]
        global_eod, mean_acc = secagg_metrics(clients, theta)
        # Mean of the per-client gaps Delta_k, unweighted  [§4.2] [eq. 6]
        mean_gap = secagg_mean_gap(clients, theta, global_eod, mean_acc)
        # Each client updates its weight and trains locally  [§4.2] [eq. 6]
        local_models = []
        for k, client in enumerate(clients):
            weights[k], model_k = client_step(
                client, theta, global_eod, mean_acc, mean_gap, beta,
                weights[k],
            )
            local_models.append(model_k)
        # Weighted average, divided by the sum of the weights  [alg. 1]
        theta = weighted_average(local_models, weights)
    return theta
Pseudocode
# Client k: gap, weight update and local training  [§4.2] [eq. 6]
# The stored value is the unnormalised weight; the paper does not say
# how it is initialised beyond omega^0 (see Pitfalls)

def client_step(client, theta, global_eod, mean_acc, mean_gap, beta, w_bar):
    # Local EOD, or None when Pr(A=a, Y=1) = 0 for some a  [§4.2] [fn. 2]
    local_eod = client.local_eod(theta)
    if local_eod is None:
        # Fall back to the accuracy gap  [§4.2] [eq. 6]
        gap = abs(client.accuracy(theta) - mean_acc)
    else:
        # EOD gap to the global metric  [§4.2] [eq. 6]
        gap = abs(global_eod - local_eod)
    # Move against the gap relative to the mean gap  [§4.2] [eq. 6]
    w_bar = w_bar - beta * (gap - mean_gap)
    # Local training is not specified in this paper  [§4]
    model_k = client.local_train(theta)
    return w_bar, model_k
Pseudocode
# Client k: its share of the global EOD  [§4.3] [eq. 7]
# Returns the term the server sums with SecAgg

def global_eod_term(client, theta, n_total, n_k, rates):
    # Conditional true-positive rate per group at this client  [eq. 7]
    # Local true-positive rate per group, Pr(Yhat=1 | A=a, Y=1, C=k)
    # [eq. 7]
    tpr_0 = client.tpr(theta, group=0)
    tpr_1 = client.tpr(theta, group=1)
    # Local share of each positive group, Pr(A=a, Y=1 | C=k)  [eq. 7]
    mass_0 = client.positive_mass(group=0)
    mass_1 = client.positive_mass(group=1)
    # Global positive-group rates from the shared statistics  [eq. 7]
    term_0 = tpr_0 * mass_0 / rates.pos_group[0]     # Pr(Y=1, A=0)
    term_1 = tpr_1 * mass_1 / rates.pos_group[1]     # Pr(Y=1, A=1)
    return (n_k / n_total) * (term_0 - term_1)

SPD variant. The same structure applies. The statistics are Pr(A=0) and Pr(A=1), and each client sends a term built from its conditional rates and the global group sizes app. A. The decomposition is written out in the appendix; see Pitfalls for a likely typo in it.

Uniform-accuracy variant (appendix). A revised gap uses a trade-off parameter eta in [0, 1]: Delta = eta * |F_global - F_k| + (1 - eta) * |Acc_k - Acc-bar| when F_k is defined, and |Acc_k - Acc-bar| otherwise. eta = 1 recovers the main method app. D eq. 6 (the revised equation is unnumbered in the compiled text).

Hyperparameters

NameValueWhereNotes
Fairness budget beta1 (default)§5.1.5 §4.2Other values studied only in fig. 3. beta = 0 equals FedAvg §4.2.
Learning-rate grid, all methods{1e-3, 1e-2, 1e-1}§5.1.5Best EOD (closest to zero) selected per method §5.1.5.
Learning-rate grid, FairBatch-based and FedFB{1e-3, 5e-3, 1e-2, 2e-2}§5.1.5Rate for the weight update of those methods.
Seeds20 random seeds, averaged§5.1.5 tab. 1Standard deviations not reported in the main tables.
Clients K (Adult, COMPAS)5§5.1.3 fig. 3 tab. 5 app. BAlso K=5 in app. C and app. D.
Heterogeneity alpha0.1, 0.2, 0.5, 10, 5000§5.1.3 tab. 1alpha to infinity gives IID splits §5.1.3.
Local model (Adult, COMPAS)Logistic regression§5.1.5Binary classification.
Local model (ACSIncome, TILES)not stated§6.1 §6.2
Local epochs, rounds, batch size, optimizer, clients per roundnot statedn/aNot in the compiled text.
Secure aggregation protocol parametersnot stated§3.1 alg. 1Cited to Bonawitz et al.; no details here.
ComputeAMD EPYC 7502 32-core CPU, MPI, one process per client§5.1.1Built on FedML §5.1.1.
Dirichlet concentration (sensitive attribute split)alpha, per sensitive value§5.1.3Draw p_a ~ Dir(alpha) for each value a of A, give p_(a,k) of the A=a datapoints to client k §5.1.3.
Clients (ACSIncome)51§6.1.1One client per state: 50 states and Puerto Rico §6.1.1.
Clients (TILES)3 occupation groups§6.2.1 tab. 2RN day shift 707, RN night shift 609, CNA 244 records tab. 2.

Results

Author-reported. All numbers are averages over 20 seeds with the grid-searched best EOD per method §5.1.5 tab. 1.

Synthetic heterogeneity, Adult and COMPAS, beta = 1 tab. 1. "Local / [Best]" is the best local baseline per cell; the table does not say which method that is.

MetricMethodAdult alpha=0.10.20.5105000COMPAS 0.10.20.5105000
Acc.FedAvg0.8350.8360.8350.8360.8370.6740.6730.6750.6740.675
Acc.Local / [Best]0.8310.8330.8340.8310.8290.6660.6590.6650.6630.664
Acc.Global RW0.8340.8330.8310.8290.8290.6730.6710.6720.6760.675
Acc.FedFB0.8250.8250.8290.8320.8320.6740.6730.6750.6770.677
Acc.FairFed / RW0.8300.8340.8320.8290.8290.6720.6700.6690.6690.673
Acc.FairFed / FairRep0.8240.8330.8340.8340.8340.6610.6550.6630.6630.660
Acc.FairFed / FairBatch0.8290.8330.8300.8300.8310.6590.6640.6650.6610.661
EODFedAvg-0.174-0.173-0.176-0.179-0.180-0.065-0.071-0.067-0.076-0.078
EODLocal / [Best]0.052-0.009-0.006-0.0130.014-0.055-0.051-0.054-0.038-0.035
EODGlobal RW-0.0300.0190.0220.0170.010-0.060-0.065-0.066-0.076-0.077
EODFedFB-0.0190.0150.015-0.012-0.012-0.062-0.061-0.063-0.077-0.072
EODFairFed / RW-0.0170.0010.0180.0160.013-0.057-0.065-0.053-0.067-0.061
EODFairFed / FairRep0.023-0.009-0.071-0.174-0.1870.0370.0230.0430.0460.039
EODFairFed / FairBatch-0.0200.0010.000-0.005-0.004-0.048-0.048-0.049-0.035-0.031
SPDFedAvg-0.176-0.179-0.178-0.177-0.177-0.137-0.141-0.138-0.142-0.149
SPDLocal / [Best]-0.107-0.128-0.122-0.122-0.108-0.124-0.114-0.121-0.101-0.103
SPDGlobal RW-0.123-0.111-0.106-0.107-0.108-0.131-0.137-0.135-0.140-0.147
SPDFedFB-0.093-0.100-0.103-0.157-0.156-0.133-0.131-0.135-0.147-0.144
SPDFairFed / RW-0.116-0.119-0.111-0.107-0.108-0.129-0.135-0.127-0.132-0.135
SPDFairFed / FairRep-0.123-0.128-0.148-0.181-0.185-0.018-0.025-0.011-0.019-0.019
SPDFairFed / FairBatch-0.116-0.117-0.113-0.117-0.119-0.112-0.114-0.116-0.016-0.026

Key claims from the text §5.2.1: at alpha = 0.1, FairFed is reported to improve EOD on Adult and COMPAS by 93% and 50%, at a cost of about 0.3% accuracy. Local strategies are reported to improve EOD by 65% (Adult) and 15% (COMPAS). Global reweighting by 73% and 2%. FedFB by 87% and 1.5%. The text also says FedFB is the closest competitor on average and that FedFB needs per-group performance from clients, which leaks information. These percentages are not reproducible from tab. 1; see Pitfalls.

Fairness budget §5.2.2 fig. 3. On Adult and COMPAS with alpha = 0.2, 5 clients and local reweighting: a larger beta moves EOD closer to zero and lowers accuracy. The figure gives no numeric values in the text.

ACSIncome and TILES case studies, reweighting only tab. 3:

MethodACSIncome Acc.ACSIncome EODACSIncome SPDTILES Acc.TILES EODTILES SPD
FedAvg0.800-0.062-0.1020.567-0.199-0.166
Local / RW0.800-0.066-0.1060.567-0.064-0.041
FairFed / RW0.799-0.050-0.0890.5560.0040.004

Text claims: ACSIncome EOD improves by about 20% (-0.062 to -0.050) §6.1.2. TILES EOD improves from -0.199 to 0.004 with a 2.6% accuracy drop §6.2.2 (see Pitfalls on the accuracy figure).

Mixed local methods (appendix C) fig. 5 fig. 6. FairFed with reweighting needs about 40% of clients to apply reweighting to beat local reweighting without fairness-aware aggregation. With more than 60% reweighting clients, it beats both local reweighting and global reweighting. The minimum accuracy over these settings is reported as 0.826 (Adult). With reweighting and FairBatch mixed, minimum accuracy is 0.829.

Single-group clients (appendix C) tab. 5 fig. 7. Five Adult clients, with two all-female and three all-male, split by Dirichlet alpha = 0.5 within each sex on the label. Local reweighting is reported to match FedAvg. FairFed improves EOD over FedAvg by 27%, global reweighting by 15%.

Uniform accuracy variant (appendix D) tab. 6:

MetricMethodAdult alpha=0.10.20.5105000COMPAS 0.10.20.5105000
Acc.FedAvg0.8350.8360.8350.8360.8370.6740.6730.6750.6740.675
Acc.Local / RW0.8340.8340.8320.8290.8290.6740.6730.6750.6760.675
Acc.FairFed / RW (eta = 0.2)0.8290.8290.8280.8260.8250.6690.6810.6770.6710.669
Acc.FairFed / RW (eta = 1.0)0.8300.8340.8320.8290.8290.6720.6700.6690.6690.673
EODFedAvg-0.174-0.173-0.176-0.179-0.180-0.065-0.071-0.067-0.076-0.078
EODLocal / RW-0.065-0.0420.0170.0150.014-0.062-0.069-0.067-0.074-0.077
EODFairFed / RW (eta = 0.2)-0.058-0.0050.0200.0210.021-0.085-0.085-0.085-0.088-0.082
EODFairFed / RW (eta = 1.0)-0.0170.0010.0180.0160.013-0.057-0.065-0.053-0.067-0.061
Std-Acc.FedAvg0.0820.0700.0670.0210.0100.0530.0600.0460.0340.000
Std-Acc.Local / RW0.0850.0740.0700.0220.0100.0540.0600.0450.0340.000
Std-Acc.FairFed / RW (eta = 0.2)0.0620.0600.0520.0200.0090.0490.0480.0310.0320.000
Std-Acc.FairFed / RW (eta = 1.0)0.0640.0620.0550.0200.0090.0540.0550.0430.0320.000

The text says lower eta improves accuracy uniformity at the cost of group fairness app. D.1 fig. 8 fig. 9.

Paper vs code

No official code.

Searched, in the order the skill lists: (1) the paper text, bibliography and LaTeX source contain no code or project-page link; the stored arXiv metadata has no link field; (2) the GitHub repository search for "FairFed" returned only repositories by other owners, none by the authors, so I did not use any of them; (3) searches for "FairFed" and "fair" inside the FedML-AI organisation returned zero results; a fairness-aggregation query with an author's name and a user search for an author's name returned zero results.

Pitfalls

  • F_k is printed with identical terms §3.3 eq. 5. Both probabilities read Pr(Yhat=1 | A=g, Y=1, C=k), so the displayed difference is zero. The intended quantity is almost certainly the EOD-style difference between A=0 and A=1 conditioned on C=k. Confirm in the PDF before implementing.
  • SPD decomposition looks mistyped app. A. The first term uses Pr(A=0 | C=k) in the numerator. The second term uses Pr(Y=1 | C=k) where the same pattern would give Pr(A=1 | C=k). Derivation from P(Yhat=1 | A=a) = sum_k P(C=k | A=a) P(Yhat=1 | A=a, C=k) supports the A=1 version. Confirm in the PDF.
  • The weight recursion has undefined details. The paper initialises omega^0 alg. 1 but does not say what omega-bar^0 is, though the update in eq. 6 uses omega-bar^(t-1). Algorithm 1 passes omega_k^t, not omega-bar, into the client step; the final division by the sum of omega-bar gives the same result as normalising. Nothing says whether omega-bar is renormalised each round or clipped to non-negative values. Large beta could make it negative. Pick and document a choice.
  • Mixed gap scales. The two branches of Delta compare an EOD gap with an accuracy gap. The paper does not normalise them, so when some clients fall back to the accuracy branch their gaps are on a different scale. This is a reading of eq. 6, not something the paper discusses.
  • Equation and table numbers were counted from LaTeX source, not from the PDF. Eq. 6 is the second row of an align environment whose first row is unnumbered. Check the numbers before citing them as final.
  • Results text vs table. Several percentages in §5.2.1 and §6.2.2 do not reproduce from tab. 1 or tab. 3. Examples: FairFed/RW on Adult at alpha = 0.1 goes from -0.174 to -0.017, a 90% reduction, not 93%. The best COMPAS FairFed entry at alpha = 0.1 (FairRep, 0.037 from -0.065) is a 43% change, not 50%. For TILES, accuracy goes from 0.567 to 0.556 (0.011 absolute, about 1.9% relative), not 2.6%. The text's 0.3% accuracy loss at alpha = 0.1 is 0.5 points for Adult and 0.2 points for COMPAS with FairFed/RW. Cite the tables, not these numbers.
  • "Local / [Best]" hides which method is best. Per cell, the method is not named. Commented-out per-method rows remain in the LaTeX source near the table (lines 575-577 of the main file) and suggest FairRep for Adult EOD at alpha = 0.1; these rows are not in the compiled paper and are not used here.
  • Selection on the test metric. Learning rates and the reported method per cell are chosen by the best EOD closest to zero, averaged over seeds §5.1.5. The split used for selection is not stated. Expect reported fairness gains to be optimistic, and treat them as upper bounds until re-run with a separate validation split.
  • Privacy claims are informal. The server gets F_global^t, Acc-bar^t and the mean gap in clear each round, and clients receive the group-positive statistics alg. 1. The paper argues SecAgg hides individual terms §4.3 but gives no formal analysis. With few clients, sums over several clients or rounds may reveal more about individuals than intended. This is our reading, not the paper's claim.
  • Undefined local EOD is common. The local EOD is undefined when a client lacks positives in a group [fn. 2]. The fallback to accuracy is the paper's only rule for this; the single-group experiment app. C is the only test of it.
  • Local debiasing methods are not restated. The reweighting, FairRep and FairBatch procedures are cited to their own papers; this card does not give their formulas. Implement them from those sources.
  • Case-study details are thin. The model, metrics and training schedule for ACSIncome and TILES are not stated. For TILES, the label is "stress above the individual's average", so the average and its computation over train and test splits matter and are not described §6.2.1.
  • Citation key. The text cites [anonymous2022improving] for FedFB. The bibliography entry lists Zeng, Chen and Lee with arXiv:2110.15545. Check the rendered author-year in the PDF.
  • Appendix content. The body refers to the uniform-accuracy variant only in the conclusion; its results are in app. D. The source LaTeX contains commented-out tables and text (for example an older hyperparameter table with Adam, weight decay and round counts); none of that is in the compiled paper, so none of it is used here.
  • Small-scale experiments. All synthetic experiments use logistic regression on two tabular datasets with K = 5, and the case studies use 3 and 51 clients. The paper lists generalisation to regression and NLP as future work §7. Do not assume the gains transfer.

Lineage

  • Builds on: FedAvg §3.1 (McMahan et al.), secure aggregation §3.1 (Bonawitz et al.), and FairBatch as a local in-processing baseline §5.1.4 (Roh et al.). None of these have cards on this wiki.
  • Local debiasing baselines: reweighting §5.1.4 (Kamiran and Calders), FairRep §5.1.4 (He et al.), FairBatch §5.1.4 (Roh et al.).
  • Global and federated fairness baselines: global reweighting §5.1.4 (Abay et al., run without differential-privacy noise per the footnote), FedFB §5.1.4 (Zeng et al., arXiv:2110.15545).
  • Related federated fairness work the paper contrasts itself with: §2 (per-group sharing approaches).
  • Superseded by: none known from content on this wiki.

Source and license

Adapted from “FairFed: Enabling Group Fairness in Federated Learning” by Yahya H. Ezzeldin, Shen Yan, Chaoyang He, Emilio Ferrara, Salman Avestimehr (arXiv:2110.00857), used under CC BY 4.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors.