SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2004.03424 · ICML · 2020

FACT: A Diagnostic for Group Fairness Trade-offs

Joon Kim, Jiahao Chen, Ameet Talwalkar

arXiv · PDF · Open in the Atlas

Code that ran

6 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 6 failures of our instrument; 2 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2004.03424.json · badge: /api/ran/2004.03424.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
wnstlr/fact canonical (classifier label)
classifier basis: classifier_2025
1 ran · 1 no recorded run
wnstlr/FACT marked official in Papers with Code
Papers with Code archive
5 ran · 1 no recorded run
FunctionStatusWhere it lives
compute_stats Ran
ran; our contract draft was wrong, not the code
wnstlr/fact/FACT/fairness.py
code served (permissive licence) · get_code("86a3413b79c196ba")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from sklearn.base import BaseEstimator, ClassifierMixin

class SimpleModel(BaseEstimator, ClassifierMixin):
    """Minimal model that implements predict method"""
    def predict(self, X):
        # Simple deterministic predictions based on first feature
        return (X[:, 0] > 0).astype(int)

# Create small sample data
np.random.seed(0)
X = np.random.randn(10, 4)  # 10 samples, 4 features
y = np.array([0, 1, 0, 1, 0, 1, 0, 1, 0, 1])  # Binary labels

# Create model instance
model = SimpleModel()

ARGS = {
    'X': X,
    'y': y,
    'model': model
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, scipy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
eps_opt Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
wnstlr/FACT/FACT/lin_opt.py
code served (permissive licence) · get_code("088e34561105e9a3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned OptimizeResult. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from scipy import optimize

# Construct valid arguments for eps_opt function
np.random.seed(0)

# A: matrix used in constraint and objective calculations
# Shape: (m, d) where m is number of constraints, d is dimensionality
A = np.array([
    [0.5, 0.2, 0.3, 0.1],
    [0.1, 0.4, 0.2, 0.3]
], dtype=np.float64)

# c: coefficient vector for objective function
# Shape: (d,) matching A.shape[1]
c = np.array([1.0, 2.0, 3.0, 0.5], dtype=np.float64)

# A_const: matrix for equality constraints
# Shape: (n_eq, d) where n_eq is number of equality constraints
A_const = np.array([
    [1.0, 1.0, 1.0, 1.0]
], dtype=np.float64)

# b_const: right-hand side of equality constraints
# Shape: (n_eq,) or (n_eq, 1)
b_const = np.array([1.0], dtype=np.float64)

# Other parameters
eps = 0.01
seed = 0
method = 'SLSQP'
epsdelta = True

ARGS = {
    'A': A,
    'c': c,
    'A_const': A_const,
    'b_const': b_const,
    'eps': eps,
    'seed': seed,
    'method': method,
    'epsdelta': epsdelta
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type OptimizeResult — a OptimizeResult output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OptimizeResult output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_fairness_mats Ran
ran; our contract draft was wrong, not the code
wnstlr/FACT/FACT/lin_opt.py
code served (permissive licence) · get_code("df76b86dee554f60")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

class FairnessMeasure:
    """Stand-in class for FairnessMeasure object"""
    def __init__(self):
        # pos_group: indices/labels for positive group
        self.pos_group = np.array([0, 1, 2, 3, 4])
        
        # neg_group: indices/labels for negative group
        self.neg_group = np.array([5, 6, 7, 8, 9])
        
        # pos_gt: positive ground truth labels
        self.pos_gt = np.array([0, 1, 5, 6, 10])
        
        # FOR: False Omission Rate
        self.FOR = 0.15
        
        # PPV: Positive Predictive Value
        self.PPV = 0.85

fm = FairnessMeasure()

ARGS = {
    "fm": fm,
    "verbose": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
opt_fairness_const_perf Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
wnstlr/FACT/FACT/lin_opt.py
code served (permissive licence) · get_code("80b808c8eacf1735")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned OptimizeResult. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from scipy import optimize

# Set random seed for reproducibility
np.random.seed(0)

# Define small matrices and vectors for the optimization problem
# A is used in obj_f: np.dot(A, x) where x has shape (d,)
# So A should be shape (m, d) where m is number of constraints/objectives
# Let's use m=3, d=4
m = 3
d = 4

A = np.random.randn(m, d).astype(np.float64)
b = np.random.randn(m, 1).astype(np.float64)

# c is used in ineq_con: np.sum(c * x)
# c should have shape (d,) to match x
c = np.random.randn(d).astype(np.float64)

# A_const and b_const are used in eq_con: np.dot(A_const, x) - np.squeeze(b_const)
# A_const should be shape (n_eq, d) where n_eq is number of equality constraints
# Let's use n_eq=2
n_eq = 2
A_const = np.random.randn(n_eq, d).astype(np.float64)
b_const = np.random.randn(n_eq, 1).astype(np.float64)

# err_ub is a scalar threshold for the inequality constraint
err_ub = 0.1

ARGS = {
    'A': A,
    'b': b,
    'c': c,
    'A_const': A_const,
    'b_const': b_const,
    'err_ub': err_ub,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type OptimizeResult — a OptimizeResult output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OptimizeResult output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
solve_LAFOP Ran
ran; our contract draft was wrong, not the code
wnstlr/FACT/FACT/lin_opt.py
code served (permissive licence) · get_code("3fc04c307fe98d96")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned OptimizeResult. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Set seed for reproducibility
np.random.seed(0)

# Parameters for solve_LAFOP
# A: matrix used in phi(x) = A @ x
# Must have shape (m, d) where m is output dim, d is input dim
A = np.random.randn(3, 8)  # 3 outputs, 8 inputs (divisible by 4)

# A_const: constraint matrix for equality constraint A_const @ x = b_const
# Shape (n_constraints, d)
A_const = np.array([[1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0]])  # 1 constraint

# b_const: right-hand side of equality constraint
b_const = np.array([[0.5]])  # Must be broadcastable/squeezable

# lmbd: regularization parameter (can be scalar or array)
lmbd = 0.02

# seed: random seed for initialization
seed = 0

ARGS = {
    'A': A,
    'A_const': A_const,
    'b_const': b_const,
    'lmbd': lmbd,
    'seed': seed
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type OptimizeResult — a OptimizeResult output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OptimizeResult output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
solve_PFOP Ran
ran; our contract draft was wrong, not the code
wnstlr/FACT/FACT/lin_opt.py
code served (permissive licence) · get_code("b074bde51cf49aca")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned OptimizeResult. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from scipy import optimize

# Define callable f: takes vector x of size d, returns scalar or array
def f_func(x):
    # f should map R^d -> R^p where p can be any dimension
    # Here we'll make it map to a scalar
    return np.sum(x**2)

# Define callable phi: takes vector x of size d, returns array
def phi_func(x):
    # phi should map R^d -> R^m where m is the number of phi outputs
    # Here we'll make it return a 3-element array
    return np.array([np.sum(x), np.prod(x), np.mean(x)])

# Define loss_f: takes output of f, returns scalar loss
def loss_f(f_out):
    # f_out is a scalar
    return f_out + 0.1

# Define loss_phi: takes output of phi, returns scalar loss
def loss_phi(phi_out):
    # phi_out is an array of shape (3,)
    return np.sum(phi_out**2)

# A_const: constraint matrix of shape (num_constraints, d)
# We'll use d=4 (dimension of x), and 2 constraints
d = 4
num_constraints = 2
A_const = np.random.randn(num_constraints, d)

# b_const: constraint RHS of shape (num_constraints,) or (num_constraints, 1)
b_const = np.random.randn(num_constraints, 1)

# lmbd: either scalar or array matching the output dimension of loss_phi
# Since loss_phi returns a scalar, lmbd can be scalar or 1D array
lmbd = np.array([0.02])

# seed
seed = 0

ARGS = {
    'f': f_func,
    'phi': phi_func,
    'loss_f': loss_f,
    'loss_phi': loss_phi,
    'A_const': A_const,
    'b_const': b_const,
    'lmbd': lmbd,
    'seed': seed,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type OptimizeResult — a OptimizeResult output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OptimizeResult output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
compute_base_rates Not yet run
unverified (harvested, no recorded run)
wnstlr/fact/FACT/fairness.py
code served (permissive licence) · get_code("75c17422b5e1aea4")
How it ran

no invocation recorded. this sample carries JSON test cases instead of a setup block; get_reference_implementation serves them with the level they back.

test_fair_instance Not yet run
unverified (harvested, no recorded run)
wnstlr/FACT/FACT/lin_opt.py
code served (permissive licence) · get_code("25accd8e7f50eaac")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 7 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
solve_PFOP
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2307.11333 (2023-07)
DEMYSTIFYING LOCAL & GLOBAL FAIRNESS TRADE-OFFS IN FEDERATED LEARNING USING PARTIAL INFORMATION DECOMPOSITION

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Group fairness, a class of fairness notions that measure how different groups of individuals are treated differently according to their protected attributes, has been shown to conflict with one another, often with a necessary cost in loss of model's predictive performance. We propose a general diagnostic that enables systematic characterization of these trade-offs in group fairness. We observe that the majority of group fairness notions can be expressed via the fairness-confusion tensor, which is the confusion matrix split according to the protected attribute values. We frame several optimization problems that directly optimize both accuracy and fairness objectives over the elements of this tensor, which yield a general perspective for understanding multiple trade-offs including group fairness incompatibilities. It also suggests an alternate post-processing method for designing fair classifiers. On synthetic and real datasets, we demonstrate the use cases of our diagnostic, particularly on understanding the trade-off landscape between accuracy and fairness.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2004.03424")
get_code_for_paper("2004.03424")
have("2004.03424")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2004.03424.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2004.03424.svg)](https://syntology.ai/paper/2004.03424)

Connect an agent — have() is free.