SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.11911 · 2024

A Notion of Complexity for Theory of Mind via Discrete World Models

arXiv · PDF · Open in the Atlas

Code that ran

7 of 12 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, 1 violated it and 0 have no contract verdict; 5 failures of our instrument; 5 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/2406.11911.json · badge: /api/ran/2406.11911.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
flecart/complexity-tom-dwm canonical (classifier label)
classifier basis: census
7 ran · 5 no recorded run
FunctionStatusWhere it lives
check_built Ran
ran, violated the contract we drafted
flecart/complexity-tom-dwm/loader.py
code served (permissive licence) · get_code("1c14ee45c4283d31")
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 os
import tempfile
import shutil

# Create a temporary directory for testing
temp_dir = tempfile.mkdtemp()

# Create a .built file with version information
built_file_path = os.path.join(temp_dir, '.built')
with open(built_file_path, 'w') as f:
    f.write("some_build_info\n")
    f.write("v1.0.0\n")

# Define arguments for the check_built function
ARGS = {
    "path": temp_dir,
    "version_string": "v1.0.0"
}
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 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
delete_tag Ran
ran; our contract draft was wrong, not the code
flecart/complexity-tom-dwm/main/prompt_utils.py
code served (permissive licence) · get_code("4c2a09077b28cd01")
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 re

def delete_tag(result: str, tag: str='answer'):
    """deletes anything between <tag> and </tag

    >>> delete_tag("kept<answer>hello</answer>")
    "kept"
    """
    return re.sub(f'<{tag}>.*</{tag}>', '', result)


ARGS = {
    'result': "kept<answer>hello</answer>",
    'tag': 'answer'
}
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
download_and_check_hash Ran
ran; our contract draft was wrong, not the code
flecart/complexity-tom-dwm/loader.py
code served (permissive licence) · get_code("4ecf75a20f9f0944")
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 os
import tempfile
import hashlib

# Create a temporary directory for testing
temp_dir = tempfile.mkdtemp()

# Create a small test file and compute its hash
test_data = b"This is a test file for hashing"
test_hash = hashlib.sha256(test_data).hexdigest()

# Create a mock response object that simulates requests.get behavior
class MockResponse:
    def __init__(self, data):
        self.data = data
        self.headers = {'content-length': str(len(data))}
        self.position = 0
    
    def iter_content(self, chunk_size=1024):
        for i in range(0, len(self.data), chunk_size):
            yield self.data[i:i+chunk_size]

# Patch requests.get to return our mock response
import requests
original_get = requests.get

def mock_get(url, stream=True):
    return MockResponse(test_data)

requests.get = mock_get

# Define the arguments
ARGS = {
    'url': 'https://example.com/testfile.bin',
    'filename': 'testfile.bin',
    'expected_hash': test_hash,
    'version': '1.0.0',
    'directory': temp_dir,
    'chunk_size': 1024 * 1024 * 10
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
requests, tqdm — 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
extract_tag Ran
ran; our contract draft was wrong, not the code
flecart/complexity-tom-dwm/main/prompt_utils.py
code served (permissive licence) · get_code("cc7539e993c742e8")
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 re

def extract_tag(result: str, tag: str='answer'):
    """extracts anything between <tag> and </tag>

    >>> extract_tag("kept<answer>hello</answer>")
    "hello"
    """
    regex = f'<{tag}>(.*)</{tag}>'
    res = re.findall(regex, result)
    if len(res) == 0:
        regex = f'<{tag}>(.*)<{tag}>'
        res = re.findall(regex, result)
    if len(res) == 0:
        return ''
    return re.findall(regex, result)[0]


ARGS = {
    'result': 'kept<answer>hello</answer>',
    'tag': 'answer'
}
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_same_values Ran
ran, honoured the contract we drafted
flecart/complexity-tom-dwm/main/prompt_utils.py
code served (permissive licence) · get_code("64ce0f34411fbdaf")
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 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
import numpy as np

# Analyze the function:
# - Takes a parameter 'array' which is list[str]
# - Returns list[int]
# - The function iterates through the array and for each element,
#   checks if it appeared before. If yes, stores the index of first occurrence.
#   If no, stores -1.

# Create test data
test_array = ["apple", "banana", "apple", "cherry", "banana", "date"]

ARGS = {
    "array": test_array
}
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 1, 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
process_json Ran
ran; our contract draft was wrong, not the code
flecart/complexity-tom-dwm/statefulness/copy_state_data.py
code served (permissive licence) · get_code("e8a7d9a22231b3b4")
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.

from pydantic import BaseModel

class Sample(BaseModel):
    prompt: str
    question: str
    answer: str
    num_states: int = -1
    num_highlights: list[tuple[int, int]] = []

# Create test samples
sample1 = Sample(
    prompt="What is the capital?",
    question="Capital of France?",
    answer="Paris",
    num_states=2,
    num_highlights=[(0, 5), (10, 15)]
)

sample2 = Sample(
    prompt="How many?",
    question="How many planets?",
    answer="Eight",
    num_states=3,
    num_highlights=[(0, 2), (5, 8), (10, 12)]
)

sample3 = Sample(
    prompt="What color?",
    question="Sky color?",
    answer="Blue",
    num_states=2,
    num_highlights=[(0, 3)]
)

sample4 = Sample(
    prompt="Default values",
    question="Test question",
    answer="Test answer"
)

ARGS = {
    "data": [sample1, sample2, sample3, sample4]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pydantic — 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
unzip_file Ran
ran; our contract draft was wrong, not the code
flecart/complexity-tom-dwm/loader.py
code served (permissive licence) · get_code("b3dded8ccf91020f")
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 os
import zipfile
import tarfile
import tempfile
import shutil

# Create a temporary directory for testing
test_dir = tempfile.mkdtemp()

# Create a test .zip file
zip_file_path = os.path.join(test_dir, 'test_archive.zip')
with zipfile.ZipFile(zip_file_path, 'w') as zf:
    zf.writestr('test_file.txt', 'test content')

# Create a test .tar.gz file
tar_file_path = os.path.join(test_dir, 'test_archive.tar.gz')
with tarfile.open(tar_file_path, 'w:gz') as tf:
    import io
    info = tarfile.TarInfo(name='test_file.txt')
    info.size = len(b'test content')
    tf.addfile(tarinfo=info, fileobj=io.BytesIO(b'test content'))

# Extract directory
extract_dir = os.path.join(test_dir, 'extract_dest')
os.makedirs(extract_dir, exist_ok=True)

ARGS = {
    'file_path': zip_file_path,
    'directory': extract_dir
}
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_number_sentences Not yet run
unverified (harvested, no recorded run)
flecart/complexity-tom-dwm/statefulness/copy_state_data.py
code served (permissive licence) · get_code("7b3181a27d7f94b3")
How it ran

no invocation recorded.

get_value Not yet run
unverified (harvested, no recorded run)
flecart/complexity-tom-dwm/main/tot_prompt.py
code served (permissive licence) · get_code("eaa9e9754f7e49f2")
How it ran

no invocation recorded.

get_values Not yet run
unverified (harvested, no recorded run)
flecart/complexity-tom-dwm/main/tot_prompt.py
code served (permissive licence) · get_code("d082501c44608619")
How it ran

no invocation recorded.

queryllama Not yet run
unverified (harvested, no recorded run)
flecart/complexity-tom-dwm/main/utils.py
code served (permissive licence) · get_code("ba4e5df31930bb6c")
How it ran

no invocation recorded.

queryllama2 Not yet run
unverified (harvested, no recorded run)
flecart/complexity-tom-dwm/main/utils.py
code served (permissive licence) · get_code("819593ad46cbef06")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 0 later) and 9 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.

FunctionAlso present inEarliest-datedOthers named
check_built 1 other paper
1 dated earlier
2212.10465 (2022-12)
SODA: Million-scale Dialogue Distillation with Social Commonsense Contextualization
download_and_check_hash 1 other paper
1 dated earlier
2212.10465 (2022-12)
SODA: Million-scale Dialogue Distillation with Social Commonsense Contextualization
unzip_file 1 other paper
1 dated earlier
2212.10465 (2022-12)
SODA: Million-scale Dialogue Distillation with Social Commonsense Contextualization

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

Theory of Mind (ToM) can be used to assess the capabilities of Large Language Models (LLMs) in complex scenarios where social reasoning is required. While the research community has proposed many ToM benchmarks, their hardness varies greatly, and their complexity is not well defined. This work proposes a framework inspired by cognitive load theory to measure the complexity of ToM tasks. We quantify a problem's complexity as the number of states necessary to solve it correctly. Our complexity measure also accounts for spurious states of a ToM problem designed to make it apparently harder. We use our method to assess the complexity of five widely adopted ToM benchmarks. On top of this framework, we design a prompting technique that augments the information available to a model with a description of how the environment changes with the agents' interactions. We name this technique Discrete World Models (DWM) and show how it elicits superior performance on ToM tasks.

For agents

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

get_harvested_code_for_paper("2406.11911")
get_code_for_paper("2406.11911")
have("2406.11911")

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

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

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

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

Connect an agent — have() is free.