G en P ilot: A Multi-Agent System for Test-Time Prompt Optimization in Image Generation (2025)

Abstract: Text-to-image synthesis has made remarkable progress, yet accurately interpreting complex and lengthy prompts remains challenging, often resulting in semantic inconsistencies and missing details. Existing solutions, such as fine-tuning, are model-specific and require training, while prior automatic prompt optimization (APO) approaches typically lack systematic error analysis and refinement strategies, resulting in limited reliability and effectiveness. Meanwhile, test-time scaling methods operate on fixed prompts and on noise or sample numbers, limiting their interpretability and adaptability. To solve these, we introduce a flexible and efficient test-time prompt optimization strategy that operates directly on the input text. We propose a plug-and-play multi-agent system called GenPilot, integrating error analysis, clustering-based adaptive exploration, fine-grained verification, and a memory module for iterative optimization. Our approach is model-agnostic, interpretable, and well-suited for handling long and complex prompts. Simultaneously, we summarize the common patterns of errors and the refinement strategy, offering more experience and encouraging further exploration. Experiments on DPG-bench and Geneval with improvements of up to 16.9% and 5.7% demonstrate the strong capability of our methods in enhancing the text and image consistency and structural coherence of generated images, revealing the effectiveness of our test-time prompt optimization strategy. The code is available at https://github.com/27yw/GenPilot.

## introduction recently, text-to-image generation models @xcite @xcite ., * corresponding author. to improve multimodal alignment in t2i generation, existing efforts @xcite @xcite can be broadly categorized into fine-tuning and prompting. while fine-tuning or retraining model parameters to capture detailed semantics information, it is often computationally intensive and model-specific. in contrast, manual prompting relies heavily on human intuition, lacking scalability across prompts, tasks, and architectures. recent works, such as opt2i @xcite , @xcite , and ap-adapter @xcite , explore automatic prompt optimization to enhance generation quality. however, most approaches require additional training and are designed for certain models, also often lack systematic error analysis. with the advancement of large language models, testtime scaling has been explored in various scenarios by leveraging additional computational resources and inference-time adjustments to improve performance. some studies extend this idea to image generation. sana-1.5 @xcite generates many samples and a verifier selects the best sample. ## conclusion in this work, we propose genpilot, a flexible and effective test-time prompt optimization multi-agent system for enhanced text-to-image generation, aiming to address the semantic gap and the compositionality catastrophe, especially for complicated and lengthy prompts. unlike previous approaches, genpilot performs test-time scaling directly on the input prompt space, formulating it as a search problem to find the optimal prompts for t2i models, iteratively refining the prompt with clustering algorithm. the system integrates modular agents for error analysis, prompt editing, multi-modal llm scoring, and memory-based feedback to support dynamic adjustment. extensive experiments on geneval and dpg-bench demonstrate the effectiveness and superiority of genpilot over other methods, highlighting the potential of test-time prompt optimization for enhancing t2i generation. we further release a set of common error patterns and refinement strategies, providing a practical resource for future research on prompt controllability and optimization.