SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2606.17506 · 2026

Evaluating Second-Order Bias of LLMs Through Epistemic Entitlement

Zhijing Jin, Terry Zhang, Ramaravind Kommiya Mothilal, Raiyan Ahmed, Shion Guha, Syed Ishtiaque

arXiv · PDF

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; 4 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-24; 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/2606.17506.json · badge: /api/ran/2606.17506.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
uofthcdslab/second-order-bias community
Papers with Code archive
5 ran · 0 no recorded run
FunctionStatusWhere it lives
cleaned_dict_len Ran
ran, honoured the contract we drafted
uofthcdslab/second-order-bias/utils/scoring.py
code served (permissive licence) · get_code("7dfc7046e2a536c9")
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 int, ndim 0, dtype family int, 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 ast
import pandas as pd
import re

UNKNOWN_RE = re.compile('^\\s*unknown\\s*$', re.IGNORECASE)

def is_unknown_value(v):
    """
    True for null, empty string, or Unknown with any casing/spacing.
    Safe for non-scalar values.
    """
    if v is None:
        return True
    if isinstance(v, str):
        return v.strip() == '' or bool(UNKNOWN_RE.match(v))
    if isinstance(v, (list, tuple, set, dict)):
        return len(v) == 0
    try:
        return bool(pd.isna(v))
    except Exception:
        return False

def cleaned_dict_len(x):
    """
    Length of parsed dict after removing keys whose value is 'unknown'
    (case-insensitive). Handles stringified dicts.
    """
    d = ast.literal_eval(x) if isinstance(x, str) else x
    return sum((1 for v in d.values() if not is_unknown_value(v)))

# Test case 1: dict as string
test_dict_str = "{'key1': 'value1', 'key2': 'unknown', 'key3': '', 'key4': None}"

# Test case 2: dict as actual dict
test_dict_obj = {
    'name': 'Alice',
    'age': 30,
    'status': 'unknown',
    'notes': '',
    'tags': []
}

# Test case 3: dict with mixed unknown values
test_dict_mixed = {
    'a': 'valid_value',
    'b': '  UNKNOWN  ',
    'c': None,
    'd': [],
    'e': 'another_valid',
    'f': '   '
}

ARGS = {
    'x': test_dict_str
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, 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
compute_scaled_score Ran
ran, honoured the contract we drafted
uofthcdslab/second-order-bias/utils/scoring.py
code served (permissive licence) · get_code("9ca793d1e5fc57d0")
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) and returned float64, 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 pandas as pd
import ast

# Create a sample DataFrame with the structure expected by compute_scaled_score
# The function expects a 'response' column containing either:
# - stringified dicts (which will be parsed)
# - 'refusal' or 'Unknown' strings

df = pd.DataFrame({
    'response': [
        "{'key1': 'value1', 'key2': 'value2'}",
        "{'key1': 'value1', 'key2': 'unknown'}",
        "{'key1': 'value1'}",
        'refusal',
        'Unknown',
        "{'key1': 'value1', 'key2': 'value2', 'key3': 'value3'}",
        "{'key1': 'value1', 'key2': ''}",
        "{}",
    ]
})

ARGS = {
    'df': df
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
pandas — 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, 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
is_unknown_value Ran
ran, violated the contract we drafted
uofthcdslab/second-order-bias/utils/scoring.py
code served (permissive licence) · get_code("242f04443bfd4bba")
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 pandas as pd
import re
import numpy as np

UNKNOWN_RE = re.compile('^\s*unknown\s*$', re.IGNORECASE)

def is_unknown_value(v):
    """
    True for null, empty string, or Unknown with any casing/spacing.
    Safe for non-scalar values.
    """
    if v is None:
        return True
    if isinstance(v, str):
        return v.strip() == '' or bool(UNKNOWN_RE.match(v))
    if isinstance(v, (list, tuple, set, dict)):
        return len(v) == 0
    try:
        return bool(pd.isna(v))
    except Exception:
        return False


# Test cases covering different input types
test_cases = [
    None,  # None case
    "",  # empty string
    "  ",  # whitespace string
    "unknown",  # unknown
    "UNKNOWN",  # unknown with different casing
    "  UnKnOwN  ",  # unknown with spacing and mixed casing
    "normal_value",  # non-unknown string
    [],  # empty list
    [1, 2, 3],  # non-empty list
    (),  # empty tuple
    (1, 2),  # non-empty tuple
    set(),  # empty set
    {1, 2},  # non-empty set
    {},  # empty dict
    {"a": 1},  # non-empty dict
    np.nan,  # NaN value
    42,  # integer
    3.14,  # float
    pd.NA,  # pandas NA
]

# Create ARGS with a single representative test case
# The function takes only one parameter: v
ARGS = {
    "v": None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — 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
mean_dict_len Ran
ran, honoured the contract we drafted
uofthcdslab/second-order-bias/utils/scoring.py
code served (permissive licence) · get_code("a58ed85b3033a2c9")
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, 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 ast
import pandas as pd
import re

# Set up the functions from the provided code
UNKNOWN_RE = re.compile(r'^\s*unknown\s*$', re.IGNORECASE)

def is_unknown_value(v):
    """
    True for null, empty string, or Unknown with any casing/spacing.
    Safe for non-scalar values.
    """
    if v is None:
        return True
    if isinstance(v, str):
        return v.strip() == '' or bool(UNKNOWN_RE.match(v))
    if isinstance(v, (list, tuple, set, dict)):
        return len(v) == 0
    try:
        return bool(pd.isna(v))
    except Exception:
        return False

def cleaned_dict_len(x):
    """
    Length of parsed dict after removing keys whose value is 'unknown'
    (case-insensitive). Handles stringified dicts.
    """
    d = ast.literal_eval(x) if isinstance(x, str) else x
    return sum((1 for v in d.values() if not is_unknown_value(v)))

def mean_dict_len(series):
    """
    Average cleaned dictionary size.
    """
    if series.empty:
        return 0
    return round(series.apply(cleaned_dict_len).mean(), 3)

# Create test data for the function
# The function expects a pandas Series where each element is either a stringified dict or a dict
test_data = [
    "{'a': 'value1', 'b': 'unknown', 'c': None}",
    {'x': 'value2', 'y': '', 'z': 'data'},
    "{'key1': 'val1', 'key2': 'UNKNOWN'}",
    {'p': 'q', 'r': None},
    "{}",
]

series = pd.Series(test_data)

ARGS = {
    "series": series
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — 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, 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
safe_div Ran
ran, honoured the contract we drafted
uofthcdslab/second-order-bias/utils/scoring.py
code served (permissive licence) · get_code("09dd661bb8e1619e")
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 float, 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)

ARGS = {
    "num": 10,
    "den": 3,
    "digits": 3
}
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 float, 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

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

Repositories linked to this paper

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

Abstract

Warning: Contains biased or toxic texts that may be offensive or upsetting. Evaluations of social bias in LLMs largely focus on whether models generate or imply biased content. However, as LLMs are increasingly used as judges of bias, they may exhibit social biases in subtler ways in how they evaluate biased content, which current methods do not systematically capture. We call this secondorder bias: social bias in an LLM's judgment about social bias, which we evaluate through a novel, philosophically grounded reasoning task. Drawing on entitlement epistemology, we conceptualize bias as misplaced foundational knowledge that shapes an agent's rational inquiry, and derive a logical reasoning task for LLMs to judge to whom a biased text is acceptable or non-acceptable. We develop two simple metrics to measure how biased LLM judges are in inferring demographics for acceptability without sufficient support, and how these inferences vary across groups targeted by biased texts. Evaluating open and closed models, we find that our task evades safety guardrails by surfacing bias in model judgment. It varies systematically across target groups, reflects implicit social maps, and shows how models are still triggered by demographic labels. Our work points to the need for LLM bias evaluation in judgment tasks and broadly, for more theoretically grounded approaches to bias evaluation in NLP. We release our code and model responses at github.com/uofthcdslab/second-order-bias.

For agents

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

get_harvested_code_for_paper("2606.17506")
get_code_for_paper("2606.17506")
have("2606.17506")

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

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

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

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

Connect an agent — have() is free.