Improved Iterative Refinement for Chart-to-Code Generation via Structured Instruction

Chengzhi Xu, Yuyang Wang, Lai Wei, Lichao Sun, Weiran Huang
6/15/2025
cs.CVcs.AI

No confident code implementation found for this paper.

Abstract

Recently, multimodal large language models (MLLMs) have attracted increasing research attention due to their powerful visual understanding capabilities. While they have achieved impressive results on various vision tasks, their performance on chart-to-code generation remains suboptimal. This task requires MLLMs to generate executable code that can reproduce a given chart, demanding not only precise visual understanding but also accurate translation of visual elements into structured code. Directly prompting MLLMs to perform this complex task often yields unsatisfactory results. To address this challenge, we propose {ChartIR}, an iterative refinement method based on structured instruction. First, we distinguish two tasks: visual understanding and code translation. To accomplish the visual understanding component, we design two types of structured instructions: description and difference. The description instruction captures the visual elements of the reference chart, while the difference instruction characterizes the discrepancies between the reference chart and the generated chart. These instructions effectively transform visual features into language representations, thereby facilitating the subsequent code translation process. Second, we decompose the overall chart generation pipeline into two stages: initial code generation and iterative refinement, enabling progressive enhancement of the final output. Experimental results show that, compared to other method, our method achieves superior performance on both the open-source model Qwen2-VL and the closed-source model GPT-4o.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Cite this paper

@article{xu2025improved,
  title  = {Improved Iterative Refinement for Chart-to-Code Generation via Structured Instruction},
  author = {Chengzhi Xu and Yuyang Wang and Lai Wei and Lichao Sun and Weiran Huang},
  year   = {2025},
  eprint = {2506.14837},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2506.14837v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2506.14837.svg)](https://codeofpaper.com/paper/2506.14837)

Discussion