SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2404.10975 · 2024

Procedural Dilemma Generation for Evaluating Moral Reasoning in Humans and Language Models

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 1 has no contract verdict; 3 failures of our instrument; 2 no recorded run), measured 2026-11-23; 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/2404.10975.json · badge: /api/ran/2404.10975.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
cicl-stanford/moral-evals canonical (classifier label)
classifier basis: census
5 ran · 2 no recorded run
FunctionStatusWhere it lives
get_context Ran
ran; our contract draft was wrong, not the code
cicl-stanford/moral-evals/offtherails/src/helpers.py
code served (permissive licence) · get_code("e0fd89f5e55b1a4f")
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 numpy as np

torch.manual_seed(0)

ARGS = {
    'name': 'Alice',
    'profession': 'engineer'
}
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 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
get_context Ran
ran; our contract draft was wrong, not the code
cicl-stanford/moral-evals/offtherails/src/stage_1.py
code served (permissive licence) · get_code("a58aba4c1171a579")
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

ARGS = {
    'name': 'Alice Johnson',
    'profession': 'engineer'
}
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
get_example Ran
ran on a synthesized input
cicl-stanford/moral-evals/offtherails/src/helpers.py
code served (permissive licence) · get_code("4406ad8261c56fb3")
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 csv
import tempfile
import os

# Create temporary directory and CSV files
temp_dir = tempfile.mkdtemp()

# Create cc_stage_2_mild.csv
cc_file = os.path.join(temp_dir, 'cc_stage_2_mild.csv')
with open(cc_file, 'w', newline='') as f:
    writer = csv.writer(f, delimiter=';')
    writer.writerow([
        'Context1', 'Action1', 'Harm1', 'Good1', 'PreventableCause1', 
        'NonPreventableCause1', 'AsMeansTo1', 'EvitableAction1', 'InevitableAction1',
        'EvitablePrevention1', 'InevitablePrevention1', 'Action1', 'Prevention1'
    ])
    writer.writerow([
        'Context2', 'Action2', 'Harm2', 'Good2', 'PreventableCause2',
        'NonPreventableCause2', 'AsMeansTo2', 'EvitableAction2', 'InevitableAction2',
        'EvitablePrevention2', 'InevitablePrevention2', 'Action2', 'Prevention2'
    ])

# Create coc_stage_2_mild.csv
coc_file = os.path.join(temp_dir, 'coc_stage_2_mild.csv')
with open(coc_file, 'w', newline='') as f:
    writer = csv.writer(f, delimiter=';')
    writer.writerow([
        'ContextA', 'ActionA', 'HarmA', 'GoodA', 'PreventableCauseA',
        'NonPreventableCauseA', 'AsSideEffectA', 'EvitableActionA', 'InevitableActionA',
        'EvitablePreventionA', 'InevitablePreventionA', 'ActionA', 'PreventionA'
    ])
    writer.writerow([
        'ContextB', 'ActionB', 'HarmB', 'GoodB', 'PreventableCauseB',
        'NonPreventableCauseB', 'AsSideEffectB', 'EvitableActionB', 'InevitableActionB',
        'EvitablePreventionB', 'InevitablePreventionB', 'ActionB', 'PreventionB'
    ])

ARGS = {
    'condition': 'cc',
    'rand_item': '1',
    'data_dir': temp_dir,
    'n_vars': 50
}
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 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
get_vars_from_out Ran
ran; our contract draft was wrong, not the code
cicl-stanford/moral-evals/offtherails/src/helpers.py
code served (permissive licence) · get_code("50decf247ea8cfa3")
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

# Analyzing the function: get_vars_from_out takes a string `out` and:
# 1. Splits it by newlines
# 2. Filters lines containing ':'
# 3. Splits each line by ': ' (colon followed by space)
# 4. Skips lines where first element is 'Context'
# 5. Appends the second element (stripped) to vars list

# Construct a valid multi-line string with the expected format
out_string = """tensor_a: [1.0, 2.0, 3.0]
Context: some_context_value
tensor_b: [4.0, 5.0]
loss: 0.5
Context: another_context
accuracy: 0.95"""

ARGS = {
    "out": out_string
}
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
parse_response Ran
ran, honoured the contract we drafted
cicl-stanford/moral-evals/offtherails/src/evaluate_llm.py
code served (permissive licence) · get_code("0e5309d0f2137cd8")
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 torch

# Based on the function body, parse_response takes a single parameter:
# - raw_response: a string that the function processes

# The function uses string methods like .lower(), .strip(), .split()
# It looks for patterns like 'a:', 'A:', 'answer:', 'Answer:'
# and keywords like 'strongly agree', 'agree', 'disagree', etc.

# Test case 1: response with "a:" prefix
raw_response_1 = "a: strongly agree"

# Test case 2: response with "Answer:" prefix
raw_response_2 = "Answer: agree"

# Test case 3: response with numeric value
raw_response_3 = "a: 5"

# Test case 4: response with neutral
raw_response_4 = "a: neutral"

# Use one of the test cases for ARGS
ARGS = {
    'raw_response': "a: strongly agree"
}
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 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
get_completions Not yet run
unverified (harvested, no recorded run)
cicl-stanford/moral-evals/offtherails/src/generate_conditions.py
code served (permissive licence) · get_code("bd4690a435f97ce8")
How it ran

no invocation recorded.

get_example Not yet run
unverified (harvested, no recorded run)
cicl-stanford/moral-evals/offtherails/src/stage_1.py
code served (permissive licence) · get_code("96407f5816599b96")
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-23.

Repositories linked to this paper

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

Abstract

As AI systems like language models are increasingly integrated into decision-making processes affecting people's lives, it's critical to ensure that these systems have sound moral reasoning. To test whether they do, we need to develop systematic evaluations. We provide a framework that uses a language model to translate causal graphs that capture key aspects of moral dilemmas into prompt templates. With this framework, we procedurally generated a large and diverse set of moral dilemmas -- the OffTheRails benchmark -- consisting of 50 scenarios and 400 unique test items. We collected moral permissibility and intention judgments from human participants for a subset of our items and compared these judgments to those from two language models (GPT-4 and Claude-2) across eight conditions. We find that moral dilemmas in which the harm is a necessary means (as compared to a side effect) resulted in lower permissibility and higher intention ratings for both participants and language models. The same pattern was observed for evitable versus inevitable harmful outcomes. However, there was no clear effect of whether the harm resulted from an agent's action versus from having omitted to act. We discuss limitations of our prompt generation pipeline and opportunities for improving scenarios to increase the strength of experimental effects.

For agents

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

get_harvested_code_for_paper("2404.10975")
get_code_for_paper("2404.10975")
have("2404.10975")

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

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

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

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

Connect an agent — have() is free.