SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2111.13654 · 2021

Do Language Models Have Beliefs? Methods for Detecting, Updating, and Visualizing Model Beliefs

arXiv · PDF · Open in the Atlas

Code that ran

10 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, 0 violated it and 9 have no contract verdict; 0 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/2111.13654.json · badge: /api/ran/2111.13654.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
peterbhase/slag-belief-updating canonical (classifier label)
classifier basis not recorded on the link
10 ran · 2 no recorded run
FunctionStatusWhere it lives
add_line_breaks_to_sentence Ran
ran on a synthesized input
peterbhase/slag-belief-updating/graph_utils.py
code served (permissive licence) · get_code("4bd0b9f5f12663b0")
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 add_line_breaks_to_sentence(sentence, every_chars=20):
    words_list = sentence.split()
    new_sent = []
    char_counter = 0
    for word_num, word in enumerate(words_list):
        char_counter += len(word)
        if char_counter > every_chars and word_num < len(words_list) - 1:
            word += '\n'
            char_counter = 0
        new_sent.append(word)
    return ' '.join(new_sent)

ARGS = {
    "sentence": "The quick brown fox jumps over the lazy dog and runs through the forest",
    "every_chars": 20
}
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
command_to_dict Ran
ran on a synthesized input
peterbhase/slag-belief-updating/utils.py
code served (permissive licence) · get_code("1068a66c77c7604f")
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 dict. 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 command_to_dict(command):
    command_dict = {}
    items = command.split()
    for idx, item in enumerate(items):
        if idx == len(items) - 1:
            break
        if item[:2] == '--':
            k = item[2:]
            v = items[idx + 1]
            command_dict[k] = v
        elif item[0] == '-':
            k = item[1:]
            v = items[idx + 1]
            command_dict[k] = v
    return command_dict

ARGS = {
    'command': '--learning-rate 0.001 -b 32 --epochs 100'
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
filter_for_rare_relations Ran
ran on a synthesized input
peterbhase/slag-belief-updating/data_utils/filter_wikidata.py
code served (permissive licence) · get_code("60159b5b4d19fa95")
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 numpy as np

torch.manual_seed(0)

# Based on the function body, it:
# 1. Iterates over 'relations' (a list/iterable of relation identifiers)
# 2. Looks up each relation in 'relation_prop_dict' (a dict mapping relations to proportions)
# 3. Compares proportions against 'relation_prop_threshold' (a float)
# 4. Returns relations with proportion < threshold

# Create a small set of relations
relations = ["rel_1", "rel_2", "rel_3", "rel_4"]

# Create a dict mapping relations to proportions
relation_prop_dict = {
    "rel_1": 0.05,   # Below threshold - should be included
    "rel_2": 0.15,   # Below threshold - should be included
    "rel_3": 0.25,   # Above threshold - excluded
    "rel_4": 0.30,   # Above threshold - excluded
}

# Set threshold
relation_prop_threshold = 0.2

ARGS = {
    "relations": relations,
    "relation_prop_dict": relation_prop_dict,
    "relation_prop_threshold": relation_prop_threshold,
}
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 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
get_experiment_name_from_command Ran
ran on a synthesized input
peterbhase/slag-belief-updating/utils.py
code served (permissive licence) · get_code("ad365ef21c622fc9")
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

# Create a temporary directory and file for the function to write to
temp_dir = tempfile.mkdtemp()
outputs_dir = os.path.join(temp_dir, 'outputs')
os.makedirs(outputs_dir, exist_ok=True)

# Create a mock command that writes to the expected output file
job_command = f"echo 'test_experiment_name' > {outputs_dir}/tmp_experiment_name.txt"

# Change to temp directory so relative paths work
original_cwd = os.getcwd()
os.chdir(temp_dir)

ARGS = {
    'job_command': job_command
}
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_result_sheet_name Ran
ran on a synthesized input
peterbhase/slag-belief-updating/utils.py
code served (permissive licence) · get_code("f555c3b4b4784251")
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)

class Args:
    def __init__(self):
        self.num_random_other = 5
        self.update_steps = 3
        self.num_successive_updates = 2
        self.eval_beam_search_alt_labels = True

ARGS = {
    'args': Args(),
    'experiment_name': 'test_experiment',
    'is_update_epoch': True,
    'split_name': 'validation'
}
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
jaccard_similarity Ran
ran on a synthesized input
peterbhase/slag-belief-updating/metrics.py
code served (permissive licence) · get_code("f4cecdbe8b090444")
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)

# Analyze the function:
# jaccard_similarity takes two parameters: list1 and list2
# Both are used with:
# - set() constructor
# - .intersection() method
# - len() function
# So they need to be list-like objects containing hashable items

list1 = [1, 2, 3, 4, 5]
list2 = [3, 4, 5, 6, 7]

ARGS = {
    "list1": list1,
    "list2": list2
}
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
nx_graph_from_pd_df Ran
ran on a synthesized input
peterbhase/slag-belief-updating/graph_utils.py
code served (permissive licence) · get_code("bd9fe803bb4b72c0")
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 DiGraph. 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 pandas as pd
import networkx as nx

# Create a minimal pandas DataFrame with the required columns
pd_df = pd.DataFrame({
    'id': [0, 1, 2, 3],
    'in_ids': [[], [0], [0, 1], [1, 2]],
    'out_ids': [[1, 2], [2, 3], [3], []],
    'correct': [True, False, True, False]
})

# Create args dict - the function takes 'args' and 'pd_df' as parameters
# Looking at the function body, 'args' is not actually used
args = {}

ARGS = {
    'args': args,
    'pd_df': pd_df
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DiGraph — a DiGraph output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DiGraph output the recorded ndim 1 and dtype family int 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
p_value Ran
ran, honoured the contract we drafted
peterbhase/slag-belief-updating/statistical_analysis.py
code served (permissive licence) · get_code("ecdceb0edcf86391")
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; 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 numpy as np

# The function p_value takes betas as input
# It expects a numpy array of beta values
# The function computes statistics on the betas using numpy operations

# Create a small test array of beta values
betas = np.array([0.5, 1.2, -0.3, 0.8, -0.1, 0.9])

ARGS = {
    "betas": betas
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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 — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
pull_independent_acc_when_wrong Ran
ran on a synthesized input
peterbhase/slag-belief-updating/metrics.py
code served (permissive licence) · get_code("c32afabea331f1dd")
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; no output shape is stated. It ran in syntology-harvest-sandbox:v5-deps (sha256:6a292aa1aed1) at 2026-09-26T22:17:14Z. 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:
# - It takes main_correctness as a parameter
# - main_correctness must have even length (pairs of elements)
# - It iterates through pairs of adjacent elements
# - For each pair, if one element is 0, it adds the other element to ind_acc_sum
# - It counts how many times an element is 0
# - Returns the sum divided by count

# Create a simple list of correctness indicators (0s and 1s)
# Must have even length and contain some 0s to avoid division by zero
main_correctness = [1, 1, 0, 1, 1, 0, 0, 1]

ARGS = {
    "main_correctness": main_correctness
}
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 — no output shape is stated: no later run recorded an output shape for this sample (observed_output and metamorphic_properties carry none; shape_contract and output_contract record ndim only)
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 syntology-harvest-sandbox:v5-deps (sha256:6a292aa1aed1); 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
to_pseudo_language Ran
ran on a synthesized input
peterbhase/slag-belief-updating/data_utils/shuffle_leapofthought_splits.py
code served (permissive licence) · get_code("531531be2eb535af")
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 = {
    'triplet': {
        'subject': 'dog',
        'predicate': '/r/IsA',
        'object': 'animal'
    }
}
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
element_is_primitive Not yet run
unverified (harvested, no recorded run)
peterbhase/slag-belief-updating/statistical_analysis.py
code served (permissive licence) · get_code("a6ed60e4ae0bead5")
How it ran

no invocation recorded.

unroll_stats Not yet run
unverified (harvested, no recorded run)
peterbhase/slag-belief-updating/statistical_analysis.py
code served (permissive licence) · get_code("75bc7f3f6f994a7c")
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, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 11 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
p_value 1 other paper
1 later
2401.06751 (2024-01)
The Unreasonable Effectiveness of Easy Training Data for Hard Tasks

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

Do language models have beliefs about the world? Dennett (1995) famously argues that even thermostats have beliefs, on the view that a belief is simply an informational state decoupled from any motivational state. In this paper, we discuss approaches to detecting when models have beliefs about the world, and we improve on methods for updating model beliefs to be more truthful, with a focus on methods based on learned optimizers or hypernetworks. Our main contributions include: (1) new metrics for evaluating belief-updating methods that focus on the logical consistency of beliefs, (2) a training objective for Sequential, Local, and Generalizing model updates (SLAG) that improves the performance of learned optimizers, and (3) the introduction of the belief graph, which is a new form of interface with language models that shows the interdependencies between model beliefs. Our experiments suggest that models possess belief-like qualities to only a limited extent, but update methods can both fix incorrect model beliefs and greatly improve their consistency. Although off-the-shelf optimizers are surprisingly strong belief-updating baselines, our learned optimizers can outperform them in more difficult settings than have been considered in past work. Code is available at https://github.com/peterbhase/SLAG-Belief-Updating

For agents

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

get_harvested_code_for_paper("2111.13654")
get_code_for_paper("2111.13654")
have("2111.13654")

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

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

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

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

Connect an agent — have() is free.