SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2206.15437 · ICML · 2022

Understanding Instance-Level Impact of Fairness Constraints

Yang Liu, Xin Wang, Jialu Wang

arXiv · PDF · Open in the Atlas

Code that ran

8 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; 1 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 6 failures of our instrument; 0 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/2206.15437.json · badge: /api/ran/2206.15437.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
ucsc-real/fairinfl canonical (classifier label)
classifier basis: classifier_2025
8 ran · 0 no recorded run
FunctionStatusWhere it lives
flatten_jacobian Ran
ran, honoured the contract we drafted
ucsc-real/fairinfl/scores.py
code served (permissive licence) · get_code("9c77ed5f1b2a5cb5")
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 ArrayImpl, ndim 2, dtype family float, shape (2, 27) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 jax
import jax.numpy as jnp
from jax import jacrev, vmap
from jax.tree_util import tree_flatten, tree_map

# Create a simple function to compute jacobians from
def simple_fn(x):
    """A simple function that returns a pytree of jacobians"""
    # Returns a dict of arrays (simulating a jacobian pytree structure)
    return {
        'layer1': jnp.array([[1.0, 2.0], [3.0, 4.0]]),
        'layer2': jnp.array([[5.0, 6.0, 7.0], [8.0, 9.0, 10.0]])
    }

# Create a jacobian pytree by calling the function
# The jacobian pytree should be a nested structure of arrays
# where each array has a batch dimension that can be vmapped over
J = {
    'layer1': jnp.ones((2, 4, 3)),  # batch=2, output_dim=4, input_dim=3
    'layer2': jnp.ones((2, 5, 3)),  # batch=2, output_dim=5, input_dim=3
}

ARGS = {
    'J': J
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 2, dtype family float, shape (2, 27) — shape (2, 27) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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_covariance_fn Ran
ran; our contract draft was wrong, not the code
ucsc-real/fairinfl/scores.py
code served (permissive licence) · get_code("57f0c39a946e2741")
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 function. 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 jax
import jax.numpy as jnp
import numpy as np
from jax import jacrev, jit, vmap

def flatten_jacobian(jac):
    """Helper to flatten jacobian for the function"""
    return jnp.reshape(jac, (jac.shape[0], -1))

# Define a simple model function that takes (params, state, x) and returns logits
def simple_fn(params, state, x):
    """
    A simple neural network function.
    Takes params (dict), state (dict), and input x.
    Returns logits of shape matching the batch size.
    """
    # params is a dict with 'w' key
    # x has shape (batch_size, input_dim)
    # Returns shape (batch_size, output_dim)
    w = params['w']
    return jnp.dot(x, w)

# Create small test data
batch_size = 2
input_dim = 4
output_dim = 3
attr_dim = 3

# Initialize parameters as a dict
params = {
    'w': jnp.ones((input_dim, output_dim))
}

# Initialize state as a dict
state = {
    'bn_mean': jnp.zeros(output_dim),
    'bn_var': jnp.ones(output_dim)
}

# Create input tensors
X = jnp.ones((batch_size, input_dim))
Y = jnp.ones((batch_size, output_dim))
Z = jnp.ones((batch_size, attr_dim))

ARGS = {
    'fn': simple_fn,
    'params': params,
    'state': state
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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_covariance_fn Ran
ran; our contract draft was wrong, not the code
ucsc-real/fairinfl/scores.py
code served (permissive licence) · get_code("1a3779fa0f3eac77")
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 function. 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 jax
import jax.numpy as jnp
import numpy as np

# Define a simple function that takes params, state, and x and returns logits
def simple_fn(params, state, x):
    """
    A simple neural network function that takes params, state, x
    and returns logits. The function should work with vmap.
    
    params: pytree of parameters
    state: state dict
    x: input array
    
    Returns logits of shape matching the expected output
    """
    # Simple linear transformation: logits = x @ W + b
    W = params['W']  # shape (4, 3)
    b = params['b']  # shape (3,)
    logits = jnp.dot(x, W) + b
    return logits

# Create params as a pytree (dict of arrays)
params = {
    'W': jnp.array(np.random.randn(4, 3), dtype=jnp.float32),
    'b': jnp.array(np.random.randn(3), dtype=jnp.float32)
}

# Create state dict
state = {
    'batch_norm_mean': jnp.array([0.0, 0.0, 0.0], dtype=jnp.float32),
    'batch_norm_var': jnp.array([1.0, 1.0, 1.0], dtype=jnp.float32)
}

# Create small input tensors
# X: batch of inputs, shape (2, 4) - 2 samples, 4 features
X = jnp.array(np.random.randn(2, 4), dtype=jnp.float32)

# Y: batch of targets, shape (2, 3) - 2 samples, 3 output dims
Y = jnp.array(np.random.randn(2, 3), dtype=jnp.float32)

# Z: batch of attributes, shape (2, 3) - 2 samples, 3 attributes
Z = jnp.array(np.random.randn(2, 3), dtype=jnp.float32)

ARGS = {
    'fn': simple_fn,
    'params': params,
    'state': state
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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_score_fn Ran
ran; our contract draft was wrong, not the code
ucsc-real/fairinfl/scores.py
code served (permissive licence) · get_code("747ee8ffd596f2a7")
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 function. 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 jax
import jax.numpy as jnp
import numpy as np
from jax import jacrev, jit, vmap

# Define hinge_loss function that's used in the code
def hinge_loss(logits, y):
    return jnp.maximum(0, 1 - logits * y)

# Define flatten_jacobian function that's used in the code
def flatten_jacobian(jac):
    batch_size = jac.shape[0]
    return jac.reshape(batch_size, -1)

# Create a minimal model function that takes (params, state, x) and returns logits
def model_fn(params, state, x):
    # Simple linear model: output shape (batch_size, 1) for binary classification
    # x shape: (batch_size, 4)
    # params is a dict with 'w' and 'b'
    logits = jnp.dot(x, params['w']) + params['b']
    return logits

# Create params - a dict with weight matrix and bias
params = {
    'w': jnp.array([0.1, 0.2, 0.3, 0.4]),  # shape (4,) to match input dim
    'b': jnp.array(0.05)  # scalar bias
}

# Create state - can be empty dict or minimal state
state = {}

# Create sample data
X = jnp.array([
    [1.0, 2.0, 3.0, 4.0],
    [2.0, 3.0, 4.0, 5.0]
], dtype=jnp.float32)  # shape (2, 4)

Y = jnp.array([1.0, -1.0])  # shape (2,) - binary labels

Z = jnp.array([0.5, 0.7])  # shape (2,) - attributes for fairness

# Define ARGS dict with all parameters for get_fairness_score_fn
ARGS = {
    'fn': model_fn,
    'params': params,
    'state': state,
    'score_type': 'grad_norm'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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_score_fn Ran
ran; our contract draft was wrong, not the code
ucsc-real/fairinfl/scores.py
code served (permissive licence) · get_code("1b73c1d15c0dec20")
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 function. 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 jax
import jax.numpy as jnp
import numpy as np

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

# Define a minimal model function that takes (params, state, x) and returns logits
def model_fn(params, state, x):
    """
    Minimal model function that takes params, state, and input x.
    Returns logits for each sample.
    """
    # x shape: (batch_size, input_dim)
    # params is a dict with 'w' and 'b'
    # Simple linear model: logits = x @ w + b
    logits = jnp.dot(x, params['w']) + params['b']
    return logits

# Create minimal params dict
params = {
    'w': jnp.array([[0.1, 0.2], [0.3, 0.4], [0.5, 0.6], [0.7, 0.8]]),  # (4, 2)
    'b': jnp.array([0.1, 0.2])  # (2,)
}

# Create minimal state dict
state = {
    'batch_norm_mean': jnp.array([0.0, 0.0]),
    'batch_norm_var': jnp.array([1.0, 1.0])
}

# Create sample data
# X: (batch_size=2, input_dim=4)
X = jnp.array([
    [1.0, 2.0, 3.0, 4.0],
    [5.0, 6.0, 7.0, 8.0]
])

# Y: (batch_size=2, num_classes=2) - binary labels
Y = jnp.array([
    [0, 1],
    [1, 0]
])

# Z: (batch_size=2, num_attributes=3) - attributes for covariance
Z = jnp.array([
    [0.1, 0.2, 0.3],
    [0.4, 0.5, 0.6]
])

# score_type options
score_type = 'covariance'

ARGS = {
    'fn': model_fn,
    'params': params,
    'state': state,
    'score_type': score_type
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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_hinge_loss_grad_norm_fn Ran
ran; our contract draft was wrong, not the code
ucsc-real/fairinfl/scores.py
code served (permissive licence) · get_code("9845cd99b6c24f4a")
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 function. 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 jax
import jax.numpy as jnp
import numpy as np
from jax import jacrev, jit, vmap

# Define hinge_loss function that the code references
def hinge_loss(logits, label):
    return jnp.maximum(0, 1 - label * logits)

# Define flatten_jacobian function that the code references
def flatten_jacobian(jacobian_matrix):
    # Flatten all dimensions except the first (batch dimension)
    batch_size = jacobian_matrix.shape[0]
    return jacobian_matrix.reshape(batch_size, -1)

# Create a simple model function that takes (params, state, x) and returns logits
def simple_model(params, state, x):
    # params: dict with 'w' key
    # state: dict with 'scale' key
    # x: input array
    # Returns logits for each sample
    w = params['w']
    scale = state['scale']
    # Simple linear transformation: (batch, 4) @ (4, 3) -> (batch, 3)
    logits = jnp.dot(x, w) * scale
    return logits

# Create params dict with a weight matrix
params = {
    'w': jnp.array(np.random.randn(4, 3).astype(np.float32))
}

# Create state dict
state = {
    'scale': jnp.array(1.0)
}

# Create model function
fn = simple_model

# Create small sample data
X = jnp.array(np.random.randn(2, 4).astype(np.float32))  # batch=2, features=4
Y = jnp.array(np.array([1.0, -1.0]))  # batch=2, binary labels

ARGS = {
    'fn': fn,
    'params': params,
    'state': state
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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_hinge_loss_grad_norm_fn Ran
ran; our contract draft was wrong, not the code
ucsc-real/fairinfl/scores.py
code served (permissive licence) · get_code("019e8e5917ec430c")
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 function. 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 jax.numpy as jnp
import numpy as np

# Define a simple model function that takes (params, state, x) and returns logits
def simple_model(params, state, x):
    """Simple linear model: output = x @ params"""
    # x shape: (batch_size, input_dim)
    # params shape: (input_dim, output_dim)
    # output shape: (batch_size, output_dim)
    return jnp.dot(x, params)

# Create small test data
batch_size = 2
input_dim = 4
output_dim = 3

# Initialize parameters (input_dim x output_dim)
params = jnp.ones((input_dim, output_dim))

# Initialize state (can be empty dict or None-like)
state = {}

# Create sample input X (batch_size x input_dim)
X = jnp.array([
    [1.0, 2.0, 3.0, 4.0],
    [5.0, 6.0, 7.0, 8.0]
])

# Create sample labels Y (batch_size,) with binary labels
Y = jnp.array([0, 1])

ARGS = {
    "fn": simple_model,
    "params": params,
    "state": state,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
hinge_loss Ran
ran, violated the contract we drafted
ucsc-real/fairinfl/scores.py
code served (permissive licence) · get_code("5c68a51000a1bbee")
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 ArrayImpl, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 jax.numpy as jnp
import numpy as np

# Create small sample data for hinge_loss
# logits: shape (2,) - batch of 2 logit values
# labels: shape (2,) - batch of 2 binary labels (0 or 1)

logits = jnp.array([0.5, -0.3], dtype=jnp.float32)
labels = jnp.array([1, 0], dtype=jnp.int32)

ARGS = {
    "logits": logits,
    "labels": labels,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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

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 5 distinct functions with an identity, 2 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 3 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
flatten_jacobian
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2107.07075 (2021-07)
Deep Learning on a Data Diet: Finding Important Examples Early in Training
hinge_loss
brick of this paper's assembly: helper
1 other paper
1 later
2402.12789 (2024-02)
Fairness Without Harm: An Influence-Guided Active Sampling Approach

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

A variety of fairness constraints have been proposed in the literature to mitigate group-level statistical bias. Their impacts have been largely evaluated for different groups of populations corresponding to a set of sensitive attributes, such as race or gender. Nonetheless, the community has not observed sufficient explorations for how imposing fairness constraints fare at an instance level. Building on the concept of influence function, a measure that characterizes the impact of a training example on the target model and its predictive performance, this work studies the influence of training examples when fairness constraints are imposed. We find out that under certain assumptions, the influence function with respect to fairness constraints can be decomposed into a kernelized combination of training examples. One promising application of the proposed fairness influence function is to identify suspicious training examples that may cause model discrimination by ranking their influence scores. We demonstrate with extensive experiments that training on a subset of weighty data examples leads to lower fairness violations with a trade-off of accuracy.

For agents

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

get_harvested_code_for_paper("2206.15437")
get_code_for_paper("2206.15437")
have("2206.15437")

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

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

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

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

Connect an agent — have() is free.