{"id":28653905,"url":"https://github.com/tiger-ai-lab/viscoder","last_synced_at":"2025-07-18T08:32:52.733Z","repository":{"id":297712303,"uuid":"996444372","full_name":"TIGER-AI-Lab/VisCoder","owner":"TIGER-AI-Lab","description":"The official code of \"VisCoder: Fine-Tuning LLMs for Executable Python Visualization Code Generation\"","archived":false,"fork":false,"pushed_at":"2025-06-07T00:53:53.000Z","size":45519,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-07T01:29:15.705Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://tiger-ai-lab.github.io/VisCoder","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TIGER-AI-Lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-05T00:52:37.000Z","updated_at":"2025-06-07T00:52:40.000Z","dependencies_parsed_at":"2025-06-07T01:39:22.914Z","dependency_job_id":null,"html_url":"https://github.com/TIGER-AI-Lab/VisCoder","commit_stats":null,"previous_names":["tiger-ai-lab/viscoder"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TIGER-AI-Lab/VisCoder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TIGER-AI-Lab%2FVisCoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TIGER-AI-Lab%2FVisCoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TIGER-AI-Lab%2FVisCoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TIGER-AI-Lab%2FVisCoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TIGER-AI-Lab","download_url":"https://codeload.github.com/TIGER-AI-Lab/VisCoder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TIGER-AI-Lab%2FVisCoder/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265728814,"owners_count":23818729,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-13T07:08:05.010Z","updated_at":"2025-07-18T08:32:52.713Z","avatar_url":"https://github.com/TIGER-AI-Lab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VisCoder: Fine-Tuning LLMs for Executable Python Visualization Code Generation\n\n[**🌐 Project Page**](https://tiger-ai-lab.github.io/VisCoder) | [**📖 arXiv**](https://arxiv.org/abs/2506.03930) | [**🤗 VisCode-200K**](https://huggingface.co/datasets/TIGER-Lab/VisCode-200K) | [**🤗 VisCoder-3B**](https://huggingface.co/TIGER-Lab/VisCoder-3B) | [**🤗 VisCoder-7B**](https://huggingface.co/TIGER-Lab/VisCoder-7B)\n\n---\n\n## 🔔 News\n\n- **🔥 [2025-06-05] VisCoder and VisCode-200K are now publicly released! Check out our [paper](https://arxiv.org/abs/2506.03930) and [collections](https://huggingface.co/collections/TIGER-Lab/viscoder-6840333efe87c4888bc93046).**\n\n## 🧠 Introduction\n\n**VisCoder** is an open-source large language model fine-tuned for **Python visualization code generation and iterative self-correction**. It is trained on **VisCode-200K**, a large-scale instruction-tuning dataset tailored for executable plotting tasks and runtime-guided revision.\n\nVisCoder addresses a core challenge in data analysis: generating Python code that produces not only syntactically correct, but also **visually meaningful plots**. Unlike general code generation tasks, visualization requires grounding across **natural language instructions, data structures**, and **rendered visual outputs**.\n\nTo enable this, **VisCode-200K** includes:\n- ✅ **150K+ executable visualization examples**, validated through runtime checks and paired with plot images.\n- 🔁 **45K multi-turn correction dialogues** from the Code-Feedback dataset, providing supervision for fixing faulty code based on execution feedback.\n\n![Alt text](assets/pipeline.png)\n\nWe further propose a **self-debug evaluation protocol**, simulating real-world developer workflows through multi-round error correction. VisCoder is benchmarked on **PandasPlotBench** against GPT-4o, GPT-4o-mini, Qwen, and LLaMA, demonstrating robust performance and strong recovery from execution failures.\n\n---\n## 📊 Main Results on PandasPlotBench\n\nWe evaluate VisCoder on **PandasPlotBench**, a benchmark for executable Python visualization code generation across three libraries: **Matplotlib**, **Seaborn**, and **Plotly**. The figure below summarizes model performance in terms of execution success and GPT-4o-judged alignment scores.\n\n![Alt text](assets/main_results.png)\n\n\u003e With **self-debug**, **VisCoder-7B** achieves over **90% execution pass rate** on both **Matplotlib** and **Seaborn**, outperforming strong open-source baselines and approaching GPT-4o performance on multiple libraries.\n\n---\n\n## 🛠️ Training \u0026 Evaluation\n\nWe provide both training and evaluation scripts for VisCoder.\n\n- 📦 **Training** is performed using the [ms-swift](https://github.com/modelscope/swift) framework with full-parameter supervised fine-tuning on VisCode-200K.\n- 📊 **Evaluation** is based on the [PandasPlotBench](https://github.com/JetBrains-Research/PandasPlotBench). We **augment the original evaluation** with an additional **Execution Pass Rate** metric and introduce a new **self-debug evaluation mode** that allows models to revise failed generations over multiple rounds.\n\nSee the following folders for details:\n\n- [`train/`](./train): Training scripts and configurations based on ms-swift.\n- [`eval/`](./eval): Evaluation scripts adapted from PandasPlotBench with our self-debug extension.\n\n## Contact\n- Yuansheng Ni: yuansheng.ni@uwaterloo.ca\n- Wenhu Chen: wenhuchen@uwaterloo.ca\n\n## 📖 Citation\n\n**BibTeX:**\n```bibtex\n@article{ni2025viscoder,\n  title={VisCoder: Fine-Tuning LLMs for Executable Python Visualization Code Generation},\n  author={Ni, Yuansheng and Nie, Ping and Zou, Kai and Yue, Xiang and Chen, Wenhu},\n  journal={arXiv preprint arXiv:2506.03930},\n  year={2025}\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiger-ai-lab%2Fviscoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiger-ai-lab%2Fviscoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiger-ai-lab%2Fviscoder/lists"}