SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.08819 · 2024

AIM: Attributing, Interpreting, Mitigating Data Unfairness

arXiv · PDF · Open in the Atlas

Code that ran

8 of 11 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, 0 violated it and 0 have no contract verdict; 7 failures of our instrument; 3 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/2406.08819.json · badge: /api/ran/2406.08819.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
zhiningliu1998/aim canonical (classifier label)
classifier basis: census
8 ran · 3 no recorded run
FunctionStatusWhere it lives
convert_df_to_tensor Ran
ran; our contract draft was wrong, not the code
zhiningliu1998/aim/src/data_infair.py
code served (permissive licence) · get_code("627de91152b2ca18")
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 torch
import pandas as pd

torch.manual_seed(0)

# Create small DataFrames with distinct dimensions
# data_X_df: 2 rows (batch), 4 columns (features)
data_X_df = pd.DataFrame(
    torch.randn(2, 4).numpy(),
    columns=['feat_0', 'feat_1', 'feat_2', 'feat_3']
)

# data_Y_df: 2 rows (batch), 1 column (target)
data_Y_df = pd.DataFrame(
    torch.randint(0, 2, (2, 1)).numpy(),
    columns=['label']
)

ARGS = {
    'data_X_df': data_X_df,
    'data_Y_df': data_Y_df,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas, torch — 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
dict_info Ran
ran; our contract draft was wrong, not the code
zhiningliu1998/aim/src/utils.py
code served (permissive licence) · get_code("11fdc2d246943147")
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 str. 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 torch

torch.manual_seed(0)

# dict_info iterates over d.items() and formats key-value pairs as strings
# It needs a dictionary with various types of values to demonstrate the function

ARGS = {
    'd': {
        'name': 'test_model',
        'version': 1.0,
        'layers': 3,
        'active': True,
        'config': {'learning_rate': 0.001, 'batch_size': 32},
        'tensor': torch.randn(2, 4),
        'list': [1, 2, 3]
    }
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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_filter_mask Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zhiningliu1998/aim/src/unloc.py
code served (permissive licence) · get_code("22b32e9df1477f9d")
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 ndarray, ndim 1, dtype family float, shape (5,) 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 numpy as np

# Construct arguments for get_filter_mask
i = 0  # index parameter
y = np.array([0, 1, 0, 1, 0])  # labels array
s = np.array([1, 1, 2, 2, 1])  # groups array
group_constraint = 'same'  # constraint type
label_constraint = 'same'  # constraint type

ARGS = {
    'i': i,
    'y': y,
    's': s,
    'group_constraint': group_constraint,
    'label_constraint': label_constraint
}
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 ndarray, ndim 1, dtype family float, shape (5,) — shape (5,) 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_input_output_df Ran
ran; our contract draft was wrong, not the code
zhiningliu1998/aim/src/data_infair.py
code served (permissive licence) · get_code("9c37d5786d79f660")
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 pandas as pd
import numpy as np

# Create a small DataFrame with the required structure
data = pd.DataFrame({
    'age': [25, 35, 45, 55],
    'annual-income': [30000, 50000, 70000, 90000],
    'education-years': [12, 16, 18, 20],
    'work-hours': [40, 45, 50, 48]
})

ARGS = {
    'data': data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — 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
get_mixup_idx Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zhiningliu1998/aim/src/unloc.py
code served (permissive licence) · get_code("2697ea014a3b6ac7")
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 int64, ndim 0, dtype family int, 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 numpy as np

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

# Create small test data
batch_size = 5
num_classes = 3
num_groups = 2

# i: index of the sample we're querying
i = 1

# y: label array (class labels for each sample)
y = np.array([0, 1, 2, 0, 1], dtype=int)

# s: group array (group assignment for each sample)
s = np.array([0, 1, 0, 1, 0], dtype=int)

# P: correspondence score matrix (batch_size x batch_size)
# Higher scores indicate higher similarity
P = np.random.rand(batch_size, batch_size)
# Make it somewhat reasonable - diagonal high, others lower
np.fill_diagonal(P, 0.9)

# group_constraint: 'na', 'same', or 'diff'
group_constraint = 'na'

# label_constraint: 'na', 'same', or 'diff'
label_constraint = 'na'

# top_n: number of top candidates to consider
top_n = 3

# random_seed: seed for reproducibility in random choice
random_seed = 123

ARGS = {
    'i': i,
    'P': P,
    'y': y,
    's': s,
    'group_constraint': group_constraint,
    'label_constraint': label_constraint,
    'top_n': top_n,
    'random_seed': random_seed,
}
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 int64, ndim 0, dtype family int, 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
idx_to_mask Ran
ran; our contract draft was wrong, not the code
zhiningliu1998/aim/src/utils.py
code served (permissive licence) · get_code("584b646b31c97aed")
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 ndarray, ndim 1, dtype family float, shape (10,) 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 numpy as np

# Create indices - a small numpy array of integer indices
indices = np.array([0, 2, 4, 7], dtype=np.int64)

# Size of the mask - should be larger than max index
size = 10

ARGS = {
    "indices": indices,
    "size": size,
}
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 ndarray, ndim 1, dtype family float, shape (10,) — shape (10,) 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
mask_to_idx Ran
ran, honoured the contract we drafted
zhiningliu1998/aim/src/utils.py
code served (permissive licence) · get_code("8ec0442dca42253c")
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 ndarray, ndim 1, dtype family int, shape (3,) 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 numpy as np

# mask_to_idx takes a boolean mask and returns indices where mask is True
# We need to create a boolean numpy array

mask = np.array([False, True, False, True, True, False])

ARGS = {
    "mask": mask
}
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 ndarray, ndim 1, dtype family int, shape (3,) — shape (3,) 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
train_val_test_split_dataframe Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zhiningliu1998/aim/src/data.py
code served (permissive licence) · get_code("056e947498c1ab75")
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 pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split

# Create a small DataFrame with a stratify column
np.random.seed(0)
n_samples = 20
df = pd.DataFrame({
    'feature1': np.random.randn(n_samples),
    'feature2': np.random.randn(n_samples),
    'stratify': np.random.choice([0, 1, 2], n_samples)
})

ARGS = {
    'df': df,
    'train_size': 0.6,
    'val_size': 0.2,
    'test_size': 0.2,
    'random_state': 42,
    'stratify': 'stratify'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, sklearn — 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
load_data Not yet run
unverified (harvested, no recorded run)
zhiningliu1998/aim/src/data_infair.py
code served (permissive licence) · get_code("c5a41c92195225bd")
How it ran

no invocation recorded.

mixup_instance Not yet run
unverified (harvested, no recorded run)
zhiningliu1998/aim/src/unloc.py
code served (permissive licence) · get_code("c1308e58057c278e")
How it ran

no invocation recorded.

normalize_graph_adj Not yet run
unverified (harvested, no recorded run)
zhiningliu1998/aim/src/utils_unloc.py
code served (permissive licence) · get_code("25026978ebf7b7cb")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 11 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.

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

Data collected in the real world often encapsulates historical discrimination against disadvantaged groups and individuals. Existing fair machine learning (FairML) research has predominantly focused on mitigating discriminative bias in the model prediction, with far less effort dedicated towards exploring how to trace biases present in the data, despite its importance for the transparency and interpretability of FairML. To fill this gap, we investigate a novel research problem: discovering samples that reflect biases/prejudices from the training data. Grounding on the existing fairness notions, we lay out a sample bias criterion and propose practical algorithms for measuring and countering sample bias. The derived bias score provides intuitive sample-level attribution and explanation of historical bias in data. On this basis, we further design two FairML strategies via sample-bias-informed minimal data editing. They can mitigate both group and individual unfairness at the cost of minimal or zero predictive utility loss. Extensive experiments and analyses on multiple real-world datasets demonstrate the effectiveness of our methods in explaining and mitigating unfairness. Code is available at https://github.com/ZhiningLiu1998/AIM.

For agents

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

get_harvested_code_for_paper("2406.08819")
get_code_for_paper("2406.08819")
have("2406.08819")

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

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

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

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

Connect an agent — have() is free.