arXiv · 2612.03558
Code-as-Agent: A Meta-Agent Automatically Evolving T2I Agents as Executable Programs
Abstract
Text-to-image (T2I) agents orchestrating multiple tools have recently attracted increasing attention. However, their reliance on hand-crafted tool chains hinders rapid iteration and limits the agent design space, leading to suboptimal performance. In this paper, we introduce **Code-as-Agent**, a meta-agent framework that represents a T2I agent as an executable program and automatically evolves it from a minimal seed into an increasingly capable agent program. Beginning with a program containing only a single image-generation call, the meta-agent repeatedly diagnoses its limitations, revises its code, and evaluates the revised program. This diagnosis--revision--evaluation loop replaces sporadic manual debugging with systematic automated evolution. By operating in program space rather than over fixed tool chains, the meta-agent can jointly evolve agent functionality and control flow, substantially broadening the space of possible agent designs. Once evolved, the resulting program directly serves as the T2I agent at deployment time. Experiments show that the evolved agents outperform manually designed workflows and achieve state-of-the-art performance across multiple T2I agent benchmarks. Moreover, they exhibit workflow structures and functional modules that are rather different from existing hand-crafted designs, providing evidence that program-space evolution can discover useful agent designs beyond existing manually designed workflows. The code can be found at https://github.com/PolyU-VCLab/CodeasAgent .
Explore related subjects
Keep this discovery
Explore connections, maps & timelines
Zhengqiang Zhang, Qiaosi Yi, Lingchen Sun, Xiangtao Kong, Rongyuan Wu, Lei Zhang. 2026-12-02. Code-as-Agent: A Meta-Agent Automatically Evolving T2I Agents as Executable Programs. https://searcharxiv.org/abs/2612.03558
Citations retain the original authors and DOI and include this site’s record URL. If this discovery service contributed to your research, you can also cite Search arXiv by Indiciae: BibTeX · RIS.