SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2607.10067 · 2026

Conservation Laws for Diffusion Models

Henry Pfister, Ziv Aharoni

arXiv · PDF

Code that ran

4 of 8 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 1 has no contract verdict; 3 failures of our instrument; 4 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/2607.10067.json · badge: /api/ran/2607.10067.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
zivaharoni/conservation-laws-diffusion-models community
Papers with Code archive
4 ran · 4 no recorded run
FunctionStatusWhere it lives
apply_sequence_masking Ran
ran; our contract draft was wrong, not the code
zivaharoni/conservation-laws-diffusion-models/src/exit.py
code served (permissive licence) · get_code("c09928d3619a5332")
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) 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)

# Create small token tensor [batch_size=2, seq_len=4]
tokens = torch.tensor([
    [101, 102, 103, 104],
    [105, 106, 107, 108]
], dtype=torch.long)

# Create s_per_sequence as a tensor [batch_size=2]
s_per_sequence = torch.tensor([0.5, 0.3], dtype=torch.float32)

# mask_token_id
mask_token_id = 0

# generator (optional, set to None for this example)
generator = None

ARGS = {
    "tokens": tokens,
    "s_per_sequence": s_per_sequence,
    "mask_token_id": mask_token_id,
    "generator": generator,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
finalize_exit_metric_accumulator Ran
ran; our contract draft was wrong, not the code
zivaharoni/conservation-laws-diffusion-models/src/exit.py
code served (permissive licence) · get_code("139279a78f1448bb")
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) 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 torch

torch.manual_seed(0)

# Construct a valid accumulator dict with all required keys
accumulator = {
    'masked_token_count': 100,
    'unmasked_token_count': 50,
    'total_token_count': 150,
    'sequence_count': 10,
    'masked_loss_sum': 250.0,
    'unmasked_loss_sum': 75.0,
    'total_loss_sum': 325.0,
    's_sum': 45.5,
    'forced_mask_sequences': 3,
}

ARGS = {
    'accumulator': accumulator,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — 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
init_exit_metric_accumulator Ran
ran on a synthesized input
zivaharoni/conservation-laws-diffusion-models/src/exit.py
code served (permissive licence) · get_code("2367846ea36d2f1c")
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) 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 torch
import torch.nn as nn

torch.manual_seed(0)

# This function takes no parameters, so ARGS should be an empty dict
ARGS = {}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — 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
per_token_nll Ran
ran; our contract draft was wrong, not the code
zivaharoni/conservation-laws-diffusion-models/src/exit.py
code served (permissive licence) · get_code("88b123f917d9db26")
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) and returned Tensor, ndim 2, dtype family float, shape (2, 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
import torch.nn.functional as F

torch.manual_seed(0)

# Create small tensors for testing
batch_size = 2
seq_length = 3
vocab_size = 4

# logits: [B, S, K] where B=batch, S=sequence, K=vocab
logits = torch.randn(batch_size, seq_length, vocab_size)

# targets: [B, S] with values in range [0, vocab_size)
targets = torch.randint(0, vocab_size, (batch_size, seq_length))

ARGS = {
    'logits': logits,
    'targets': targets,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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, 3) — shape (2, 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
evaluate_model_exit Not yet run
unverified (harvested, no recorded run)
zivaharoni/conservation-laws-diffusion-models/src/exit.py
code served (permissive licence) · get_code("c62b62cf1fb934f9")
How it ran

no invocation recorded.

evaluate_model_exit_curve Not yet run
unverified (harvested, no recorded run)
zivaharoni/conservation-laws-diffusion-models/src/exit.py
code served (permissive licence) · get_code("fc21728dc3da4734")
How it ran

no invocation recorded.

sample_uniform_mask_rates Not yet run
unverified (harvested, no recorded run)
zivaharoni/conservation-laws-diffusion-models/src/exit.py
code served (permissive licence) · get_code("394abc4dbbb20859")
How it ran

no invocation recorded.

update_exit_metric_accumulator Not yet run
unverified (harvested, no recorded run)
zivaharoni/conservation-laws-diffusion-models/src/exit.py
code served (permissive licence) · get_code("1398fb29e4022641")
How it ran

no invocation recorded.

Also present in other papers' code

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

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

While autoregressive models optimize the exact data likelihood via the chain rule, diffusion models are typically trained with denoising objectives. We develop conservation laws based on generalized extrinsic information transfer (GEXIT) functions for a broad class of memoryless noise processes, showing that the data-model cross-entropy (CE) can be characterized exactly as an integral of local informationtheoretic derivatives along the noise path. This yields a unified characterization of the likelihood for discrete and continuous diffusion, with the Gaussian case reducing to the well-known mutual information-minimum mean-square error (I-MMSE) relationship. An immediate implication is a locality property: one can compute the information-theoretic derivatives using only the marginal posteriors along the noise path. As a result, training reduces to learning the marginal posteriors by minimizing the negative log-likelihood. While the conservation law implies that the entropy does not depend on the noise path, finite-capacity denoisers approximate the posteriors with varying accuracy across noise types, leading to differences in performance. We validate these predictions on synthetic Markov sources and standard benchmarks, including text8 and CIFAR-10. Code is available at https: //github.com/zivaharoni/conservation-laws-diffusion-models. Recent work has begun to make this connection explicit by interpreting diffusion through informationtheoretic derivatives along the noising path, including Gaussian results based on I-MMSE curves

For agents

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

get_harvested_code_for_paper("2607.10067")
get_code_for_paper("2607.10067")
have("2607.10067")

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

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

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

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

Connect an agent — have() is free.