SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2304.05977 · 2023

ImageReward: Learning and Evaluating Human Preferences for Text-to-Image Generation

Yuxiao Dong, Jie Tang, Ming Ding, Xiao Liu, Yuxuan Tong, Yuchen Wu, Jiazheng Xu, Qinkai Li

arXiv · PDF · Open in the Atlas

Code that ran

3 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; 0 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 2 failures of our instrument; 9 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/2304.05977.json · badge: /api/ran/2304.05977.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
THUDM/ImageReward canonical (classifier label)
classifier basis: census
2 ran · 8 no recorded run
LemonTwoL/ReNeg community
Papers with Code archive
1 ran · 1 no recorded run
FunctionStatusWhere it lives
get_reward_fn Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
LemonTwoL/ReNeg/reward_fn.py
pointer only (licence: NONE) · get_code("d91265552bd9c879")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, LemonTwoL/ReNeg 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.

is_url Ran
ran, violated the contract we drafted
THUDM/ImageReward/ImageReward/models/BLIP/blip.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from jylins/videoxum, is pointer only (licence: NONE) · get_code("4d1d9c47619920ba")
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 jylins/videoxum, 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.

load Ran
ran; our contract draft was wrong, not the code
THUDM/ImageReward/ImageReward/utils.py
code served (permissive licence) · get_code("96b66ffedde07222")
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 ImageReward. 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 os
import torch
import tempfile
from unittest.mock import Mock, patch
from pathlib import Path

torch.manual_seed(0)

# Create a minimal ImageReward model class that satisfies the function's needs
class ImageReward(torch.nn.Module):
    def __init__(self, device='cpu', med_config=None):
        super().__init__()
        self.device_type = device
        self.med_config = med_config
        self.linear = torch.nn.Linear(4, 2)
    
    def forward(self, x):
        return self.linear(x)
    
    def eval(self):
        return super().eval()
    
    def to(self, device):
        return super().to(device)
    
    def load_state_dict(self, state_dict, strict=False):
        # Mock implementation - just accept the state dict
        return Mock()

# Create a temporary directory for model files
temp_dir = tempfile.mkdtemp()

# Create mock model checkpoint file
mock_checkpoint_path = os.path.join(temp_dir, 'ImageReward.pt')
torch.save({'linear.weight': torch.randn(2, 4), 'linear.bias': torch.randn(2)}, mock_checkpoint_path)

# Create mock med_config file
mock_config_path = os.path.join(temp_dir, 'med_config.json')
with open(mock_config_path, 'w') as f:
    f.write('{}')

# Mock the ImageReward class to be importable from this module
import sys
current_module = sys.modules[__name__]
setattr(current_module, 'ImageReward', ImageReward)

# Define ARGS dictionary with all parameters for the load function
ARGS = {
    'name': mock_checkpoint_path,  # Use local file path instead of model name
    'device': 'cpu',
    'download_root': temp_dir,
    'med_config': mock_config_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
huggingface_hub, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ImageReward — a ImageReward output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ImageReward 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
ImageReward_download Not yet run
unverified (harvested, no recorded run)
THUDM/ImageReward/ImageReward/utils.py
code served (permissive licence) · get_code("b1ae6f0bdf766e6c")
How it ran

no invocation recorded.

create_vit Not yet run
unverified (harvested, no recorded run)
THUDM/ImageReward/ImageReward/models/BLIP/blip.py
code served (permissive licence) · get_code("f837c334ddfa8af4")
How it ran

no invocation recorded.

encode_prompt_rm Not yet run
unverified (harvested, no recorded run)
THUDM/ImageReward/ImageReward/ReFL_SDXL.py
code served (permissive licence) · get_code("69fa0b8db2b6b3de")
How it ran

no invocation recorded.

get_hpsv2_fn Not yet run
unverified (harvested, no recorded run)
LemonTwoL/ReNeg/reward_fn.py
pointer only (licence: NONE) · get_code("6b8ba3c0c865429c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, LemonTwoL/ReNeg 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. No invocation recorded.

import_model_class_from_model_name_or_path Not yet run
unverified (harvested, no recorded run)
THUDM/ImageReward/ImageReward/ReFL_SDXL.py
code served (permissive licence) · get_code("01e3b39e9e10abfb")
How it ran

no invocation recorded.

load_checkpoint Not yet run
unverified (harvested, no recorded run)
THUDM/ImageReward/ImageReward/models/BLIP/blip.py
code served (permissive licence) · get_code("8337576ab7f136c1")
How it ran

no invocation recorded.

load_score Not yet run
unverified (harvested, no recorded run)
THUDM/ImageReward/ImageReward/utils.py
code served (permissive licence) · get_code("ef6e5967acc37116")
How it ran

no invocation recorded.

parse_args Not yet run
unverified (harvested, no recorded run)
THUDM/ImageReward/ImageReward/ReFL_SDXL.py
code served (permissive licence) · get_code("f4d1dbd44db71bc0")
How it ran

no invocation recorded.

parse_args Not yet run
unverified (harvested, no recorded run)
THUDM/ImageReward/ImageReward/ReFL_SDXL_LoRA.py
code served (permissive licence) · get_code("e8c37411989e89c1")
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, 9 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 9 later) and 3 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
is_url 11 other papers
2 dated earlier, 9 later
2211.09790 (2022-11)
ConStruct-VL: Data-Free Continual Structured VL Concepts Learning
2303.12060 (2023-03)
VideoXum: Cross-modal Visual and Textural Summarization of Videos
2305.16304 (2023-05)
Candidate Set Re-ranking for Composed Image Retrieval with Dual Multi-modal Encoder
and 8 more not named here
create_vit 5 other papers
1 dated earlier, 4 later
2210.01936 (2022-10)
When and why vision-language models behave like bags-of-words, and what to do about it?
2305.16304 (2023-05)
Candidate Set Re-ranking for Composed Image Retrieval with Dual Multi-modal Encoder
2310.19785 (2023-10)
What's "up" with vision-language models? Investigating their struggle with spatial reasoning
and 2 more not named here
import_model_class_from_model_name_or_path 2 other papers
2 later
2410.07171 (2024-10)
IterComp: Iterative Composition-Aware Feedback Learning from Model Gallery for Text-to-Image Generation
2510.23974 (2025-10)
Diffusion Adaptive Text Embedding for Text-to-Image Diffusion Models
ImageReward_download 1 other paper
1 later
2410.07171 (2024-10)
IterComp: Iterative Composition-Aware Feedback Learning from Model Gallery for Text-to-Image Generation
encode_prompt_rm 1 other paper
1 later
2510.23974 (2025-10)
Diffusion Adaptive Text Embedding for Text-to-Image Diffusion Models
load 1 other paper
1 later
2410.07171 (2024-10)
IterComp: Iterative Composition-Aware Feedback Learning from Model Gallery for Text-to-Image Generation
load_score 1 other paper
1 later
2410.07171 (2024-10)
IterComp: Iterative Composition-Aware Feedback Learning from Model Gallery for Text-to-Image Generation
parse_args 1 other paper
1 later
2510.23974 (2025-10)
Diffusion Adaptive Text Embedding for Text-to-Image Diffusion Models
parse_args 1 other paper
1 later
2510.23974 (2025-10)
Diffusion Adaptive Text Embedding for Text-to-Image Diffusion Models

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

We present a comprehensive solution to learn and improve text-to-image models from human preference feedback. To begin with, we build ImageReward-the first general-purpose text-to-image human preference reward model-to effectively encode human preferences. Its training is based on our systematic annotation pipeline including rating and ranking, which collects 137k expert comparisons to date. In human evaluation, ImageReward outperforms existing scoring models and metrics, making it a promising automatic metric for evaluating text-to-image synthesis. On top of it, we propose Reward Feedback Learning (ReFL), a direct tuning algorithm to optimize diffusion models against a scorer. Both automatic and human evaluation support ReFL's advantages over compared methods. All code and datasets are provided at https://github.com/THUDM/ImageReward.

For agents

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

get_harvested_code_for_paper("2304.05977")
get_code_for_paper("2304.05977")
have("2304.05977")

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

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

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

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

Connect an agent — have() is free.