ChartCoder: Advancing Multimodal Large Language Model for Chart-to-Code Generation
Xuanle Zhao, Xianzhen Luo, Qi Shi, Chi Chen, Shuo Wang, Zhiyuan Liu, Maosong Sun
Abstract
Multimodal Large Language Models (MLLMs) have demonstrated remarkable capabilities in chart understanding tasks. However, interpreting charts with textual descriptions often leads to information loss, as it fails to fully capture the dense information embedded in charts. In contrast, parsing charts into code provides lossless representations that can effectively contain all critical details. Although existing open-source MLLMs have achieved success in chart understanding tasks, they still face two major challenges when applied to chart-to-code tasks: (1) Low executability and poor restoration of chart details in the generated code and (2) Lack of large-scale and diverse training data. To address these challenges, we propose ChartCoder, the first dedicated chart-to-code MLLM, which leverages Code LLMs as the language backbone to enhance the executability of the generated code. Furthermore, we introduce Chart2Code-160k, the first large-scale and diverse dataset for chart-to-code generation, and propose the Snippet-of-Thought (SoT) method, which transforms direct chart-to-code generation data into step-by-step generation. Experiments demonstrate that ChartCoder, with only 7B parameters, surpasses existing open-source MLLMs on chart-to-code benchmarks, achieving superior chart restoration and code excitability. Our code is available at https://github.com/thunlp/ChartCoder.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext dff8e2c2-a036-4f00-8fde-d651c151ddccCited by top-tier papers16
- SHARE: An SLM-based Hierarchical Action CorREction Assistant for Text-to-SQLGe Qu, Jinyang Li, Bowen Qin, Xiaolong Li et al.ACL 2025 · 13 citations
- JanusCoder: Towards a Foundational Visual-Programmatic Interface for Code IntelligenceQiushi Sun, Jingyang Gong, Yang Liu, Qiaosheng Chen et al.ICLR 2026 · 9 citations
- MM-ReCoder: Advancing Chart-to-Code Generation with Reinforcement Learning and Self-CorrectionZitian Tang, Xu Zhang, Jianbo Yuan, Yang Zou et al.CVPR 2026 · 4 citations
- Draw with Thought: Unleashing Multimodal Reasoning for Scientific Diagram GenerationZhiqing Cui, Jiahao Yuan, Hanqing Wang, Yanshu Li et al.ACM MM 2025 · 3 citations
- GeoTikzBridge: Advancing Multimodal Code Generation for Geometric Perception and ReasoningJiayin Sun, Caixia Sun, Boyu Yang, hailin li et al.CVPR 2026 · 3 citations
Builds on10
- Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh et al.ICML 2021 · 47,906 citations
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.NeurIPS 2022 · 22,562 citations
- UniChart: A Universal Vision-language Pretrained Model for Chart Comprehension and ReasoningAhmed Masry, Parsa Kavehzadeh, Do Xuan Long, Enamul Hoque et al.EMNLP 2023 · 48 citations
- Outline, Then Details: Syntactically Guided Coarse-To-Fine Code GenerationWenqing Zheng, S. P. Sharan, Ajay Kumar Jaiswal, Kevin Wang et al.ICML 2023 · 35 citations
- Enhancing Multimodal Continual Instruction Tuning with BranchLoRADuzhen Zhang, Yong Ren, Zhong-Zhi Li, Yahan Yu et al.ACL 2025 · 9 citations
Related papers
- NovaChart: A Large-scale Dataset towards Chart Understanding and Generation of Multimodal Large Language ModelsLinmei Hu, Duokang Wang, Yiming Pan, Jifan Yu et al.ACM MM 2024 · 5 citations
- From Charts to Code: A Hierarchical Benchmark for Multimodal ModelsJiahao Tang, Henry Hengyuan Zhao, Lijian Wu, Zijian Zhang et al.ACL 2026 · 5 citations
- Chart2Code53: A Large-Scale Diverse and Complex Dataset for Enhancing Chart-to-Code GenerationTianhao Niu, Yiming Cui, Baoxin Wang, Xiao Xu et al.EMNLP 2025
- MLLM-Based UI2Code Automation Guided by UI Layout InformationFan Wu, Cuiyun Gao, Shuqing Li, Xin-Cheng Wen et al.ISSTA 2025 · 5 citations
- Making Multimodal LLMs Reliable Chart Data Extractors: A Benchmark and Training FrameworkYuchen He, Peizhi Ying, Liqi Cheng, Kuilin Peng et al.CHI 2026 · 1 citation
