SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2607.17060 · 2026

What does a Bayes-filtered transformer believe? A predictive Monte Carlo approach

Susan Wei, Afiq Abdillah, Effiezal Aswadi, Haotong Ma

arXiv · PDF · Open in the Atlas

Code that ran

11 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; 3 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 8 failures of our instrument; 1 no recorded run), measured 2026-11-23; 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/2607.17060.json · badge: /api/ran/2607.17060.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
afiq-aswadi/bft-pmc canonical (classifier label)
classifier basis: census
11 ran · 1 no recorded run
FunctionStatusWhere it lives
energy_distance_multidim Ran
ran, honoured the contract we drafted
afiq-aswadi/bft-pmc/metrics.py
code served (permissive licence) · get_code("5489114b76c255d1")
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 numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Create two sample matrices with matching dimensions
# samples_a: shape [N, D] where N=5, D=3
# samples_b: shape [M, D] where M=4, D=3
samples_a = np.random.randn(5, 3).astype(np.float64)
samples_b = np.random.randn(4, 3).astype(np.float64)

ARGS = {
    'samples_a': samples_a,
    'samples_b': samples_b,
}
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 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
find_all_checkpoints Ran
ran; our contract draft was wrong, not the code
afiq-aswadi/bft-pmc/analysis/checkpoints.py
code served (permissive licence) · get_code("b2169addb6e1946c")
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 tempfile
from pathlib import Path

# Create a temporary directory to simulate a run directory
temp_dir = tempfile.mkdtemp()
run_dir = Path(temp_dir)

# Create some dummy checkpoint files with the expected naming pattern
checkpoint_files = [
    'checkpoint_step_100.pt',
    'checkpoint_step_50.pt',
    'checkpoint_step_200.pt',
]

for filename in checkpoint_files:
    filepath = run_dir / filename
    filepath.write_text('')

ARGS = {
    'run_dir': run_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 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
find_latest_checkpoint Ran
ran; our contract draft was wrong, not the code
afiq-aswadi/bft-pmc/analysis/checkpoints.py
code served (permissive licence) · get_code("6f57d9f09cdca659")
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 PosixPath. 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 tempfile
from pathlib import Path

# Create a temporary directory to serve as run_dir
temp_dir = tempfile.TemporaryDirectory()
run_dir = Path(temp_dir.name)

# Create some checkpoint files with different step numbers
(run_dir / "checkpoint_step_100.pt").touch()
(run_dir / "checkpoint_step_250.pt").touch()
(run_dir / "checkpoint_step_50.pt").touch()

ARGS = {
    "run_dir": run_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 PosixPath — a PosixPath output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PosixPath 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_step Ran
ran, honoured the contract we drafted
afiq-aswadi/bft-pmc/analysis/checkpoints.py
code served (permissive licence) · get_code("663bc481a165fa7e")
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.

from pathlib import Path

# The function get_step takes a Path object and extracts the step number
# from the filename stem by splitting on '_' and taking the last part

# Create a Path object with a stem that contains underscores and ends with a number
test_path = Path("checkpoint_epoch_5_step_42")

ARGS = {
    "p": test_path
}
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 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
load_generalising_dataset Ran
ran; our contract draft was wrong, not the code
afiq-aswadi/bft-pmc/balls_and_urns/dataset.py
code served (permissive licence) · get_code("3233fea92e342f67")
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 numpy as np
from pathlib import Path
import tempfile

# Create a temporary .npz file with the required data
temp_dir = tempfile.mkdtemp()
temp_path = Path(temp_dir) / "test_data.npz"

# Create sample data matching what the function expects
generalising_tokens = np.random.randint(0, 100, size=(2, 4), dtype=np.int32)
alpha = np.array(0.5, dtype=np.float32)
vocab_size = np.array(100, dtype=np.int32)
seq_len = np.array(4, dtype=np.int32)
batch_size = np.array(2, dtype=np.int32)

# Save to npz file
np.savez(
    temp_path,
    generalising_tokens=generalising_tokens,
    alpha=alpha,
    vocab_size=vocab_size,
    seq_len=seq_len,
    batch_size=batch_size
)

ARGS = {
    "path": temp_path
}
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 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
load_memorising_dataset Ran
ran; our contract draft was wrong, not the code
afiq-aswadi/bft-pmc/balls_and_urns/dataset.py
code served (permissive licence) · get_code("efd1a51a91e8a951")
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 numpy as np
from pathlib import Path
import tempfile
import os

# Create a temporary directory and a test .npz file
temp_dir = tempfile.mkdtemp()
temp_path = Path(temp_dir) / "test_data.npz"

# Create sample data with the expected keys
memorising_tokens = np.array([[1, 2, 3], [4, 5, 6]], dtype=np.int32)
theta_pool = np.array([[0.1, 0.2], [0.3, 0.4], [0.5, 0.6], [0.7, 0.8]], dtype=np.float32)
num_tasks = np.array(5)

# Save as .npz file
np.savez(
    temp_path,
    memorising_tokens=memorising_tokens,
    theta_pool=theta_pool,
    num_tasks=num_tasks
)

ARGS = {
    'path': temp_path
}
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 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
load_predictive_samples Ran
ran; our contract draft was wrong, not the code
afiq-aswadi/bft-pmc/balls_and_urns/dataset.py
code served (permissive licence) · get_code("093eda4129ab157b")
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 numpy as np
from pathlib import Path
import tempfile

# Create a temporary npz file with all required arrays
temp_dir = tempfile.mkdtemp()
temp_path = Path(temp_dir) / "test_data.npz"

# Create sample data matching what the function expects
np.savez(
    temp_path,
    model_samples=np.random.randn(2, 4, 5).astype(np.float32),
    baseline_generalising=np.random.randn(3, 4).astype(np.float32),
    baseline_memorising=np.random.randn(3, 4).astype(np.float32),
    posterior_dirichlet_alpha=np.random.randn(2, 3).astype(np.float32),
    posterior_pool_weights=np.random.randn(2, 4).astype(np.float32),
    prior_dirichlet_alpha=np.random.randn(3, 2).astype(np.float32),
    theta_pool=np.random.randn(4, 5, 6).astype(np.float32),
    prompt_tokens=np.array([1, 2, 3, 4], dtype=np.int32),
    step=np.array(42),
    prompt_source=np.array("source_test", dtype=str)
)

ARGS = {
    "path": temp_path
}
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 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
precompute_rotary_frequencies Ran
ran, honoured the contract we drafted
afiq-aswadi/bft-pmc/markov/model.py
code served (permissive licence) · get_code("1db55008315130be")
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 tuple, 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

torch.manual_seed(0)

ARGS = {
    "head_dim": 8,
    "max_seq_len": 4,
    "theta": 10000.0,
}
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 tuple, ndim 3, dtype family float — a tuple 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
prepend_bos Ran
ran; our contract draft was wrong, not the code
afiq-aswadi/bft-pmc/balls_and_urns/analysis.py
code served (permissive licence) · get_code("7eadbc1def14d38b")
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 int, shape (2, 5) 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

torch.manual_seed(0)

# Create a 2D tensor of token IDs: batch_size=2, sequence_length=4
tokens = torch.randint(0, 100, (2, 4), dtype=torch.long)

# BOS token ID
bos_token = 1

ARGS = {
    'tokens': tokens,
    'bos_token': bos_token,
}
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 int, shape (2, 5) — shape (2, 5) 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
sliced_wasserstein Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
afiq-aswadi/bft-pmc/metrics.py
code served (permissive licence) · get_code("56df6b610501614d")
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 numpy as np

# Set random seed for reproducibility
np.random.seed(42)

# Create sample matrices with shape [N, D]
# samples_a: 5 samples, 3 dimensions
samples_a = np.random.randn(5, 3).astype(np.float32)

# samples_b: 7 samples, 3 dimensions (same number of dimensions as samples_a)
samples_b = np.random.randn(7, 3).astype(np.float32)

# Number of random projections to average over
n_projections = 50

# Random seed for reproducibility
seed = 42

ARGS = {
    'samples_a': samples_a,
    'samples_b': samples_b,
    'n_projections': n_projections,
    'seed': seed,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — 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
symmetrised_kl Ran
ran; our contract draft was wrong, not the code
afiq-aswadi/bft-pmc/metrics.py
code served (permissive licence) · get_code("4dfa43cb5d75808f")
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

torch.manual_seed(0)

# Create two valid probability distributions
# Shape: (batch_size=2, sequence_length=3, vocab_size=4)
# Each needs to sum to 1 along the last dimension

batch_size = 2
seq_length = 3
vocab_size = 4

# Create random positive values and normalize to sum to 1
p_unnormalized = torch.rand(batch_size, seq_length, vocab_size)
p = p_unnormalized / p_unnormalized.sum(dim=-1, keepdim=True)

q_unnormalized = torch.rand(batch_size, seq_length, vocab_size)
q = q_unnormalized / q_unnormalized.sum(dim=-1, keepdim=True)

ARGS = {
    'p': p,
    'q': q,
    'eps': 1e-10
}
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 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
apply_rotary_embedding Not yet run
unverified (harvested, no recorded run)
afiq-aswadi/bft-pmc/markov/model.py
code served (permissive licence) · get_code("876803eb5c6a33b4")
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, 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 12 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

A Bayes-filtered transformer (BFT) is a transformer trained on sequences that are generated in two steps: first a latent task is drawn from a prior, then observations are drawn conditional on that task. Trained under autoregressive log loss, the BFT's next-token prediction, in the idealized limit, is the Bayesian posterior predictive distribution (PPD) induced by that prior and that conditional law. In practice the trained BFT is only an approximation of this ideal PPD, raising an interpretive question: what prior and posterior over the latent task has the trained BFT actually internalized? Existing work answers this question by comparing the trained BFT's predictions against the predictions of various "reference" posteriors, each standing in for a different candidate algorithm or computation the BFT might be implementing. This prediction-space comparison is fragile: different posteriors can share the same posterior-mean predictions. We use predictive Monte Carlo (PMC) as a general interpretability tool for any BFT: using only next-token generation, PMC returns an approximation to the implicit prior and posterior over the latent task, answering the interpretive question directly in latent space. We apply PMC to three stylized task families spanning 0-Markov and 1-Markov exchangeability. The phenomena previously reported in these settings remain visible in latent space. Code is available at https://github.com/afiq-aswadi/bft-pmc.

For agents

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

get_harvested_code_for_paper("2607.17060")
get_code_for_paper("2607.17060")
have("2607.17060")

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

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

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

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

Connect an agent — have() is free.