VinciCoder: Unifying Multimodal Code Generation via Coarse-to-fine Visual Reinforcement Learning

Xuanle Zhao, Deyang Jiang, Zhixiong Zeng, Lei Chen, Haibo Qiu, Jing Huang, Yufeng Zhong, Liming Zheng, Yilin Cao, Lin Ma · OpenReview

Abstract

Multimodal code generation has garnered significant interest within the research community. Despite the notable success of recent vision-language models (VLMs) on specialized tasks like chart-to-code generation, their reliance on single-task training regimens fosters a narrow paradigm that hinders the development of generalized VIsioN Code Intelligence. In this work, we introduce VinciCoder, a unified multimodal code generation model that addresses this limitation via a two-stage training framework. We begin by constructing a large-scale Supervised Finetuning (SFT) corpus comprising 1.6M image-code pairs for tasks involving direct code generation and visual-based code refinement. Subsequently, we introduce a Visual Reinforcement Learning (ViRL) strategy, which employs a coarse-to-fine reward mechanism to improve visual fidelity by calculating visual similarity across local and global image patches. Extensive experiments on diverse multimodal code generation benchmarks demonstrate that VinciCoder achieves state-of-the-art performance, surpassing recent open-source models. The ablation study further validates the effectiveness of our proposed coarse-to-fine ViRL strategy.

Introduction

While Large Language Models (LLMs) have reached expert-level proficiency in text-based coding, their multimodal counterparts—Vision-Language Models (VLMs)—often struggle with "Vision-to-Code" tasks. Most existing models are highly specialized; for instance, a model might excel at converting a chart into Python code but fail significantly when tasked with generating HTML/CSS for a webpage or LaTeX for a scientific diagram.

VinciCoder training pipeline and multimodal code generation examples.

The authors of VinciCoder identify two primary bottlenecks in the current landscape: a lack of unity across diverse visual-to-code tasks and the use of brittle rewards during training. Standard Supervised Fine-Tuning (SFT) relies on text-matching, which is insufficient for code where the ultimate measure of success is the rendered visual output rather than the specific string of characters used to produce it.

Methodology

VinciCoder addresses these challenges through a two-stage training framework designed to bridge the gap between visual perception and code logic.

Large-Scale Supervised Fine-Tuning (SFT)

The first stage involves training on a massive dataset of 1.6 million image-code pairs. A key innovation here is the Visual-based Code Refinement task. Rather than simply generating code from scratch, the model is trained to take an imperfect code snippet and a target image, then "debug" the code until the rendered visual output matches the target. This approach forces the model to understand the direct relationship between specific code segments and their visual manifestations.

Visual Reinforcement Learning (ViRL)

To further refine the model's precision, the researchers introduced a novel Visual Reinforcement Learning (ViRL) strategy using Group Relative Policy Optimization (GRPO). Unlike traditional RL that uses rule-based textual rewards, ViRL evaluates the model based on the visual similarity between the rendered output of the generated code and the original source image.

The coarse-to-fine Visual Reinforcement Learning (ViRL) framework.

As shown in the framework above, VinciCoder employs a coarse-to-fine reward mechanism. To ensure high fidelity, the reward function utilizes DINOv2 (a self-supervised vision backbone) to compare both a downsampled "global" thumbnail for layout and "local" patches for fine-grained details like text, icons, or specific data points in a chart. The authors found DINOv2 superior to CLIP for this purpose due to its ability to capture precise spatial features.

Experimental Setup and Datasets

The model was trained on a diverse corpus of 1.6M SFT pairs (including 300k refinement samples) and 42k RL samples. Evaluation spanned several rigorous benchmarks:

  • ChartMimic: Chart-to-code generation.
  • Design2Code: Webpage-to-HTML conversion.
  • UniSVG: Image-to-SVG generation.
  • Image2Struct: Image-to-LaTeX conversion.
  • ChemDraw: A new benchmark introduced by the authors for converting molecular structure images into SMILES strings and rendering code.

Key Results and Insights

VinciCoder (built on the Qwen-VL and Qwen-Coder series) establishes a new state-of-the-art for open-source multimodal code generation.

  • Performance: VinciCoder-8B consistently outperformed larger models, such as InternVL3.5-14B and Qwen2.5-VL-72B. On the ChartMimic benchmark, it achieved a 91.6% execution rate, demonstrating high reliability.
  • Proprietary Rivalry: In specialized scientific and chart-to-code domains, VinciCoder approached or matched the performance of closed-source giants like GPT-4o and Gemini 1.5 Pro.
  • Visual Feedback: The study confirms that RL based on rendered visual similarity is significantly more effective than text-matching RL. This approach makes the training "language agnostic," allowing the model to learn the visual intent regardless of the target programming language.

Conclusion

VinciCoder demonstrates that unifying diverse multimodal coding tasks under a single framework with visual-centric reinforcement learning is a powerful path toward generalized vision-code intelligence. While challenges remain—particularly in the high complexity of SVG generation and the computational cost of rendering rewards—VinciCoder represents a significant leap forward for open-source multimodal AI.

Summary updated

BibTeX
@misc{zhao2025vincicoder,
  author = {Xuanle Zhao and Deyang Jiang and Zhixiong Zeng and Lei Chen and Haibo Qiu and Jing Huang and Yufeng Zhong and Liming Zheng and Yilin Cao and Lin Ma},
  title = {{VinciCoder: Unifying Multimodal Code Generation via Coarse-to-fine Visual Reinforcement Learning}},
  year = {2025},
  eprint = {2511.00391},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.00391},
}
Figure