SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1607.06520 · 2016

Man is to Computer Programmer as Woman is to Homemaker? Debiasing Word Embeddings

Kai-Wei Chang, James Zou, Adam Kalai, Venkatesh Saligrama, Tolga Bolukbasi

arXiv · PDF · Open in the Atlas

Code that ran

4 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 3 have no contract verdict; 1 failure of our instrument; 4 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/1607.06520.json · badge: /api/ran/1607.06520.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
KylianvG/Embetter community (classifier label)
classifier basis not recorded on the link
4 ran · 4 no recorded run
FunctionStatusWhere it lives
doPCA Ran
ran on a synthesized input
KylianvG/Embetter/embetter/we.py
code served (permissive licence) · get_code("477f989cede89f09")
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 PCA. 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.decomposition import PCA

class WordEmbedding:
    """Stand-in WordEmbedding class that stores word vectors."""
    def __init__(self, vocab_dict):
        self.vocab = vocab_dict
    
    def v(self, word):
        """Return the embedding vector for a word."""
        return self.vocab[word]

# Create a small embedding space with 4-dimensional vectors
embedding_dict = {
    'man': np.array([1.0, 0.0, 0.5, 0.2]),
    'woman': np.array([0.9, 0.1, 0.4, 0.3]),
    'king': np.array([0.8, 0.2, 0.6, 0.1]),
    'queen': np.array([0.7, 0.3, 0.5, 0.2]),
}

embedding = WordEmbedding(embedding_dict)

# Create word pairs for gender space
pairs = [
    ('man', 'woman'),
    ('king', 'queen'),
]

ARGS = {
    'pairs': pairs,
    'embedding': embedding,
    'num_components': 2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PCA — a PCA output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PCA 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
drop Ran
ran on a synthesized input
KylianvG/Embetter/embetter/we.py
code served (permissive licence) · get_code("6572be3776bf9339")
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 (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

# Create small numpy arrays for the drop function
# u: embedding to be debiased (shape: 4,)
# v: bias subspace (shape: 4,)
u = np.array([1.0, 2.0, 3.0, 4.0])
v = np.array([0.5, 0.5, 0.5, 0.5])

ARGS = {
    "u": u,
    "v": v,
}
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 (4,) — shape (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
get_confirm_token Ran
ran; our contract draft was wrong, not the code
KylianvG/Embetter/embetter/download.py
code served (permissive licence) · get_code("0a61606e18188ee3")
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 requests
from unittest.mock import Mock

# Create a mock Response object with cookies attribute
response = Mock(spec=requests.Response)

# Create a cookies dict with a download_warning key
cookies_dict = {
    'download_warning': 'test_token_value',
    'other_cookie': 'other_value'
}

# Set the cookies attribute
response.cookies = cookies_dict

ARGS = {
    'response': response
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
requests — 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_datapoints_embedding Ran
ran on a synthesized input
KylianvG/Embetter/compare_bias.py
code served (permissive licence) · get_code("bbb0284a24424f1a")
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 list, 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 WordEmbedding:
    """Stand-in WordEmbedding object that supports v() method."""
    def __init__(self):
        # Store word vectors in a small embedding space
        self.vectors = {
            'nurse': torch.tensor([0.1, 0.2, 0.3, 0.4]),
            'doctor': torch.tensor([0.5, 0.6, 0.7, 0.8]),
            'engineer': torch.tensor([0.2, 0.4, 0.6, 0.8]),
            'teacher': torch.tensor([0.15, 0.25, 0.35, 0.45]),
        }
    
    def v(self, word):
        """Return the embedding vector for a word."""
        if word in self.vectors:
            return self.vectors[word]
        return torch.tensor([0.0, 0.0, 0.0, 0.0])

# Create embedding instance
E = WordEmbedding()

# Gender axis vector (direction in embedding space)
v_gender = torch.tensor([0.1, 0.0, -0.1, 0.0])

# List of profession words to project
professions = ['nurse', 'doctor', 'engineer', 'teacher']

# Unique occupations that are present in all embeddings being compared
unique_occupations = ['nurse', 'doctor', 'engineer', 'teacher']

ARGS = {
    'E': E,
    'v_gender': v_gender,
    'professions': professions,
    'unique_occupations': unique_occupations,
}
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 list, ndim 1, dtype family float — a list 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
load_definitional_pairs Not yet run
unverified (harvested, no recorded run)
KylianvG/Embetter/embetter/data.py
code served (permissive licence) · get_code("13a9e5c9d94de75a")
How it ran

no invocation recorded.

load_gender_seed Not yet run
unverified (harvested, no recorded run)
KylianvG/Embetter/embetter/data.py
code served (permissive licence) · get_code("23d66cdad7877370")
How it ran

no invocation recorded.

load_professions Not yet run
unverified (harvested, no recorded run)
KylianvG/Embetter/embetter/data.py
code served (permissive licence) · get_code("eed051de44f84947")
How it ran

no invocation recorded.

to_utf8 Not yet run
unverified (harvested, no recorded run)
KylianvG/Embetter/embetter/we.py
code served (permissive licence) · get_code("f18a11867b6e3ff2")
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, 2 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 2 later) and 6 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
get_confirm_token 38 other papers
3 dated earlier, 35 later
1409.8230 (2014-09)
RENOIR - A Dataset for Real Low-Light Image Noise Reduction
1503.03832 (2015-03)
FaceNet: A Unified Embedding for Face Recognition and Clustering
1506.03134 (2015-06)
Pointer Networks
and 35 more not named here
to_utf8 1 other paper
1 later
2006.01938 (2020-06)
Nurse is Closer to Woman than Surgeon? Mitigating Gender-Biased Proximities in Word Embeddings

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

The blind application of machine learning runs the risk of amplifying biases present in data. Such a danger is facing us with word embedding, a popular framework to represent text data as vectors which has been used in many machine learning and natural language processing tasks. We show that even word embeddings trained on Google News articles exhibit female/male gender stereotypes to a disturbing extent. This raises concerns because their widespread use, as we describe, often tends to amplify these biases. Geometrically, gender bias is first shown to be captured by a direction in the word embedding. Second, gender neutral words are shown to be linearly separable from gender definition words in the word embedding. Using these properties, we provide a methodology for modifying an embedding to remove gender stereotypes, such as the association between between the words receptionist and female, while maintaining desired associations such as between the words queen and female. We define metrics to quantify both direct and indirect gender biases in embeddings, and develop algorithms to "debias" the embedding. Using crowd-worker evaluation as well as standard benchmarks, we empirically demonstrate that our algorithms significantly reduce gender bias in embeddings while preserving the its useful properties such as the ability to cluster related concepts and to solve analogy tasks. The resulting embeddings can be used in applications without amplifying gender bias.

For agents

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

get_harvested_code_for_paper("1607.06520")
get_code_for_paper("1607.06520")
have("1607.06520")

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

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

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

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

Connect an agent — have() is free.