SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2404.06356 · NeurIPS · 2024

Policy-Guided Diffusion

Shimon Whiteson, Jakob Foerster, Cong Lu, Matthew Jackson, Michael Matthews, Benjamin Ellis

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; 2 honoured the contract we drafted, 1 violated it and 1 has no contract verdict; 2 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/2404.06356.json · badge: /api/ran/2404.06356.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
EmptyJackson/policy-guided-diffusion canonical (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
emptyjackson/policy-guided-diffusion community
Papers with Code archive
4 ran · 1 no recorded run
FunctionStatusWhere it lives
c_in Ran
ran, violated the contract we drafted
emptyjackson/policy-guided-diffusion/diffusion/edm.py
code served (permissive licence) · get_code("da6ca2b23cc7aaca")
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 (2,) 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 c_in takes two parameters: sigma and sigma_data
# Both are used in arithmetic operations (exponentiation, addition, multiplication)
# They can be scalars, arrays, or tensors

# Create small tensor arguments
sigma = torch.tensor([0.5, 1.0], dtype=torch.float32)
sigma_data = torch.tensor([0.1, 0.2], dtype=torch.float32)

ARGS = {
    "sigma": sigma,
    "sigma_data": sigma_data,
}
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 1, dtype family float, shape (2,) — shape (2,) 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
c_noise Ran
ran, honoured the contract we drafted
emptyjackson/policy-guided-diffusion/diffusion/edm.py
code served (permissive licence) · get_code("0f28e76fe7815eaf")
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 ArrayImpl, ndim 0, dtype family float, 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 jax.numpy as jnp
import numpy as np

def c_noise(sigma):
    return jnp.log(sigma) * 0.25

# sigma should be a positive scalar or array
# The function computes log(sigma) * 0.25
sigma_value = jnp.array(2.0)

ARGS = {
    "sigma": sigma_value
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 0, dtype family float, 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
c_out Ran
ran, honoured the contract we drafted
emptyjackson/policy-guided-diffusion/diffusion/edm.py
code served (permissive licence) · get_code("2157d6be2688d86c")
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 0, dtype family float, 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 torch
import numpy as np

torch.manual_seed(0)

# sigma and sigma_data are used in arithmetic operations
# They should be numeric types (float, torch.Tensor, or numpy array)
# Based on the function body, they're scalars or broadcastable tensors

sigma = torch.tensor(2.0)
sigma_data = torch.tensor(1.5)

ARGS = {
    "sigma": sigma,
    "sigma_data": sigma_data,
}
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 0, dtype family float, 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
c_skip Ran
ran on a synthesized input
emptyjackson/policy-guided-diffusion/diffusion/edm.py
code served (permissive licence) · get_code("21594882d5ae8fc1")
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 (2,) 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 c_skip takes two parameters: sigma and sigma_data
# Both are used in arithmetic operations (exponentiation and division)
# They should be numeric types - either scalars or tensors

# Create small tensors for sigma and sigma_data
sigma = torch.tensor([0.5, 1.5], dtype=torch.float32)
sigma_data = torch.tensor([2.0, 3.0], dtype=torch.float32)

ARGS = {
    "sigma": sigma,
    "sigma_data": sigma_data,
}
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 1, dtype family float, shape (2,) — shape (2,) 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
parse_agent_args Ran
ran; our contract draft was wrong, not the code
EmptyJackson/policy-guided-diffusion/util/args.py
code served (permissive licence) · get_code("42bfba69b3ad42c4")
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 Namespace. 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 sys
import argparse

# Construct valid arguments for parse_agent_args
ARGS = {
    'cmd_args': [
        '--dataset_name', 'test_dataset',
        '--seed', '42',
        '--num_train_steps', '100000',
        '--eval_rate', '10',
        '--num_env_workers', '4',
        '--batch_size', '64',
        '--num_synth_workers', '8',
        '--num_synth_rollouts', '128',
        '--synth_dataset_lifetime', '10000',
        '--synth_batch_size', '60',
        '--synth_batch_lifetime', '1',
        '--diffusion_timesteps', '100',
        '--denoiser_checkpoint', 'model.pt',
        '--policy_guidance_coeff', '0.5',
        '--policy_guidance_cosine_coeff', '0.3',
        '--agent', 'iql',
        '--activation', 'relu',
        '--num_rollout_steps', '64',
        '--gamma', '0.99',
        '--gae_lambda', '0.95',
        '--value_loss_coef', '0.5',
        '--entropy_coef', '0.01',
        '--polyak_step_size', '0.005',
        '--lr', '0.0003',
        '--lr_schedule', 'constant',
        '--policy_noise', '0.2',
        '--noise_clip', '0.5',
        '--a_max', '1.0',
        '--num_critic_updates_per_step', '2',
        '--td3_alpha', '2.5',
        '--iql_tau', '0.7',
        '--iql_beta', '3.0',
        '--wandb_project', 'test_project',
        '--wandb_team', 'test_team',
        '--wandb_group', 'test_group',
    ]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace 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
parse_diffusion_args Ran
ran; our contract draft was wrong, not the code
EmptyJackson/policy-guided-diffusion/util/args.py
code served (permissive licence) · get_code("9a7b1d67b678c8ca")
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 Namespace. 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 sys
import argparse

# Setup for parse_diffusion_args
# The function only parses command-line arguments and returns a Namespace object
# No actual models, tensors, or data loaders are needed since this is just argument parsing

ARGS = {
    'cmd_args': [
        '--debug',
        '--debug_nans',
        '--dataset_name', 'test_dataset',
        '--seed', '42',
        '--num_epochs', '100',
        '--eval_rate', '25',
        '--val_ratio', '0.1',
        '--batch_size', '16',
        '--trajectory_length', '64',
        '--dataset_stride', '4',
        '--diffusion_method', 'edm',
        '--diffusion_timesteps', '128',
        '--ema_decay', '0.99',
        '--ema_update_every', '5',
        '--edm_p_mean', '-1.0',
        '--edm_p_std', '1.0',
        '--edm_sigma_data', '0.5',
        '--edm_sigma_min', '0.001',
        '--edm_sigma_max', '100',
        '--edm_rho', '8.0',
        '--edm_s_tmin', '0.1',
        '--edm_s_tmax', '40.0',
        '--edm_s_churn', '100',
        '--edm_s_noise', '1.01',
        '--edm_first_order',
        '--num_blocks', '4',
        '--num_features', '512',
        '--lr', '0.001',
        '--log',
        '--save_checkpoint',
        '--wandb_project', 'test_project',
        '--wandb_team', 'test_team',
        '--wandb_group', 'test_group',
    ]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace 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
train_step Not yet run
unverified (harvested, no recorded run)
emptyjackson/policy-guided-diffusion/diffusion/edm.py
code served (permissive licence) · get_code("9b56bf0de382cda7")
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

In many real-world settings, agents must learn from an offline dataset gathered by some prior behavior policy. Such a setting naturally leads to distribution shift between the behavior policy and the target policy being trained-requiring policy conservatism to avoid instability and overestimation bias. Autoregressive world models offer a different solution to this by generating synthetic, on-policy experience. However, in practice, model rollouts must be severely truncated to avoid compounding error. As an alternative, we propose policy-guided diffusion. Our method uses diffusion models to generate entire trajectories under the behavior distribution, applying guidance from the target policy to move synthetic experience further on-policy. We show that policy-guided diffusion models a regularized form of the target distribution that balances action likelihood under both the target and behavior policies, leading to plausible trajectories with high target policy probability, while retaining a lower dynamics error than an offline world model baseline. Using synthetic experience from policy-guided diffusion as a drop-in substitute for real data, we demonstrate significant improvements in performance across a range of standard offline reinforcement learning algorithms and environments. Our approach provides an effective alternative to autoregressive offline world models, opening the door to the controllable generation of synthetic training data.

For agents

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

get_harvested_code_for_paper("2404.06356")
get_code_for_paper("2404.06356")
have("2404.06356")

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

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

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

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

Connect an agent — have() is free.