SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2503.08918 · ICLR · 2025

Multilevel Generative Samplers for Investigating Critical Phenomena

Germany, Shinichi Nakajima, Bifold, Kim Nicoli, Karl Jansen, Stefan Ühn, Ankur Singha, Elia Cellini

arXiv · PDF · Open in the Atlas

Code that ran

10 of 16 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (7 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 2 failures of our instrument; 6 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/2503.08918.json · badge: /api/ran/2503.08918.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
mlneuralsampler/multilevel canonical (classifier label)
classifier basis: classifier_2025
10 ran · 6 no recorded run
FunctionStatusWhere it lives
EmbeddingC_F Ran
ran on a synthesized input · constructed an object; no result was computed
mlneuralsampler/multilevel/van_code/nn.py
code served (permissive licence) · get_code("c9de1facdf8d3dfb")
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 an instance of its own class, EmbeddingC_F: the run constructed the object and did not call it, so no result was computed. 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)

ARGS = {
    'Lf': 8,
    'channels': 3,
    'device': 'cpu'
}
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 EmbeddingC_F — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a EmbeddingC_F 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
HB_level Ran
ran on a synthesized input · constructed an object; no result was computed
mlneuralsampler/multilevel/van_code/nn.py
code served (permissive licence) · get_code("7613bdb209ef8606")
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 an instance of its own class, HB_level: the run constructed the object and did not call it, so no result was computed. 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)

# Create a mock local_energy function that computes energy for each site
class MockLocalEnergy(nn.Module):
    def __init__(self):
        super().__init__()
    
    def forward(self, x):
        # x shape: (batch, Lf, Lf)
        # Return local energy per site: (batch, Lf, Lf)
        return torch.randn(x.shape)

# Instantiate the mock local energy module
local_energy_fn = MockLocalEnergy()

ARGS = {
    'Lf': 4,
    'beta': 0.5,
    'local_energy': local_energy_fn,
    'device': 'cpu',
    'level': 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 HB_level — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a HB_level 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
MaskedConv2d Ran
ran on a synthesized input · constructed an object; no result was computed
mlneuralsampler/multilevel/van_code/nn.py
code served (permissive licence) · get_code("d81b67e6163414d2")
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 an instance of its own class, MaskedConv2d: the run constructed the object and did not call it, so no result was computed. 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)

# MaskedConv2d inherits from nn.Conv2d
# Required positional args for nn.Conv2d: in_channels, out_channels, kernel_size
# Optional args: stride, padding, dilation, groups, bias, padding_mode, device, dtype
# Required kwarg for MaskedConv2d: exclusive

ARGS = {
    'in_channels': 3,
    'out_channels': 4,
    'kernel_size': 3,
    'stride': 1,
    'padding': 1,
    'dilation': 1,
    'groups': 1,
    'bias': True,
    'padding_mode': 'zeros',
    'exclusive': True,
}
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 MaskedConv2d — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MaskedConv2d 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
MultilevelBlock Ran
ran on a synthesized input · constructed an object; no result was computed
mlneuralsampler/multilevel/van_code/nn.py
code served (permissive licence) · get_code("eb3ef5fae39c1587")
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 an instance of its own class, MultilevelBlock: the run constructed the object and did not call it, so no result was computed. 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)

# Create a minimal embedding module that satisfies the usage in forward/reverse
class MinimalEmbedding(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, sample):
        # Returns (transformed_sample, auxiliary_value)
        return self.linear(sample), torch.tensor(0.0)
    
    def reverse(self, sample):
        # Returns (transformed_sample, auxiliary_value)
        return self.linear(sample), torch.tensor(0.0)

# Create a minimal van_upsampling module that satisfies the usage
class MinimalVanUpsampling(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(3, 5)
    
    def forward(self, sample):
        # Returns (upsampled_sample, dlogq)
        return self.linear(sample), torch.tensor([0.1, 0.2])
    
    def reverse(self, sample):
        # Returns (downsampled_sample, dlogq)
        reverse_linear = nn.Linear(5, 3)
        return reverse_linear(sample), torch.tensor([0.1, 0.2])

embedding = MinimalEmbedding()
van_upsampling = MinimalVanUpsampling()

ARGS = {
    'embedding': embedding,
    'van_upsampling': van_upsampling
}
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 MultilevelBlock — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MultilevelBlock 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
PixelCNN Ran
ran on a synthesized input · constructed an object; no result was computed
mlneuralsampler/multilevel/van_code/nn.py
code served (permissive licence) · get_code("5ce222bcc64a795e")
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 an instance of its own class, PixelCNN: the run constructed the object and did not call it, so no result was computed. 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)

ARGS = {
    'L': 4,
    'net_depth': 3,
    'net_width': 8,
    'half_kernel_size': 1,
    'bias': True,
    'z2': False,
    'res_block': True,
    'x_hat_clip': 0.04,
    'final_conv': True,
    'epsilon': 1e-6,
    'device': 'cpu',
}
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 PixelCNN — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a PixelCNN 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
ResBlock Ran
ran on a synthesized input · constructed an object; no result was computed
mlneuralsampler/multilevel/van_code/nn.py
code served (permissive licence) · get_code("cf4928b4a14beac3")
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 an instance of its own class, ResBlock: the run constructed the object and did not call it, so no result was computed. 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)

# The ResBlock.forward method calls self.block(x), so block must be a callable nn.Module
# that takes a tensor and returns a tensor of the same shape (since it's added to x)

class SimpleBlock(nn.Module):
    def __init__(self):
        super(SimpleBlock, self).__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, x):
        return self.linear(x)

block = SimpleBlock()

ARGS = {
    'block': block
}
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 ResBlock — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ResBlock 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
VANUpsampling Ran
ran on a synthesized input · constructed an object; no result was computed
mlneuralsampler/multilevel/van_code/nn.py
code served (permissive licence) · get_code("309928389973c07d")
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 an instance of its own class, VANUpsampling: the run constructed the object and did not call it, so no result was computed. 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)

class DummyNet(nn.Module):
    """A minimal network that returns (sample, logq) tuple"""
    def __init__(self, input_dim, output_dim):
        super().__init__()
        self.linear = nn.Linear(input_dim, output_dim)
    
    def forward(self, x):
        # Returns (transformed_sample, log_prob)
        sample = self.linear(x)
        logq = torch.sum(sample ** 2, dim=1, keepdim=True)
        return sample, logq
    
    def reverse(self, x):
        # Returns (reverse_transformed_sample, log_prob)
        sample = self.linear(x)
        logq = torch.sum(sample ** 2, dim=1, keepdim=True)
        return sample, logq

# Create two networks with different dimensions
net_i = DummyNet(input_dim=4, output_dim=3)
net_f = DummyNet(input_dim=3, output_dim=5)

ARGS = {
    'net_i': net_i,
    'net_f': net_f,
}
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 VANUpsampling — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a VANUpsampling 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
compute_metrics Ran
ran; our contract draft was wrong, not the code
mlneuralsampler/multilevel/van_code/nn.py
code served (permissive licence) · get_code("c58bd2dcaff29593")
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 2, 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)

# w is used with:
# - w.shape[-1] to get the last dimension
# - torch.logsumexp(-w, -1) which operates on the last dimension
# - torch.logsumexp(-2 * w, -1) which operates on the last dimension
# So w should be a multi-dimensional tensor with a meaningful last dimension

# Create a small tensor with shape (2, 4)
# where batch size is 2 and the last dimension (N) is 4
w = torch.randn(2, 4)

ARGS = {
    "w": w
}
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 2, 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
grab Ran
ran, honoured the contract we drafted
mlneuralsampler/multilevel/van_code/nn.py
code served (permissive licence) · get_code("a0c6ec7446882eb7")
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 ndarray, ndim 2, dtype family float, shape (2, 4) 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)

# Test case 1: tensor input
tensor_var = torch.randn(2, 4)

# Test case 2: non-tensor input (numpy array)
numpy_var = np.array([1, 2, 3, 4])

# Test case 3: non-tensor input (list)
list_var = [1, 2, 3]

# Test case 4: non-tensor input (dict)
dict_var = {"key": "value"}

# The function takes a single parameter 'var'
# We'll test with a tensor since that's the main logic path
ARGS = {
    "var": tensor_var
}
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 ndarray, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
make_checker_mask Ran
ran; our contract draft was wrong, not the code
mlneuralsampler/multilevel/van_code/nn.py
code served (permissive licence) · get_code("e18e546fda12e839")
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 (4, 3) 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)

ARGS = {
    "shape": (4, 3),
    "parity": 1
}
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 (4, 3) — shape (4, 3) 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
Multilevel Not yet run
unverified (harvested, no recorded run)
mlneuralsampler/multilevel/van_code/nn.py
code served (permissive licence) · get_code("8dab55722dae1b3d")
How it ran

no invocation recorded.

NeuralVANMultilevel Not yet run
unverified (harvested, no recorded run)
mlneuralsampler/multilevel/van_code/nn.py
code served (permissive licence) · get_code("3b8f2d179f76c02e")
How it ran

no invocation recorded.

VAN_CNN Not yet run
unverified (harvested, no recorded run)
mlneuralsampler/multilevel/van_code/nn.py
code served (permissive licence) · get_code("0dc52519ea492528")
How it ran

no invocation recorded.

make_conv_net Not yet run
unverified (harvested, no recorded run)
mlneuralsampler/multilevel/van_code/nn.py
code served (permissive licence) · get_code("fac4692f10805d63")
How it ran

no invocation recorded.

print_metrics Not yet run
unverified (harvested, no recorded run)
mlneuralsampler/multilevel/van_code/nn.py
code served (permissive licence) · get_code("1e2601d2d0b3fda4")
How it ran

no invocation recorded.

save Not yet run
unverified (harvested, no recorded run)
mlneuralsampler/multilevel/van_code/nn.py
code served (permissive licence) · get_code("eaac88066f686727")
How it ran

no invocation recorded.

Also present in other papers' code

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

Investigating critical phenomena or phase transitions is of high interest in physics and chemistry, for which Monte Carlo (MC) simulations, a crucial tool for numerically analyzing macroscopic properties of given systems, are often hindered by an emerging divergence of correlation length-known as scale invariance at criticality (SIC) in the renormalization group theory. SIC causes the system to behave the same at any length scale, from which many existing sampling methods suffer: long-range correlations cause critical slowing down in Markov chain Monte Carlo (MCMC), and require intractably large receptive fields for generative samplers. In this paper, we propose a Renormalization-informed Generative Critical Sampler (RiGCS)-a novel sampler specialized for near-critical systems, where SIC is leveraged as an advantage rather than a nuisance. Specifically, RiGCS builds on MultiLevel Monte Carlo (MLMC) with Heat Bath (HB) algorithms, which perform ancestral sampling from low-resolution to high-resolution lattice configurations with site-wise-independent conditional HB sampling. Although MLMC-HB is highly efficient under exact SIC, it suffers from a low acceptance rate under slight SIC violation. Notably, SIC violation always occurs in finite-size systems, and may induce long-range and higher-order interactions in the renormalized distributions, which are not considered by independent HB samplers. RiGCS enhances MLMC-HB by replacing a part of the conditional HB sampler with generative models that capture those residual interactions and improve the sampling efficiency. Our experiments show that the effective sample size of RiGCS is a few orders of magnitude higher than state-of-the-art generative model baselines in sampling configurations for 128 × 128 two-dimensional Ising systems. SIC also allows us to adopt a specialized sequential training protocol with model transfer, which significantly accelerates training.

For agents

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

get_harvested_code_for_paper("2503.08918")
get_code_for_paper("2503.08918")
have("2503.08918")

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

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

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

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

Connect an agent — have() is free.