ChatPaper.aiChatPaper

VisCoder: 실행 가능한 파이썬 시각화 코드 생성을 위한 LLM 미세 조정

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

June 4, 2025
저자: Yuansheng Ni, Ping Nie, Kai Zou, Xiang Yue, Wenhu Chen
cs.AI

초록

대규모 언어 모델(LLMs)은 코드 정확성과 시각적 의미론 모두에 의존하는 다이어그램 및 차트 그리기와 같은 시각화 작업에서 종종 어려움을 겪는다. 기존의 지시 튜닝 데이터셋은 실행 기반 감독이 부족하고 반복적인 코드 수정을 위한 지원이 제한적이어서, 취약하고 신뢰할 수 없는 플롯 생성을 초래한다. 본 연구에서는 Python 기반 시각화 및 자체 수정을 위한 대규모 지시 튜닝 데이터셋인 VisCode-200K를 제안한다. 이 데이터셋은 두 가지 출처에서 얻은 20만 개 이상의 예제를 포함한다: (1) 오픈소스 저장소에서 검증된 플롯팅 코드와 자연어 지시문, 렌더링된 플롯이 짝을 이루는 데이터; (2) Code-Feedback에서 얻은 4만 5천 개의 다중 턴 수정 대화로, 런타임 피드백을 사용하여 오류가 있는 코드를 수정할 수 있도록 한다. 우리는 VisCode-200K를 사용하여 Qwen2.5-Coder-Instruct를 미세 조정하여 VisCoder를 생성하고, 이를 PandasPlotBench에서 평가한다. VisCoder는 강력한 오픈소스 베이스라인을 크게 능가하며 GPT-4o-mini와 같은 사유 모델의 성능에 근접한다. 또한, 반복적 수정을 평가하기 위해 자체 디버그 평가 프로토콜을 채택하여, 실행 가능하고 시각적으로 정확한 코드 생성을 위한 피드백 기반 학습의 이점을 입증한다.
English
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.
PDF212June 5, 2025