AesCode:基于解耦跨模态奖励的审美代码生成
AesCode: Aesthetic Code Generation with Decoupled Cross-Modal Rewards
AI总结:
AesCode通过设计图与解耦跨模态奖励优化代码生成,结合参考图像提升审美质量,在视觉质量评分上较同规模Qwen3-VL基线提升显著,达到闭源前沿模型水平。
摘要:
生成幻灯片、海报、仪表板等信息丰富的视觉制品代码颇具吸引力,因为输出结果结构化、可编辑且可验证。然而代码模型无法感知布局和颜色选择在画布上的整体呈现,往往限制了空间规划和审美质量。图像生成器擅长视觉设计,但可能错误渲染请求的内容,使其输出难以直接用于复现。因此我们引入AesCode,该模型生成基于内容提示的代码,同时使用同一提示生成的图像作为审美指导。为此,AesCode将目标表示为描述整个画布且使每个属性可归因的设计图。从该图中,我们推导互补的跨模态奖励:确定性验证器对可从代码和渲染中解析的属性进行评分,而视觉语言模型(VLM)评判者则使用与图元素及关系绑定的样本特定视觉图准则(VGR)评估不可解析的属性。我们通过带逐通道归一化的强化学习优化这些解耦奖励,以共同提升空间规划、审美质量和可验证正确性。为评估该设置,我们构建了一个分别对可验证正确性和视觉质量评分的基准,其视觉评分与人类判断高度一致。我们发现参考图像可显著提升现有模型生成代码的视觉质量, ablation实验表明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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。