AesCode:解耦跨模态奖励的美学代码生成

·

研究论文 · 2026/10/14

生成幻灯片、海报和仪表板等信息丰富的视觉产物代码具有吸引力,因为输出结构化、可编辑且可验证。但代码模型无法看到布局和颜色在画布上的组合效果,常限制空间规划和美学质量。图像生成器擅长视觉设计,但可能错误呈现所要求的内容,使其输出难以作为直接复现的可靠目标。为此,我们提出 AesCode,它基于内容提示生成代码,同时使用同一提示生成的图像作为美学指导。AesCode 将目标表示为描述整个画布的设计图,使每个属性可归因。由此导出互补的跨模态奖励:确定性验证器对可从代码和渲染中解析的属性评分,VLM 评判器则用与图元素和关系绑定的样本特定 Visual Graph Rubric(VGR)评估不可解析属性。我们通过带逐通道归一化的强化学习优化这些解耦奖励,以共同提升空间规划、美学质量和可验证正确性。为评估该设定,我们构建了分别对可验证正确性和视觉质量评分的基准,其视觉分数与人类判断高度一致。我们发现参考图像显著提升现有模型生成代码的视觉质量,消融实验表明 AesCode 从参考图像作为模型输入和视觉奖励来源两方面获益。相对于给定相同参考的同等规模 Qwen3-VL 基线,AesCode-8B 和 AesCode-32B 的视觉质量分别提升 31.1 和 22.4 个百分点,达到与 GPT-5.5、Claude Opus 4.8 等闭源前沿模型相当的水平。

该工作针对代码生成视觉产物时模型无法感知画布布局与色彩组合效果的核心问题,提出解耦跨模态奖励与设计图表示,在可验证正确性和美学质量上同时取得显著提升,且基准的视觉评分与人类判断高度一致,对代码生成与视觉设计交叉领域具有参考价值。

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.

阅读原文

参与讨论