UniCoder: Unified Visual-to-Code Generation via Symbolic Rewards and Reference-Guided Code Optimization
Yaozhi Zheng, Yilei Jiang, Manyuan Zhang, Yuxuan Wan, Kaituo Feng, Tianshuo Peng, Bo Zhang, Xiangyu Yue
Abstract
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) Reward Coarseness, where semantic metrics like CLIP scores fail to penalize fine-grained element deviations, and (2) 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 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 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.
Create a lesson
Related papers
UniDR: Learning To Generate Anatomical Deformations From Images via Unified Diffusion Modeling and Registration
Shared title terminologycs.CVSwakshar Deb, Tonmoy Hossain, Tom Fletcher et al.
PROPS: Can Visual Generators Keep the Current Look of a Prop?
Shared title terminologycs.CVXiangzhao Hao, Dianyi Wang, Keyan Zhou et al.
Inspect Before You Decide: Evidence-Guided Visual Search for Industrial Anomaly Detection
Shared title terminologycs.CVPeng Chen, Chao Huang, Yangyang Liu et al.
AgroVG+: Generalized Visual Grounding in Agriculture with Region-Supervised Action Generation
Shared title terminologycs.CVHaocheng Li, Juepeng Zheng, Guilong Xiao et al.
Counting Symbols on Technical Drawings: A Benchmark and Verified Rewards for MLLMs
Shared title terminologycs.CVJunxian Li, Ruixuan Yang, Zhenhua Xu
PartPO: Part-Level Policy Optimization for Shape-to-Program Generation
Shared title terminologycs.CVHannuo Zhang, Zhixiang Chi, Xuanchen Li et al.