Code-based Image Generation: Benchmarking, Baselines, and Improved Rewards
Abstract
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.
Create a lesson
Metadata
- Comments
- Project page: https://codeimagegen.github.io
Related papers
Local Background Fitting for Reference-Based Localization of Generative Image Edits
Shared title terminologycs.CVHailong Wang, Wuzheng Tan, Bing Han et al.
Guiding Unified Multimodal Models to Generate Images from Long Prompts
Shared title terminologycs.CVHao Zhang, Jiaxin Qi, Jianqiang Huang
ScaleTrojan: Uncovering Backdoor Vulnerability in Visual Autoregressive Text-to-Image Generation
Shared title terminologycs.CVBin Cui, Qianqian Xu, Shilong Bao et al.
Noise Stability Predicts Which Face Images Are Easy to Attack: A Benchmark of Fragility Estimators Across Face Recognizers
Shared title terminologycs.CVAlexander Apartsin, Yehudit Aperstein
DualSight: Learning to Disentangle Artifact and Semantic Features for Detection of Diffusion-Generated Images
Shared title terminologycs.CVAhmed Abdullah, Nikolas Ebert, Oliver Wasenmüller
GaussianDiT: 3D Gaussian Scene Generation with Spatial Latent Diffusion
Shared title terminologycs.CVRunyi Yang, Mengjiao Ma, Letian Shi et al.