arXiv:2506.14837cs.CVcs.AI2025-06被引 7

通过分步指令提升图表转代码的准确率

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

  • 拆解任务为视觉理解与代码转换,用描述和差异指令引导模型
  • 在Qwen2-VL和GPT-4o上均优于现有方法,生成代码更准确
  • 适合需要高精度图表自动化生成的研究者与开发者

多模态大模型虽在视觉任务中表现优异,但在图表转代码任务上仍不理想。该任务要求模型将图表精确转化为可执行代码,需兼具精准视觉理解与结构化代码映射能力。直接提示模型效果不佳。为此,本文提出{ChartIR},一种基于结构化指令的迭代优化方法。首先区分视觉理解与代码翻译两个子任务:设计“描述”与“差异”两类结构化指令,分别捕捉参考图的视觉元素及生成图与参考图之间的差异,将视觉特征转化为语言表征,助力代码生成。其次,将流程分解为初始生成与迭代优化两阶段,实现输出逐步改进。实验表明,在开源模型Qwen2-VL与闭源模型GPT-4o上,本方法均显著优于对比方法。

原文摘要 · Abstract (English)

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.

图表生成多模态代码生成指令优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。