The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
Error code: DatasetGenerationCastError
Exception: DatasetGenerationCastError
Message: An error occurred while generating the dataset
All the data files must have the same columns, but at some point there are 3 new columns ({'compile_rate', 'time_sec', 'loss'}) and 4 missing columns ({'policy_loss', 'std_reward', 'prompt', 'step_time_sec'}).
This happened while the csv dataset builder was generating data using
hf://datasets/mayank-dubey-ai/retro-icon-rl/outputs/paint-with-code/surya_training_log.csv (at revision 53cec9b57bb12d9ee68b550624521cb7646212d9), ['hf://datasets/mayank-dubey-ai/retro-icon-rl@53cec9b57bb12d9ee68b550624521cb7646212d9/outputs/grpo_post_sft_training_log.csv', 'hf://datasets/mayank-dubey-ai/retro-icon-rl@53cec9b57bb12d9ee68b550624521cb7646212d9/outputs/grpo_surya_training_log.csv', 'hf://datasets/mayank-dubey-ai/retro-icon-rl@53cec9b57bb12d9ee68b550624521cb7646212d9/outputs/grpo_training_log.csv', 'hf://datasets/mayank-dubey-ai/retro-icon-rl@53cec9b57bb12d9ee68b550624521cb7646212d9/outputs/master_pipeline/grpo_master_training_log.csv', 'hf://datasets/mayank-dubey-ai/retro-icon-rl@53cec9b57bb12d9ee68b550624521cb7646212d9/outputs/paint-with-code/surya_training_log.csv']
Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)
Traceback: Traceback (most recent call last):
File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1848, in _prepare_split_single
writer.write_table(table)
~~~~~~~~~~~~~~~~~~^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/arrow_writer.py", line 765, in write_table
self._write_table(pa_table, writer_batch_size=writer_batch_size)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/arrow_writer.py", line 773, in _write_table
pa_table = table_cast(pa_table, self._schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2378, in table_cast
return cast_table_to_schema(table, schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2306, in cast_table_to_schema
raise CastError(
...<3 lines>...
)
datasets.table.CastError: Couldn't cast
step: int64
mean_reward: double
best_reward: double
compile_rate: int64
loss: double
time_sec: double
-- schema metadata --
pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 976
to
{'step': Value('int64'), 'prompt': Value('string'), 'mean_reward': Value('float64'), 'best_reward': Value('float64'), 'std_reward': Value('float64'), 'policy_loss': Value('float64'), 'step_time_sec': Value('float64')}
because column names don't match
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1369, in compute_config_parquet_and_info_response
parquet_operations, partial, estimated_dataset_info = stream_convert_to_parquet(
~~~~~~~~~~~~~~~~~~~~~~~~~^
builder, max_dataset_size_bytes=max_dataset_size_bytes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 948, in stream_convert_to_parquet
builder._prepare_split(split_generator=splits_generators[split], file_format="parquet")
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1694, in _prepare_split
for job_id, done, content in self._prepare_split_single(
~~~~~~~~~~~~~~~~~~~~~~~~~~^
gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
):
^
File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1850, in _prepare_split_single
raise DatasetGenerationCastError.from_cast_error(
...<4 lines>...
)
datasets.exceptions.DatasetGenerationCastError: An error occurred while generating the dataset
All the data files must have the same columns, but at some point there are 3 new columns ({'compile_rate', 'time_sec', 'loss'}) and 4 missing columns ({'policy_loss', 'std_reward', 'prompt', 'step_time_sec'}).
This happened while the csv dataset builder was generating data using
hf://datasets/mayank-dubey-ai/retro-icon-rl/outputs/paint-with-code/surya_training_log.csv (at revision 53cec9b57bb12d9ee68b550624521cb7646212d9), ['hf://datasets/mayank-dubey-ai/retro-icon-rl@53cec9b57bb12d9ee68b550624521cb7646212d9/outputs/grpo_post_sft_training_log.csv', 'hf://datasets/mayank-dubey-ai/retro-icon-rl@53cec9b57bb12d9ee68b550624521cb7646212d9/outputs/grpo_surya_training_log.csv', 'hf://datasets/mayank-dubey-ai/retro-icon-rl@53cec9b57bb12d9ee68b550624521cb7646212d9/outputs/grpo_training_log.csv', 'hf://datasets/mayank-dubey-ai/retro-icon-rl@53cec9b57bb12d9ee68b550624521cb7646212d9/outputs/master_pipeline/grpo_master_training_log.csv', 'hf://datasets/mayank-dubey-ai/retro-icon-rl@53cec9b57bb12d9ee68b550624521cb7646212d9/outputs/paint-with-code/surya_training_log.csv']
Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
step int64 | prompt string | mean_reward float64 | best_reward float64 | std_reward float64 | policy_loss float64 | step_time_sec float64 |
|---|---|---|---|---|---|---|
1 | payments | 0.53335 | 0.6771 | 0.131426 | -0.005355 | 24.479067 |
2 | retro joystick | 0.242 | 0.3195 | 0.067639 | -0.004972 | 17.975153 |
3 | memory | 0.7471 | 0.7471 | 0 | -0 | 15.837439 |
4 | gold coin | 0.20695 | 0.3207 | 0.077607 | 0.006468 | 18.396043 |
5 | magic potion | 0.18445 | 0.2864 | 0.12648 | -0.001473 | 16.987814 |
6 | gold coin | 0.1807 | 0.2157 | 0.028577 | -0.000999 | 16.537061 |
7 | shield | 0.252275 | 0.3717 | 0.093013 | 0.008568 | 14.847119 |
8 | git commit | 0.65335 | 0.7471 | 0.125391 | 0.000166 | 17.660764 |
9 | AI agent | 0.29875 | 0.3543 | 0.042933 | 0.005914 | 17.564432 |
10 | terminal | 0.32835 | 0.4371 | 0.094901 | -0.000672 | 16.824835 |
11 | search | 0.17795 | 0.2217 | 0.03351 | -0.002648 | 20.622159 |
12 | sword | 0.225675 | 0.2521 | 0.033815 | -0.004219 | 25.221877 |
13 | terminal | 0.2821 | 0.3271 | 0.034881 | -0.000073 | 15.549071 |
14 | browser | 0.63085 | 0.7471 | 0.119469 | 0.004639 | 18.273975 |
15 | magic potion | 0.2089 | 0.2214 | 0.018484 | 0.006496 | 17.010339 |
16 | search | 0.1867 | 0.2217 | 0.028577 | 0.002066 | 15.963508 |
17 | browser | 0.6421 | 0.7471 | 0.075609 | 0.000149 | 18.284819 |
18 | sword | 0.32585 | 0.4021 | 0.061288 | 0.000452 | 15.98771 |
19 | API key | 0.22295 | 0.3317 | 0.0725 | 0.009199 | 15.986112 |
20 | terminal | 0.3096 | 0.3271 | 0.020207 | 0.001616 | 16.294384 |
1 | database | 0.05 | 0.05 | 0 | -0 | 36.172632 |
2 | gold coin | 0.525 | 0.7625 | 0.193918 | 0.000351 | 23.366719 |
3 | browser | 0.05 | 0.05 | 0 | -0 | 16.793178 |
4 | database | 0.05 | 0.05 | 0 | -0 | 24.009246 |
5 | docker container | 0.2875 | 0.525 | 0.274241 | 0.011828 | 22.803774 |
6 | retro joystick | 0.703125 | 1 | 0.35625 | -0.001501 | 22.746243 |
7 | bug | 0.2875 | 0.525 | 0.274241 | 0.003189 | 25.372632 |
8 | database | 0.0375 | 0.05 | 0.025 | -0.00115 | 22.278829 |
9 | bug | 0.40625 | 0.525 | 0.2375 | 0.003122 | 26.818465 |
10 | browser | 0.05 | 0.05 | 0 | -0 | 19.884256 |
11 | security | 0 | 0 | 0 | -0 | 18.948702 |
12 | payments | 0.05 | 0.05 | 0 | -0 | 19.425033 |
13 | bug | 0.40625 | 0.525 | 0.2375 | -0.001654 | 29.559701 |
14 | magic potion | 0.05 | 0.05 | 0 | -0 | 15.78418 |
15 | shield | 0.05 | 0.05 | 0 | -0 | 20.762825 |
16 | payments | 0.05 | 0.05 | 0 | -0 | 14.738039 |
17 | gold coin | 0.584375 | 0.7625 | 0.11875 | -0.003329 | 26.171797 |
18 | git commit | 0.40625 | 0.525 | 0.2375 | 0.004157 | 23.725693 |
19 | terminal | 0.05 | 0.05 | 0 | -0 | 18.375307 |
20 | browser | 0.05 | 0.05 | 0 | -0 | 18.142796 |
1 | heart health | 0.2625 | 0.36 | 0.112583 | 0.00332 | 26.329172 |
2 | git commit | 0.28375 | 0.36 | 0.078249 | 0.056434 | 20.531512 |
3 | docker container | 0.425 | 0.64 | 0.157586 | -0.060576 | 24.350115 |
4 | heart health | 0.36375 | 0.57 | 0.165397 | -0.075907 | 20.531283 |
5 | API key | 0.2625 | 0.36 | 0.112583 | 0.001453 | 15.809036 |
6 | AI agent | 0.2975 | 0.395 | 0.09456 | -0.079612 | 26.435798 |
7 | retro joystick | 0.43 | 0.57 | 0.098995 | -0.003736 | 19.010792 |
8 | gold coin | 0.36 | 0.36 | 0 | -0 | 17.738249 |
9 | memory | 0.38125 | 0.535 | 0.123381 | 0.006968 | 21.204258 |
10 | gold coin | 0.36 | 0.36 | 0 | -0 | 22.499598 |
11 | sword | 0.2625 | 0.36 | 0.112583 | 0.006101 | 16.134336 |
12 | search | 0.2625 | 0.36 | 0.112583 | -0.061507 | 17.071515 |
13 | heart health | 0.32 | 0.36 | 0.08 | 0.010661 | 20.760784 |
14 | security | 0.28875 | 0.36 | 0.083504 | -0.063744 | 19.923968 |
15 | security | 0.2625 | 0.36 | 0.112583 | -0.003329 | 17.228513 |
1 | bookmark star | 0.703125 | 0.7625 | 0.11875 | 0.001598 | 85.040905 |
2 | shopping cart | 0.64375 | 1 | 0.2375 | -0.006962 | 69.173173 |
3 | battle axe | 0.7625 | 1 | 0.274241 | -0.001006 | 36.894394 |
4 | motherboard | 0.16875 | 0.525 | 0.2375 | 0.017386 | 44.196706 |
5 | upload cloud | 0.2875 | 0.525 | 0.193918 | -0.005082 | 72.357271 |
6 | map pin | 0.88125 | 1 | 0.137121 | -0.007617 | 52.295356 |
7 | sapphire jewel | 0.584375 | 1 | 0.298848 | -0.006482 | 54.109286 |
8 | banana fruit | 0.63125 | 1 | 0.476697 | 0.00206 | 37.570902 |
9 | floppy disk | 0.809375 | 1 | 0.233045 | 0.013781 | 51.559546 |
10 | spell book | 0.63125 | 1 | 0.442236 | 0.035195 | 55.851081 |
11 | motherboard | 0.203125 | 0.475 | 0.22041 | -0.011759 | 53.327066 |
12 | ssl certificate | 0.525 | 1 | 0.387836 | 0.00274 | 70.452441 |
13 | magic wand | 0.821875 | 1 | 0.227389 | -0.000447 | 55.728706 |
14 | moon crescent | 0.7625 | 1 | 0.274241 | -0.007791 | 38.275235 |
15 | treasure chest | 0.940625 | 1 | 0.11875 | 0.003485 | 44.481196 |
16 | pull request | 0.0375 | 0.05 | 0.025 | -0.00507 | 49.857831 |
17 | drone | 0.88125 | 1 | 0.2375 | 0.016064 | 51.304993 |
18 | bookmark star | 0.5125 | 1 | 0.408503 | -0.016038 | 43.824342 |
19 | delivery truck | 0.940625 | 1 | 0.11875 | 0.003443 | 57.60395 |
20 | eyeglasses | 0.928125 | 1 | 0.14375 | -0.008422 | 52.210125 |
21 | memory | 0.36875 | 0.525 | 0.246961 | 0.002091 | 54.198283 |
22 | apple fruit | 0.7625 | 1 | 0.274241 | 0.000568 | 43.729864 |
23 | memory | 0.16875 | 0.525 | 0.2375 | 0.003739 | 46.745078 |
24 | castle tower | 1 | 1 | 0 | -0 | 51.449323 |
25 | cactus plant | 0.690625 | 1 | 0.473834 | -0.003219 | 42.198138 |
1 | null | 0.075 | 0.2 | null | null | null |
2 | null | 0.025 | 0.2 | null | null | null |
3 | null | 0.075 | 0.2 | null | null | null |
4 | null | 0.15 | 0.2 | null | null | null |
5 | null | 0.175 | 0.2 | null | null | null |
6 | null | 0.175 | 0.2 | null | null | null |
7 | null | 0.175 | 0.2 | null | null | null |
8 | null | 0.15 | 0.2 | null | null | null |
9 | null | 0.175 | 0.2 | null | null | null |
10 | null | 0.125 | 0.2 | null | null | null |
11 | null | 0.175 | 0.2 | null | null | null |
12 | null | 0.2 | 0.2 | null | null | null |
13 | null | 0.175 | 0.2 | null | null | null |
14 | null | 0.175 | 0.2 | null | null | null |
15 | null | 0.2 | 0.2 | null | null | null |
16 | null | 0.2 | 0.2 | null | null | null |
17 | null | 0.2 | 0.2 | null | null | null |
18 | null | 0.175 | 0.2 | null | null | null |
19 | null | 0.2 | 0.2 | null | null | null |
20 | null | 0.175 | 0.2 | null | null | null |
RetroIcon-RL: 32x32 Retro Pixel-Art Icon Generation with Deterministic Verification
This repository implements RetroIcon-RL β training and evaluating small code models with Reinforcement Learning (RL) and programmatic verification to generate consistent, crisp retro pixel-art icon packs from natural language prompts using sharp SVG block geometry.
π― Phase 1 β The 32x32 Task Specification
- Canvas: Exactly $32 \times 32$ integer grid (
viewBox="0 0 32 32"). - Palette: Fixed 8-Color Retro Palette:
BLACK:#000000|DARK_GRAY:#2B2D42|WHITE:#FFFFFF|CYAN:#00E5FFPURPLE:#9D4EDD|GREEN:#00E676|YELLOW:#FFD600|RED:#FF1744
- Geometry Rules: Strict integer
<rect>pixel blocks. No bezier<path>, no<circle>, no gradients, no anti-aliasing.
π οΈ Phase 2 β Deterministic Rule-Based Validator & Pure-Python Renderer
The pipeline prompt β model β structured SVG β validator β pixel-perfect PNG enforces 6 automated checks:
- XML/SVG parse tree well-formedness.
- Exact $32 \times 32$ dimensions.
- 100% adherence to the fixed 8-color palette.
- All coordinates within $[0, 32]$.
- Integer-only rectangular geometry without bezier smoothing.
- Minimum icon density (>= 3 distinct geometry blocks).
π The Master V2 Pipeline (SFT + GRPO)
We implemented Surya Narreddi's Pairwise RL methodology to train Qwen3-8B on an NVIDIA H100.
1. SFT Warm-Start (120 Gold Experts)
We synthesized 120 canonical 32x32 pixel-art icons using Gemini 2.5 Flash (data/expert_expanded_100.jsonl). Fine-tuning on this dataset gave the base model the 2D spatial coordinate grammar needed to place pixels accurately.
2. Surya-Style Pairwise GRPO Training
Using the SuryaRewardEngine, we abandoned absolute 1-to-10 scoring. For every generation step, Qwen generated $G=4$ rollouts. The engine pitted them in blind 1v1 matchups against the Gold Reference pool, judged by Gemini 2.5 Flash on silhouette clarity and aesthetic polish.
Results
The final policy achieved 100% syntactic validity and beat or tied the Gemini 2.5 Flash Gold standard on highly complex visual metaphors (e.g. mushroom fungi, spell book, hard drive, pocket compass, dynamite fuse, store storefront, camera photo).
π¨ Experiment 2: Paint-with-Code (Qwen2.5-Coder-1.5B)
We also ran a pure Direct RL (GRPO) experiment on Qwen2.5-Coder-1.5B to draw watercolor hibiscus flowers using Python matplotlib.patches.
- Result: The model learned 100% executable Python syntax in just 10 steps. However, without an SFT warm-start, it hit an aesthetic plateau, generating structurally valid but visually crude geometric blobs, proving that RL requires a strong structural prior for complex creative tasks.
π Reproduction
# 1. Clone repository
git clone https://huggingface.co/datasets/mayank-dubey-ai/retro-icon-rl
cd retro-icon-rl
# 2. Run the full Master V2 Pipeline (SFT + GRPO + Showcase)
python3 train_master_v2.py
- Downloads last month
- 589