Code-based Image Generation: Benchmarking, Baselines, and Improved Rewards
Abstract
Post-training open-source LLMs with distillation and GRPO for code-based image generation, using a judge that sees both the program and rendered image, improves benchmark scores and human preference.
Recent improvements in the coding ability of language models have made code an emerging paradigm for image generation: the model writes a program, and a renderer turns it into an image. We benchmark frontier and open-weight LLMs on code-based image generation (CIG) and ask two further questions: 1) can open-source LLMs learn this capability from stronger models through post-training, and 2) does having a program enable a better reward for training? To answer them, we post-train open-source LLMs in two stages: distillation with supervised fine-tuning from a mixture of stronger teachers, then reinforcement learning with GRPO. We compare rewards that differ only by what the judge is shown: the image, the program, or both. We find that 1) after post-training, our model, Pictor-27B, matches or beats its teacher mix on GenEval2 and PRISM-Bench. 2) The program does enable a better reward: the model trained with the judge shown both image and program gains 18.0 GenEval2 GM points over its base model, against 15.5 for the program alone and 14.3 for the image alone. People also prefer its images to those of the image-only model. We analyse why. The image alone does not show what a shape is meant to be, and the program alone does not show whether it is visible in the render. Shown both, the judge can verify the intent of the program against the rendered image. Code, data and models are available at https://codeimagegen.github.io.
Get this paper in your agent:
hf papers read 2612.02434 Don't have the latest CLI?
curl -LsSf https://hf.co/cli/install.sh | bash Models citing this paper 7
CodeImageGen/Pictor-9B-SFT
Datasets citing this paper 1
CodeImageGen/Pictor-SFT-35k
Spaces citing this paper 0
No Space linking this paper
Collections including this paper 0
No Collection including this paper