SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.18913 · ICLR · 2024

Debiasing Algorithm through Model Adaptation

Tomasz Limisiewicz, David Mareček, Tomáš Musil

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; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 2 no recorded run), measured 2026-11-23; 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/2310.18913.json · badge: /api/ran/2310.18913.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
tomlimi/dama canonical (classifier label)
classifier basis: census
6 ran · 2 no recorded run
FunctionStatusWhere it lives
apply_dama_on_module Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tomlimi/dama/src/dama/dama_main.py
code served (permissive licence) · get_code("ca75bd01669c06b9")
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 SmallMLP. 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

torch.manual_seed(0)

# Create a small MLP module
class SmallMLP(nn.Module):
    def __init__(self):
        super().__init__()
        self.weight = nn.Parameter(torch.randn(4, 3))
    
    def forward(self, x):
        return x @ self.weight.t()

old_mlp = SmallMLP()

# Create projection matrix P
# For 'before' case: weight is (4, 3), so P should be (3, 3)
# For 'after' case: weight is (4, 3), so P should be (4, 4)
# We'll use a case that works for 'before': P is (3, 3)
P = torch.randn(3, 3)

# Create dummy mu_in and mu_out (not used in function body)
mu_in = torch.randn(3)
mu_out = torch.randn(4)

# projection_location can be 'before' or 'after'
projection_location = 'before'

ARGS = {
    'old_mlp': old_mlp,
    'P': P,
    'mu_in': mu_in,
    'mu_out': mu_out,
    'projection_location': projection_location
}
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 SmallMLP — a SmallMLP output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SmallMLP 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
custom_orth Ran
ran, honoured the contract we drafted
tomlimi/dama/src/dama/dama_main.py
code served (permissive licence) · get_code("97322bae37e502a9")
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 2, dtype family float, shape (4, 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
import scipy

# Create a small test matrix for the custom_orth function
# Using a rectangular matrix (4 rows x 3 columns) to test SVD
A = np.random.randn(4, 3)

ARGS = {
    "A": A
}
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 ndarray, ndim 2, dtype family float, shape (4, 3) — shape (4, 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
descriptive_stat Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tomlimi/dama/src/dama/compute_v_dama.py
code served (permissive licence) · get_code("f93fa86a3459036c")
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 numpy as np

# The function takes 'data' which is used with:
# - min(data)
# - np.mean(data)
# - np.std(data)
# - max(data)
# This indicates data should be a list or array-like of numeric values

ARGS = {
    'data': [1.5, 2.3, 3.1, 4.7, 5.2, 6.8, 7.1, 8.9]
}
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 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_colspace_projection Ran
ran, honoured the contract we drafted
tomlimi/dama/src/dama/dama_main.py
code served (permissive licence) · get_code("743ff0cea42bae4f")
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 2, dtype family float, shape (4, 4) 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
import scipy.linalg

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

# Create a small non-zero matrix for testing
# Using distinct dimensions (4x3) so shapes can be probed
W = np.random.randn(4, 3).astype(np.float64)

ARGS = {
    "W": W
}
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 ndarray, ndim 2, dtype family float, shape (4, 4) — shape (4, 4) 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
load_profession_data Ran
ran; our contract draft was wrong, not the code
tomlimi/dama/src/generate_adapt_data.py
code served (permissive licence) · get_code("40ddbc722bbc936f")
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 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 json
import os
import tempfile
import shutil

# Create a temporary directory to hold the professions.json file
temp_dir = tempfile.mkdtemp()

# Create sample profession data
profession_data = [
    ["doctor", "treats patients", "wealthy and intelligent"],
    ["nurse", "provides care", "caring and nurturing"],
    ["engineer", "builds structures", "logical and precise"],
    ["teacher", "educates students", "patient and knowledgeable"]
]

# Write the professions.json file to the temp directory
prof_data_path = os.path.join(temp_dir, 'professions.json')
with open(prof_data_path, 'w') as f:
    json.dump(profession_data, f)

# Define the ARGS dictionary
ARGS = {
    'profession_path': temp_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
load_vs Ran
ran; our contract draft was wrong, not the code
tomlimi/dama/src/dama_l/dama_l_main.py
code served (permissive licence) · get_code("def150b9e2ed43fb")
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 dict. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 os
import torch
import numpy as np
import tempfile
import shutil

torch.manual_seed(0)

# Create a temporary directory to simulate the file structure
temp_dir = tempfile.mkdtemp()

# Create a mock vs.npy file
vs_data = {
    'g_val_1': {'vs': np.random.randn(2, 4).astype(np.float32)},
    'g_val_2': {'vs': np.random.randn(2, 4).astype(np.float32)},
}
vs_file_path = os.path.join(temp_dir, 'vs.npy')
np.save(vs_file_path, vs_data)

# Create a projections file path in the same directory
projections_loadfrom = os.path.join(temp_dir, 'projections.npy')

ARGS = {
    'projections_loadfrom': projections_loadfrom,
    'device': 'cpu',
}
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 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
get_profession_data Not yet run
unverified (harvested, no recorded run)
tomlimi/dama/src/generate_adapt_data.py
code served (permissive licence) · get_code("ea1db304f9f2f6d0")
How it ran

no invocation recorded.

get_pronoun_probabilities Not yet run
unverified (harvested, no recorded run)
tomlimi/dama/src/noise.py
code served (permissive licence) · get_code("e6ac65b7ebcdd4e2")
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, 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 8 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-23.

Repositories linked to this paper

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

Abstract

Large language models are becoming the go-to solution for the ever-growing number of tasks. However, with growing capacity, models are prone to rely on spurious correlations stemming from biases and stereotypes present in the training data. This work proposes a novel method for detecting and mitigating gender bias in language models. We perform causal analysis to identify problematic model components and discover that mid-upper feed-forward layers are most prone to convey bias. Based on the analysis results, we intervene in the model by applying a linear projection to the weight matrices of these layers. Our titular method DAMA significantly decreases bias as measured by diverse metrics while maintaining the model's performance on downstream tasks. We release code for our method and models, which retrain LLaMA's state-of-the-art performance while being significantly less biased. 1

For agents

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

get_harvested_code_for_paper("2310.18913")
get_code_for_paper("2310.18913")
have("2310.18913")

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

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

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

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

Connect an agent — have() is free.