SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2206.11684 · NAACL · 2022

Theory-Grounded Measurement of U.S. Social Stereotypes in English Language Models

Hal Daumé, Yang Cao, Anna Sotnikova, Rachel Rudinger, Linda Zou

arXiv · PDF · Open in the Atlas

Code that ran

5 of 6 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; 4 failures of our instrument; 1 no recorded run), measured 2026-11-21; 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/2206.11684.json · badge: /api/ran/2206.11684.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
tristacao/u.s_stereotypes marked official in Papers with Code
Papers with Code archive
5 ran · 1 no recorded run
FunctionStatusWhere it lives
column_squishing Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tristacao/u.s_stereotypes/code/quick_set.py
code served (permissive licence) · get_code("dfc4c7eafe20231b")
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

# Read the function to understand what it expects:
# - z: a 1D numpy array that is sorted in descending order (except first element)
# - do_proj: a boolean flag

# Create a valid 1D numpy array that satisfies the assertion
# The assertion checks: all([z[i] >= z[i + 1] for i in range(1, n - 1)])
# This means z must be non-increasing (sorted descending)
z = np.array([5.0, 4.0, 3.0, 2.0, 1.0])

ARGS = {
    "z": z,
    "do_proj": True
}
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
equal Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tristacao/u.s_stereotypes/code/quick_set.py
code served (permissive licence) · get_code("b80e00cc4e3d833c")
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 bool, ndim 0, dtype family float, 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 torch
import numpy as np

torch.manual_seed(0)

# The function 'equal' takes two arguments: l1 and l2
# It checks that they have the same length and compares elements pairwise
# The elements must support != comparison

# Create two lists with comparable elements
list1 = [1, 2, 3, 4]
list2 = [1, 2, 3, 4]

ARGS = {
    "l1": list1,
    "l2": list2,
}
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 bool, ndim 0, dtype family float, 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
get_lognorm_score Ran
ran, honoured the contract we drafted
tristacao/u.s_stereotypes/code/quick_set.py
code served (permissive licence) · get_code("c10a7daab0c2714e")
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 float64, ndim 0, 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
from torch import nn

torch.manual_seed(0)

class MockTokenizer:
    def __init__(self):
        self.mask_token_id = 103
        self.vocab_size = 1000
    
    def encode(self, text, return_tensors='pt'):
        # Return tensor with some token ids, including mask tokens
        # Format: [CLS] tokens... [SEP]
        tokens = torch.tensor([[101, 103, 103, 102]])  # [CLS] [MASK] [MASK] [SEP]
        if return_tensors == 'pt':
            return tokens
        return tokens.squeeze().tolist()

class MockBertModel(nn.Module):
    def __init__(self, vocab_size=1000, hidden_size=4):
        super().__init__()
        self.hidden_size = hidden_size
        self.vocab_size = vocab_size
        
        # Mock hidden state transformation
        self.cls = nn.Module()
        self.cls.predictions = nn.Module()
        self.cls.predictions.transform = nn.Linear(hidden_size, hidden_size)
        self.cls.predictions.decoder = nn.Linear(hidden_size, vocab_size)
    
    def forward(self, input_ids, output_hidden_states=True):
        batch_size = input_ids.shape[0]
        seq_len = input_ids.shape[1]
        
        # Mock logits
        logits = torch.randn(batch_size, seq_len, self.vocab_size)
        
        # Mock hidden states (num_layers, batch, seq, hidden)
        hidden_states = [torch.randn(batch_size, seq_len, self.hidden_size) for _ in range(2)]
        
        class Output:
            def __init__(self, logits, hidden_states):
                self.logits = logits
                self.hidden_states = hidden_states
        
        return Output(logits, hidden_states)

class MockRobertaModel(nn.Module):
    def __init__(self, vocab_size=1000, hidden_size=4):
        super().__init__()
        self.hidden_size = hidden_size
        self.vocab_size = vocab_size
        
        # Mock roberta head
        self.lm_head = nn.Module()
        self.lm_head.dense = nn.Linear(hidden_size, hidden_size)
        self.lm_head.layer_norm = nn.LayerNorm(hidden_size)
        self.lm_head.decoder = nn.Linear(hidden_size, vocab_size)
    
    def forward(self, input_ids, output_hidden_states=True):
        batch_size = input_ids.shape[0]
        seq_len = input_ids.shape[1]
        
        # Mock logits
        logits = torch.randn(batch_size, seq_len, self.vocab_size)
        
        # Mock hidden states
        hidden_states = [torch.randn(batch_size, seq_len, self.hidden_size) for _ in range(2)]
        
        class Output:
            def __init__(self, logits, hidden_states):
                self.logits = logits
                self.hidden_states = hidden_states
        
        return Output(logits, hidden_states)

# Create mock instances
tokenizer = MockTokenizer()
bert_model = MockBertModel(vocab_size=1000, hidden_size=4)
roberta_model = MockRobertaModel(vocab_size=1000, hidden_size=4)

ARGS = {
    'mname': 'bert',
    'model': bert_model,
    'tokenizer': tokenizer,
    'sentence': 'The [MASK] [MASK] is good',
    'trait': 'cat dog'
}
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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
min_delta Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tristacao/u.s_stereotypes/code/quick_set.py
code served (permissive licence) · get_code("13df2570a4194949")
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

# Analyze what min_delta expects:
# - C: numpy array that gets indexed with an order array, passed to column_squishing
# - j: an integer that gets compared in (order == j).nonzero()

# column_squishing expects:
# - z: 1D numpy array, sorted in descending order
# - do_proj: boolean (defaults to True, but False is passed in min_delta)

# Create a small valid input for min_delta
# C should be a 1D numpy array (since it's indexed with order and passed to column_squishing)
# j should be a valid index into C

C = np.array([0.9, 0.7, 0.5, 0.3])  # 1D array, descending order
j = 1  # valid index into C

ARGS = {
    "C": C,
    "j": j
}
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
multiclass_update Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tristacao/u.s_stereotypes/code/quick_set.py
code served (permissive licence) · get_code("247d588bb9258777")
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 (3, 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

# Construct valid arguments for multiclass_update
# The function signature is: multiclass_update(A, x, j)
# where:
# - A is a 2D numpy array (k, d) - matrix to update
# - x is a 1D numpy array (d,) - feature vector
# - j is an integer - index for the class

# Create a small (k, d) matrix with k=3, d=4
np.random.seed(0)
A = np.random.randn(3, 4)

# Create a feature vector of length d=4
x = np.random.randn(4)

# Create a class index j in valid range [0, k-1]
j = 1

ARGS = {
    "A": A,
    "x": x,
    "j": j
}
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 2, dtype family float, shape (3, 4) — shape (3, 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
sensitivity Not yet run
unverified (harvested, no recorded run)
tristacao/u.s_stereotypes/code/quick_set.py
code served (permissive licence) · get_code("30e909ed983d4b99")
How it ran

no invocation recorded.

Also present in other papers' code

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

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-21.

Repositories linked to this paper

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

Abstract

NLP models trained on text have been shown to reproduce human stereotypes, which can magnify harms to marginalized groups when systems are deployed at scale. We adapt the Agency-Belief-Communion (ABC) stereotype model of Koch et al. (2016) from social psychology as a framework for the systematic study and discovery of stereotypic group-trait associations in language models (LMs). We introduce the sensitivity test (SeT) for measuring stereotypical associations from language models. To evaluate SeT and other measures using the ABC model, we collect group-trait judgments from U.S.-based subjects to compare with English LM stereotypes. Finally, we extend this framework to measure LM stereotyping of intersectional identities.

For agents

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

get_harvested_code_for_paper("2206.11684")
get_code_for_paper("2206.11684")
have("2206.11684")

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

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

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

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

Connect an agent — have() is free.