SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2106.04757 · ICLR · 2021

Responsible Machine Learning (SRML), co-located with ICLR 2022 FAIR MACHINE LEARNING UNDER LIMITED DEMOGRAPHICALLY LABELED DATA

Rishabh Iyer, Mustafa Ozdayi, Murat Kantarcioglu

arXiv · PDF · Open in the Atlas

Code that ran

4 of 5 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 4 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-22; 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/2106.04757.json · badge: /api/ran/2106.04757.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
TinfoilHat0/BiFair canonical (classifier label)
classifier basis: census
4 ran · 1 no recorded run
FunctionStatusWhere it lives
gen_synth_data Ran
ran on a synthesized input
TinfoilHat0/BiFair/src/my_utils.py
code served (permissive licence) · get_code("36e7c1b5c52b2745")
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 DatasetWithMeta. 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
from torch.utils.data import Dataset

torch.manual_seed(0)

class DatasetWithMeta(Dataset):
    def __init__(self, inputs, labels, metas):
        super().__init__()
        self.inputs = inputs
        self.labels = labels
        self.metas = metas

    def __len__(self):
        return self.inputs.shape[0]

    def __getitem__(self, idx):
        return (idx, self.inputs[idx], self.labels[idx].float(), self.metas[idx].float())

def gen_synth_data(ds_size=6000):
    pr_priv_fav = 2 / 3
    pr_unpriv_fav = 1 / 3
    n_priv_fav = int(ds_size // 2 * pr_priv_fav)
    n_unpriv_fav = int(ds_size // 2 * pr_unpriv_fav)
    n_priv_unfav = int(ds_size // 2 * (1 - pr_priv_fav))
    n_unpriv_unfav = int(ds_size // 2 * (1 - pr_unpriv_fav))
    x_priv_fav = torch.cat([torch.normal(mean=1, std=1, size=(n_priv_fav, 1)), torch.ones(n_priv_fav, 1)], dim=1)
    x_unpriv_fav = torch.cat([torch.normal(mean=1, std=1, size=(n_unpriv_fav, 1)), torch.zeros(n_unpriv_fav, 1)], dim=1)
    x_priv_unfav = torch.cat([torch.normal(mean=0, std=1, size=(n_priv_unfav, 1)), torch.ones(n_priv_unfav, 1)], dim=1)
    x_unpriv_unfav = torch.cat([torch.normal(mean=0, std=1, size=(n_unpriv_unfav, 1)), torch.zeros(n_unpriv_unfav, 1)], dim=1)
    synth_inputs = torch.cat((x_priv_fav, x_unpriv_fav, x_priv_unfav, x_unpriv_unfav), dim=0)
    synth_labels = torch.cat((torch.ones(n_priv_fav + n_unpriv_fav), torch.zeros(n_priv_unfav + n_unpriv_unfav)), dim=0)
    synth_metas = torch.cat((torch.ones(n_priv_fav), torch.zeros(n_unpriv_fav), torch.ones(n_priv_unfav), torch.zeros(n_unpriv_unfav)), dim=0)
    return DatasetWithMeta(synth_inputs, synth_labels, synth_metas)

ARGS = {
    "ds_size": 8
}
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 DatasetWithMeta — a DatasetWithMeta 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_data Ran
ran on a synthesized input
TinfoilHat0/BiFair/src/my_utils.py
code served (permissive licence) · get_code("73f1b25b3ab3d0da")
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 os
import tempfile

# Create temporary directory structure with mock data files
temp_dir = tempfile.mkdtemp()
data_name = "test_data"
pytorch_dir = os.path.join(temp_dir, f"{data_name}_pytorch")
os.makedirs(pytorch_dir, exist_ok=True)

# Create small dummy datasets
torch.manual_seed(0)
train_ds = [(torch.randn(2, 4), torch.randint(0, 2, (2,)))]
val_ds = [(torch.randn(2, 4), torch.randint(0, 2, (2,)))]
test_ds = [(torch.randn(2, 4), torch.randint(0, 2, (2,)))]

# Save the datasets
torch.save(train_ds, os.path.join(pytorch_dir, f"{data_name}_train.pt"))
torch.save(val_ds, os.path.join(pytorch_dir, f"{data_name}_val.pt"))
torch.save(test_ds, os.path.join(pytorch_dir, f"{data_name}_test.pt"))

ARGS = {
    'data': data_name,
    'data_dir': temp_dir
}
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 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_kamiran_weights Ran
ran on a synthesized input
TinfoilHat0/BiFair/src/fair_algs.py
code served (permissive licence) · get_code("a971a85e36b3cd8c")
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, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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 numpy as np

torch.manual_seed(0)

class MockDataset:
    def __init__(self, metas, labels):
        self.metas = metas
        self.labels = labels

# Create small tensors for metas and labels
# metas: binary protected attribute (0 or 1)
# labels: binary outcome/label (0 or 1)
metas = torch.tensor([1, 0, 1, 0], dtype=torch.long)
labels = torch.tensor([1, 1, 0, 0], dtype=torch.long)

ds = MockDataset(metas=metas, labels=labels)

ARGS = {
    "ds": ds
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
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_model Ran
ran on a synthesized input
TinfoilHat0/BiFair/src/my_models.py
code served (permissive licence) · get_code("300d66040e8a18d9")
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 LogisticReg. 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 torch.nn as nn
from torchvision import models as pt_models

torch.manual_seed(0)

# Test case 1: celebA path
data_celebA = 'celebA'

# Test case 2: LogisticReg path
data_other = 'mnist'
input_size_value = 128

ARGS = {
    'data': 'mnist',
    'input_size': 128
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type LogisticReg — a LogisticReg output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a LogisticReg 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_dem_data Not yet run
unverified (harvested, no recorded run)
TinfoilHat0/BiFair/src/my_utils.py
code served (permissive licence) · get_code("7930bfc0387cc451")
How it ran

no invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 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 5 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

Research has shown that, machine learning models might inherit and propagate undesired social biases encoded in the data. To address this problem, fair training algorithms are developed. However, most algorithms assume we know demographic/sensitive data features such as gender and race. This assumption falls short in scenarios where collecting demographic information is not feasible due to privacy concerns, and data protection policies. A recent line of work develops fair training methods that can function without any demographic feature on the data, that are collectively referred as Rawlsian methods. Yet, we show in experiments that, Rawlsian methods tend to exhibit relatively high bias. Given this, we look at the middle ground between the previous approaches, and consider a setting where we know the demographic attributes for only a small subset of our data. In such a setting, we design fair training algorithms which exhibit both good utility, and low bias. In particular, we show that our techniques can train models to significantly outperform Rawlsian approaches even when 0.1% of demographic attributes are available in the training data. Furthermore, our main algorithm can accommodate multiple training objectives easily. We expand our main algorithm to achieve robustness to label noise in addition to fairness in the limited demographics setting to highlight that property as well.

For agents

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

get_harvested_code_for_paper("2106.04757")
get_code_for_paper("2106.04757")
have("2106.04757")

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

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

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

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

Connect an agent — have() is free.