File size: 3,045 Bytes
127449b
2536cdc
 
127449b
 
 
 
2536cdc
127449b
 
2536cdc
 
437c7b7
 
 
 
c432972
437c7b7
 
 
 
 
 
 
 
 
 
 
2536cdc
437c7b7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
875c0b6
 
 
 
 
437c7b7
875c0b6
437c7b7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
base_model:
- Qwen/Qwen2.5-Coder-3B-Instruct
datasets:
- TIGER-Lab/VisCode-200K
language:
- en
license: apache-2.0
tags:
- code
library_name: transformers
pipeline_tag: text-generation
---

# VisCoder-3B

[🏠 Project Page](https://tiger-ai-lab.github.io/VisCoder) | [πŸ“– Paper](https://arxiv.org/abs/2506.03930) | [πŸ’» GitHub](https://github.com/TIGER-AI-Lab/VisCoder) | [πŸ€— VisCode-200K](https://huggingface.co/datasets/TIGER-Lab/VisCode-200K) | [πŸ€— VisCoder-7B](https://huggingface.co/TIGER-Lab/VisCoder-7B) 

**VisCoder-3B** is a lightweight language model fine-tuned for **Python visualization code generation and iterative correction**. It is trained on **VisCode-200K**, a large-scale instruction-tuning dataset that integrates natural language instructions, validated Python code, and execution-guided revision supervision.

## 🧠 Model Description

**VisCoder-3B** is trained on **VisCode-200K**, a large-scale instruction-tuning dataset tailored for executable Python visualization tasks. It addresses a core challenge in data analysis: generating Python code that not only executes successfully but also produces **semantically meaningful plots** by aligning **natural language instructions**, **data structures**, and **visual outputs**.

We propose a **self-debug evaluation protocol** that simulates real-world developer workflows. In this setting, models are allowed to revise previously failed generations over multiple rounds with guidance from **execution feedback**.

## πŸ“Š Main Results on PandasPlotBench

We evaluate VisCoder-3B on [**PandasPlotBench**](https://github.com/TIGER-AI-Lab/VisCoder/tree/main/eval), which tests executable visualization code generation across **Matplotlib**, **Seaborn**, and **Plotly**. Evaluation includes both standard generation and **multi-turn self-debugging**

![image/png](https://cdn-uploads.huggingface.co/production/uploads/64de37ee5e192985054be575/ZTicATvYEIVRe4OCj16GV.png)

> VisCoder-3B outperforms existing open-source baselines on multiple libraries and shows consistent recovery improvements under the self-debug protocol.

## πŸ“ Training Details

- **Base model**: Qwen2.5-Coder-3B-Instruct  
- **Framework**: [ms-swift](https://github.com/modelscope/swift)  
- **Tuning method**: Full-parameter supervised fine-tuning (SFT)  
- **Dataset**: [VisCode-200K](https://huggingface.co/datasets/TIGER-Lab/VisCode-200K), which includes:  
  - 150K+ validated Python visualization samples with corresponding images  
  - 45K+ multi-turn correction dialogues guided by execution results  

## πŸ“– Citation

If you use VisCoder-3B or VisCode-200K in your research, please cite:

```bibtex
@article{ni2025viscoder,
  title={VisCoder: Fine-Tuning LLMs for Executable Python Visualization Code Generation},
  author={Ni, Yuansheng and Nie, Ping and Zou, Kai and Yue, Xiang and Chen, Wenhu},
  journal={arXiv preprint arXiv:2506.03930},
  year={2025}
}
```
For evaluation scripts and more information, see our [GitHub repository](https://github.com/TIGER-AI-Lab/VisCoder).