SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.06121 · ICML · 2024

Iterated Denoising Energy Matching for Sampling from Boltzmann Densities

Yoshua Bengio, Alexander Tong, Sarthak Mittal, Joey Avishek, Bose, Gauthier Gidel, Cheng-Hao Liu, Siamak Ravanbakhsh, Nikolay Malkin, Jarrid Rector-Brooks, Pablo Lemos, Tara Akhound-Sadegh, and 1 more

arXiv · PDF · Open in the Atlas

Code that ran

8 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (3 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 5 failures of our instrument; 2 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/2402.06121.json · badge: /api/ran/2402.06121.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
jarridrb/dem canonical (classifier label)
classifier basis: classifier_2025
8 ran · 2 no recorded run
FunctionStatusWhere it lives
AISData Ran
ran on a synthesized input · constructed an object; no result was computed
jarridrb/dem/dem/models/components/sde_integration.py
code served (permissive licence) · get_code("05630fa764ede53f")
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, AISData: 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

torch.manual_seed(0)

ARGS = {
    "x": torch.randn(2, 4),
    "log_w": torch.randn(2),
    "add_count": torch.tensor([1, 2]),
}
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 AISData — the run constructed an instance of its own class and did not call it; no shape 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
ReplayBuffer Ran
ran on a synthesized input · constructed an object; no result was computed
jarridrb/dem/dem/models/components/sde_integration.py
code served (permissive licence) · get_code("c0238358b3127562")
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, ReplayBuffer: 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

torch.manual_seed(0)

def initial_sampler():
    """Create a simple sampler that returns x and log_w tensors."""
    x = torch.randn(2, 4)  # batch_size=2, dim=4
    log_w = torch.randn(2)
    return x, log_w

ARGS = {
    'dim': 4,
    'max_length': 16,
    'min_sample_length': 8,
    'initial_sampler': initial_sampler,
    'device': 'cpu',
    'temperature': 1.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 ReplayBuffer — 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 ReplayBuffer 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
VEReverseSDE Ran
ran on a synthesized input · constructed an object; no result was computed
jarridrb/dem/dem/models/components/sde_integration.py
code served (permissive licence) · get_code("1e856fe0d2ba8386")
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, VEReverseSDE: 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 score model that takes (t, x) and returns scores
class ScoreModel(nn.Module):
    def __init__(self, x_dim):
        super().__init__()
        self.linear = nn.Linear(x_dim, x_dim)
    
    def forward(self, t, x):
        # t: scalar or batch of scalars
        # x: (batch_size, x_dim)
        return self.linear(x)

# Create a minimal noise schedule that has a g method
class NoiseSchedule:
    def g(self, t):
        # t can be scalar or tensor
        # return a scalar or batch of scalars
        if isinstance(t, torch.Tensor):
            if t.dim() == 0:
                return torch.tensor(0.5)
            else:
                return torch.full_like(t, 0.5)
        return 0.5

# Build instances
x_dim = 4
score_model = ScoreModel(x_dim)
noise_schedule = NoiseSchedule()

ARGS = {
    'score': score_model,
    'noise_schedule': noise_schedule
}
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 VEReverseSDE — 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 VEReverseSDE 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
conditional_no_grad Ran
ran; our contract draft was wrong, not the code
jarridrb/dem/dem/models/components/sde_integration.py
code served (permissive licence) · get_code("7a316acfbe0e868f")
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 _GeneratorContextManager. 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)

ARGS = {
    "condition": 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 _GeneratorContextManager — a _GeneratorContextManager output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a _GeneratorContextManager 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
euler_maruyama_step Ran
ran; our contract draft was wrong, not the code
jarridrb/dem/dem/models/components/sde_integration.py
code served (permissive licence) · get_code("e57978157ea21e5c")
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
import numpy as np


class SimpleNoiseSchedule(torch.nn.Module):
    def __init__(self):
        super().__init__()
    
    def g(self, t):
        # Return a scalar noise schedule value
        if isinstance(t, torch.Tensor):
            return torch.ones_like(t) * 0.1
        return 0.1


class SimpleScore(torch.nn.Module):
    def __init__(self):
        super().__init__()
    
    def forward(self, t, x):
        # Return score with same shape as x
        return torch.randn_like(x) * 0.01


class VEReverseSDE(torch.nn.Module):
    noise_type = 'diagonal'
    sde_type = 'ito'

    def __init__(self, score, noise_schedule):
        super().__init__()
        self.score = score
        self.noise_schedule = noise_schedule

    def f(self, t, x):
        if t.dim() == 0:
            t = t * torch.ones(x.shape[0]).to(x.device)
        score = self.score(t, x)
        return self.g(t, x).pow(2) * score

    def g(self, t, x):
        g = self.noise_schedule.g(t)
        return g.unsqueeze(1) if g.ndim > 0 else torch.full_like(x, g)


torch.manual_seed(0)

score_model = SimpleScore()
noise_schedule = SimpleNoiseSchedule()
sde = VEReverseSDE(score_model, noise_schedule)

t = torch.tensor(0.5)
x = torch.randn(2, 4)
dt = 0.01
diffusion_scale = 1.0

ARGS = {
    'sde': sde,
    't': t,
    'x': x,
    'dt': dt,
    'diffusion_scale': diffusion_scale
}
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 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
grad_E Ran
ran; our contract draft was wrong, not the code
jarridrb/dem/dem/models/components/sde_integration.py
code served (permissive licence) · get_code("a014cc7f7a0f7646")
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 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 torch.nn as nn

torch.manual_seed(0)

# Define a simple energy function as an nn.Module
class EnergyFunction(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 1)
    
    def forward(self, x):
        return self.linear(x).sum(dim=-1, keepdim=True)

# Create instances
x = torch.randn(2, 4, requires_grad=False)
energy_function = EnergyFunction()

ARGS = {
    "x": x,
    "energy_function": energy_function
}
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 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
negative_time_descent Ran
ran; our contract draft was wrong, not the code
jarridrb/dem/dem/models/components/sde_integration.py
code served (permissive licence) · get_code("2aff702e8d21bee4")
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 3, dtype family float, shape (3, 2, 6) 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 torch.nn as nn

torch.manual_seed(0)

# Create a simple energy function that satisfies the interface
class SimpleEnergyFunction(nn.Module):
    def __init__(self, n_particles=2, n_spatial_dim=3):
        super().__init__()
        self.n_particles = n_particles
        self.n_spatial_dim = n_spatial_dim
        self.is_molecule = True
        self.linear = nn.Linear(n_particles * n_spatial_dim, 1)
    
    def forward(self, x):
        # x shape: (batch, n_particles * n_spatial_dim)
        batch_size = x.shape[0]
        x_flat = x.view(batch_size, -1)
        energy = self.linear(x_flat)
        return energy.squeeze(-1)

# Create a simple clipper that has the clip_scores method
class SimpleClipper:
    def clip_scores(self, scores):
        return torch.clamp(scores, -0.1, 0.1)

# Initialize components
n_particles = 2
n_spatial_dim = 3
batch_size = 2

energy_function = SimpleEnergyFunction(n_particles=n_particles, n_spatial_dim=n_spatial_dim)

# Initial positions: (batch_size, n_particles * n_spatial_dim)
x = torch.randn(batch_size, n_particles * n_spatial_dim)

num_steps = 3
dt = 0.0001
clipper = SimpleClipper()

ARGS = {
    "x": x,
    "energy_function": energy_function,
    "num_steps": num_steps,
    "dt": dt,
    "clipper": clipper
}
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 3, dtype family float, shape (3, 2, 6) — shape (3, 2, 6) 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
remove_mean Ran
ran; our contract draft was wrong, not the code
jarridrb/dem/dem/models/components/sde_integration.py
code served (permissive licence) · get_code("e63616b709d7b674")
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 3, dtype family float, shape (2, 3, 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

torch.manual_seed(0)

n_particles = 3
n_dimensions = 4
batch_size = 2

# Create a tensor with shape (batch_size, n_particles, n_dimensions)
# This matches the expected input shape for the function
samples = torch.randn(batch_size, n_particles, n_dimensions)

ARGS = {
    "samples": samples,
    "n_particles": n_particles,
    "n_dimensions": n_dimensions,
}
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 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 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
BaseEnergyFunction Not yet run
unverified (harvested, no recorded run)
jarridrb/dem/dem/models/components/sde_integration.py
code served (permissive licence) · get_code("4417fed9baa3ae47")
How it ran

no invocation recorded.

integrate_sde Not yet run
unverified (harvested, no recorded run)
jarridrb/dem/dem/models/components/sde_integration.py
code served (permissive licence) · get_code("4ef35e9b375c671f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 2 later) and 8 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
remove_mean
brick of this paper's assembly: helper
2 other papers
2 later · 1 only as an assembly brick
2410.12456 (2024-10)
Training Neural Samplers with Reverse Diffusive KL Divergence
2504.11516 (2025-04)
FEAT: Free energy Estimators with Adaptive Transport
conditional_no_grad
brick of this paper's assembly: helper
1 other paper
1 later
2503.15676 (2025-03)
High Temporal Consistency through Semantic Similarity Propagation in Semi-Supervised Video Semantic Segmentation for Autonomous Flight

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

Efficiently generating statistically independent samples from an unnormalized probability distribution, such as equilibrium samples of many-body systems, is a foundational problem in science. In this paper, we propose ITERATED DENOISING ENERGY MATCHING (iDEM), an iterative algorithm that uses a novel stochastic score matching objective leveraging solely the energy function and its gradient-and no data samples-to train a diffusion-based sampler. Specifically, iDEM alternates between (I) sampling regions of high model density from a diffusion-based sampler and (II) using these samples in our stochastic matching objective to further improve the sampler. iDEM is scalable to high dimensions as the inner matching objective, is simulation-free, and requires no MCMC samples. Moreover, by leveraging the fast mode mixing behavior of diffusion, iDEM smooths out the energy landscape enabling efficient exploration and learning of an amortized sampler. We evaluate iDEM on a suite of tasks ranging from standard synthetic energy functions to invariant n-body particle systems. We show that the proposed approach achieves state-of-the-art performance on all metrics and trains 2 -5× faster, which allows it to be the first method to train using energy on the challenging 55-particle Lennard-Jones system.

For agents

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

get_harvested_code_for_paper("2402.06121")
get_code_for_paper("2402.06121")
have("2402.06121")

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

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

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

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

Connect an agent — have() is free.