SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2102.04130 · NeurIPS · 2021

Bias Out-of-the-Box: An Empirical Analysis of Intersectional Occupational Biases in Popular Generative Language Models

Yuki Asano, Hannah Kirk, Yennie Jun, Haider Iqbal, Elias Benussi, Filippo Volpin, Frederic Dreyer, Aleksandar Shtedritski

arXiv · PDF · Open in the Atlas

Code that ran

5 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 0 have no contract verdict; 5 failures of our instrument; 0 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/2102.04130.json · badge: /api/ran/2102.04130.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
oxai/intersectional_gpt2 canonical (classifier label)
classifier basis: classifier_2025
5 ran · 0 no recorded run
FunctionStatusWhere it lives
clean_category_labels Ran
ran; our contract draft was wrong, not the code
oxai/intersectional_gpt2/scripts/Generate_Freq_Matrices.py
code served (permissive licence) · get_code("53d7375cb7c01f9d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) 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.

ARGS = {
    'i': 'man'
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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 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
clean_genders Ran
ran; our contract draft was wrong, not the code
oxai/intersectional_gpt2/scripts/Generate_Freq_Matrices.py
code served (permissive licence) · get_code("ab680db0dda2f109")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) 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.

ARGS = {
    'i': 'man'
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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 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
make_count_df Ran
ran; our contract draft was wrong, not the code
oxai/intersectional_gpt2/scripts/Generate_Figures.py
code served (permissive licence) · get_code("9bef46089976434d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) 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 sample freq_matrix DataFrame
# The function expects columns: 'name', 'category', 'gender', and various job columns
np.random.seed(0)

# Create sample data
categories = ['buddhist', 'christian', 'hindu', 'muslim', 'jewish', 'asian', 'black', 'hispanic', 'white']
genders = ['M', 'F']
names = ['Alice', 'Bob', 'Charlie', 'Diana', 'Eve', 'Frank', 'Grace', 'Henry', 'Iris']

data = []
for i, (cat, name) in enumerate(zip(categories, names)):
    gender = genders[i % 2]
    row = {
        'name': name,
        'category': cat,
        'gender': gender,
        'doctor': np.random.randint(0, 100),
        'teacher': np.random.randint(0, 100),
        'engineer': np.random.randint(0, 100),
        'nurse': np.random.randint(0, 100),
        'lawyer': np.random.randint(0, 100)
    }
    data.append(row)

freq_matrix = pd.DataFrame(data)

gender = 'M'
intersection = 'religion'
CUM_THRESHOLD = 0.5

ARGS = {
    'freq_matrix': freq_matrix,
    'gender': gender,
    'intersection': intersection,
    'CUM_THRESHOLD': CUM_THRESHOLD
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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
threshold_check Ran
ran; our contract draft was wrong, not the code
oxai/intersectional_gpt2/scripts/Generate_Figures.py
code served (permissive licence) · get_code("fa7b5381f71a6c38")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) 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 sample frequency matrix (DataFrame) with the expected structure
# The function expects columns: 'category', 'gender', and various token columns

data = {
    'category': ['christian', 'christian', 'buddhist', 'buddhist', 'hindu', 'hindu', 
                 'jewish', 'jewish', 'muslim', 'muslim'],
    'gender': ['male', 'female', 'male', 'female', 'male', 'female',
               'male', 'female', 'male', 'female'],
    'token1': [10, 15, 8, 12, 20, 25, 5, 7, 18, 22],
    'token2': [3, 4, 2, 3, 5, 6, 1, 2, 4, 5],
    'token3': [50, 60, 45, 55, 70, 80, 30, 40, 65, 75],
    'token4': [1, 1, 0, 1, 2, 2, 0, 0, 1, 2]
}

freq_matrix = pd.DataFrame(data)

# Set intersection to one of the valid options
intersection = 'religion'

# Set a threshold value
THRESHOLD = 50

ARGS = {
    'freq_matrix': freq_matrix,
    'intersection': intersection,
    'THRESHOLD': THRESHOLD
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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
threshold_tables Ran
ran; our contract draft was wrong, not the code
oxai/intersectional_gpt2/scripts/Logistic_Regression.py
code served (permissive licence) · get_code("a7ea4a39b7bdec9e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) 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 pandas as pd
import numpy as np

# Create freq_matrix_idents with required structure
# Must have columns: 'category', 'gender', and various token columns
categories_idents = ['base'] * 4 + ['asian', 'black', 'hispanic', 'white'] * 2 + \
                    ['christian', 'buddhist', 'hindu', 'jewish', 'muslim'] * 2 + \
                    ['gay', 'straight'] * 2 + ['conservative', 'liberal'] * 2

genders_idents = ['male', 'female'] * 15

# Create some token columns with frequency data
np.random.seed(42)
n_rows_idents = len(categories_idents)
token_data_idents = {
    'token1': np.random.randint(0, 100, n_rows_idents),
    'token2': np.random.randint(0, 100, n_rows_idents),
    'token3': np.random.randint(0, 100, n_rows_idents),
    'token4': np.random.randint(0, 100, n_rows_idents),
    'token5': np.random.randint(0, 100, n_rows_idents),
}

freq_matrix_idents = pd.DataFrame({
    'category': categories_idents,
    'gender': genders_idents,
    **token_data_idents
})

# Create freq_matrix_names with required structure (for continent intersection)
# This one doesn't need 'category' column based on how it's used
n_rows_names = 20
token_data_names = {
    'token1': np.random.randint(0, 100, n_rows_names),
    'token2': np.random.randint(0, 100, n_rows_names),
    'token3': np.random.randint(0, 100, n_rows_names),
    'token4': np.random.randint(0, 100, n_rows_names),
}

# For continent, it needs category and gender columns too
categories_names = ['africa', 'asia', 'europe', 'north_america', 'south_america'] * 4
genders_names = ['male', 'female'] * 10

freq_matrix_names = pd.DataFrame({
    'category': categories_names,
    'gender': genders_names,
    **token_data_names
})

ARGS = {
    'freq_matrix_idents': freq_matrix_idents,
    'freq_matrix_names': freq_matrix_names
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
numpy, pandas — 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

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

The capabilities of natural language models trained on large-scale data have increased immensely over the past few years. Open source libraries such as Hugging-Face have made these models easily available and accessible. While prior research has identified biases in large language models, this paper considers biases contained in the most popular versions of these models when applied 'out-of-the-box' for downstream tasks. We focus on generative language models as they are well-suited for extracting biases inherited from training data. Specifically, we conduct an indepth analysis of GPT-2, which is the most downloaded text generation model on HuggingFace, with over half a million downloads per month. We assess biases related to occupational associations for different protected categories by intersecting gender with religion, sexuality, ethnicity, political affiliation, and continental name origin. Using a template-based data collection pipeline, we collect 396K sentence completions made by GPT-2 and find: (i) The machine-predicted jobs are less diverse and more stereotypical for women than for men, especially for intersections; (ii) Intersectional interactions are highly relevant for occupational associations, which we quantify by fitting 262 logistic models; (iii) For most occupations, GPT-2 reflects the skewed gender and ethnicity distribution found in US Labor Bureau data, and even pulls the societally-skewed distribution towards gender parity in cases where its predictions deviate from real labor market observations. This raises the normative question of what language models should learn -whether they should reflect or correct for existing inequalities.

For agents

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

get_harvested_code_for_paper("2102.04130")
get_code_for_paper("2102.04130")
have("2102.04130")

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

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

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

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

Connect an agent — have() is free.