Add dataset card with metadata and sample usage

#2
by nielsr HF Staff - opened
Files changed (1) hide show
  1. README.md +63 -0
README.md ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ task_categories:
3
+ - image-text-to-text
4
+ ---
5
+
6
+ # RationalRewards: Reasoning Rewards Scale Visual Generation Both Training and Test Time
7
+
8
+ [Paper](https://huggingface.co/papers/2604.11626) | [Project Page](https://tiger-ai-lab.github.io/RationalRewards/) | [GitHub](https://github.com/TIGER-AI-Lab/RationalRewards)
9
+
10
+ RationalRewards is a reasoning-based reward model and toolkit for visual generation. Instead of reducing human judgments to a single unexplained score, it generates explicit multi-dimensional critiques before scoring. This transforms reward models from passive evaluators into active optimization tools that support both train-time reinforcement learning and test-time prompt refinement.
11
+
12
+ The datasets associated with this project include:
13
+ - **SFT training data:** High-quality rationales used for Supervised Fine-Tuning.
14
+ - **Preference evaluation data:** Benchmarking data for preference prediction (GenAIBench, MMRB2, ERBench).
15
+ - **RL training data:** Data used for diffusion reinforcement learning.
16
+
17
+ These datasets were constructed using **Preference-Anchored Rationalization (PARROT)**, a framework that recovers high-quality rationales from preference-only data through anchored generation, consistency filtering, and distillation.
18
+
19
+ ## Sample Usage
20
+
21
+ The following code snippet demonstrates how to construct messages for a text-to-image (T2I) evaluation using RationalRewards templates:
22
+
23
+ ```python
24
+ import base64
25
+
26
+ def build_t2i_messages(prompt, image_bytes):
27
+ system_prompt = (
28
+ "You are an expert image generation evaluator. Your task is to evaluate "
29
+ "the quality of a generated image based on a user instruction. Afterwards, "
30
+ "you need to suggest how to refine the original user request to produce "
31
+ "better image generation (if any)."
32
+ )
33
+ image_b64 = base64.b64encode(image_bytes).decode()
34
+ user_instruction = f"User Instruction: {prompt}
35
+ You are provided with one image:
36
+ 1. Generated Image <image>
37
+
38
+ To do this, you must first assess the image on three critical aspects, provide justifications and absolute scores in 1-4 scale."
39
+
40
+ parts = user_instruction.split("<image>")
41
+ content = [
42
+ {"type": "text", "text": parts[0]},
43
+ {"type": "image_url", "image_url": {"url": f"data:image/png;base64,{image_b64}"}},
44
+ ]
45
+ if len(parts) > 1:
46
+ content.append({"type": "text", "text": parts[1]})
47
+
48
+ return [
49
+ {"role": "system", "content": system_prompt},
50
+ {"role": "user", "content": content},
51
+ ]
52
+ ```
53
+
54
+ ## Citation
55
+
56
+ ```bibtex
57
+ @article{rationalrewards2026,
58
+ title = {RationalRewards: Reasoning Rewards Scale Visual Generation Both Training and Test Time},
59
+ author = {Haozhe Wang and Cong Wei and Weiming Ren and Jiaming Liu and Fangzhen Lin and Wenhu Chen},
60
+ journal = {arXiv:2604.11626},
61
+ year = {2026}
62
+ }
63
+ ```