[Paper Review] Visual Programming for Text-to-Image Generation and Evaluation
This paper introduces VPGen, a visual programming framework for interpretable, step-by-step text-to-image (T2I) generation that uses a fine-tuned language model to generate object counts and layouts before passing them to a layout-to-image diffusion model. It also proposes VPEval, an explainable evaluation framework using task-specific visual modules and multimodal explanations. VPGen achieves superior control over object counts, spatial relations, and scales, while VPEval shows higher human correlation than single-model baselines.
As large language models have demonstrated impressive performance in many domains, recent works have adopted language models (LMs) as controllers of visual modules for vision-and-language tasks. While existing work focuses on equipping LMs with visual understanding, we propose two novel interpretable/explainable visual programming frameworks for text-to-image (T2I) generation and evaluation. First, we introduce VPGen, an interpretable step-by-step T2I generation framework that decomposes T2I generation into three steps: object/count generation, layout generation, and image generation. We employ an LM to handle the first two steps (object/count generation and layout generation), by finetuning it on text-layout pairs. Our step-by-step T2I generation framework provides stronger spatial control than end-to-end models, the dominant approach for this task. Furthermore, we leverage the world knowledge of pretrained LMs, overcoming the limitation of previous layout-guided T2I works that can only handle predefined object classes. We demonstrate that our VPGen has improved control in counts/spatial relations/scales of objects than state-of-the-art T2I generation models. Second, we introduce VPEval, an interpretable and explainable evaluation framework for T2I generation based on visual programming. Unlike previous T2I evaluations with a single scoring model that is accurate in some skills but unreliable in others, VPEval produces evaluation programs that invoke a set of visual modules that are experts in different skills, and also provides visual+textual explanations of the evaluation results. Our analysis shows that VPEval provides a more human-correlated evaluation for skill-specific and open-ended prompts than widely used single model-based evaluation. We hope that our work encourages future progress on interpretable/explainable generation and evaluation for T2I models.
Motivation & Objective
- To address the lack of interpretable and controllable text-to-image generation by decomposing the task into modular, step-by-step visual programming components.
- To overcome the limitations of end-to-end T2I models in handling spatial relationships, object counts, and unseen object classes.
- To develop an evaluation framework that provides explainable, skill-specific assessments with visual and textual justifications, improving alignment with human judgments.
- To enable stronger spatial and semantic control in T2I generation by leveraging the world knowledge of large language models.
- To demonstrate that modular, programmatic evaluation using expert visual modules yields higher human correlation than single-model evaluation baselines.
Proposed method
- VPGen decomposes T2I generation into three sequential modules: object/count generation, layout generation, and image generation, each executed via specialized components.
- A fine-tuned Vicuna language model generates object lists and spatial layouts from text prompts, leveraging pre-trained world knowledge for unseen objects.
- Layout-to-image diffusion models (e.g., GLIGEN) generate final images from the predicted layouts, enabling high-fidelity image synthesis.
- VPEval constructs evaluation programs that dynamically invoke specialized visual modules—such as object detectors, depth estimators, and VQA models—based on prompt semantics.
- Each evaluation module provides visual and textual explanations of its assessment, enabling interpretable and multi-skill evaluation of generated images.
- A large language model (GPT-3.5-Turbo) generates evaluation programs on-the-fly for open-ended prompts without fine-tuning on annotated programs.
Experimental results
Research questions
- RQ1Can a step-by-step visual programming framework improve spatial and semantic control in text-to-image generation compared to end-to-end models?
- RQ2To what extent can a language model’s world knowledge improve generalization to unseen object classes in layout-guided T2I generation?
- RQ3Can a modular evaluation framework with expert visual modules achieve higher human correlation than single-model evaluation baselines?
- RQ4How effective is the combination of visual and textual explanations in improving interpretability and reliability of T2I evaluation?
- RQ5Can dynamic program generation for evaluation maintain high accuracy and coverage without fine-tuning on expensive annotations?
Key findings
- VPGen outperforms strong baselines like Stable Diffusion in generating accurate object counts, spatial relations, and scales, demonstrating superior layout control.
- On skill-based prompts, VPGen achieved higher scores than baselines in Count (63.7), Spatial (63.8), and Scale (51.2) skills, with VPEval † reaching 79.0 in Scale.
- VPEval achieved a human correlation of 66.6 on skill-based prompts, significantly outperforming CLIP (33.2), captioning metrics (BLEU-4: 18.3), and VQA (55.9) baselines.
- In open-ended prompts, VPEval achieved a Spearman’s ρ of 56.9 with human judgments, improving to 60.3 with VPEval † using stronger VQA modules.
- Human evaluation showed near-perfect inter-annotator agreement (κ = 0.85, α = 0.85), validating the reliability of the human judgments used to assess VPEval.
- Program faithfulness analysis confirmed high coverage of prompt elements and high per-module accuracy, indicating robustness in program generation and execution.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.