arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2612.00307cs.CVcs.AIcs.CL
收藏

谁绘制了那个像素?面向图像到代码生成与编辑的细粒度视觉归因

Who Drew That Pixel? Fine-Grained Visual Attribution for Image-to-Code Generation and Editing

Johns Hopkins University(约翰斯·霍普金斯大学);University of Washington(华盛顿大学)

Hexuan Wang, Zixian Ma, Ranjay Krishna, Jaemin Cho

AI总结:

该研究提出渲染归因方法,将渲染元素追溯至源代码以实现细粒度视觉反馈,在图像到代码生成与编辑的多个基准上优于GRPO,还能提升智能体的视觉相似性与代码编辑能力。

摘要:

图像到代码生成的强化学习通常会对渲染输出与参考图像之间的整体视觉相似性进行奖励。然而,诸如GRPO之类的方法会为程序中的每个token分配相同的优势,使得正确绘制元素的代码与错误绘制元素的代码获得相同的学习信号。为解决该问题,我们提出了渲染归因(render attribution),它可将渲染元素追溯至其源代码,从而实现细粒度视觉反馈。在训练期间,我们将参考图像和渲染图像分解为单个元素,基于几何相似性进行一对一匹配,并为负责的代码token分配元素特定的优势,即使是在共享定义的情况下也可实现。在涵盖SVG、TikZ和HTML的五个基准(VFIG-Bench、VFIG-OOD、SVG-Bench Emoji、DaTikZ-v3和Design2Code)上,使用三种不同的起始模型,我们的方法优于GRPO(例如,在VFIG-Bench上LPIPS降低23%),在所有28项基准指标对比中均表现更优,且额外训练步骤时间最多仅增加1.3%。结合额外的代码感知奖励和相应的信用分配,它还能更好地保留代码结构并提升可编辑性。作为智能体工具,渲染归因即使对于前沿智能体Claude Sonnet 5.5,也能在相同回合预算下将LPIPS提升17%,并让一个开源27B智能体在4个回合内超越其16回合的结果,同时减少84%的token使用量。通过将渲染元素与其代码关联,渲染归因将视觉反馈转化为学习和编辑的精确指导。

英文摘要:

Reinforcement learning for image-to-code generation typically rewards the overall visual similarity between rendered outputs and reference images. However, methods such as GRPO assign the same advantage to every token in a program, giving code that draws an element correctly the same learning signal as code that draws it incorrectly. To address this, we introduce render attribution, which traces rendered elements back to their source code, enabling fine-grained visual feedback. During training, we decompose the reference and rendered images into individual elements, match them one-to-one based on geometric similarity, and assign element-specific advantages to the responsible code tokens, even across shared definitions. Across five benchmarks (VFIG-Bench, VFIG-OOD, SVG-Bench Emoji, DaTikZ-v3, and Design2Code) spanning SVG, TikZ, and HTML with three different starting models, our method outperforms GRPO (e.g., 23% lower LPIPS on VFIG-Bench), improving all 28 benchmark-metric comparisons with at most 1.3% additional training-step time. With an additional code-aware reward and corresponding credit assignment, it also better preserves code structure and improves editability. As an agent tool, render attribution improves LPIPS by 17% at the same turn budget even for a frontier agent (Claude Sonnet 5.5), and lets an open 27B agent surpass its 16-turn result in four turns with 84% fewer tokens. By linking rendered elements to their code, render attribution turns visual feedback into precise guidance for learning and editing.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑