TL;DR
This paper investigates whether general-purpose coding agents (like GPT-6-Astra) can serve as effective visual generators by writing executable code rather than using traditional diffusion models. The researchers find that while these agents lack the photorealistic "finish" of native image generators, they exhibit superior structural fidelity and maintain a consistent, shared internal representation of scenes—a "visual language of thought"—across different drawing interfaces and even when generating images one pixel at a time.
What Problem Does This Paper Address?
Modern image generation is dominated by specialized models like Stable Diffusion or Midjourney. While these models produce stunningly realistic images, the construction process is implicit and often struggles with precise structural constraints, text rendering, and complex spatial reasoning.
The authors explore an alternative: agentic visual generation. Instead of predicting pixels directly, can an LLM act as a "coding agent" that writes programs (SVG, JavaScript, Python) to build an image? This approach shifts the focus from "perceptual richness" (how real it looks) to "compositional accuracy" (how well it follows instructions). The paper also tackles a deeper cognitive question: Do these models possess a shared internal "mental map" of a scene that exists independently of the specific code they are writing?
Methods
The researchers developed a framework of drawing harnesses—different interfaces through which an agent can express visual ideas:
- Canvas 2D/SVG: Writing code for vector graphics or JavaScript drawing commands.
- Shapes: Using a sequence of geometric primitives (rectangles, ellipses).
- GUI: Operating a graphical painting application (JS Paint) via mouse clicks and drags.
- Blender: Writing Python scripts to generate 3D scenes.
- Pixel Harness: The most extreme case, where the agent assigns the color of a single pixel $(x, y)$ in a fresh, independent session for every single pixel in a grid.
To test the "Language of Thought" hypothesis, they conducted spatial coherence tests. An agent was asked to arrange furniture in a room and then "draw" the room from multiple viewpoints. Crucially, they tested if the agent could maintain a consistent layout even after its previous drawings and furniture lists were deleted from its context window.
Datasets
The study introduces AgentDrawBench, a new 200-prompt benchmark designed to evaluate agent-based generation. It spans seven domains:
- Photographic scenes
- Human/organic subjects
- Product/material design
- Spatial/3D layouts
- Stylized illustrations
- Designed visuals (posters, UI)
- Diagrams/symbolic tasks
The prompts were curated from existing benchmarks like Arena-T2I-Hard and BizGenEval to provide a rigorous comparison against native image generators. The authors also utilized WorldBench for visual question-answering (VQA) tasks to see if agents could better understand an image by first reconstructing it as code.
Key Insights and Ideas
- Architects, Not Painters: Coding agents excel at structure. In domains like graphic design and symbolic diagrams, they frequently outperform native image generators because they can precisely place elements and render legible text.
- Code as a Reasoning Tool: In VQA tasks, agents were often more accurate when answering questions based on their own SVG source code than when looking at the actual rendered image. The code acts as a "visual language of thought" that strips away distracting textures to reveal the underlying logic of the scene.
- The Internal Imagery Hypothesis: Perhaps the most striking finding is that agents maintain a consistent "mental image." When asked to provide the color for 16,384 pixels independently (with no memory of the previous pixels), the resulting assembly still formed a recognizable, coherent image of the Mona Lisa.
- Spatial Persistence: Agents can maintain a "world state" in their weights. Even when their conversation history was wiped, they could "revisit" a room they had previously designed and draw it from a new angle with high consistency, suggesting they aren't just generating code on the fly but are referencing a stable internal arrangement.
Key Results
- Structural Fidelity: GPT-6-Astra (using Canvas 2D) achieved 85.8% structural fidelity, significantly higher than
gpt-image-1(68.8%) and nearly matchinggpt-image-2(90.7%). - Design Dominance: On design and symbolic tasks, the coding agent achieved a 92.0% holistic win rate against native generators.
- Perceptual Gap: The agents struggled with realism. Win rates for anatomy, light transport, and materials were generally below 50% compared to native models.
- VQA Accuracy: Answering from reconstructed SVG code yielded 69.0% accuracy, compared to 65.0% from the render and 74.0% from the original image. In academic and digital-world domains, the code-based answers were actually more accurate than those based on the original images.
Limitations and Future Work
- Perceptual Richness: The current output often looks like "clip art" or technical diagrams. The authors suggest that future work could involve hybrid systems where agents provide the structural "skeleton" and a diffusion model provides the "skin."
- Computational Cost: Generating images via iterative coding and rendering is significantly more expensive in terms of tokens and time than a single forward pass of a diffusion model.
- Interface Dependency: The agent's performance is heavily tied to the quality of the drawing API (harness) it is given. Developing more "human-like" drawing interfaces for agents is a promising direction.
- Evaluation: The study relies heavily on VLM-based (Vision-Language Model) automated judges, which, while standard, may have their own biases compared to human aesthetic judgment.
Summary updated