SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2209.12753 · ICML · 2023

On Investigating the Conservative Property of Score-Based Generative Models

Wei-Fang Sun, Chun-Yi Lee, Chen-Hao Chao, Bo-Wun Cheng

arXiv · PDF · Open in the Atlas

Code that ran

10 of 10 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; 0 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 5 failures of our instrument; 0 no recorded run), measured 2026-11-22; 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/2209.12753.json · badge: /api/ran/2209.12753.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
chen-hao-chao/qcsbm canonical (classifier label)
classifier basis not recorded on the link
10 ran · 0 no recorded run
FunctionStatusWhere it lives
from_flattened_numpy Ran
ran; our contract draft was wrong, not the code
chen-hao-chao/qcsbm/2d_examples/likelihood.py
code served (permissive licence) · get_code("079c57a39a6c5cba")
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
import numpy as np

torch.manual_seed(0)

# The function takes a flattened numpy array and reshapes it to a target shape,
# then converts it to a torch tensor.
# We need:
# - x: a flattened numpy array
# - shape: a tuple representing the target shape

# Create a small flattened numpy array
flattened_array = np.arange(24, dtype=np.float32)  # 24 elements

# Define target shape - using distinct dimensions (2, 3, 4)
target_shape = (2, 3, 4)

ARGS = {
    "x": flattened_array,
    "shape": target_shape,
}
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 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
get_div_fn Ran
ran; our contract draft was wrong, not the code
chen-hao-chao/qcsbm/2d_examples/likelihood.py
code served (permissive licence) · get_code("fc7647832d475a31")
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 function. 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 simple neural network function that takes (x, t) and returns a tensor
class SimpleNet(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x, t):
        # x shape: (batch, 4)
        # t shape: (batch,) or scalar
        # return shape: (batch, 3)
        return self.linear(x)

# Instantiate the network
net = SimpleNet()

# Create a callable function that wraps the network
def fn(x, t):
    return net(x, t)

# Create test inputs
x = torch.randn(2, 4, requires_grad=False)  # batch_size=2, input_dim=4
t = torch.randn(2)  # batch_size=2

# eps tensor for multiplication (should match output shape of fn)
eps = torch.randn(2, 3)  # batch_size=2, output_dim=3

ARGS = {
    "fn": fn
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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_ode_sampler Ran
ran on a synthesized input
chen-hao-chao/qcsbm/2d_examples/sampling_fn.py
code served (permissive licence) · get_code("40193c964ac8904e")
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 function. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
import numpy as np
from abc import ABC, abstractmethod

torch.manual_seed(0)

# Define a minimal SDE class that satisfies the interface
class MockSDE(ABC):
    def __init__(self):
        self.T = 1.0
    
    def prior_sampling(self, shape):
        return torch.randn(shape)
    
    def reverse(self, score_fn, probability_flow=False):
        return self
    
    def discretize(self, x, t):
        f = torch.zeros_like(x)
        G = torch.ones(x.shape[0])
        return f, G
    
    def sde(self, x, t):
        # Returns (drift, diffusion)
        drift = torch.zeros_like(x)
        diffusion = torch.ones(x.shape[0])
        return drift, diffusion

# Define a minimal score model
class MockScoreModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, x, t):
        return self.linear(x)

# Create instances
sde = MockSDE()
score_model = MockScoreModel()

# Define arguments for get_ode_sampler
ARGS = {
    'sde': sde,
    'shape': (2, 4),  # batch_size=2, feature_dim=4
    'rtol': 1e-05,
    'atol': 1e-05,
    'method': 'RK45',
    'eps': 0.001,
    'device': 'cpu',
    'is_score_model': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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_optimizer Ran
ran; our contract draft was wrong, not the code
chen-hao-chao/qcsbm/real_world/losses.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from hfmei/idc, is pointer only (licence: NONE) · get_code("8ff7c24dade9904c")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from hfmei/idc, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_step_fn Ran
ran on a synthesized input
chen-hao-chao/qcsbm/2d_examples/losses.py
code served (permissive licence) · get_code("22392e9874fb3431")
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 function. 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 accepts (perturbed_batch, t) and returns scores
class ScoreModel(nn.Module):
    def __init__(self, input_dim=4, output_dim=2):
        super().__init__()
        self.linear = nn.Linear(input_dim, output_dim)
    
    def forward(self, x, t):
        # x shape: (batch_size, input_dim)
        # t shape: (batch_size,)
        # Return shape: (batch_size, output_dim)
        return self.linear(x)

# Create a minimal optimizer
score_model = ScoreModel(input_dim=4, output_dim=2)
optimizer = torch.optim.Adam(score_model.parameters(), lr=0.001)

# Create a small batch tensor (batch_size=2, feature_dim=4)
batch = torch.randn(2, 4, dtype=torch.double)

ARGS = {
    'reg_type': 'none',
    'std_value_max': 0.5,
    'std_value_min': 0.5,
    'balancing_fac': 0.1,
    'slices': 1,
    'dtype': torch.double
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
optimization_manager Ran
ran; our contract draft was wrong, not the code
chen-hao-chao/qcsbm/real_world/losses.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from hfmei/idc, is pointer only (licence: NONE) · get_code("366bb8c7035a2fc8")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from hfmei/idc, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

scan Ran
ran on a synthesized input
chen-hao-chao/qcsbm/2d_examples/sde_lib.py
code served (permissive licence) · get_code("f3f215c2361c2958")
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

torch.manual_seed(0)

# Define a simple function f that takes (carry, x) and returns (new_carry, y)
def f(carry, x):
    # carry: tensor of shape (4,)
    # x: tensor of shape (3,)
    # returns: (new_carry, y) where both are tensors
    new_carry = carry + x.sum()  # scalar added to carry
    y = torch.cat([carry, x])     # concatenate for output
    return new_carry, y

# Initialize carry as a small tensor
init = torch.zeros(4)

# Create a list of input tensors (xs)
xs = [
    torch.randn(3),
    torch.randn(3),
]

ARGS = {
    'f': f,
    'init': init,
    'xs': xs,
}
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
to_flattened_numpy Ran
ran; our contract draft was wrong, not the code
chen-hao-chao/qcsbm/2d_examples/likelihood.py
code served (permissive licence) · get_code("4c6099d480772401")
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 1, dtype family float, shape (8,) 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)

# The function takes a tensor x, calls detach(), cpu(), numpy(), and reshape()
# We need a torch tensor on CPU
x = torch.randn(2, 4)

ARGS = {
    "x": x
}
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 1, dtype family float, shape (8,) — shape (8,) 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
to_sliced_tensor Ran
ran on a synthesized input
chen-hao-chao/qcsbm/2d_examples/losses.py
code served (permissive licence) · get_code("0d480a5e5f4ef7a9")
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 (6, 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)

# The function takes:
# - batch: a tensor that will be unsqueezed and expanded
# - slices: an integer indicating how many times to expand

# Looking at the function body:
# batch.unsqueeze(0) adds a dimension at position 0
# .expand(slices, *batch.shape) expands along that new dimension
# So batch should be a 2D tensor (or higher), and slices should be an int

# Create a small 2D batch tensor
batch = torch.randn(2, 4)  # shape (2, 4)

# Create slices parameter
slices = 3

ARGS = {
    "batch": batch,
    "slices": slices
}
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 (6, 4) — shape (6, 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
to_sliced_vector Ran
ran on a synthesized input
chen-hao-chao/qcsbm/2d_examples/losses.py
code served (permissive licence) · get_code("94885b5b78ee8716")
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 1, dtype family float, shape (24,) 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)

# Analyze the function:
# - batch: needs .unsqueeze(0), .expand(), .shape, .contiguous(), .view()
#   These are all torch.Tensor methods
# - slices: used as an integer for expand() and view()

batch = torch.randn(2, 4)
slices = 3

ARGS = {
    "batch": batch,
    "slices": slices,
}
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 1, dtype family float, shape (24,) — shape (24,) 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

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, 5 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 5 later) and 5 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
optimization_manager 16 other papers
4 dated earlier, 12 later
2106.05527 (2021-06)
Soft Truncation: A Universal Training Technique of Score-based Diffusion Model for High Precision Score Estimation
2110.05243 (2021-10)
Score-based diffusion models for accelerated MRI
2205.01490 (2022-05)
Subspace Diffusion Generative Models
and 13 more not named here
get_optimizer 15 other papers
2 dated earlier, 13 later
2110.05243 (2021-10)
Score-based diffusion models for accelerated MRI
2205.01490 (2022-05)
Subspace Diffusion Generative Models
2210.04296 (2022-10)
FP-Diffusion: Improving Score-based Diffusion Models by Enforcing the Underlying Score Fokker-Planck Equation
and 12 more not named here
get_div_fn 11 other papers
3 dated earlier, 8 later
2106.05527 (2021-06)
Soft Truncation: A Universal Training Technique of Score-based Diffusion Model for High Precision Score Estimation
2205.01490 (2022-05)
Subspace Diffusion Generative Models
2205.13699 (2022-05)
Maximum Likelihood Training of Implicit Nonlinear Diffusion Models
and 8 more not named here
to_flattened_numpy 5 other papers
5 later · 1 only as an assembly brick
2212.01747 (2022-12)
Fast Point Cloud Generation with Straight Flows
2401.02032 (2024-01)
DiffusionEdge: Diffusion Probabilistic Model for Crisp Edge Detection
2405.17673 (2024-05)
Fast Samplers for Inverse Problems in Iterative Refinement Models
and 2 more not named here
from_flattened_numpy 4 other papers
4 later · 1 only as an assembly brick
2212.01747 (2022-12)
Fast Point Cloud Generation with Straight Flows
2405.17673 (2024-05)
Fast Samplers for Inverse Problems in Iterative Refinement Models
2410.00983 (2024-10)
Robust Guided Diffusion for Offline Black-Box Optimization
and 1 more not named here

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

Existing Score-Based Models (SBMs) can be categorized into constrained SBMs (CSBMs) or unconstrained SBMs (USBMs) according to their parameterization approaches. CSBMs model probability density functions as Boltzmann distributions, and assign their predictions as the negative gradients of some scalar-valued energy functions. On the other hand, USBMs employ flexible architectures capable of directly estimating scores without the need to explicitly model energy functions. In this paper, we demonstrate that the architectural constraints of CSBMs may limit their modeling ability. In addition, we show that US-BMs' inability to preserve the property of conservativeness may lead to degraded performance in practice. To address the above issues, we propose Quasi-Conservative Score-Based Models (QCS-BMs) for keeping the advantages of both CSBMs and USBMs. Our theoretical derivations demonstrate that the training objective of QCSBMs can be efficiently integrated into the training processes by leveraging the Hutchinson's trace estimator. In addition, our experimental results on the CIFAR-10, CIFAR-100, ImageNet, and SVHN datasets validate the effectiveness of QCSBMs. Finally, we justify the advantage of QCSBMs using an example of a one-layered autoencoder.

For agents

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

get_harvested_code_for_paper("2209.12753")
get_code_for_paper("2209.12753")
have("2209.12753")

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

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

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

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

Connect an agent — have() is free.