SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2105.05650 · 2021

Unbiased Monte Carlo Cluster Updates with Autoregressive Neural Networks

arXiv · PDF · Open in the Atlas

Code that ran

6 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; 3 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 3 failures of our instrument; 1 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/2105.05650.json · badge: /api/ran/2105.05650.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
wdphy16/neural-cluster-update canonical (classifier label)
classifier basis: census
6 ran · 1 no recorded run
FunctionStatusWhere it lives
MaskedConv2d Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
wdphy16/neural-cluster-update/net.py
code served (permissive licence) · get_code("24a001e0b6b5fa2b")
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 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 jax
import jax.numpy as jnp
from jax import random as jrand

ARGS = {
    'out_chan': 8,
    'filter_shape': (3, 3),
    'dilation': (1, 1),
    'exclusive': True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, 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
expect_bwd Ran
ran; our contract draft was wrong, not the code
wdphy16/neural-cluster-update/expect.py
code served (permissive licence) · get_code("265f428eead62f98")
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 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 jax
import jax.numpy as jnp
from functools import partial

# Define small stand-in functions for log_prob_fun and expected_fun
def log_prob_fun(params, log_prob_args):
    """Mock log probability function that returns a batch of log probs"""
    # params is a dict with 'w' key, log_prob_args contains data
    # Returns shape (batch_size,)
    batch_size = log_prob_args['x'].shape[0]
    w = params['w']
    x = log_prob_args['x']
    # Simple mock: sum of params * input
    return jnp.sum(w * x, axis=1)

def expected_fun(params, expected_args):
    """Mock expected value function"""
    # Returns a scalar
    w = params['w']
    z = expected_args['z']
    return jnp.sum(w * z)

# Create small parameter dict
params = {
    'w': jnp.array([0.1, 0.2, 0.3, 0.4])
}

# Create log_prob_args with batch of data
log_prob_args = {
    'x': jnp.array([[1.0, 2.0, 3.0, 4.0],
                     [5.0, 6.0, 7.0, 8.0]])  # batch_size=2, dim=4
}

# Create expected_args
expected_args = {
    'z': jnp.array([0.5, 0.5, 0.5, 0.5])
}

# Create weight vector (batch_size=2)
weight = jnp.array([0.6, 0.4])

# Construct res tuple as used in the function
res = (params, log_prob_args, expected_args, weight)

# Create gradient vector g
g = jnp.array(1.0)

# Test both cases: mean_grad_expected_is_zero True and False
mean_grad_expected_is_zero_true = True
mean_grad_expected_is_zero_false = False

ARGS = {
    'log_prob_fun': log_prob_fun,
    'expected_fun': expected_fun,
    'mean_grad_expected_is_zero': mean_grad_expected_is_zero_false,
    'res': res,
    'g': g
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, 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
expect_fwd Ran
ran; our contract draft was wrong, not the code
wdphy16/neural-cluster-update/expect.py
code served (permissive licence) · get_code("1a09472bd1a15643")
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. 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 torch.nn as nn

torch.manual_seed(0)

# Define a simple log probability function
def log_prob_fun(params, log_prob_args):
    """Compute log probability"""
    x = log_prob_args['x']
    return torch.sum(x * params['w'], dim=1, keepdim=True)

# Define a simple expected value function
def expected_fun(params, expected_args):
    """Compute expected values"""
    z = expected_args['z']
    # Return shape (batch_size, feature_dim)
    return z * params['scale']

# Create small parameter dict
params = {
    'w': torch.randn(4),
    'scale': torch.ones(3)
}

# Create log_prob_args
log_prob_args = {
    'x': torch.randn(2, 4)
}

# Create expected_args
expected_args = {
    'z': torch.randn(2, 3)
}

# mean_grad_expected_is_zero is a boolean flag
mean_grad_expected_is_zero = True

ARGS = {
    'log_prob_fun': log_prob_fun,
    'expected_fun': expected_fun,
    'params': params,
    'log_prob_args': log_prob_args,
    'expected_args': expected_args,
    'mean_grad_expected_is_zero': mean_grad_expected_is_zero
}
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 — a tuple 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_ckpt_name Ran
ran, honoured the contract we drafted
wdphy16/neural-cluster-update/utils.py
code served (permissive licence) · get_code("beb69ab9184116cf")
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 os

def parse_ckpt_name(filename):
    filename = os.path.basename(filename)
    filename = filename.replace('.pickle', '')
    step = int(filename)
    return step

ARGS = {
    'filename': '/path/to/12345.pickle'
}
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
prev_index_2d Ran
ran, honoured the contract we drafted
wdphy16/neural-cluster-update/net.py
code served (permissive licence) · get_code("41b4e4f2e415cc8e")
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 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

torch.manual_seed(0)

# Analyze the function:
# prev_index_2d(i, j, L) takes three parameters:
# - i: an integer (row index)
# - j: an integer (column index)
# - L: an integer (number of columns/width of 2D grid)
# The function converts 2D indices to a linear index, decrements it, 
# then converts back to 2D indices.

# Valid test case: a 3x4 grid (3 rows, 4 columns)
# Use i=1, j=2, L=4
# This should work: v = 1*4 + 2 - 1 = 5
# Then i = 5 // 4 = 1, j = 5 % 4 = 1
# Result: (1, 1)

ARGS = {
    "i": 1,
    "j": 2,
    "L": 4
}
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 1, dtype family int — 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
welford_update Ran
ran, honoured the contract we drafted
wdphy16/neural-cluster-update/sample_raw.py
code served (permissive licence) · get_code("d243b64694b10075")
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 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)

# Welford's algorithm for online mean and variance computation
# The function takes:
# - curr: current value (scalar or tensor)
# - step: current step number (integer)
# - mean: running mean (scalar or tensor)
# - var_sum: running sum of squared differences (scalar or tensor)

# Create small tensor arguments
curr = torch.tensor(5.2)
step = 3
mean = torch.tensor(4.8)
var_sum = torch.tensor(0.45)

ARGS = {
    "curr": curr,
    "step": step,
    "mean": mean,
    "var_sum": var_sum
}
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 tuple, ndim 1, 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
expect Not yet run
unverified (harvested, no recorded run)
wdphy16/neural-cluster-update/expect.py
code served (permissive licence) · get_code("f3159a740a151f69")
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-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

Efficient sampling of complex high-dimensional probability distributions is a central task in computational science. Machine learning methods like autoregressive neural networks, used with Markov chain Monte Carlo sampling, provide good approximations to such distributions, but suffer from either intrinsic bias or high variance. In this Letter, we propose a way to make this approximation unbiased and with low variance. Our method uses physical symmetries and variable-size cluster updates which utilize the structure of autoregressive factorization. We test our method for first- and second-order phase transitions of classical spin systems, showing its viability for critical systems and in the presence of metastable states.

For agents

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

get_harvested_code_for_paper("2105.05650")
get_code_for_paper("2105.05650")
have("2105.05650")

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

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

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

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

Connect an agent — have() is free.