AesCode: Aesthetic Code Generation with Decoupled Cross-Modal Rewards
Abstract
Generating information-rich visual artifacts such as slides, posters, and dashboards as code is appealing because the outputs are structured, editable, and verifiable. Yet code models cannot see how their choices of layout and color come together on the canvas, often limiting spatial planning and aesthetic quality. Image generators excel at visual design but can misrender requested content, making their outputs unreliable targets for direct reproduction. We therefore introduce AesCode, which generates code grounded in the content prompt while using an image generated from the same prompt as an aesthetic guidance. To do so, AesCode represents the target as a design graph that describes the whole canvas and makes each property attributable. From this graph, we derive complementary cross-modal rewards: deterministic verifiers score properties parsable from code and rendering, while a VLM judge assesses the non-parsable ones with a sample-specific Visual Graph Rubric (VGR) tied to graph elements and relations. We optimize these decoupled rewards through reinforcement learning with per-channel normalization to jointly improve spatial planning, aesthetic quality, and verifiable correctness. To evaluate this setting, we build a benchmark that scores verifiable correctness and visual quality separately, with visual scores highly consistent with human judgments. We find that reference images substantially improve the visual quality of code generated by existing models, and ablations show that AesCode benefits from references both as model input and as a source of visual rewards. Relative to same-scale Qwen3-VL baselines given the same references, AesCode-8B and AesCode-32B improve visual quality by 31.1 and 22.4 percentage points, reaching scores comparable to those of closed-source frontier models such as GPT-5.5 and Claude Opus 4.8.
The following analysis is generated by AI and may contain errors. It is separate from the authors’ abstract and is not peer review.
Research summary
AesCode introduces a decoupled cross-modal reward system using a Design Graph representation to optimize aesthetic code generation via reinforcement learning. The paper presents a rigorous methodology that effectively combines deterministic verification with VLM-based aesthetic judgment, achieving state-of-the-art results that rival frontier closed-source models, thereby validating the potential of code-based approaches for high-fidelity visual design.
Methodology
The paper proposes AesCode, a framework for generating visual artifacts (slides, posters) as code. The core innovation is the "Design Graph" representation, which decomposes the visual canvas into attributable properties. This allows for a decoupled reward system: deterministic verifiers check parsable properties (e.g., text presence, layout constraints), while a Vision-Language Model (VLM) judge assesses non-parsable aesthetic qualities using a sample-specific Visual Graph Rubric (VGR). The training utilizes Reinforcement Learning (RL) with per-channel normalization to optimize these distinct reward signals simultaneously. This approach effectively bridges the gap between the structural reliability of code generation and the aesthetic fidelity of image generation.
Results & evaluation
The authors introduce a new benchmark that separates verifiable correctness from visual quality, noting high consistency with human judgments. Experiments show that AesCode-8B and AesCode-32B outperform same-scale Qwen3-VL baselines by 31.1 and 22.4 percentage points in visual quality, respectively, when given reference images. The results claim parity with closed-source frontier models like GPT-5.5 and Claude Opus 4.8. The ablation studies confirm the utility of reference images both as input context and as a source for visual rewards.
Reproducibility
The paper provides a project page and likely code release (implied by the GitHub URL structure). The methodology is detailed enough to understand the RL setup and reward decomposition. However, the reliance on a VLM judge for aesthetic scoring introduces a dependency on the specific VLM used, which may vary in robustness.
Limitations
The primary limitation is the dependency on high-quality reference images for optimal performance; without them, the aesthetic guidance is lost. Additionally, the "Design Graph" construction may be complex for highly unstructured or free-form artistic layouts, potentially limiting generalizability to strict UI/dashboard design. The evaluation relies heavily on VLM-based scoring, which, while consistent with humans, is not a ground-truth metric.
Broader impact
This work has significant implications for the "code-as-design" paradigm, making it viable for professional-grade visual content creation. By decoupling aesthetic and functional rewards, it offers a template for other multimodal generation tasks where structural integrity and perceptual quality are distinct objectives. It could drive adoption of code-based design tools in enterprise settings where editability is crucial. AesCode introduces a decoupled cross-modal reward system using a Design Graph representation to optimize aesthetic code generation via reinforcement learning. The paper presents a rigorous methodology that effectively combines deterministic verification with VLM-based aesthetic judgment, achieving state-of-the-art results that rival frontier closed-source models, thereby validating the potential of code-based approaches for high-fidelity visual design.
Author of this paper? Send a correction.