SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.09219 · 2023

"Kelly is a Warm Person, Joseph is a Role Model": Gender Biases in LLM-Generated Reference Letters

arXiv · PDF · Open in the Atlas

Code that ran

5 of 7 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; 2 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/2310.09219.json · badge: /api/ran/2310.09219.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
uclanlp/biases-llm-reference-letters canonical (classifier label)
classifier basis: census
5 ran · 2 no recorded run
FunctionStatusWhere it lives
calculate_dict Ran
ran; our contract draft was wrong, not the code
uclanlp/biases-llm-reference-letters/biases_lexical_content.py
code served (permissive licence) · get_code("6347eb74fe6ccde8")
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.

from collections import Counter

# Analyzing the function:
# - female_array: used with Counter(), so needs to be an iterable
# - male_array: used with Counter(), so needs to be an iterable
# Both are passed to Counter() which counts hashable elements
# The function compares keys and adds missing keys with value 0

# Create simple iterables with some overlapping and non-overlapping elements
female_array = [1, 2, 3, 1, 2]  # Counter will be {1: 2, 2: 2, 3: 1}
male_array = [2, 3, 4, 2, 4]    # Counter will be {2: 2, 3: 1, 4: 2}

ARGS = {
    "female_array": female_array,
    "male_array": male_array
}
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 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
data_collator Ran
ran; our contract draft was wrong, not the code
uclanlp/biases-llm-reference-letters/agency_classifier/finetune_bert_bias.py
code served (permissive licence) · get_code("3aca3023253a4a1d")
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 torch

torch.manual_seed(0)

# The data_collator function expects a list of dicts with 'input_ids', 'attention_mask', and 'label' keys
# Each sample should have input_ids and attention_mask as sequences, and label as a scalar

data = [
    {
        'input_ids': [101, 2054, 2003, 102],
        'attention_mask': [1, 1, 1, 1],
        'label': 0
    },
    {
        'input_ids': [101, 1045, 2572, 102],
        'attention_mask': [1, 1, 1, 1],
        'label': 1
    }
]

ARGS = {
    'data': data
}
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 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
generate_response_rec_alpaca Ran
ran; our contract draft was wrong, not the code
uclanlp/biases-llm-reference-letters/generation_util.py
code served (permissive licence) · get_code("91fb03f05a38e2cb")
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 torch
import torch.nn as nn

torch.manual_seed(0)

class MockTokenizer:
    def __init__(self):
        self.eos_token = "[END]"
    
    def encode(self, text):
        # Return a list of token IDs (simple mock)
        return [101, 2054, 2003, 1037, 3231, 1012, 102] + [103] * len(text.split())
    
    def decode(self, token_ids, skip_special_tokens=False, clean_up_tokenization_spaces=False):
        # Simple mock that returns a string representation
        if isinstance(token_ids, torch.Tensor):
            token_ids = token_ids.tolist()
        return "This is a sample recommendation letter for the candidate based on their qualifications."

class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def generate(self, input_ids, max_new_tokens=512, repetition_penalty=1.5, 
                 temperature=0.1, top_p=0.75, num_beams=2):
        # Mock generate: return input_ids extended with dummy tokens
        batch_size = input_ids.shape[0]
        dummy_tokens = torch.randint(100, 200, (batch_size, max_new_tokens), dtype=torch.long)
        output = torch.cat([input_ids, dummy_tokens], dim=1)
        return output

arguments = {
    'occupation': 'Professor',
    'name': 'John Smith',
    'pronoun': 'him',
    'info': 'John has excellent research skills and is a dedicated teacher.'
}

model = MockModel()
tokenizer = MockTokenizer()
device = 'cpu'

ARGS = {
    'arguments': arguments,
    'model': model,
    'tokenizer': tokenizer,
    'device': device
}
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 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
odds_ratio Ran
ran; our contract draft was wrong, not the code
uclanlp/biases-llm-reference-letters/biases_lexical_content.py
code served (permissive licence) · get_code("66fc6b55d97f7cb9")
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
from operator import itemgetter

# Create sample data for f_dict and m_dict
# These are dictionaries mapping categories to counts
f_dict = {
    'category_a': 150,
    'category_b': 200,
    'category_c': 120,
    'category_d': 180,
    'category_e': 95,
    'category_f': 250,
    'category_g': 140,
    'category_h': 175,
}

m_dict = {
    'category_a': 180,
    'category_b': 160,
    'category_c': 200,
    'category_d': 120,
    'category_e': 110,
    'category_f': 220,
    'category_g': 160,
    'category_h': 190,
}

ARGS = {
    'f_dict': f_dict,
    'm_dict': m_dict,
    'topk': 50,
    'threshold': 20,
}
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
predict Ran
ran, honoured the contract we drafted
uclanlp/biases-llm-reference-letters/classifier.py
code served (permissive licence) · get_code("abf1dc7ccaae0104")
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 torch.nn as nn
from collections import Counter

class MockClassifier(nn.Module):
    """Mock classifier that returns label and score for text input"""
    def __init__(self):
        super().__init__()
        self.labels = ['POSITIVE', 'NEGATIVE']
    
    def __call__(self, text):
        # Return a list with a single dict containing label and score
        return [{'label': self.labels[0], 'score': 0.85}]

# Create mock classifier instance
mock_classifier = MockClassifier()

# Define all arguments
ARGS = {
    'text': 'This is a great product. It works well. Amazing quality.',
    'classifier': mock_classifier,
    'task': 'sentiment',
    'output_type': 'csv',
    'is_sentencelevel': True
}
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, 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
compute_metrics Not yet run
unverified (harvested, no recorded run)
uclanlp/biases-llm-reference-letters/agency_classifier/finetune_bert_bias.py
code served (permissive licence) · get_code("1cd818c7ce732b1c")
How it ran

no invocation recorded.

run_inference Not yet run
unverified (harvested, no recorded run)
uclanlp/biases-llm-reference-letters/bert_inference.py
code served (permissive licence) · get_code("530258d882726289")
How it ran

no invocation recorded.

Also present in other papers' code

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

Large Language Models (LLMs) have recently emerged as an effective tool to assist individuals in writing various types of content, including professional documents such as recommendation letters. Though bringing convenience, this application also introduces unprecedented fairness concerns. Model-generated reference letters might be directly used by users in professional scenarios. If underlying biases exist in these model-constructed letters, using them without scrutinization could lead to direct societal harms, such as sabotaging application success rates for female applicants. In light of this pressing issue, it is imminent and necessary to comprehensively study fairness issues and associated harms in this real-world use case. In this paper, we critically examine gender biases in LLM-generated reference letters. Drawing inspiration from social science findings, we design evaluation methods to manifest biases through 2 dimensions: (1) biases in language style and (2) biases in lexical content. We further investigate the extent of bias propagation by analyzing the hallucination bias of models, a term that we define to be bias exacerbation in model-hallucinated contents. Through benchmarking evaluation on 2 popular LLMs- ChatGPT and Alpaca, we reveal significant gender biases in LLM-generated recommendation letters. Our findings not only warn against using LLMs for this application without scrutinization, but also illuminate the importance of thoroughly studying hidden biases and harms in LLM-generated professional documents.

For agents

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

get_harvested_code_for_paper("2310.09219")
get_code_for_paper("2310.09219")
have("2310.09219")

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

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

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

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

Connect an agent — have() is free.