SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2103.11790 · 2021

Large Pre-trained Language Models Contain Human-like Biases of What is Right and Wrong to Do

arXiv · PDF · Open in the Atlas

Code that ran

6 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; 0 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 0 failures of our instrument; 0 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/2103.11790.json · badge: /api/ran/2103.11790.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
ml-research/MoRT_NMI canonical (classifier label)
classifier basis: census
6 ran · 0 no recorded run
FunctionStatusWhere it lives
best_and_worst_question Ran
ran on a synthesized input
ml-research/MoRT_NMI/MoRT/mort/funcs_mcm.py
code served (permissive licence) · get_code("7c98160760473f83")
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 3, 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)

# Analyzing the function:
# - biases: list of tuples where each tuple is (float/numeric, something)
# - overall_bias: a numeric value (float or tensor)
# - The function computes absolute differences and sorts them
# - Returns nested structure with tuples

# Construct biases as list of tuples: (bias_value, identifier)
biases = [
    (0.5, "question_1"),
    (0.3, "question_2"),
    (0.8, "question_3"),
    (0.2, "question_4"),
]

overall_bias = 0.4

ARGS = {
    "biases": biases,
    "overall_bias": overall_bias,
}
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 3, 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
calc_banned_ngram_tokens Ran
ran on a synthesized input
ml-research/MoRT_NMI/MoRT/mcm_textgeneration/mcm_models.py
code served (permissive licence) · get_code("bf60ebe2c2b77444")
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 2, dtype family int; 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

torch.manual_seed(0)

# prev_input_ids: tensor of shape (num_hypos, sequence_length)
# The function calls .tolist() on rows and slices with indexing
num_hypos = 2
seq_length = 6
prev_input_ids = torch.tensor([
    [10, 20, 30, 40, 50, 60],
    [15, 25, 35, 45, 55, 65]
], dtype=torch.long)

# num_hypos: number of hypotheses
num_hypos = 2

# no_repeat_ngram_size: size of n-grams to track
no_repeat_ngram_size = 3

# cur_len: current sequence length
cur_len = 5

ARGS = {
    "prev_input_ids": prev_input_ids,
    "num_hypos": num_hypos,
    "no_repeat_ngram_size": no_repeat_ngram_size,
    "cur_len": cur_len,
}
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 list, ndim 2, dtype family int — 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
chunks Ran
ran on a synthesized input
ml-research/MoRT_NMI/MoRT/mort/funcs_mcm.py
code served (permissive licence) · get_code("53df4c9a654254cf")
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 2, dtype family int; 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

ARGS = {
    "l": [1, 2, 3, 4, 5, 6, 7, 8, 9],
    "n": 3
}
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 list, ndim 2, dtype family int — 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
get_actions_temporal Ran
ran on a synthesized input
ml-research/MoRT_NMI/MoRT/mort/dataMoral.py
code served (permissive licence) · get_code("a76d890b6f0424e9")
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 tempfile
import os

# Create temporary directory and mock verb files
temp_dir = tempfile.mkdtemp()
os.chdir(temp_dir)

# Create the directory structure
os.makedirs('retrain_use/skip_thoughts', exist_ok=True)

# Create mock verb list files for 'rcv1' and 'trc2'
with open('retrain_use/skip_thoughts/verbList_rcv1.txt', 'w') as f:
    f.write("jump\n")
    f.write("run\n")
    f.write("skip\n")

with open('retrain_use/skip_thoughts/verbList_trc2.txt', 'w') as f:
    f.write("sprint\n")
    f.write("walk\n")
    f.write("crawl\n")

# Define the ARGS dictionary
ARGS = {
    'tempName': 'rcv1'
}
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 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
top_k_top_p_filtering Ran
ran on a synthesized input
ml-research/MoRT_NMI/MoRT/mcm_textgeneration/mcm_models.py
code served (permissive licence) · get_code("0b42b3fc90731551")
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 Tensor, ndim 2, dtype family float, shape (2, 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 torch
from torch import Tensor
import torch.nn as nn
from torch.nn import functional as F

torch.manual_seed(0)

# Create a mock tokenizer with batch_decode method
class MockTokenizer:
    def batch_decode(self, token_ids, clean_up_tokenization_spaces=True):
        # Return mock decoded texts
        batch_size = token_ids.shape[0]
        return [f"mock text {i}" for i in range(batch_size)]

# Create a mock MCM (Minimum Coherence Model) callable
class MockMCM:
    def __call__(self, texts):
        # Return mock scores for each text, and dummy second/third outputs
        scores = [0.8] * len(texts)
        return [scores], None, None

# Prepare basic tensors
logits = torch.randn(2, 4)  # batch_size=2, vocab_size=4
input_ids = torch.tensor([[1, 2], [3, 4]])  # batch_size=2, seq_len=2

# Create instances
tokenizer = MockTokenizer()
mcm = MockMCM()

ARGS = {
    'logits': logits,
    'top_k': 2,
    'top_p': 0.9,
    'filter_value': float('-inf'),
    'min_tokens_to_keep': 1,
    'input_ids': input_ids,
    'use_mcm': False,
    'tokenizer': tokenizer,
    'mcm': mcm,
    'threshold': 0.5,
    'mcm_keep_at_least': 1,
    'edge_cases_file': '',
    'eot_token': '<|endoftext|>'
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 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
top_k_top_p_filtering_dialogpt Ran
ran on a synthesized input
ml-research/MoRT_NMI/MoRT/mcm_textgeneration/mcm_models.py
code served (permissive licence) · get_code("022cbd43faa014bc")
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 Tensor, ndim 2, dtype family float, shape (2, 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 torch
import torch.nn as nn
from torch import Tensor

torch.manual_seed(0)

# Create a minimal tokenizer stand-in
class MinimalTokenizer:
    def decode(self, token_tensor, clean_up_tokenization_spaces=True):
        # Return a simple string representation
        return " ".join([f"token_{t.item()}" for t in token_tensor])

# Create a minimal MCM (meaning/coherence model) stand-in
class MinimalMCM(nn.Module):
    def __init__(self):
        super().__init__()
    
    def forward(self, texts):
        # Return tuple of (scores, _, _) where scores is a list of floats for each text
        scores = [0.8 - i * 0.1 for i in range(len(texts))]
        return (scores, None, None)
    
    def __call__(self, texts):
        return self.forward(texts)

# Set up basic tensors and parameters
batch_size = 2
vocab_size = 4
seq_len = 3

logits = torch.randn(batch_size, vocab_size)
input_ids = torch.randint(0, vocab_size, (batch_size, seq_len))

tokenizer = MinimalTokenizer()
mcm = MinimalMCM()

ARGS = {
    'logits': logits,
    'top_k': 2,
    'top_p': 0.9,
    'filter_value': float('-inf'),
    'min_tokens_to_keep': 1,
    'input_ids': input_ids,
    'use_mcm': False,
    'tokenizer': tokenizer,
    'mcm': mcm,
    'threshold': 0.5,
    'mcm_keep_at_least': 1,
    'edge_cases_file': '',
    'start_mcm_token': None,
    'num_text_splits': 1,
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 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

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

Artificial writing is permeating our lives due to recent advances in large-scale, transformer-based language models (LMs) such as BERT, its variants, GPT-2/3, and others. Using them as pre-trained models and fine-tuning them for specific tasks, researchers have extended state of the art for many NLP tasks and shown that they capture not only linguistic knowledge but also retain general knowledge implicitly present in the data. Unfortunately, LMs trained on unfiltered text corpora suffer from degenerated and biased behaviour. While this is well established, we show that recent LMs also contain human-like biases of what is right and wrong to do, some form of ethical and moral norms of the society -- they bring a "moral direction" to surface. That is, we show that these norms can be captured geometrically by a direction, which can be computed, e.g., by a PCA, in the embedding space, reflecting well the agreement of phrases to social norms implicitly expressed in the training texts and providing a path for attenuating or even preventing toxic degeneration in LMs. Being able to rate the (non-)normativity of arbitrary phrases without explicitly training the LM for this task, we demonstrate the capabilities of the "moral direction" for guiding (even other) LMs towards producing normative text and showcase it on RealToxicityPrompts testbed, preventing the neural toxic degeneration in GPT-2.

For agents

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

get_harvested_code_for_paper("2103.11790")
get_code_for_paper("2103.11790")
have("2103.11790")

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

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

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

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

Connect an agent — have() is free.