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

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Ni, Yuansheng, Nie, Ping, Zou, Kai, Yue, Xiang, Chen, Wenhu
Format: Preprint
Veröffentlicht: 2025
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866909811826753536
author Ni, Yuansheng
Nie, Ping
Zou, Kai
Yue, Xiang
Chen, Wenhu
author_facet Ni, Yuansheng
Nie, Ping
Zou, Kai
Yue, Xiang
Chen, Wenhu
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2506_03930
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle VisCoder: Fine-Tuning LLMs for Executable Python Visualization Code Generation
Ni, Yuansheng
Nie, Ping
Zou, Kai
Yue, Xiang
Chen, Wenhu
Software Engineering
Artificial Intelligence
Computation and Language
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.
title VisCoder: Fine-Tuning LLMs for Executable Python Visualization Code Generation
topic Software Engineering
Artificial Intelligence
Computation and Language
url https://arxiv.org/abs/2506.03930