SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2501.05803 · ICLR · 2025

Test-time Alignment of Diffusion Models without Reward Over-optimization

Minkyu Kim, Dongmin Park, Sunwoo Kim

arXiv · PDF · Open in the Atlas

Code that ran

9 of 12 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; 1 honoured the contract we drafted, 0 violated it and 8 have no contract verdict; 0 failures of our instrument; 3 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/2501.05803.json · badge: /api/ran/2501.05803.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
krafton-ai/DAS canonical (classifier label)
classifier basis not recorded on the link
9 ran · 3 no recorded run
FunctionStatusWhere it lives
aesthetic_score Ran
ran on a synthesized input
krafton-ai/DAS/das/rewards.py
code served (permissive licence) · get_code("47714310f035f682")
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)

# Stand-in AestheticScorer that mimics the expected interface
class MockAestheticScorer(nn.Module):
    def __init__(self, dtype=torch.float32, device=None):
        super().__init__()
        self.dtype = dtype
        self.device = device
        # Register a small learnable parameter to make it a proper nn.Module
        self.register_buffer('_dummy', torch.zeros(1, dtype=dtype, device=device))
    
    def forward(self, images):
        # images shape: (batch, channels, height, width)
        # Return aesthetic scores for each image in batch
        batch_size = images.shape[0]
        scores = torch.randn(batch_size, dtype=self.dtype, device=self.device) * 0.5 + 0.7
        return scores

# Monkey-patch the import to use our mock
import sys
from types import ModuleType

das_module = ModuleType('das')
scorers_module = ModuleType('das.scorers')
aesthetic_scorer_module = ModuleType('das.scorers.aesthetic_scorer')

aesthetic_scorer_module.AestheticScorer = MockAestheticScorer
scorers_module.aesthetic_scorer = aesthetic_scorer_module
das_module.scorers = scorers_module
sys.modules['das'] = das_module
sys.modules['das.scorers'] = scorers_module
sys.modules['das.scorers.aesthetic_scorer'] = aesthetic_scorer_module

# Define arguments for the function
ARGS = {
    'torch_dtype': torch.float32,
    'aesthetic_target': 0.75,
    'grad_scale': 1.0,
    'device': 'cpu',
    'return_loss': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
das, 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
betas_for_alpha_bar Ran
ran, honoured the contract we drafted
krafton-ai/DAS/das/diffusers_patch/lcm_with_logprob.py
pointer only (licence: MIT); the stored copy get_code serves, from jachansantiago/mode_guidance, is pointer only (licence: NONE) · get_code("fde7881344a30b12")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from jachansantiago/mode_guidance, 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.

clip_score Ran
ran on a synthesized input
krafton-ai/DAS/das/rewards.py
code served (permissive licence) · get_code("b9541044b78a4a5c")
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)

class MockCLIPScorer(nn.Module):
    def __init__(self, dtype=torch.float32, device=None):
        super().__init__()
        self.dtype = dtype
        self.device = device
        self.linear = nn.Linear(4, 1)
    
    def forward(self, images, prompts):
        batch_size = images.shape[0]
        scores = torch.randn(batch_size, dtype=self.dtype, device=self.device)
        return scores

import sys
from unittest.mock import MagicMock

das_module = MagicMock()
das_module.scorers.clip_scorer.CLIPScorer = MockCLIPScorer
sys.modules['das'] = das_module
sys.modules['das.scorers'] = das_module.scorers
sys.modules['das.scorers.clip_scorer'] = das_module.scorers.clip_scorer

ARGS = {
    'inference_dtype': torch.float32,
    'device': 'cpu',
    'return_loss': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
das, 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
compute_ess Ran
ran on a synthesized input
krafton-ai/DAS/das/smc_utils.py
code served (permissive licence) · get_code("638ef43222c986d4")
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 as th

th.manual_seed(0)

# w should be a tensor where we can sum along a dimension and compute ESS
# The function uses: w.sum(dim=dim), w ** 2, th.sum(w ** 2, dim=dim)
# These are standard tensor operations

# Create a small tensor with shape (2, 4) - batch size 2, feature dim 4
# Using weights that are positive (ESS makes sense for probability weights)
w = th.rand(2, 4) + 0.1  # Add 0.1 to ensure all positive

ARGS = {
    "w": w,
    "dim": -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 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
compute_ess_from_log_w Ran
ran on a synthesized input
krafton-ai/DAS/das/smc_utils.py
code served (permissive licence) · get_code("b7ecc0cc64dc5ebc")
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 as th

th.manual_seed(0)

# Create a small log_weights tensor
# Shape: (2, 4) - batch size 2, 4 dimensions
log_w = th.randn(2, 4)

ARGS = {
    "log_w": log_w,
    "dim": -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 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
get_variance Ran
ran on a synthesized input
krafton-ai/DAS/das/diffusers_patch/ddim_with_logprob.py
code served (permissive licence) · get_code("0f88113ed6486c35")
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

torch.manual_seed(0)

class DiffusionSchedule:
    """Stand-in class that mimics a diffusion model scheduler."""
    def __init__(self):
        # Create a small cumulative product schedule (batch of alphas over timesteps)
        self.alphas_cumprod = torch.linspace(0.9, 0.1, 10)  # 10 timesteps
        self.final_alpha_cumprod = torch.tensor(0.05)

# Create instance
schedule = DiffusionSchedule()

# Create test tensors
timestep = torch.tensor([2, 5], dtype=torch.long)  # batch of 2
prev_timestep = torch.tensor([1, 4], dtype=torch.long)  # batch of 2

ARGS = {
    "self": schedule,
    "timestep": timestep,
    "prev_timestep": prev_timestep,
}
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 (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
jpeg_compressibility Ran
ran on a synthesized input
krafton-ai/DAS/das/rewards.py
code served (permissive licence) · get_code("e1a14b1c366e53ca")
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 numpy as np
from PIL import Image
import io

torch.manual_seed(0)

ARGS = {
    "inference_dtype": torch.float32,
    "device": "cpu",
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, 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
normalize_weights Ran
ran on a synthesized input
krafton-ai/DAS/das/smc_utils.py
code served (permissive licence) · get_code("c05fb5231070387d")
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 as th

th.manual_seed(0)

# Create a small log_weights tensor (batch=2, features=4)
log_weights = th.randn(2, 4)

# The dim parameter specifies which dimension to normalize over
dim = -1

ARGS = {
    "log_weights": log_weights,
    "dim": dim,
}
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
rescale_zero_terminal_snr Ran
ran on a synthesized input
krafton-ai/DAS/das/diffusers_patch/lcm_with_logprob.py
code served (permissive licence) · get_code("6cef65ea9b3a0d85")
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 (5,) 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)

# Create a small tensor of betas with shape (5,)
# Betas should be values between 0 and 1 (they represent noise schedule)
betas = torch.linspace(0.0001, 0.02, 5)

ARGS = {
    "betas": betas,
}
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 (5,) — shape (5,) 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
ddim_prediction_with_mean Not yet run
unverified (harvested, no recorded run)
krafton-ai/DAS/das/diffusers_patch/ddim_with_logprob.py
code served (permissive licence) · get_code("986e249fed0367ec")
How it ran

no invocation recorded.

ddim_step_with_mean Not yet run
unverified (harvested, no recorded run)
krafton-ai/DAS/das/diffusers_patch/ddim_with_logprob.py
code served (permissive licence) · get_code("d3b6a569179d9722")
How it ran

no invocation recorded.

lcm_step_with_mean Not yet run
unverified (harvested, no recorded run)
krafton-ai/DAS/das/diffusers_patch/lcm_with_logprob.py
code served (permissive licence) · get_code("1a8d52ace26b455e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 11 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
betas_for_alpha_bar 2 other papers
1 dated earlier, 1 later
2410.07659 (2024-10)
MotionAura: Generating High-Quality and Motion Consistent Videos using Discrete Diffusion
2606.18209 (2026-06)
Rethinking Dataset Distillation for Classification: Do Distilled Sets Outperform Coresets?

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

Diffusion models excel in generative tasks, but aligning them with specific objectives while maintaining their versatility remains challenging. Existing fine-tuning methods often suffer from reward over-optimization, while approximate guidance approaches fail to optimize target rewards effectively. Addressing these limitations, we propose a training-free, test-time method based on Sequential Monte Carlo (SMC) to sample from the reward-aligned target distribution. Our approach, tailored for diffusion sampling and incorporating tempering techniques, achieves comparable or superior target rewards to fine-tuning methods while preserving diversity and cross-reward generalization. We demonstrate its effectiveness in single-reward optimization, multi-objective scenarios, and online black-box optimization. This work offers a robust solution for aligning diffusion models with diverse downstream objectives without compromising their general capabilities. Code is available at https://github.com/krafton-ai/DAS.

For agents

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

get_harvested_code_for_paper("2501.05803")
get_code_for_paper("2501.05803")
have("2501.05803")

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

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

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

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

Connect an agent — have() is free.