SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2301.10896 · EACL Findings · 2023

Causal Reasoning About Entities and Events in Procedural Texts

Li Zhang, Chris Callison-Burch, Shuyan Zhou, Weiqiu You, Yue Yang, Hainiu Xu, Manni Arora

arXiv · PDF · Open in the Atlas

Code that ran

7 of 15 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 7 have no contract verdict; 0 failures of our instrument; 8 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/2301.10896.json · badge: /api/ran/2301.10896.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
zharry29/causal_reasoning_of_entities_and_events canonical (classifier label)
classifier basis not recorded on the link
7 ran · 8 no recorded run
FunctionStatusWhere it lives
goal_to_code Ran
ran on a synthesized input
zharry29/causal_reasoning_of_entities_and_events/codex/v1.2.6/openai_models.py
code served (permissive licence) · get_code("41277c3358776c7b")
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

torch.manual_seed(0)

def goal_to_code(goal):
    if goal[:6].lower() == 'how to':
        goal = goal[6:].strip()
    return '_'.join(goal.capitalize().split())

ARGS = {
    'goal': 'how to build a neural network'
}
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
parse_codex_prediction Ran
ran on a synthesized input
zharry29/causal_reasoning_of_entities_and_events/codex/v1.2.1/openai_models.py
code served (permissive licence) · get_code("3c38f3bbfb0461a3")
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. 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

# The function parse_codex_prediction takes a string parameter gen_code
# It processes the string line by line, looking for Python function definitions
# and self.* attribute assignments or self.event changes

# Create a valid gen_code string that the function can parse
gen_code = """def step_1():
    self.player.health = True
    self.event_a.change = "more likely"

def step_2():
    self.enemy.armor = False
    self.event_b.change = "less likely"
"""

ARGS = {
    "gen_code": gen_code
}
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 — a list output has no array shape of its own; none is 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
parse_codex_prediction Ran
ran on a synthesized input
zharry29/causal_reasoning_of_entities_and_events/codex/v1.2.3/openai_models.py
code served (permissive licence) · get_code("b08a7d06f5210cff")
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

# Construct valid arguments for parse_codex_prediction
gen_code = """def step_0():
    self.agent_health = 100
    self.agent_position = 5
    self.event_damage = self.agent_health > 50

def step_1():
    self.agent_health = 75
    self.agent_position = 10
    self.event_damage = self.agent_health > 50

def step_2():
    self.agent_health = 30
    self.agent_position = 15
    self.event_damage = self.agent_health > 50
"""

ARGS = {
    "gen_code": gen_code
}
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 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
parse_codex_prediction Ran
ran on a synthesized input
zharry29/causal_reasoning_of_entities_and_events/codex/v1.2.5/openai_models.py
code served (permissive licence) · get_code("5cbdf807893e810c")
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

def parse_codex_prediction(gen_code):
    print(gen_code)
    step_changes = []
    current_step_changes = []
    initial = True
    for line in gen_code.split('\n'):
        line = line.strip()
        if line.startswith('def '):
            if not initial:
                step_changes.append(current_step_changes)
                current_step_changes = []
            initial = False
        elif line.startswith('event'):
            if '.change = "less likely"' in line:
                change = 'less likely'
            elif '.change = "more likely"' in line:
                change = 'more likely'
            elif '.change = "equally likely"' in line:
                continue
            else:
                print(line)
                continue
            current_step_changes.append((line[0:6], change))
        elif not line:
            break
    step_changes.append(current_step_changes)
    return step_changes

# Construct a valid gen_code string with function definitions and event lines
gen_code = """def step_1():
    event1.change = "more likely"
    event2.change = "less likely"

def step_2():
    event3.change = "more likely"
    event4.change = "equally likely"
"""

ARGS = {
    'gen_code': gen_code
}
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 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
parse_codex_prediction Ran
ran on a synthesized input
zharry29/causal_reasoning_of_entities_and_events/codex/v1.2.6/openai_models.py
code served (permissive licence) · get_code("5ccf8fb9732577d7")
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. 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

# Examine the function: parse_codex_prediction takes gen_code (a string)
# The function:
# - Splits gen_code by newlines
# - Iterates through lines
# - Looks for lines starting with 'def ' to mark step boundaries
# - Looks for lines starting with 'self.event' containing ' -= ' or ' +=' 
# - Extracts substring [5:11] from matching lines
# - Returns a list of lists of tuples

# Construct a valid gen_code string that exercises the function

gen_code = """initial line
def step_one():
    self.event_a -= 5
    self.event_b += 10
def step_two():
    self.event_c -= 3
    self.event_d += 7
"""

ARGS = {
    'gen_code': gen_code
}
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 — a list output has no array shape of its own; none is 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
parse_gen Ran
ran on a synthesized input
zharry29/causal_reasoning_of_entities_and_events/gpt3/niket1/openai_models.py
code served (permissive licence) · get_code("76067d310884b7d2")
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

# Construct a valid argument for parse_gen
# The function expects a string with lines formatted as "Step N: (option)..."

ret = """Step 1: (A) first option
Step 2: (B) second option
Step 3: (C) third option"""

ARGS = {
    'ret': ret
}
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
text_to_code Ran
ran on a synthesized input
zharry29/causal_reasoning_of_entities_and_events/codex/v1.2.1/openai_models.py
code served (permissive licence) · get_code("492f53812fee57cc")
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

def text_to_code(s, capitalize=False, lower=False):

    def strip_det(s):
        return s.removeprefix('a ').removeprefix('the ').removeprefix('my ').replace(' a ', ' ').replace(' the ', ' ').replace(' my ', ' ')
    s = s.replace('.', '').replace(',', '').replace('?', '')
    if capitalize:
        return '_'.join([x.capitalize() for x in strip_det(s).split()])
    if lower:
        return '_'.join([x.lower() for x in strip_det(s).split()])
    return '_'.join(strip_det(s).split())

ARGS = {
    's': 'the quick brown fox jumps over a lazy dog',
    'capitalize': False,
    'lower': False
}
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
entity_and_event Not yet run
unverified (harvested, no recorded run)
zharry29/causal_reasoning_of_entities_and_events/codex/v1.2.3/openai_models.py
code served (permissive licence) · get_code("efd28f7fa5c65a9c")
How it ran

no invocation recorded.

event_only Not yet run
unverified (harvested, no recorded run)
zharry29/causal_reasoning_of_entities_and_events/codex/v1.2.1/openai_models.py
code served (permissive licence) · get_code("d28314959a83c236")
How it ran

no invocation recorded.

event_only Not yet run
unverified (harvested, no recorded run)
zharry29/causal_reasoning_of_entities_and_events/codex/v1.2.2/openai_models.py
code served (permissive licence) · get_code("c83c46cb3d332009")
How it ran

no invocation recorded.

event_only Not yet run
unverified (harvested, no recorded run)
zharry29/causal_reasoning_of_entities_and_events/codex/v1.2.4/openai_models.py
code served (permissive licence) · get_code("2e2c16954ed09e3b")
How it ran

no invocation recorded.

event_only Not yet run
unverified (harvested, no recorded run)
zharry29/causal_reasoning_of_entities_and_events/codex/v1.2.5/openai_models.py
code served (permissive licence) · get_code("6b0568644ace839f")
How it ran

no invocation recorded.

gpt3 Not yet run
unverified (harvested, no recorded run)
zharry29/causal_reasoning_of_entities_and_events/gpt3.5/openai_models.py
code served (permissive licence) · get_code("62bd25caa33a238d")
How it ran

no invocation recorded.

gpt3 Not yet run
unverified (harvested, no recorded run)
zharry29/causal_reasoning_of_entities_and_events/gpt3/niket1/openai_models.py
code served (permissive licence) · get_code("2b309e8385773dbd")
How it ran

no invocation recorded.

gpt3_prompt Not yet run
unverified (harvested, no recorded run)
zharry29/causal_reasoning_of_entities_and_events/gpt3/niket1/openai_models.py
code served (permissive licence) · get_code("303e6c5008ec8231")
How it ran

no invocation recorded.

Also present in other papers' code

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

Entities and events are crucial to natural language reasoning and common in procedural texts. Existing work has focused either exclusively on entity state tracking (e.g., whether a pan is hot) or on event reasoning (e.g., whether one would burn themselves by touching the pan), while these two tasks are often causally related. We propose CREPE, the first benchmark on causal reasoning of event plausibility and entity states. We show that most language models, including GPT-3, perform close to chance at .35 F1, lagging far behind human at .87 F1. We boost model performance to .59 F1 by creatively representing events as programming languages while prompting language models pretrained on code. By injecting the causal relations between entities and events as intermediate reasoning steps in our representation, we further boost the performance to .67 F1. Our findings indicate not only the challenge that CREPE brings for language models, but also the efficacy of code-like prompting combined with chain-of-thought prompting for multihop event reasoning. 1 * Equal contribution. 1 Data and code can be found at https://github.com/z harry29/causal_reasoning_of_entities_and_events.

For agents

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

get_harvested_code_for_paper("2301.10896")
get_code_for_paper("2301.10896")
have("2301.10896")

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

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

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

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

Connect an agent — have() is free.