VisCoder: Fine-Tuning LLMs for Executable Python Visualization Code Generation

Yuansheng Ni, Ping Nie, Kai Zou, Xiang Yue, Wenhu Chen
6/4/2025
cs.SEcs.AIcs.CL

No official code found. Best implementation: TIGER-AI-Lab/VisCoder (19 stars, Apache-2.0, last commit 2025-09-21).

Abstract

Large language models (LLMs) often struggle with visualization tasks like plotting diagrams, charts, where success depends on both code correctness and visual semantics. Existing instruction-tuning datasets lack execution-grounded supervision and offer limited support for iterative code correction, resulting in fragile and unreliable plot generation. We present VisCode-200K, a large-scale instruction tuning dataset for Python-based visualization and self-correction. It contains over 200K examples from two sources: (1) validated plotting code from open-source repositories, paired with natural language instructions and rendered plots; and (2) 45K multi-turn correction dialogues from Code-Feedback, enabling models to revise faulty code using runtime feedback. We fine-tune Qwen2.5-Coder-Instruct on VisCode-200K to create VisCoder, and evaluate it on PandasPlotBench. VisCoder significantly outperforms strong open-source baselines and approaches the performance of proprietary models like GPT-4o-mini. We further adopt a self-debug evaluation protocol to assess iterative repair, demonstrating the benefits of feedback-driven learning for executable, visually accurate code generation.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

The official code of "VisCoder: Fine-Tuning LLMs for Executable Python Visualization Code Generation" [EMNLP25]

192Shell, PythonJun 5, 20251 years agoApache-2.0
coderllmvisualization

Similar Papers

Cite this paper

@article{ni2025viscoder,
  title  = {VisCoder: Fine-Tuning LLMs for Executable Python Visualization Code Generation},
  author = {Yuansheng Ni and Ping Nie and Kai Zou and Xiang Yue and Wenhu Chen},
  year   = {2025},
  eprint = {2506.03930},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2506.03930v2}
}

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.03930.svg)](https://codeofpaper.com/paper/2506.03930)

Discussion