arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.31732cs.CV
收藏

UniCoder: 通过符号奖励和参考引导代码优化的统一视觉到代码生成

UniCoder: Unified Visual-to-Code Generation via Symbolic Rewards and Reference-Guided Code Optimization

The Chinese University of Hong Kong(香港中文大学);Shanghai Artificial Intelligence Laboratory(上海人工智能实验室)

Yaozhi Zheng, Yilei Jiang, Manyuan Zhang, Yuxuan Wan, Kaituo Feng, Tianshuo Peng, Bo Zhang, Xiangyu Yue

AI总结:

提出UniCoder框架,通过符号属性对齐实现密集元素级奖励,并利用参考引导代码优化策略克服探索停滞,在多个基准上达到与专有模型相当的性能。

摘要:

视觉到代码生成将科学图表、矢量图形和网页转换为可执行脚本,需要像素级精确对齐,而标准多模态大语言模型仅通过监督微调无法实现。尽管强化学习在理论上提供了弥合这一差距的途径,但其应用受到两个基本障碍的阻碍:(1) 奖励粗糙性,即语义指标如CLIP分数无法惩罚细粒度元素偏差;(2) 探索停滞,即稀疏、异构的代码搜索空间阻止策略引导有效轨迹。为克服这些限制,我们引入了UniCoder,一个统一的强化学习框架,集成了两种新颖机制。首先,我们提出符号属性对齐,使用轻量级辅助LLM将生成的代码解析为离散视觉属性(如十六进制颜色、坐标范围),实现密集的逐元素奖励计算。其次,为逃离局部最优,我们设计了参考引导代码优化,一种将真实轨迹动态注入低性能rollout组的策略,将盲目探索转化为引导策略改进。在ChartMimic、UniSVG、Design2Code和ScreenBench基准上的大量实验表明,我们的8B参数模型不仅超越了所有开源基线,还达到了与专有模型相当的最先进性能,为通用视觉到代码合成建立了新范式。

英文摘要:

Visual-to-Code generation, which transforms scientific plots, vector graphics, and webpages into executable scripts, demands a level of pixel-precise alignment that standard Multimodal Large Language Models (MLLMs) fail to achieve through Supervised Fine-Tuning (SFT) alone. While Reinforcement Learning (RL) offers a theoretical pathway to bridge this gap, its application is hindered by two fundamental obstacles: (1) \textit{Reward Coarseness}, where semantic metrics like CLIP scores fail to penalize fine-grained element deviations, and (2) \textit{Exploration Stagnation}, where the sparse, heterogeneous code search space prevents the policy from bootstrapping valid trajectories. To overcome these limitations, we introduce UniCoder, a unified RL framework that integrates two novel mechanisms. First, we propose \textbf{Symbolic Attribute Alignment}, which employs a lightweight auxiliary LLM to parse generated code into discrete visual attributes (e.g., hex colors, coordinate limits), enabling dense, element-wise reward computation. Second, to escape local optima, we devise \textbf{Reference-Guided Code Optimization}, a strategy that dynamically injects ground-truth trajectories into low-performing rollout groups, transforming blind exploration into guided policy improvement. Extensive experiments on ChartMimic, UniSVG, Design2Code and ScreenBench benchmarks demonstrate that our 8B-parameter model not only surpasses all open-source baselines but also achieves state-of-the-art performance comparable to proprietary models, establishing a new paradigm for generalized visual-to-code synthesis.

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

↑